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 
43  edm::ParameterSet const &, const SimTrackManager* );
44 
45 
46  ~BHMSD() 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 BeginOfRun *) override;
64  void update(const BeginOfEvent *) override;
65  void update(const ::EndOfEvent *) override;
66  void clearHits() override;
67 
68 private:
69 
70  G4ThreeVector SetToLocal(const G4ThreeVector& global);
71  G4ThreeVector SetToLocalExit(const G4ThreeVector& globalPoint);
72  void GetStepInfo(G4Step* aStep);
73  G4bool HitExists();
74  void CreateNewHit();
75  void UpdateHit();
76  void StoreHit(BscG4Hit*);
77  void ResetForNewPrimary();
78  void Summarize();
79 
80 
81 private:
82 
85 
86  G4ThreeVector entrancePoint, exitPoint;
87  G4ThreeVector theEntryPoint, theExitPoint;
88 
90  G4int primID ;
91 
93  G4int hcID;
96 
97  G4int tsID;
99  G4Track* theTrack;
100  G4VPhysicalVolume* currentPV;
103  G4double tSlice;
104 
105  G4StepPoint* preStepPoint;
106  G4StepPoint* postStepPoint;
107  float edeposit;
108 
109  G4ThreeVector hitPoint;
110  G4ThreeVector hitPointExit;
111  G4ThreeVector hitPointLocal;
112  G4ThreeVector hitPointLocalExit;
113 
114  float Pabs, Tof, Eloss;
115  short ParticleType;
117 
118  int ParentId;
119  float Vx,Vy,Vz;
120  float X,Y,Z;
121 
122  int eventno;
123 
124 protected:
125 
127  G4int emPDG;
128  G4int epPDG;
129  G4int gammaPDG;
130 };
131 
132 #endif
133 
134 
135 
136 
float Z
Definition: BHMSD.h:120
float incidentEnergy
Definition: BHMSD.h:89
std::string name
Definition: BHMSD.h:92
G4double tSlice
Definition: BHMSD.h:103
G4ThreeVector hitPointExit
Definition: BHMSD.h:110
void clear() override
Definition: BHMSD.cc:360
void ResetForNewPrimary()
Definition: BHMSD.cc:214
float PhiAtEntry
Definition: BHMSD.h:116
void Initialize(G4HCofThisEvent *HCE) override
Definition: BHMSD.cc:90
float Eloss
Definition: BHMSD.h:114
G4ThreeVector theEntryPoint
Definition: BHMSD.h:87
BHMNumberingScheme * numberingScheme
Definition: BHMSD.h:84
G4StepPoint * preStepPoint
Definition: BHMSD.h:105
G4ThreeVector hitPoint
Definition: BHMSD.h:109
void DrawAll() override
Definition: BHMSD.cc:364
G4int tSliceID
Definition: BHMSD.h:102
BHMSD(std::string, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: BHMSD.cc:30
int eventno
Definition: BHMSD.h:122
void CreateNewHit()
Definition: BHMSD.cc:234
G4ThreeVector hitPointLocal
Definition: BHMSD.h:111
type of data representation of DDCompactView
Definition: DDCompactView.h:90
virtual double getEnergyDeposit(G4Step *step)
Definition: BHMSD.cc:86
float X
Definition: BHMSD.h:120
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: BHMSD.cc:329
float edepositEM
Definition: BHMSD.h:126
TrackingSlaveSD * slave
Definition: BHMSD.h:83
float edepositHAD
Definition: BHMSD.h:126
float Vx
Definition: BHMSD.h:119
float Vz
Definition: BHMSD.h:119
G4ThreeVector SetToLocalExit(const G4ThreeVector &globalPoint)
Definition: BHMSD.cc:321
void Summarize()
Definition: BHMSD.cc:356
float Y
Definition: BHMSD.h:120
uint32_t previousUnitID
Definition: BHMSD.h:101
G4int tsID
Definition: BHMSD.h:97
void PrintAll() override
Definition: BHMSD.cc:368
uint32_t unitID
Definition: BHMSD.h:101
float Vy
Definition: BHMSD.h:119
float Tof
Definition: BHMSD.h:114
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
Definition: BHMSD.cc:385
G4ThreeVector theExitPoint
Definition: BHMSD.h:87
G4Track * theTrack
Definition: BHMSD.h:99
G4ThreeVector entrancePoint
Definition: BHMSD.h:86
const SimTrackManager * theManager
Definition: BHMSD.h:95
void clearHits() override
Definition: BHMSD.cc:398
float edeposit
Definition: BHMSD.h:107
G4StepPoint * postStepPoint
Definition: BHMSD.h:106
short ParticleType
Definition: BHMSD.h:115
G4int primaryID
Definition: BHMSD.h:102
G4int primID
Definition: BHMSD.h:90
BscG4Hit * currentHit
Definition: BHMSD.h:98
BscG4HitCollection * theHC
Definition: BHMSD.h:94
~BHMSD() override
Definition: BHMSD.cc:80
void fillHits(edm::PSimHitContainer &, std::string use) override
Definition: BHMSD.cc:374
G4int gammaPDG
Definition: BHMSD.h:129
int ParentId
Definition: BHMSD.h:118
void UpdateHit()
Definition: BHMSD.cc:293
G4ThreeVector SetToLocal(const G4ThreeVector &global)
Definition: BHMSD.cc:313
float ThetaAtEntry
Definition: BHMSD.h:116
void GetStepInfo(G4Step *aStep)
Definition: BHMSD.cc:122
std::vector< std::string > getNames() override
Definition: BHMSD.cc:402
G4ThreeVector hitPointLocalExit
Definition: BHMSD.h:112
std::vector< PSimHit > PSimHitContainer
G4VPhysicalVolume * currentPV
Definition: BHMSD.h:100
step
uint32_t setDetUnitId(G4Step *) override
Definition: BHMSD.cc:169
G4int hcID
Definition: BHMSD.h:93
G4THitsCollection< BscG4Hit > BscG4HitCollection
float Pabs
Definition: BHMSD.h:114
G4int epPDG
Definition: BHMSD.h:128
G4bool HitExists()
Definition: BHMSD.cc:174
void StoreHit(BscG4Hit *)
Definition: BHMSD.cc:222
bool ProcessHits(G4Step *, G4TouchableHistory *) override
Definition: BHMSD.cc:105
Definition: BHMSD.h:35
G4int emPDG
Definition: BHMSD.h:127
G4ThreeVector exitPoint
Definition: BHMSD.h:86