CMS 3D CMS Logo

BscSD.h
Go to the documentation of this file.
1 //
2 #ifndef Bsc_BscSD_h
3 #define Bsc_BscSD_h
4 //
5 
8 
12 
13 // last
14 //#include "SimG4Core/Application/interface/SimTrackManager.h"
15 //#include "SimG4CMS/Calo/interface/CaloSD.h"
16 
17 
18 //#include "SimG4Core/Notification/interface/TrackWithHistory.h"
19 //#include "SimG4Core/Notification/interface/TrackContainer.h"
20 
24 
25 
26 #include "G4Step.hh"
27 #include "G4StepPoint.hh"
28 #include "G4Track.hh"
29 #include "G4VPhysicalVolume.hh"
30 
31 //#include <CLHEP/Vector/ThreeVector.h>
32 //#include <iostream>
33 //#include <fstream>
34 //#include <vector>
35 //#include <map>
36 #include <string>
37 
38 
39 
40 class TrackingSlaveSD;
41 //AZ:
42 class BscSD;
43 
44 class TrackInformation;
45 class SimTrackManager;
46 class TrackingSlaveSD;
47 class UpdatablePSimHit;
50 
51 
52 //-------------------------------------------------------------------
53 
54 class BscSD : public SensitiveTkDetector,
55  public Observer<const BeginOfRun *>,
56  public Observer<const BeginOfEvent*>,
57  public Observer<const EndOfEvent*> {
58 
59 public:
60 
62  edm::ParameterSet const &, const SimTrackManager* );
63 
64 
65  ~BscSD() override;
66 
67  bool ProcessHits(G4Step *,G4TouchableHistory *) override;
68  uint32_t setDetUnitId(G4Step*) override;
69 
70  void Initialize(G4HCofThisEvent * HCE) override;
71  void EndOfEvent(G4HCofThisEvent * eventHC) override;
72  void clear() override;
73  void DrawAll() override;
74  void PrintAll() override;
75 
76  virtual double getEnergyDeposit(G4Step* step);
77  //protected:
78  // Collection hits_;
79  void fillHits(edm::PSimHitContainer&, std::string use) override;
80 
81  std::vector<std::string> getNames() override;
82 
83  private:
84  void update(const BeginOfRun *) override;
85  void update(const BeginOfEvent *) override;
86  void update(const ::EndOfEvent *) override;
87  void clearHits() override;
88 
89  //void SetNumberingScheme(BscNumberingScheme* scheme);
90 
91 
92 
93  // int eventno;
94  private:
95 
96  G4ThreeVector SetToLocal(const G4ThreeVector& global);
97  G4ThreeVector SetToLocalExit(const G4ThreeVector& globalPoint);
98  void GetStepInfo(G4Step* aStep);
99  G4bool HitExists();
100  void CreateNewHit();
101  void UpdateHit();
102  void StoreHit(BscG4Hit*);
103  void ResetForNewPrimary();
104  void Summarize();
105 
106 
107  private:
108 
109  //AZ:
112 
113  G4ThreeVector entrancePoint, exitPoint;
114  G4ThreeVector theEntryPoint ;
115  G4ThreeVector theExitPoint ;
116 
118  G4int primID ;
119 
120  // G4String name;
122  G4int hcID;
125 
126  G4int tsID;
128  G4Track* theTrack;
129  G4VPhysicalVolume* currentPV;
130  // unsigned int unitID, previousUnitID;
133  G4double tSlice;
134 
135  G4StepPoint* preStepPoint;
136  G4StepPoint* postStepPoint;
137  float edeposit;
138 
139  G4ThreeVector hitPoint;
140  // G4ThreeVector Position;
141  G4ThreeVector hitPointExit;
142  G4ThreeVector hitPointLocal;
143  G4ThreeVector hitPointLocalExit;
144  float Pabs;
145  float Tof;
146  float Eloss;
147  short ParticleType;
148 
150  float PhiAtEntry;
151 
152  int ParentId;
153  float Vx,Vy,Vz;
154  float X,Y,Z;
155 
156 
157  //
158  // Hist
159  //
160  int eventno;
161 
162  protected:
163 
165  G4int emPDG;
166  G4int epPDG;
167  G4int gammaPDG;
168 };
169 
170 #endif // BscSD_h
171 
172 
173 
174 
G4int gammaPDG
Definition: BscSD.h:167
G4int emPDG
Definition: BscSD.h:165
G4int epPDG
Definition: BscSD.h:166
void Summarize()
Definition: BscSD.cc:399
uint32_t previousUnitID
Definition: BscSD.h:131
float Y
Definition: BscSD.h:154
TrackingSlaveSD * slave
Definition: BscSD.h:110
G4ThreeVector SetToLocal(const G4ThreeVector &global)
Definition: BscSD.cc:355
float PhiAtEntry
Definition: BscSD.h:150
G4bool HitExists()
Definition: BscSD.cc:208
float Vx
Definition: BscSD.h:153
BscSD(std::string, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: BscSD.cc:48
float edeposit
Definition: BscSD.h:137
G4int tSliceID
Definition: BscSD.h:132
float Tof
Definition: BscSD.h:145
virtual double getEnergyDeposit(G4Step *step)
Definition: BscSD.cc:113
int ParentId
Definition: BscSD.h:152
void GetStepInfo(G4Step *aStep)
Definition: BscSD.cc:155
float X
Definition: BscSD.h:154
void CreateNewHit()
Definition: BscSD.cc:275
float edepositEM
Definition: BscSD.h:164
float Eloss
Definition: BscSD.h:146
G4int primID
Definition: BscSD.h:118
BscG4HitCollection * theHC
Definition: BscSD.h:123
G4ThreeVector hitPointLocalExit
Definition: BscSD.h:143
type of data representation of DDCompactView
Definition: DDCompactView.h:90
std::vector< std::string > getNames() override
Definition: BscSD.cc:446
G4int tsID
Definition: BscSD.h:126
void UpdateHit()
Definition: BscSD.cc:334
G4VPhysicalVolume * currentPV
Definition: BscSD.h:129
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
Definition: BscSD.cc:428
uint32_t unitID
Definition: BscSD.h:131
G4int primaryID
Definition: BscSD.h:132
G4StepPoint * preStepPoint
Definition: BscSD.h:135
void fillHits(edm::PSimHitContainer &, std::string use) override
Definition: BscSD.cc:417
std::string name
Definition: BscSD.h:121
float ThetaAtEntry
Definition: BscSD.h:149
bool ProcessHits(G4Step *, G4TouchableHistory *) override
Definition: BscSD.cc:134
G4int hcID
Definition: BscSD.h:122
float Z
Definition: BscSD.h:154
float edepositHAD
Definition: BscSD.h:164
G4ThreeVector hitPoint
Definition: BscSD.h:139
void PrintAll() override
Definition: BscSD.cc:411
uint32_t setDetUnitId(G4Step *) override
Definition: BscSD.cc:202
void StoreHit(BscG4Hit *)
Definition: BscSD.cc:263
G4ThreeVector theEntryPoint
Definition: BscSD.h:114
void clearHits() override
Definition: BscSD.cc:441
G4StepPoint * postStepPoint
Definition: BscSD.h:136
short ParticleType
Definition: BscSD.h:147
G4ThreeVector hitPointExit
Definition: BscSD.h:141
BscNumberingScheme * numberingScheme
Definition: BscSD.h:111
float incidentEnergy
Definition: BscSD.h:117
G4ThreeVector exitPoint
Definition: BscSD.h:113
G4ThreeVector theExitPoint
Definition: BscSD.h:115
Definition: BscSD.h:54
G4ThreeVector SetToLocalExit(const G4ThreeVector &globalPoint)
Definition: BscSD.cc:363
G4Track * theTrack
Definition: BscSD.h:128
int eventno
Definition: BscSD.h:160
G4double tSlice
Definition: BscSD.h:133
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: BscSD.cc:371
G4ThreeVector entrancePoint
Definition: BscSD.h:113
void DrawAll() override
Definition: BscSD.cc:407
void clear() override
Definition: BscSD.cc:403
void Initialize(G4HCofThisEvent *HCE) override
Definition: BscSD.cc:117
std::vector< PSimHit > PSimHitContainer
step
~BscSD() override
Definition: BscSD.cc:104
float Vz
Definition: BscSD.h:153
G4THitsCollection< BscG4Hit > BscG4HitCollection
float Pabs
Definition: BscSD.h:144
float Vy
Definition: BscSD.h:153
G4ThreeVector hitPointLocal
Definition: BscSD.h:142
BscG4Hit * currentHit
Definition: BscSD.h:127
void ResetForNewPrimary()
Definition: BscSD.cc:254
const SimTrackManager * theManager
Definition: BscSD.h:124