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
16#include "BesTruthTrack.hh"
17
18//
19// Constructor
20//
22 : G4VSensitiveDetector(name)
23{
25 manager->AddSensitiveDetector(this);
26}
27
28// Ask the sensitive detector manager
29//
30void BesSensitiveDetector::GetCurrentTrackIndex(G4int& trackIndex, G4int& g4TrackId) const
31{
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
void GetCurrentTrackIndex(G4int &trackIndex, G4int &g4TrackId) const
BesSensitiveDetector(const G4String name)
G4int GetCurrentTrackIndex() const
void AddSensitiveDetector(BesSensitiveDetector *detector)
std::vector< BesTruthTrack * > * GetTrackList()
static BesSensitiveManager * GetSensitiveManager()