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 
17 #include <string>
18 
19 class G4Step;
20 class G4HCofThisEvent;
21 class G4Track;
22 class G4StepPoint;
23 class TrackingSlaveSD;
24 class SimTrackManager;
25 class TotemTestHitHBNtuple;
26 
27 class TotemRPSD : public SensitiveTkDetector, public Observer<const BeginOfEvent*>, public Observer<const EndOfEvent*> {
28 public:
29  TotemRPSD(const std::string&,
30  const edm::EventSetup&,
32  edm::ParameterSet const&,
33  const SimTrackManager*);
34  ~TotemRPSD() override;
35 
36  void printHitInfo();
37 
38  void Initialize(G4HCofThisEvent* HCE) override;
39  void EndOfEvent(G4HCofThisEvent* eventHC) override;
40  void clear() override;
41  void DrawAll() override;
42  void PrintAll() override;
43 
44  void fillHits(edm::PSimHitContainer&, const std::string&) override;
45  static constexpr double rp_garage_position_ = 40.0;
46 
47 private:
48  static constexpr unsigned int maxTotemHits_ = 15000;
49  void clearHits() override;
50  bool ProcessHits(G4Step* step, G4TouchableHistory* tHistory) override;
51  uint32_t setDetUnitId(const G4Step* step) override;
52  void update(const BeginOfEvent*) override;
53  void update(const ::EndOfEvent*) override;
54 
56 
57  std::unique_ptr<TrackingSlaveSD> slave_;
58  std::unique_ptr<TotemRPVDetectorOrganization> numberingScheme_;
59 
60 private:
62 
63  G4ThreeVector setToLocal(const G4ThreeVector& globalPoint);
64  void stepInfo(const G4Step* aStep);
65  G4bool hitExists();
66  void createNewHit();
67  void updateHit();
68  void storeHit(TotemRPG4Hit*);
69  void resetForNewPrimary();
70  void summarize();
71  bool isPrimary(const G4Track* track);
72 
73 private:
74  // Data relative to primary particle (the one which triggers a shower)
75  // These data are common to all Hits of a given shower.
76  // One shower is made of several hits which differ by the
77  // unit ID (cristal/fiber/scintillator) and the Time slice ID.
78 
79  G4ThreeVector entrancePoint_;
81 
82  G4String name_;
83  G4int hcID_;
85 
87  G4Track* theTrack_;
88  G4VPhysicalVolume* currentPV_;
89  unsigned int unitID_;
91  G4double tSlice_;
92 
93  G4StepPoint* preStepPoint_;
94  G4StepPoint* postStepPoint_;
95  G4ThreeVector hitPoint_;
96  G4ThreeVector exitPoint_;
97  G4ThreeVector theLocalEntryPoint_;
98  G4ThreeVector theLocalExitPoint_;
99 
100  double Pabs_;
101  double thePx_, thePy_, thePz_;
102  double Tof_;
103  double Eloss_;
105 
107  double PhiAtEntry_;
108 
110  double Vx_, Vy_, Vz_;
111 
112  // Hist
113  //static TotemTestHitHBNtuple* theNtuple_;
114  int eventno_;
115 };
116 
117 #endif // PPS_TotemRPSD_h
void fillHits(edm::PSimHitContainer &, const std::string &) override
Definition: TotemRPSD.cc:269
G4Track * theTrack_
Definition: TotemRPSD.h:87
void DrawAll() override
Definition: TotemRPSD.cc:262
G4THitsCollection< TotemRPG4Hit > TotemRPG4HitCollection
double Tof_
Definition: TotemRPSD.h:102
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
Definition: TotemRPSD.cc:230
void createNewHit()
Definition: TotemRPSD.cc:190
G4int tSliceID_
Definition: TotemRPSD.h:90
G4VPhysicalVolume * currentPV_
Definition: TotemRPSD.h:88
std::unique_ptr< TotemRPVDetectorOrganization > numberingScheme_
Definition: TotemRPSD.h:58
void storeHit(TotemRPG4Hit *)
Definition: TotemRPSD.cc:181
bool ProcessHits(G4Step *step, G4TouchableHistory *tHistory) override
Definition: TotemRPSD.cc:114
void PrintAll() override
Definition: TotemRPSD.cc:264
int eventno_
Definition: TotemRPSD.h:114
TotemRPSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: TotemRPSD.cc:33
TotemRPG4HitCollection * theHC_
Definition: TotemRPSD.h:84
G4ThreeVector entrancePoint_
Definition: TotemRPSD.h:79
double Pabs_
Definition: TotemRPSD.h:100
G4double tSlice_
Definition: TotemRPSD.h:91
void stepInfo(const G4Step *aStep)
Definition: TotemRPSD.cc:125
void clearHits() override
Definition: TotemRPSD.cc:287
void printHitInfo()
Definition: TotemRPSD.cc:78
void Initialize(G4HCofThisEvent *HCE) override
Definition: TotemRPSD.cc:67
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: TotemRPSD.cc:237
void updateHit()
void clear() override
Definition: TotemRPSD.cc:260
G4ThreeVector theLocalEntryPoint_
Definition: TotemRPSD.h:97
int ParentId_
Definition: TotemRPSD.h:109
uint32_t setDetUnitId(const G4Step *step) override
Definition: TotemRPSD.cc:177
short ParticleType_
Definition: TotemRPSD.h:104
G4StepPoint * postStepPoint_
Definition: TotemRPSD.h:94
int verbosity_
Definition: TotemRPSD.h:61
unsigned int unitID_
Definition: TotemRPSD.h:89
G4int primaryID_
Definition: TotemRPSD.h:90
void setNumberingScheme(TotemRPVDetectorOrganization *scheme)
Definition: TotemRPSD.cc:274
G4StepPoint * preStepPoint_
Definition: TotemRPSD.h:93
static unsigned int maxTotemHits_
Definition: TotemRPSD.h:48
static double rp_garage_position_
Definition: TotemRPSD.h:45
double PhiAtEntry_
Definition: TotemRPSD.h:107
double Vy_
Definition: TotemRPSD.h:110
G4ThreeVector theLocalExitPoint_
Definition: TotemRPSD.h:98
double ThetaAtEntry_
Definition: TotemRPSD.h:106
double Vz_
Definition: TotemRPSD.h:110
void resetForNewPrimary()
G4bool hitExists()
double thePz_
Definition: TotemRPSD.h:101
double thePx_
Definition: TotemRPSD.h:101
double incidentEnergy_
Definition: TotemRPSD.h:80
G4ThreeVector exitPoint_
Definition: TotemRPSD.h:96
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
Definition: TotemRPSD.cc:280
void summarize()
Definition: TotemRPSD.cc:258
G4int hcID_
Definition: TotemRPSD.h:83
std::vector< PSimHit > PSimHitContainer
step
Definition: StallMonitor.cc:94
bool isPrimary(const G4Track *track)
Definition: TotemRPSD.cc:289
~TotemRPSD() override
Definition: TotemRPSD.cc:65
double Eloss_
Definition: TotemRPSD.h:103
std::unique_ptr< TrackingSlaveSD > slave_
Definition: TotemRPSD.h:57
double thePy_
Definition: TotemRPSD.h:101
G4ThreeVector hitPoint_
Definition: TotemRPSD.h:95
#define constexpr
TotemRPG4Hit * currentHit_
Definition: TotemRPSD.h:86
double Vx_
Definition: TotemRPSD.h:110
G4String name_
Definition: TotemRPSD.h:82