LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
OpDetSensitiveDetector.h
Go to the documentation of this file.
1 //
6 // This is the sensitive detector class for the OpDet detectors. It is
7 // associated with the relevant detector volumes in DetectorConstruction.cxx
8 // and is called via the ProcessHits method every time a particle steps
9 // within the volume.
10 //
11 // The detector owns a hit collection which is passed back to LArG4 at
12 // the end of the event. One OpDetSensitiveDetector corresponds to a set
13 // of OpDet's, which are looked up by their G4PhysicalVolume in the OpDetLookup class.
14 //
15 // Photons stepping into the volume are stopped and killed and their trackID,
16 // 4 position and 4 momentum are stored in the relevant SimPhotons.
17 //
18 // Ben Jones, MIT, 06/04/2010
19 //
20 
21 #ifndef OpDetSensitiveDetector_h
22 #define OpDetSensitiveDetector_h 1
23 
24 #include "Geant4/G4String.hh"
25 #include "Geant4/G4Types.hh"
26 #include "Geant4/G4VSensitiveDetector.hh"
27 class G4HCofThisEvent;
28 class G4Step;
29 class G4TouchableHistory;
30 
31 namespace larg4 {
32 
33  class OpDetLookup;
34  class OpDetPhotonTable;
35 
36  class OpDetSensitiveDetector : public G4VSensitiveDetector {
37 
38  public:
39  OpDetSensitiveDetector(G4String name, bool useLitePhotons = false);
41 
42  // Beginning and end of event
43  virtual void Initialize(G4HCofThisEvent*);
44  virtual void EndOfEvent(G4HCofThisEvent*) {}
45 
46  // Tidy up event in abort
47  virtual void clear() {}
48 
49  // Run per step in sensitive volume
50  virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*);
51 
52  // Required but empty
53  virtual void DrawAll() {}
54  virtual void PrintAll() {}
55 
56  private:
58  bool const fUseLitePhotons;
59 
62 
63  //double fGlobalTimeOffset;
64 
66  void AddPhoton(G4Step const* aStep, int OpDet);
67 
69  void AddLitePhoton(G4Step const* aStep, int OpDet);
70  };
71 }
72 
73 #endif
bool const fUseLitePhotons
Fill simplified lite photons instead of full information photons.
Geant4 interface.
virtual void EndOfEvent(G4HCofThisEvent *)
void AddLitePhoton(G4Step const *aStep, int OpDet)
Adds the photon at the specified step with reduced information.
void AddPhoton(G4Step const *aStep, int OpDet)
Adds the photon at the specified step with full information.
virtual void Initialize(G4HCofThisEvent *)
OpDetSensitiveDetector(G4String name, bool useLitePhotons=false)
virtual G4bool ProcessHits(G4Step *, G4TouchableHistory *)