CGEM BOSS
6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
BesSensitiveDetector.cc
Go to the documentation of this file.
1
//---------------------------------------------------------------------------//
2
//////// BOOST --- BESIII Object_Oriented Simulation Tool //
3
////---------------------------------------------------------------------------//
4
////Author : Dengzy
5
////Created: Aug, 2004
6
////Modified:
7
////Comment:
8
////$Id: BesSensitiveDetector.cc
9
10
// A pure virtual class that represents a generic Bes sensitive
11
// Detector. Bes subsystems should inherit from this class when
12
// implementing their hit scoring.
13
14
#include "
BesSensitiveDetector.hh
"
15
#include "
BesSensitiveManager.hh
"
16
#include "
BesTruthTrack.hh
"
17
18
//
19
// Constructor
20
//
21
BesSensitiveDetector::BesSensitiveDetector
(
const
G4String name)
22
: G4VSensitiveDetector(name)
23
{
24
BesSensitiveManager
* manager =
BesSensitiveManager::GetSensitiveManager
();
25
manager->
AddSensitiveDetector
(
this
);
26
}
27
28
// Ask the sensitive detector manager
29
//
30
void
BesSensitiveDetector::GetCurrentTrackIndex
(G4int& trackIndex, G4int& g4TrackId)
const
31
{
32
BesSensitiveManager
* manager =
BesSensitiveManager::GetSensitiveManager
();
33
if
(manager)
34
{
35
trackIndex = manager->
GetCurrentTrackIndex
();
36
std::vector<BesTruthTrack*>* trackList = manager->
GetTrackList
();
37
if
(trackList)
38
{
39
G4int size = trackList->size();
40
if
(size>0)
41
{
42
for
(G4int i=0;i<size;i++)
43
{
44
if
( (*trackList)[i]->GetIndex() == trackIndex )
45
{
46
g4TrackId = (*trackList)[i]->GetG4TrackId();
47
break
;
48
}
49
}
50
}
51
}
52
}
53
}
54
55
56
57
58
59
60
61
BesSensitiveDetector.hh
BesSensitiveManager.hh
BesTruthTrack.hh
BesSensitiveDetector::GetCurrentTrackIndex
void GetCurrentTrackIndex(G4int &trackIndex, G4int &g4TrackId) const
Definition
BesSensitiveDetector.cc:30
BesSensitiveDetector::BesSensitiveDetector
BesSensitiveDetector(const G4String name)
Definition
BesSensitiveDetector.cc:21
BesSensitiveManager
Definition
BesSensitiveManager.hh:73
BesSensitiveManager::GetCurrentTrackIndex
G4int GetCurrentTrackIndex() const
Definition
BesSensitiveManager.hh:93
BesSensitiveManager::AddSensitiveDetector
void AddSensitiveDetector(BesSensitiveDetector *detector)
Definition
BesSensitiveManager.hh:88
BesSensitiveManager::GetTrackList
std::vector< BesTruthTrack * > * GetTrackList()
Definition
BesSensitiveManager.hh:94
BesSensitiveManager::GetSensitiveManager
static BesSensitiveManager * GetSensitiveManager()
Definition
BesSensitiveManager.hh:85
6.6.5.i
Simulation
BOOST
TruSim
TruSim-00-00-17
src
BesSensitiveDetector.cc
Generated by
1.12.0