CMS 3D CMS Logo

TkAccumulatingSensitiveDetector.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_TkAccumulatingSensitiveDetector_H
2 #define SimG4CMS_TkAccumulatingSensitiveDetector_H
3 
17 
18 #include "G4Step.hh"
19 #include "G4Track.hh"
20 
21 #include <string>
22 
23 class TrackInformation;
24 class SimTrackManager;
25 class TrackingSlaveSD;
26 class FrameRotation;
27 class UpdatablePSimHit;
30 
32  public Observer<const BeginOfEvent *>,
33  public Observer<const BeginOfTrack *>,
34  public Observer<const BeginOfJob *> {
35 public:
37  const GeometricDet *,
39  edm::ParameterSet const &,
40  const SimTrackManager *);
42  bool ProcessHits(G4Step *, G4TouchableHistory *) override;
43  uint32_t setDetUnitId(const G4Step *) override;
44  void EndOfEvent(G4HCofThisEvent *) override;
45 
46  void fillHits(edm::PSimHitContainer &, const std::string &) override;
47  void clearHits() override;
48 
49 private:
50  void createHit(const G4Step *);
51  void sendHit();
52  void updateHit(const G4Step *);
53  bool newHit(const G4Step *);
54  bool closeHit(const G4Step *);
55 
56 protected:
57  void update(const BeginOfEvent *) override;
58  void update(const BeginOfTrack *) override;
59  void update(const BeginOfJob *) override;
60 
61 private:
62  // data members initialised before run
65  std::unique_ptr<TrackingSlaveSD> slaveLowTof;
66  std::unique_ptr<TrackingSlaveSD> slaveHighTof;
67  std::unique_ptr<FrameRotation> theRotation;
68  std::unique_ptr<const G4ProcessTypeEnumerator> theG4ProcTypeEnumerator;
71  bool printHits;
73  double rTracker2; // tracker volume R^2
74  double rTracker; // tracker volume R
75  double zTracker; // tracker volume Z
76  float theTofLimit;
77  float energyCut;
79 
80  // run time cache
82  uint32_t lastId;
83  int lastTrack;
84 
85  // cache stuff for debugging and printout
88  const G4VPhysicalVolume *oldVolume;
89  float px, py, pz;
90  int eventno;
92 };
93 
94 #endif
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
std::unique_ptr< TrackingSlaveSD > slaveHighTof
std::unique_ptr< FrameRotation > theRotation
std::unique_ptr< const G4ProcessTypeEnumerator > theG4ProcTypeEnumerator
bool ProcessHits(G4Step *, G4TouchableHistory *) override
uint32_t setDetUnitId(const G4Step *) override
std::unique_ptr< TrackingSlaveSD > slaveLowTof
void fillHits(edm::PSimHitContainer &, const std::string &) override
std::vector< PSimHit > PSimHitContainer
void EndOfEvent(G4HCofThisEvent *) override
TkAccumulatingSensitiveDetector(const std::string &, const GeometricDet *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
TrackerG4SimHitNumberingScheme * theNumberingScheme