CMS 3D CMS Logo

TimingSD.h
Go to the documentation of this file.
1 #ifndef Forward_TimingSD_h
2 #define Forward_TimingSD_h
3 //
4 // Base sensitive class for timing detectors and sensors
5 //
6 // Created 17 June 2018 V.Ivantchenko
7 //
8 
11 
13 
16 
17 #include <string>
18 
19 class G4Step;
20 class G4StepPoint;
21 class G4Track;
22 class G4VPhysicalVolume;
23 class TrackingSlaveSD;
24 class SimTrackManager;
26 
27 //-------------------------------------------------------------------
28 
29 class TimingSD : public SensitiveTkDetector, public Observer<const BeginOfEvent*> {
30 public:
32 
33  ~TimingSD() override;
34 
35  bool ProcessHits(G4Step*, G4TouchableHistory*) override;
36 
37  void Initialize(G4HCofThisEvent* HCE) override;
38  void EndOfEvent(G4HCofThisEvent* eventHC) override;
39  void PrintAll() override;
40 
41  void fillHits(edm::PSimHitContainer&, const std::string&) override;
42  void clearHits() override;
43 
44 protected:
45  void update(const BeginOfEvent*) override;
46 
47  // define time slices
48  void setTimeFactor(double);
49 
50  // define MC truth thresholds
51  void setCuts(double eCut, double historyCut);
52 
53  // by default accumulate hit for the same detector
54  // and time slice, use primary information for fastest
55  // Geant4 particle, check if for this detector new
56  // hit can be merged with the existing one
57  virtual bool checkHit(const G4Step*, BscG4Hit*);
58 
59  void setToLocal(const G4StepPoint* stepPoint, const G4ThreeVector& globalPoint, G4ThreeVector& localPoint);
60 
61  // accessors
62  const G4ThreeVector& getLocalEntryPoint() const { return hitPointLocal; };
63  const G4ThreeVector& getGlobalEntryPoint() const { return hitPoint; };
64 
65 private:
66  void getStepInfo(const G4Step*);
67  bool hitExists(const G4Step*);
68  void createNewHit(const G4Step*);
69  void updateHit();
70  void storeHit(BscG4Hit*);
71 
74 
77 
79  const G4Track* theTrack;
80  const G4StepPoint* preStepPoint;
81  const G4StepPoint* postStepPoint;
82 
84 
85  int primID;
86  int hcID;
87  int tsID;
88  int primaryID;
89  int tSliceID;
90 
91  G4ThreeVector hitPoint;
92  G4ThreeVector hitPointExit;
93  G4ThreeVector hitPointLocal;
94  G4ThreeVector hitPointLocalExit;
95 
96  double tSlice;
97  double timeFactor;
98 
99  double energyCut; // MeV
100  double energyHistoryCut; // MeV
101 
102  double incidentEnergy; // MeV
103  float tof; // ns
104  float edeposit;
106 };
107 
108 #endif
TimingSD::PrintAll
void PrintAll() override
Definition: TimingSD.cc:348
SimTrackManager
Definition: SimTrackManager.h:35
BscG4Hit.h
Observer
Definition: Observer.h:23
TimingSD::hitPointLocal
G4ThreeVector hitPointLocal
Definition: TimingSD.h:93
TimingSD::primaryID
int primaryID
Definition: TimingSD.h:88
TimingSD::getGlobalEntryPoint
const G4ThreeVector & getGlobalEntryPoint() const
Definition: TimingSD.h:63
TimingSD::hcID
int hcID
Definition: TimingSD.h:86
TimingSD::~TimingSD
~TimingSD() override
Definition: TimingSD.cc:59
TimingSD::setTimeFactor
void setTimeFactor(double)
Definition: TimingSD.cc:79
BscG4HitCollection.h
TimingSD::hitExists
bool hitExists(const G4Step *)
Definition: TimingSD.cc:182
TimingSD::fillHits
void fillHits(edm::PSimHitContainer &, const std::string &) override
Definition: TimingSD.cc:355
SensitiveTkDetector
Definition: SensitiveTkDetector.h:8
TimingSD::slave
TrackingSlaveSD * slave
Definition: TimingSD.h:72
TimingSD::storeHit
void storeHit(BscG4Hit *)
Definition: TimingSD.cc:241
TimingSD::tSliceID
int tSliceID
Definition: TimingSD.h:89
TimingSD
Definition: TimingSD.h:29
TimingSD::getLocalEntryPoint
const G4ThreeVector & getLocalEntryPoint() const
Definition: TimingSD.h:62
G4ProcessTypeEnumerator
Definition: G4ProcessTypeEnumerator.h:6
TimingSD::clearHits
void clearHits() override
Definition: TimingSD.cc:368
TimingSD::checkHit
virtual bool checkHit(const G4Step *, BscG4Hit *)
Definition: TimingSD.cc:214
Observer.h
SensitiveTkDetector.h
TimingSD::hitPointLocalExit
G4ThreeVector hitPointLocalExit
Definition: TimingSD.h:94
TimingSD::createNewHit
void createNewHit(const G4Step *)
Definition: TimingSD.cc:252
TimingSD::incidentEnergy
double incidentEnergy
Definition: TimingSD.h:102
TimingSD::tof
float tof
Definition: TimingSD.h:103
TimingSD::Initialize
void Initialize(G4HCofThisEvent *HCE) override
Definition: TimingSD.cc:64
TimingSD::theManager
const SimTrackManager * theManager
Definition: TimingSD.h:75
TimingSD::hitPoint
G4ThreeVector hitPoint
Definition: TimingSD.h:91
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
TimingSD::previousUnitID
uint32_t previousUnitID
Definition: TimingSD.h:83
TimingSD::theEnumerator
G4ProcessTypeEnumerator * theEnumerator
Definition: TimingSD.h:73
TimingSD::unitID
uint32_t unitID
Definition: TimingSD.h:83
TimingSD::theTrack
const G4Track * theTrack
Definition: TimingSD.h:79
BscG4HitCollection
G4THitsCollection< BscG4Hit > BscG4HitCollection
Definition: BscG4HitCollection.h:13
TimingSD::energyHistoryCut
double energyHistoryCut
Definition: TimingSD.h:100
BeginOfEvent.h
TimingSD::primID
int primID
Definition: TimingSD.h:85
TimingSD::edepositEM
float edepositEM
Definition: TimingSD.h:105
TimingSD::timeFactor
double timeFactor
Definition: TimingSD.h:97
TrackingSlaveSD
Definition: TrackingSlaveSD.h:11
BeginOfEvent
Definition: BeginOfEvent.h:6
TimingSD::EndOfEvent
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: TimingSD.cc:317
TimingSD::preStepPoint
const G4StepPoint * preStepPoint
Definition: TimingSD.h:80
TimingSD::updateHit
void updateHit()
Definition: TimingSD.cc:298
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TimingSD::currentHit
BscG4Hit * currentHit
Definition: TimingSD.h:78
TimingSD::setToLocal
void setToLocal(const G4StepPoint *stepPoint, const G4ThreeVector &globalPoint, G4ThreeVector &localPoint)
Definition: TimingSD.cc:312
TimingSD::energyCut
double energyCut
Definition: TimingSD.h:99
TimingSD::postStepPoint
const G4StepPoint * postStepPoint
Definition: TimingSD.h:81
TimingSD::TimingSD
TimingSD(const std::string &, const SensitiveDetectorCatalog &, const SimTrackManager *)
Definition: TimingSD.cc:37
TimingSD::edeposit
float edeposit
Definition: TimingSD.h:104
TimingSD::getStepInfo
void getStepInfo(const G4Step *)
Definition: TimingSD.cc:113
TimingSD::theHC
BscG4HitCollection * theHC
Definition: TimingSD.h:76
TimingSD::setCuts
void setCuts(double eCut, double historyCut)
Definition: TimingSD.cc:89
BscG4Hit
Definition: BscG4Hit.h:17
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
TimingSD::ProcessHits
bool ProcessHits(G4Step *, G4TouchableHistory *) override
Definition: TimingSD.cc:102
TimingSD::hitPointExit
G4ThreeVector hitPointExit
Definition: TimingSD.h:92
TimingSD::tSlice
double tSlice
Definition: TimingSD.h:96
TimingSD::tsID
int tsID
Definition: TimingSD.h:87
TimingSD::edepositHAD
float edepositHAD
Definition: TimingSD.h:105
TimingSD::update
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
Definition: TimingSD.cc:361