CMS 3D CMS Logo

TotemSD.h
Go to the documentation of this file.
1 #ifndef Forward_TotemSD_h
2 #define Forward_TotemSD_h
3 // -*- C++ -*-
4 //
5 // Package: Forward
6 // Class : TotemSD
7 //
16 //
17 // Original Author:
18 // Created: Tue May 16 10:14:34 CEST 2006
19 //
20 
21 // system include files
22 
23 // user include files
24 
29 
33 
34 #include "G4Step.hh"
35 #include "G4StepPoint.hh"
36 #include "G4Track.hh"
37 
38 #include <string>
39 
40 class TrackingSlaveSD;
41 class SimTrackManager;
42 
43 class TotemSD : public SensitiveTkDetector, public Observer<const BeginOfEvent*> {
44 public:
45  TotemSD(const std::string&,
46  const edm::EventSetup&,
48  edm::ParameterSet const&,
49  const SimTrackManager*);
50  ~TotemSD() override;
51 
52  bool ProcessHits(G4Step*, G4TouchableHistory*) override;
53  uint32_t setDetUnitId(const G4Step*) override;
54 
55  void Initialize(G4HCofThisEvent* HCE) override;
56  void EndOfEvent(G4HCofThisEvent* eventHC) override;
57  void PrintAll() override;
58 
59  void fillHits(edm::PSimHitContainer&, const std::string&) override;
60  void clearHits() override;
61 
62 protected:
63  void update(const BeginOfEvent*) override;
64 
65 private:
66  G4ThreeVector setToLocal(const G4ThreeVector& globalPoint);
67  void getStepInfo(const G4Step* aStep);
68  bool hitExists();
69  void createNewHit();
70  void createNewHitEvo();
71  G4ThreeVector posizioEvo(const G4ThreeVector&, double, double, double, double, int&);
72  void updateHit();
73  void storeHit(TotemG4Hit*);
74  void resetForNewPrimary();
75 
76 private:
79 
80  // Data relative to primary particle (the one which triggers a shower)
81  // These data are common to all Hits of a given shower.
82  // One shower is made of several hits which differ by the
83  // unit ID (cristal/fiber/scintillator) and the Time slice ID.
84 
85  G4ThreeVector entrancePoint;
87  G4int primID; //@@ ID of the primary particle.
88 
89  G4int hcID;
92 
93  int tsID;
95  G4Track* theTrack;
96  G4VPhysicalVolume* currentPV;
99  double tSlice;
100 
101  const G4StepPoint* preStepPoint;
102  const G4StepPoint* postStepPoint;
103  float edeposit;
104  G4ThreeVector hitPoint;
105 
106  G4ThreeVector Posizio;
107  float Pabs;
108  float Tof;
109  float Eloss;
111 
113  float PhiAtEntry;
114 
115  int ParentId;
116  float Vx, Vy, Vz;
117 };
118 
119 #endif
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
Definition: TotemSD.cc:162
void resetForNewPrimary()
Definition: TotemSD.cc:449
int ParentId
Definition: TotemSD.h:115
void Initialize(G4HCofThisEvent *HCE) override
Definition: TotemSD.cc:106
uint32_t unitID
Definition: TotemSD.h:97
float Pabs
Definition: TotemSD.h:107
G4ThreeVector posizioEvo(const G4ThreeVector &, double, double, double, double, int &)
Definition: TotemSD.cc:327
G4ThreeVector Posizio
Definition: TotemSD.h:106
TotemG4HitCollection * theHC
Definition: TotemSD.h:90
float Tof
Definition: TotemSD.h:108
G4ThreeVector entrancePoint
Definition: TotemSD.h:85
double tSlice
Definition: TotemSD.h:99
int primaryID
Definition: TotemSD.h:98
bool ProcessHits(G4Step *, G4TouchableHistory *) override
Definition: TotemSD.cc:90
void createNewHit()
Definition: TotemSD.cc:245
uint32_t previousUnitID
Definition: TotemSD.h:97
float incidentEnergy
Definition: TotemSD.h:86
void storeHit(TotemG4Hit *)
Definition: TotemSD.cc:438
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
Definition: TotemSD.cc:155
TotemVDetectorOrganization * numberingScheme
Definition: TotemSD.h:78
G4int hcID
Definition: TotemSD.h:89
int tSliceID
Definition: TotemSD.h:98
const G4StepPoint * preStepPoint
Definition: TotemSD.h:101
float Eloss
Definition: TotemSD.h:109
float edeposit
Definition: TotemSD.h:103
float Vx
Definition: TotemSD.h:116
G4ThreeVector hitPoint
Definition: TotemSD.h:104
void fillHits(edm::PSimHitContainer &, const std::string &) override
Definition: TotemSD.cc:149
~TotemSD() override
Definition: TotemSD.cc:85
TotemG4Hit * currentHit
Definition: TotemSD.h:94
G4VPhysicalVolume * currentPV
Definition: TotemSD.h:96
uint32_t setDetUnitId(const G4Step *) override
Definition: TotemSD.cc:102
void PrintAll() override
Definition: TotemSD.cc:144
short ParticleType
Definition: TotemSD.h:110
float PhiAtEntry
Definition: TotemSD.h:113
const G4StepPoint * postStepPoint
Definition: TotemSD.h:102
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: TotemSD.cc:118
void updateHit()
Definition: TotemSD.cc:421
float Vz
Definition: TotemSD.h:116
G4int primID
Definition: TotemSD.h:87
TrackingSlaveSD * slave
Definition: TotemSD.h:77
void createNewHitEvo()
Definition: TotemSD.cc:290
G4Track * theTrack
Definition: TotemSD.h:95
std::vector< PSimHit > PSimHitContainer
TotemSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: TotemSD.cc:47
int tsID
Definition: TotemSD.h:93
float Vy
Definition: TotemSD.h:116
void clearHits() override
Definition: TotemSD.cc:160
float ThetaAtEntry
Definition: TotemSD.h:112
const SimTrackManager * theManager
Definition: TotemSD.h:91
bool hitExists()
Definition: TotemSD.cc:206
void getStepInfo(const G4Step *aStep)
Definition: TotemSD.cc:169