CMS 3D CMS Logo

TotemRPSD.h
Go to the documentation of this file.
1 #ifndef PPS_TotemRPSD_h
2 #define PPS_TotemRPSD_h
3 
11 
16 
19 
20 #include <string>
21 
22 class G4Step;
23 class G4HCofThisEvent;
24 class G4Track;
25 class G4StepPoint;
26 class TrackingSlaveSD;
27 class SimTrackManager;
28 class TotemTestHitHBNtuple;
29 
30 class TotemRPSD : public SensitiveTkDetector, public Observer<const BeginOfEvent*>, public Observer<const EndOfEvent*> {
31 public:
33  ~TotemRPSD() override;
34 
35  // Geant4 methods
36  bool ProcessHits(G4Step* step, G4TouchableHistory* tHistory) override;
37 
38  void Initialize(G4HCofThisEvent* HCE) override;
39  void EndOfEvent(G4HCofThisEvent* eventHC) override;
40  void PrintAll() override;
41 
42  // CMSSW methods
43  uint32_t setDetUnitId(const G4Step* step) override;
44  void fillHits(edm::PSimHitContainer&, const std::string&) override;
45  void clearHits() override;
46 
47 protected:
48  void update(const BeginOfEvent*) override;
49  void update(const ::EndOfEvent*) override;
50 
51 private:
52  G4ThreeVector setToLocal(const G4ThreeVector& globalPoint);
53  void stepInfo(const G4Step* aStep);
54  void createNewHit();
55  void storeHit(TotemRPG4Hit*);
56  void printHitInfo();
57 
58  std::unique_ptr<TrackingSlaveSD> slave_;
59  std::unique_ptr<TotemRPVDetectorOrganization> numberingScheme_;
60 
63  G4Track* theTrack_ = nullptr;
64  G4VPhysicalVolume* currentPV_ = nullptr;
65  G4int hcID_ = -1;
66  G4int primaryID_ = 0;
67  G4int parentID_ = 0;
68  G4int tSliceID_ = 0;
69  G4double tSlice_ = 0.0;
70 
71  G4StepPoint* preStepPoint_ = nullptr;
72  G4StepPoint* postStepPoint_ = nullptr;
73  G4ThreeVector hitPoint_;
74  G4ThreeVector exitPoint_;
75  G4ThreeVector theLocalEntryPoint_;
76  G4ThreeVector theLocalExitPoint_;
77 
78  double incidentEnergy_ = 0.0;
79  double pabs_ = 0.0;
80  double thePx_ = 0.0;
81  double thePy_ = 0.0;
82  double thePz_ = 0.0;
83  double tof_ = 0.0;
84  double eloss_ = 0.0;
85 
86  double thetaAtEntry_ = 0.0;
87  double phiAtEntry_ = 0.0;
88 
89  double vx_ = 0.0;
90  double vy_ = 0.0;
91  double vz_ = 0.0;
92 
93  unsigned int unitID_ = 0;
95  int eventno_ = 0;
96  short particleType_ = 0;
97 };
98 
99 #endif // PPS_TotemRPSD_h
void fillHits(edm::PSimHitContainer &, const std::string &) override
Definition: TotemRPSD.cc:231
G4Track * theTrack_
Definition: TotemRPSD.h:63
G4THitsCollection< TotemRPG4Hit > TotemRPG4HitCollection
double pabs_
Definition: TotemRPSD.h:79
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
Definition: TotemRPSD.cc:199
void createNewHit()
Definition: TotemRPSD.cc:161
G4int tSliceID_
Definition: TotemRPSD.h:68
G4VPhysicalVolume * currentPV_
Definition: TotemRPSD.h:64
std::unique_ptr< TotemRPVDetectorOrganization > numberingScheme_
Definition: TotemRPSD.h:59
void storeHit(TotemRPG4Hit *)
Definition: TotemRPSD.cc:152
bool ProcessHits(G4Step *step, G4TouchableHistory *tHistory) override
Definition: TotemRPSD.cc:92
double vx_
Definition: TotemRPSD.h:89
void PrintAll() override
Definition: TotemRPSD.cc:226
int eventno_
Definition: TotemRPSD.h:95
G4int parentID_
Definition: TotemRPSD.h:67
TotemRPG4HitCollection * theHC_
Definition: TotemRPSD.h:61
G4double tSlice_
Definition: TotemRPSD.h:69
void stepInfo(const G4Step *aStep)
Definition: TotemRPSD.cc:104
void clearHits() override
Definition: TotemRPSD.cc:244
void printHitInfo()
Definition: TotemRPSD.cc:70
void Initialize(G4HCofThisEvent *HCE) override
Definition: TotemRPSD.cc:58
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: TotemRPSD.cc:206
double vz_
Definition: TotemRPSD.h:91
G4ThreeVector theLocalEntryPoint_
Definition: TotemRPSD.h:75
uint32_t setDetUnitId(const G4Step *step) override
Definition: TotemRPSD.cc:148
G4StepPoint * postStepPoint_
Definition: TotemRPSD.h:72
int verbosity_
Definition: TotemRPSD.h:94
double vy_
Definition: TotemRPSD.h:90
unsigned int unitID_
Definition: TotemRPSD.h:93
G4int primaryID_
Definition: TotemRPSD.h:66
double thetaAtEntry_
Definition: TotemRPSD.h:86
G4StepPoint * preStepPoint_
Definition: TotemRPSD.h:71
G4ThreeVector theLocalExitPoint_
Definition: TotemRPSD.h:76
double thePz_
Definition: TotemRPSD.h:82
double thePx_
Definition: TotemRPSD.h:80
double incidentEnergy_
Definition: TotemRPSD.h:78
double eloss_
Definition: TotemRPSD.h:84
TotemRPSD(const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: TotemRPSD.cc:35
G4ThreeVector exitPoint_
Definition: TotemRPSD.h:74
double tof_
Definition: TotemRPSD.h:83
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
Definition: TotemRPSD.cc:237
G4int hcID_
Definition: TotemRPSD.h:65
std::vector< PSimHit > PSimHitContainer
step
Definition: StallMonitor.cc:83
short particleType_
Definition: TotemRPSD.h:96
~TotemRPSD() override
Definition: TotemRPSD.cc:56
double phiAtEntry_
Definition: TotemRPSD.h:87
std::unique_ptr< TrackingSlaveSD > slave_
Definition: TotemRPSD.h:58
double thePy_
Definition: TotemRPSD.h:81
G4ThreeVector hitPoint_
Definition: TotemRPSD.h:73
TotemRPG4Hit * currentHit_
Definition: TotemRPSD.h:62