CMS 3D CMS Logo

TkAccumulatingSensitiveDetector.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_TkAccumulatingSensitiveDetector_H
2 #define SimG4CMS_TkAccumulatingSensitiveDetector_H
3 
14 
15 #include "G4Step.hh"
16 #include "G4Track.hh"
17 
18 #include <string>
19 
20 class TrackInformation;
21 class SimTrackManager;
22 class TrackingSlaveSD;
23 class FrameRotation;
24 class UpdatablePSimHit;
27 
29  public Observer<const BeginOfEvent *>,
30  public Observer<const BeginOfTrack *>,
31  public Observer<const BeginOfJob *> {
32 public:
34  const edm::EventSetup &,
36  edm::ParameterSet const &,
37  const SimTrackManager *);
39  bool ProcessHits(G4Step *, G4TouchableHistory *) override;
40  uint32_t setDetUnitId(const G4Step *) override;
41  void EndOfEvent(G4HCofThisEvent *) override;
42 
43  void fillHits(edm::PSimHitContainer &, const std::string &) override;
44  void clearHits() override;
45 
46 private:
47  void createHit(const G4Step *);
48  void sendHit();
49  void updateHit(const G4Step *);
50  bool newHit(const G4Step *);
51  bool closeHit(const G4Step *);
52 
53 protected:
54  void update(const BeginOfEvent *) override;
55  void update(const BeginOfTrack *) override;
56  void update(const BeginOfJob *) override;
57 
58 private:
59  // data members initialised before run
61  std::unique_ptr<TrackingSlaveSD> slaveLowTof;
62  std::unique_ptr<TrackingSlaveSD> slaveHighTof;
63  std::unique_ptr<FrameRotation> theRotation;
64  std::unique_ptr<const G4ProcessTypeEnumerator> theG4ProcTypeEnumerator;
67  bool printHits;
69  double rTracker2; // tracker volume R^2
70  double rTracker; // tracker volume R
71  double zTracker; // tracker volume Z
72  float theTofLimit;
73  float energyCut;
75 
76  // run time cache
78  uint32_t lastId;
79  int lastTrack;
80 
81  // cache stuff for debugging and printout
84  const G4VPhysicalVolume *oldVolume;
85  float px, py, pz;
86  int eventno;
88 };
89 
90 #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
TkAccumulatingSensitiveDetector(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
std::vector< PSimHit > PSimHitContainer
void EndOfEvent(G4HCofThisEvent *) override
TrackerG4SimHitNumberingScheme * theNumberingScheme