CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  void printHitInfo();
36 
37  void Initialize(G4HCofThisEvent* HCE) override;
38  void EndOfEvent(G4HCofThisEvent* eventHC) override;
39  void clear() override;
40  void DrawAll() override;
41  void PrintAll() override;
42 
43  void fillHits(edm::PSimHitContainer&, const std::string&) override;
44  static constexpr double rp_garage_position_ = 40.0;
45 
46 private:
47  static constexpr unsigned int maxTotemHits_ = 15000;
48  void clearHits() override;
49  bool ProcessHits(G4Step* step, G4TouchableHistory* tHistory) override;
50  uint32_t setDetUnitId(const G4Step* step) override;
51  void update(const BeginOfEvent*) override;
52  void update(const ::EndOfEvent*) override;
53 
55 
56  std::unique_ptr<TrackingSlaveSD> slave_;
57  std::unique_ptr<TotemRPVDetectorOrganization> numberingScheme_;
58 
59 private:
61 
62  G4ThreeVector setToLocal(const G4ThreeVector& globalPoint);
63  void stepInfo(const G4Step* aStep);
64  G4bool hitExists();
65  void createNewHit();
66  void updateHit();
67  void storeHit(TotemRPG4Hit*);
68  void resetForNewPrimary();
69  void summarize();
70  bool isPrimary(const G4Track* track);
71 
72 private:
73  // Data relative to primary particle (the one which triggers a shower)
74  // These data are common to all Hits of a given shower.
75  // One shower is made of several hits which differ by the
76  // unit ID (cristal/fiber/scintillator) and the Time slice ID.
77 
78  G4ThreeVector entrancePoint_;
80 
81  G4String name_;
82  G4int hcID_;
84 
86  G4Track* theTrack_;
87  G4VPhysicalVolume* currentPV_;
88  unsigned int unitID_;
90  G4double tSlice_;
91 
92  G4StepPoint* preStepPoint_;
93  G4StepPoint* postStepPoint_;
94  G4ThreeVector hitPoint_;
95  G4ThreeVector exitPoint_;
96  G4ThreeVector theLocalEntryPoint_;
97  G4ThreeVector theLocalExitPoint_;
98 
99  double Pabs_;
100  double thePx_, thePy_, thePz_;
101  double Tof_;
102  double Eloss_;
104 
106  double PhiAtEntry_;
107 
109  double Vx_, Vy_, Vz_;
110 
111  // Hist
112  //static TotemTestHitHBNtuple* theNtuple_;
113  int eventno_;
114 };
115 
116 #endif // PPS_TotemRPSD_h
void fillHits(edm::PSimHitContainer &, const std::string &) override
Definition: TotemRPSD.cc:268
G4Track * theTrack_
Definition: TotemRPSD.h:86
void DrawAll() override
Definition: TotemRPSD.cc:261
G4THitsCollection< TotemRPG4Hit > TotemRPG4HitCollection
double Tof_
Definition: TotemRPSD.h:101
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
Definition: TotemRPSD.cc:229
void createNewHit()
Definition: TotemRPSD.cc:189
G4int tSliceID_
Definition: TotemRPSD.h:89
G4VPhysicalVolume * currentPV_
Definition: TotemRPSD.h:87
std::unique_ptr< TotemRPVDetectorOrganization > numberingScheme_
Definition: TotemRPSD.h:57
void storeHit(TotemRPG4Hit *)
Definition: TotemRPSD.cc:180
bool ProcessHits(G4Step *step, G4TouchableHistory *tHistory) override
Definition: TotemRPSD.cc:113
void PrintAll() override
Definition: TotemRPSD.cc:263
int eventno_
Definition: TotemRPSD.h:113
TotemRPG4HitCollection * theHC_
Definition: TotemRPSD.h:83
G4ThreeVector entrancePoint_
Definition: TotemRPSD.h:78
double Pabs_
Definition: TotemRPSD.h:99
G4double tSlice_
Definition: TotemRPSD.h:90
static constexpr double rp_garage_position_
Definition: TotemRPSD.h:44
void stepInfo(const G4Step *aStep)
Definition: TotemRPSD.cc:124
void clearHits() override
Definition: TotemRPSD.cc:286
void printHitInfo()
Definition: TotemRPSD.cc:77
void Initialize(G4HCofThisEvent *HCE) override
Definition: TotemRPSD.cc:66
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: TotemRPSD.cc:236
void updateHit()
void clear() override
Definition: TotemRPSD.cc:259
G4ThreeVector theLocalEntryPoint_
Definition: TotemRPSD.h:96
int ParentId_
Definition: TotemRPSD.h:108
uint32_t setDetUnitId(const G4Step *step) override
Definition: TotemRPSD.cc:176
short ParticleType_
Definition: TotemRPSD.h:103
G4StepPoint * postStepPoint_
Definition: TotemRPSD.h:93
int verbosity_
Definition: TotemRPSD.h:60
unsigned int unitID_
Definition: TotemRPSD.h:88
G4int primaryID_
Definition: TotemRPSD.h:89
void setNumberingScheme(TotemRPVDetectorOrganization *scheme)
Definition: TotemRPSD.cc:273
G4StepPoint * preStepPoint_
Definition: TotemRPSD.h:92
double PhiAtEntry_
Definition: TotemRPSD.h:106
double Vy_
Definition: TotemRPSD.h:109
G4ThreeVector theLocalExitPoint_
Definition: TotemRPSD.h:97
double ThetaAtEntry_
Definition: TotemRPSD.h:105
double Vz_
Definition: TotemRPSD.h:109
void resetForNewPrimary()
G4bool hitExists()
double thePz_
Definition: TotemRPSD.h:100
static constexpr unsigned int maxTotemHits_
Definition: TotemRPSD.h:47
double thePx_
Definition: TotemRPSD.h:100
double incidentEnergy_
Definition: TotemRPSD.h:79
TotemRPSD(const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: TotemRPSD.cc:33
G4ThreeVector exitPoint_
Definition: TotemRPSD.h:95
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
Definition: TotemRPSD.cc:279
void summarize()
Definition: TotemRPSD.cc:257
G4int hcID_
Definition: TotemRPSD.h:82
std::vector< PSimHit > PSimHitContainer
step
Definition: StallMonitor.cc:98
bool isPrimary(const G4Track *track)
Definition: TotemRPSD.cc:288
~TotemRPSD() override
Definition: TotemRPSD.cc:64
double Eloss_
Definition: TotemRPSD.h:102
std::unique_ptr< TrackingSlaveSD > slave_
Definition: TotemRPSD.h:56
double thePy_
Definition: TotemRPSD.h:100
G4ThreeVector hitPoint_
Definition: TotemRPSD.h:94
TotemRPG4Hit * currentHit_
Definition: TotemRPSD.h:85
double Vx_
Definition: TotemRPSD.h:109
G4String name_
Definition: TotemRPSD.h:81