CMS 3D CMS Logo

BHMSD.h
Go to the documentation of this file.
1 #ifndef SimG4CMSForward_BHMSD_h
2 #define SimG4CMSForward_BHMSD_h
3 
6 
10 
14 
15 
16 #include "G4Step.hh"
17 #include "G4StepPoint.hh"
18 #include "G4Track.hh"
19 #include "G4VPhysicalVolume.hh"
20 
21 #include <string>
22 
23 class TrackingSlaveSD;
24 
25 class TrackInformation;
26 class SimTrackManager;
27 class TrackingSlaveSD;
28 class UpdatablePSimHit;
31 
32 
33 //-------------------------------------------------------------------
34 
35 class BHMSD : public SensitiveTkDetector,
36  public Observer<const BeginOfRun *>,
37  public Observer<const BeginOfEvent*>,
38  public Observer<const EndOfEvent*> {
39 
40 public:
41 
42  BHMSD(const std::string&, const DDCompactView &, const SensitiveDetectorCatalog &,
43  edm::ParameterSet const &, const SimTrackManager* );
44 
45 
46  ~BHMSD() override;
47 
48  bool ProcessHits(G4Step *,G4TouchableHistory *) override;
49  uint32_t setDetUnitId(const 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  double getEnergyDeposit(const G4Step* step);
58  void fillHits(edm::PSimHitContainer&, const std::string&) override;
59  void clearHits() override;
60 
61 private:
62 
63  void update(const BeginOfRun *) override;
64  void update(const BeginOfEvent *) override;
65  void update(const ::EndOfEvent *) override;
66 
67  G4ThreeVector SetToLocal(const G4ThreeVector& global);
68  G4ThreeVector SetToLocalExit(const G4ThreeVector& globalPoint);
69  void GetStepInfo(G4Step* aStep);
70  G4bool HitExists();
71  void CreateNewHit();
72  void UpdateHit();
73  void StoreHit(BscG4Hit*);
74  void ResetForNewPrimary();
75  void Summarize();
76 
77 private:
78 
81 
82  G4ThreeVector entrancePoint, exitPoint;
83  G4ThreeVector theEntryPoint, theExitPoint;
84 
86  G4int primID ;
87 
88  G4int hcID;
91 
92  G4int tsID;
94  G4Track* theTrack;
95  G4VPhysicalVolume* currentPV;
98  G4double tSlice;
99 
100  G4StepPoint* preStepPoint;
101  G4StepPoint* postStepPoint;
102  float edeposit;
103 
104  G4ThreeVector hitPoint;
105  G4ThreeVector hitPointExit;
106  G4ThreeVector hitPointLocal;
107  G4ThreeVector hitPointLocalExit;
108 
109  float Pabs, Tof, Eloss;
110  short ParticleType;
112 
113  int ParentId;
114  float Vx,Vy,Vz;
115  float X,Y,Z;
116 
117  int eventno;
118 
119 protected:
120 
122  G4int emPDG;
123  G4int epPDG;
124  G4int gammaPDG;
125 };
126 
127 #endif
128 
129 
130 
131 
float Z
Definition: BHMSD.h:115
float incidentEnergy
Definition: BHMSD.h:85
G4double tSlice
Definition: BHMSD.h:98
G4ThreeVector hitPointExit
Definition: BHMSD.h:105
void clear() override
Definition: BHMSD.cc:323
void ResetForNewPrimary()
Definition: BHMSD.cc:185
float PhiAtEntry
Definition: BHMSD.h:111
BHMSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: BHMSD.cc:30
void Initialize(G4HCofThisEvent *HCE) override
Definition: BHMSD.cc:63
float Eloss
Definition: BHMSD.h:109
G4ThreeVector theEntryPoint
Definition: BHMSD.h:83
BHMNumberingScheme * numberingScheme
Definition: BHMSD.h:80
G4StepPoint * preStepPoint
Definition: BHMSD.h:100
G4ThreeVector hitPoint
Definition: BHMSD.h:104
void DrawAll() override
Definition: BHMSD.cc:326
G4int tSliceID
Definition: BHMSD.h:97
int eventno
Definition: BHMSD.h:117
void CreateNewHit()
Definition: BHMSD.cc:203
G4ThreeVector hitPointLocal
Definition: BHMSD.h:106
type of data representation of DDCompactView
Definition: DDCompactView.h:90
float X
Definition: BHMSD.h:115
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: BHMSD.cc:294
float edepositEM
Definition: BHMSD.h:121
TrackingSlaveSD * slave
Definition: BHMSD.h:79
float edepositHAD
Definition: BHMSD.h:121
float Vx
Definition: BHMSD.h:114
float Vz
Definition: BHMSD.h:114
G4ThreeVector SetToLocalExit(const G4ThreeVector &globalPoint)
Definition: BHMSD.cc:287
void Summarize()
Definition: BHMSD.cc:320
float Y
Definition: BHMSD.h:115
uint32_t previousUnitID
Definition: BHMSD.h:96
G4int tsID
Definition: BHMSD.h:92
void PrintAll() override
Definition: BHMSD.cc:329
uint32_t unitID
Definition: BHMSD.h:96
float Vy
Definition: BHMSD.h:114
float Tof
Definition: BHMSD.h:109
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
Definition: BHMSD.cc:345
G4ThreeVector theExitPoint
Definition: BHMSD.h:83
G4Track * theTrack
Definition: BHMSD.h:94
G4ThreeVector entrancePoint
Definition: BHMSD.h:82
const SimTrackManager * theManager
Definition: BHMSD.h:90
void clearHits() override
Definition: BHMSD.cc:358
float edeposit
Definition: BHMSD.h:102
G4StepPoint * postStepPoint
Definition: BHMSD.h:101
short ParticleType
Definition: BHMSD.h:110
G4int primaryID
Definition: BHMSD.h:97
G4int primID
Definition: BHMSD.h:86
BscG4Hit * currentHit
Definition: BHMSD.h:93
BscG4HitCollection * theHC
Definition: BHMSD.h:89
void fillHits(edm::PSimHitContainer &, const std::string &) override
Definition: BHMSD.cc:334
~BHMSD() override
Definition: BHMSD.cc:53
G4int gammaPDG
Definition: BHMSD.h:124
int ParentId
Definition: BHMSD.h:113
void UpdateHit()
Definition: BHMSD.cc:261
G4ThreeVector SetToLocal(const G4ThreeVector &global)
Definition: BHMSD.cc:280
float ThetaAtEntry
Definition: BHMSD.h:111
void GetStepInfo(G4Step *aStep)
Definition: BHMSD.cc:95
uint32_t setDetUnitId(const G4Step *) override
Definition: BHMSD.cc:142
double getEnergyDeposit(const G4Step *step)
Definition: BHMSD.cc:59
G4ThreeVector hitPointLocalExit
Definition: BHMSD.h:107
std::vector< PSimHit > PSimHitContainer
G4VPhysicalVolume * currentPV
Definition: BHMSD.h:95
step
G4int hcID
Definition: BHMSD.h:88
G4THitsCollection< BscG4Hit > BscG4HitCollection
float Pabs
Definition: BHMSD.h:109
G4int epPDG
Definition: BHMSD.h:123
G4bool HitExists()
Definition: BHMSD.cc:146
void StoreHit(BscG4Hit *)
Definition: BHMSD.cc:192
bool ProcessHits(G4Step *, G4TouchableHistory *) override
Definition: BHMSD.cc:78
Definition: BHMSD.h:35
G4int emPDG
Definition: BHMSD.h:122
G4ThreeVector exitPoint
Definition: BHMSD.h:82