OpDetSensitiveDetector.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file OpDetSensitiveDetector.h
3 //
4 /// \author bjpjones@mit.edu
5 ////////////////////////////////////////////////////////////////////////
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
45  EndOfEvent(G4HCofThisEvent*)
46  {}
47 
48  // Tidy up event in abort
49  virtual void
51  {}
52 
53  // Run per step in sensitive volume
54  virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*);
55 
56  // Required but empty
57  virtual void
59  {}
60  virtual void
62  {}
63 
64  private:
65  /// Fill simplified lite photons instead of full information photons.
66  bool const fUseLitePhotons;
67 
70 
71  //double fGlobalTimeOffset;
72 
73  /// Adds the photon at the specified step with full information.
74  void AddPhoton(G4Step const* aStep, int OpDet);
75 
76  /// Adds the photon at the specified step with reduced information.
77  void AddLitePhoton(G4Step const* aStep, int OpDet);
78  };
79 }
80 
81 #endif
static QCString name
Definition: declinfo.cpp:673
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 *)