CMS 3D CMS Logo

FastTimerSD.h
Go to the documentation of this file.
1 #ifndef SimG4CMSForward_FastTimerSD_h
2 #define SimG4CMSForward_FastTimerSD_h
3 
7 
12 
16 
17 #include "G4Step.hh"
18 #include "G4StepPoint.hh"
19 #include "G4Track.hh"
20 #include "G4VPhysicalVolume.hh"
21 
22 #include <string>
23 
24 class TrackingSlaveSD;
25 class TrackInformation;
26 class SimTrackManager;
27 class TrackingSlaveSD;
28 class UpdatablePSimHit;
31 
32 //-------------------------------------------------------------------
33 
35  public Observer<const BeginOfJob *>,
36  public Observer<const BeginOfRun *>,
37  public Observer<const BeginOfEvent*>,
38  public Observer<const EndOfEvent*> {
39 
40 public:
41 
43  edm::ParameterSet const &, const SimTrackManager* );
44 
45 
46  ~FastTimerSD() override;
47 
48  bool ProcessHits(G4Step *,G4TouchableHistory *) override;
49  uint32_t setDetUnitId(G4Step*) override;
50 
51  void Initialize(G4HCofThisEvent * HCE) override;
52  void EndOfEvent(G4HCofThisEvent * eventHC) override;
53  void clear() override;
54  void DrawAll() override;
55  void PrintAll() override;
56 
57  virtual double getEnergyDeposit(G4Step* step);
58  void fillHits(edm::PSimHitContainer&, std::string use) override;
59 
60  std::vector<std::string> getNames() override;
61 
62 private:
63  void update(const BeginOfJob *) override;
64  void update(const BeginOfRun *) override;
65  void update(const BeginOfEvent *) override;
66  void update(const ::EndOfEvent *) override;
67  void clearHits() override;
68 
69 private:
70 
71  G4ThreeVector SetToLocal(const G4ThreeVector& global);
72  G4ThreeVector SetToLocalExit(const G4ThreeVector& globalPoint);
73  void GetStepInfo(G4Step* aStep);
74  G4bool HitExists();
75  void CreateNewHit();
76  void UpdateHit();
77  void StoreHit(BscG4Hit*);
78  void ResetForNewPrimary();
79  void Summarize();
80  std::vector<double> getDDDArray(const std::string &, const DDsvalues_type &);
81 
82 private:
83 
86  int type_;
87 
88  G4ThreeVector entrancePoint, exitPoint;
89  G4ThreeVector theEntryPoint, theExitPoint;
90 
92  G4int primID ;
93 
95  G4int hcID;
98 
99  G4int tsID;
101  G4Track* theTrack;
102  G4VPhysicalVolume* currentPV;
105  G4double tSlice;
106 
107  G4StepPoint* preStepPoint;
108  G4StepPoint* postStepPoint;
109  float edeposit;
110 
111  G4ThreeVector hitPoint;
112  G4ThreeVector hitPointExit;
113  G4ThreeVector hitPointLocal;
114  G4ThreeVector hitPointLocalExit;
115 
116  float Pabs, Tof, Eloss;
117  short ParticleType;
119 
120  int ParentId;
121  float Vx,Vy,Vz;
122  float X,Y,Z;
123 
124  int eventno;
125 
126 protected:
127 
129  G4int emPDG;
130  G4int epPDG;
131  G4int gammaPDG;
132 };
133 
134 #endif
135 
136 
137 
138 
std::string name
Definition: FastTimerSD.h:94
G4ThreeVector hitPoint
Definition: FastTimerSD.h:111
void clear() override
Definition: FastTimerSD.cc:386
G4ThreeVector hitPointExit
Definition: FastTimerSD.h:112
G4ThreeVector SetToLocalExit(const G4ThreeVector &globalPoint)
Definition: FastTimerSD.cc:348
float edepositHAD
Definition: FastTimerSD.h:128
G4ThreeVector theEntryPoint
Definition: FastTimerSD.h:89
G4int tSliceID
Definition: FastTimerSD.h:104
virtual double getEnergyDeposit(G4Step *step)
Definition: FastTimerSD.cc:98
void UpdateHit()
Definition: FastTimerSD.cc:320
uint32_t setDetUnitId(G4Step *) override
Definition: FastTimerSD.cc:184
BscG4Hit * currentHit
Definition: FastTimerSD.h:100
uint32_t unitID
Definition: FastTimerSD.h:103
float edeposit
Definition: FastTimerSD.h:109
short ParticleType
Definition: FastTimerSD.h:117
type of data representation of DDCompactView
Definition: DDCompactView.h:90
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
Definition: FastTimerSD.cc:401
G4int tsID
Definition: FastTimerSD.h:99
const FastTimeDDDConstants * ftcons
Definition: FastTimerSD.h:85
G4ThreeVector SetToLocal(const G4ThreeVector &global)
Definition: FastTimerSD.cc:340
G4bool HitExists()
Definition: FastTimerSD.cc:205
TrackingSlaveSD * slave
Definition: FastTimerSD.h:84
G4int gammaPDG
Definition: FastTimerSD.h:131
G4int primID
Definition: FastTimerSD.h:92
FastTimerSD(std::string, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: FastTimerSD.cc:40
void clearHits() override
Definition: FastTimerSD.cc:437
G4StepPoint * postStepPoint
Definition: FastTimerSD.h:108
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:20
const SimTrackManager * theManager
Definition: FastTimerSD.h:97
G4ThreeVector hitPointLocalExit
Definition: FastTimerSD.h:114
G4VPhysicalVolume * currentPV
Definition: FastTimerSD.h:102
void ResetForNewPrimary()
Definition: FastTimerSD.cc:245
void StoreHit(BscG4Hit *)
Definition: FastTimerSD.cc:252
std::vector< std::string > getNames() override
Definition: FastTimerSD.cc:441
G4ThreeVector hitPointLocal
Definition: FastTimerSD.h:113
G4Track * theTrack
Definition: FastTimerSD.h:101
void DrawAll() override
Definition: FastTimerSD.cc:388
float incidentEnergy
Definition: FastTimerSD.h:91
BscG4HitCollection * theHC
Definition: FastTimerSD.h:96
~FastTimerSD() override
Definition: FastTimerSD.cc:94
G4StepPoint * preStepPoint
Definition: FastTimerSD.h:107
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: FastTimerSD.cc:356
G4ThreeVector entrancePoint
Definition: FastTimerSD.h:88
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: FastTimerSD.cc:447
G4ThreeVector theExitPoint
Definition: FastTimerSD.h:89
void fillHits(edm::PSimHitContainer &, std::string use) override
Definition: FastTimerSD.cc:397
uint32_t previousUnitID
Definition: FastTimerSD.h:103
float PhiAtEntry
Definition: FastTimerSD.h:118
float edepositEM
Definition: FastTimerSD.h:128
G4double tSlice
Definition: FastTimerSD.h:105
std::vector< PSimHit > PSimHitContainer
step
G4THitsCollection< BscG4Hit > BscG4HitCollection
float ThetaAtEntry
Definition: FastTimerSD.h:118
void Summarize()
Definition: FastTimerSD.cc:384
G4int hcID
Definition: FastTimerSD.h:95
G4ThreeVector exitPoint
Definition: FastTimerSD.h:88
void Initialize(G4HCofThisEvent *HCE) override
Definition: FastTimerSD.cc:102
void CreateNewHit()
Definition: FastTimerSD.cc:263
G4int primaryID
Definition: FastTimerSD.h:104
bool ProcessHits(G4Step *, G4TouchableHistory *) override
Definition: FastTimerSD.cc:117
void GetStepInfo(G4Step *aStep)
Definition: FastTimerSD.cc:134
void PrintAll() override
Definition: FastTimerSD.cc:390