BOSS 7.0.3
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//
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)
void AddSensitiveDetector(BesSensitiveDetector *detector)