CMS 3D CMS Logo

PPSPixelSD.h
Go to the documentation of this file.
1 #ifndef _PPSPixelSD_h
2 #define _PPSPixelSD_h
3 // -*- C++ -*-
4 //
5 // Package: PPS
6 // Class : PPSPixelSD
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 
34 
37 
38 #include <string>
39 
40 class TrackingSlaveSD;
41 class SimTrackManager;
42 class G4Step;
43 class G4StepPoint;
44 class G4Track;
45 
47  public Observer<const BeginOfEvent*>,
48  public Observer<const EndOfEvent*> {
49 public:
51  ~PPSPixelSD() override;
52 
53  // Geant4 methods
54  bool ProcessHits(G4Step*, G4TouchableHistory*) override;
55 
56  void Initialize(G4HCofThisEvent* HCE) override;
57  void EndOfEvent(G4HCofThisEvent* eventHC) override;
58  void PrintAll() override;
59 
60  // CMSSW methods
61  uint32_t setDetUnitId(const G4Step*) override;
62  void fillHits(edm::PSimHitContainer&, const std::string&) override;
63  void clearHits() override;
64 
65 protected:
66  void update(const BeginOfEvent*) override;
67  void update(const ::EndOfEvent*) override;
68 
69 private:
70  G4ThreeVector setToLocal(const G4ThreeVector& globalPoint);
71  void stepInfo(const G4Step* aStep);
72  bool hitExists();
73  void createNewHit();
74  void updateHit();
75  void storeHit(PPSPixelG4Hit*);
76 
77  std::unique_ptr<TrackingSlaveSD> slave_;
78  std::unique_ptr<PPSVDetectorOrganization> numberingScheme_;
79 
83  G4Track* theTrack_ = nullptr;
84  G4VPhysicalVolume* currentPV_ = nullptr;
85  G4int hcID_ = -1;
86 
87  G4StepPoint* preStepPoint_ = nullptr;
88  G4StepPoint* postStepPoint_ = nullptr;
89  G4ThreeVector hitPoint_;
90  G4ThreeVector exitPoint_;
91  G4ThreeVector theLocalEntryPoint_;
92  G4ThreeVector theLocalExitPoint_;
93 
94  double tSlice_ = 0.0;
95  double eloss_ = 0.0;
96  float incidentEnergy_ = 0.f;
97  float pabs_ = 0.f;
98  float tof_ = 0.f;
99 
100  float thetaAtEntry_ = 0.f;
101  float phiAtEntry_ = 0.f;
102  float vx_ = 0.f;
103  float vy_ = 0.f;
104  float vz_ = 0.f;
105 
106  uint32_t unitID_ = 0;
107  uint32_t previousUnitID_ = 0;
108  int tsID_ = 0;
109  int primaryID_ = 0;
110  int parentID_ = 0;
111  int tSliceID_ = 0;
112  int eventno_ = 0;
113  short particleType_ = 0;
114 };
115 
116 #endif
PPSPixelSD(const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, SimTrackManager const *)
Definition: PPSPixelSD.cc:37
uint32_t previousUnitID_
Definition: PPSPixelSD.h:107
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
Definition: PPSPixelSD.cc:139
uint32_t setDetUnitId(const G4Step *) override
Definition: PPSPixelSD.cc:73
void stepInfo(const G4Step *aStep)
Definition: PPSPixelSD.cc:146
int parentID_
Definition: PPSPixelSD.h:110
G4ThreeVector exitPoint_
Definition: PPSPixelSD.h:90
G4int hcID_
Definition: PPSPixelSD.h:85
void clearHits() override
Definition: PPSPixelSD.cc:137
void PrintAll() override
Definition: PPSPixelSD.cc:118
G4VPhysicalVolume * currentPV_
Definition: PPSPixelSD.h:84
const SimTrackManager * theManager_
Definition: PPSPixelSD.h:81
G4StepPoint * preStepPoint_
Definition: PPSPixelSD.h:87
float vz_
Definition: PPSPixelSD.h:104
float phiAtEntry_
Definition: PPSPixelSD.h:101
void createNewHit()
Definition: PPSPixelSD.cc:203
void storeHit(PPSPixelG4Hit *)
Definition: PPSPixelSD.cc:260
bool ProcessHits(G4Step *, G4TouchableHistory *) override
Definition: PPSPixelSD.cc:60
float tof_
Definition: PPSPixelSD.h:98
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
Definition: PPSPixelSD.cc:129
float vx_
Definition: PPSPixelSD.h:102
int eventno_
Definition: PPSPixelSD.h:112
int primaryID_
Definition: PPSPixelSD.h:109
PPSPixelG4Hit * currentHit_
Definition: PPSPixelSD.h:82
G4Track * theTrack_
Definition: PPSPixelSD.h:83
float vy_
Definition: PPSPixelSD.h:103
float thetaAtEntry_
Definition: PPSPixelSD.h:100
G4ThreeVector theLocalExitPoint_
Definition: PPSPixelSD.h:92
bool hitExists()
Definition: PPSPixelSD.cc:181
void Initialize(G4HCofThisEvent *HCE) override
Definition: PPSPixelSD.cc:77
float incidentEnergy_
Definition: PPSPixelSD.h:96
std::unique_ptr< TrackingSlaveSD > slave_
Definition: PPSPixelSD.h:77
float pabs_
Definition: PPSPixelSD.h:97
PPSPixelG4HitCollection * theHC_
Definition: PPSPixelSD.h:80
double tSlice_
Definition: PPSPixelSD.h:94
std::unique_ptr< PPSVDetectorOrganization > numberingScheme_
Definition: PPSPixelSD.h:78
void fillHits(edm::PSimHitContainer &, const std::string &) override
Definition: PPSPixelSD.cc:123
~PPSPixelSD() override
Definition: PPSPixelSD.cc:58
int tSliceID_
Definition: PPSPixelSD.h:111
G4ThreeVector hitPoint_
Definition: PPSPixelSD.h:89
G4StepPoint * postStepPoint_
Definition: PPSPixelSD.h:88
short particleType_
Definition: PPSPixelSD.h:113
std::vector< PSimHit > PSimHitContainer
uint32_t unitID_
Definition: PPSPixelSD.h:106
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: PPSPixelSD.cc:91
void updateHit()
Definition: PPSPixelSD.cc:249
G4ThreeVector theLocalEntryPoint_
Definition: PPSPixelSD.h:91
double eloss_
Definition: PPSPixelSD.h:95