BOSS 8.0.0
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 "TruSim/BesSensitiveDetector.hh"
15#include "TruSim/BesSensitiveManager.hh"
16#include "TruSim/BesTruthTrack.hh"
17
18//
19// Constructor
20//
22 : G4VSensitiveDetector( name ) {
24 manager->AddSensitiveDetector( this );
25}
26
27// Ask the sensitive detector manager
28//
29void BesSensitiveDetector::GetCurrentTrackIndex( G4int& trackIndex, G4int& g4TrackId ) const {
31 if ( manager )
32 {
33 trackIndex = manager->GetCurrentTrackIndex();
34 std::vector<BesTruthTrack*>* trackList = manager->GetTrackList();
35 if ( trackList )
36 {
37 G4int size = trackList->size();
38 if ( size > 0 )
39 {
40 for ( G4int i = 0; i < size; i++ )
41 {
42 if ( ( *trackList )[i]->GetIndex() == trackIndex )
43 {
44 g4TrackId = ( *trackList )[i]->GetG4TrackId();
45 break;
46 }
47 }
48 }
49 }
50 }
51}
void GetCurrentTrackIndex(G4int &trackIndex, G4int &g4TrackId) const
BesSensitiveDetector(const G4String name)