CMS 3D CMS Logo

TotemRPSD.h
Go to the documentation of this file.
1 #ifndef PPS_TotemRPSD_h
2 #define PPS_TotemRPSD_h
3 
11 
16 
17 #include <string>
18 
19 class G4Step;
20 class G4HCofThisEvent;
21 class G4Track;
22 class G4StepPoint;
23 class TrackingSlaveSD;
24 class SimTrackManager;
25 class TotemTestHitHBNtuple;
26 
27 class TotemRPSD : public SensitiveTkDetector, public Observer<const BeginOfEvent*>, public Observer<const EndOfEvent*> {
28 public:
29  TotemRPSD(const std::string&,
30  const edm::EventSetup&,
32  edm::ParameterSet const&,
33  const SimTrackManager*);
34  ~TotemRPSD() override;
35 
36  void printHitInfo();
37 
38  void Initialize(G4HCofThisEvent* HCE) override;
39  void EndOfEvent(G4HCofThisEvent* eventHC) override;
40  void clear() override;
41  void DrawAll() override;
42  void PrintAll() override;
43 
44  void fillHits(edm::PSimHitContainer&, const std::string&) override;
45  static constexpr double rp_garage_position_ = 40.0;
46 
47 private:
48  static constexpr unsigned int maxTotemHits_ = 15000;
49  void clearHits() override;
50  bool ProcessHits(G4Step* step, G4TouchableHistory* tHistory) override;
51  uint32_t setDetUnitId(const G4Step* step) override;
52  void update(const BeginOfEvent*) override;
53  void update(const ::EndOfEvent*) override;
54 
56 
57  std::unique_ptr<TrackingSlaveSD> slave_;
58  std::unique_ptr<TotemRPVDetectorOrganization> numberingScheme_;
59 
60 private:
62 
63  G4ThreeVector setToLocal(const G4ThreeVector& globalPoint);
64  void stepInfo(const G4Step* aStep);
65  G4bool hitExists();
66  void createNewHit();
67  void updateHit();
68  void storeHit(TotemRPG4Hit*);
69  void resetForNewPrimary();
70  void summarize();
71  bool isPrimary(const G4Track* track);
72 
73 private:
74  // Data relative to primary particle (the one which triggers a shower)
75  // These data are common to all Hits of a given shower.
76  // One shower is made of several hits which differ by the
77  // unit ID (cristal/fiber/scintillator) and the Time slice ID.
78 
79  G4ThreeVector entrancePoint_;
81 
82  G4String name_;
83  G4int hcID_;
85 
87  G4Track* theTrack_;
88  G4VPhysicalVolume* currentPV_;
89  unsigned int unitID_;
91  G4double tSlice_;
92 
93  G4StepPoint* preStepPoint_;
94  G4StepPoint* postStepPoint_;
95  G4ThreeVector hitPoint_;
96  G4ThreeVector exitPoint_;
97  G4ThreeVector theLocalEntryPoint_;
98  G4ThreeVector theLocalExitPoint_;
99 
100  double Pabs_;
101  double thePx_, thePy_, thePz_;
102  double Tof_;
103  double Eloss_;
105 
107  double PhiAtEntry_;
108 
110  double Vx_, Vy_, Vz_;
111 
112  // Hist
113  //static TotemTestHitHBNtuple* theNtuple_;
114  int eventno_;
115 };
116 
117 #endif // PPS_TotemRPSD_h
TotemRPSD::theLocalEntryPoint_
G4ThreeVector theLocalEntryPoint_
Definition: TotemRPSD.h:97
TotemRPSD::hcID_
G4int hcID_
Definition: TotemRPSD.h:83
TotemRPSD::setNumberingScheme
void setNumberingScheme(TotemRPVDetectorOrganization *scheme)
Definition: TotemRPSD.cc:274
SimTrackManager
Definition: SimTrackManager.h:35
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
Observer
Definition: Observer.h:23
TotemRPSD::DrawAll
void DrawAll() override
Definition: TotemRPSD.cc:262
TotemRPSD::theTrack_
G4Track * theTrack_
Definition: TotemRPSD.h:87
step
step
Definition: StallMonitor.cc:94
TotemRPSD::thePy_
double thePy_
Definition: TotemRPSD.h:101
TotemRPSD::theHC_
TotemRPG4HitCollection * theHC_
Definition: TotemRPSD.h:84
TotemRPSD
Definition: TotemRPSD.h:27
SensitiveTkDetector
Definition: SensitiveTkDetector.h:8
TotemRPSD::entrancePoint_
G4ThreeVector entrancePoint_
Definition: TotemRPSD.h:79
TotemRPSD::Vx_
double Vx_
Definition: TotemRPSD.h:110
TotemRPSD::EndOfEvent
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: TotemRPSD.cc:237
TotemRPSD::tSlice_
G4double tSlice_
Definition: TotemRPSD.h:91
TotemRPSD::PhiAtEntry_
double PhiAtEntry_
Definition: TotemRPSD.h:107
TotemRPSD::storeHit
void storeHit(TotemRPG4Hit *)
Definition: TotemRPSD.cc:181
TotemRPSD::printHitInfo
void printHitInfo()
Definition: TotemRPSD.cc:78
TotemRPSD::ThetaAtEntry_
double ThetaAtEntry_
Definition: TotemRPSD.h:106
EndOfEvent.h
TotemRPSD::PrintAll
void PrintAll() override
Definition: TotemRPSD.cc:264
TotemRPSD::ParentId_
int ParentId_
Definition: TotemRPSD.h:109
TotemRPSD::setDetUnitId
uint32_t setDetUnitId(const G4Step *step) override
Definition: TotemRPSD.cc:177
Observer.h
SensitiveTkDetector.h
TotemRPSD::ParticleType_
short ParticleType_
Definition: TotemRPSD.h:104
TotemRPSD::Pabs_
double Pabs_
Definition: TotemRPSD.h:100
TotemRPG4Hit
Definition: TotemRPG4Hit.h:30
TotemRPSD::clearHits
void clearHits() override
Definition: TotemRPSD.cc:287
TotemRPSD::currentHit_
TotemRPG4Hit * currentHit_
Definition: TotemRPSD.h:86
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
TotemRPSD::fillHits
void fillHits(edm::PSimHitContainer &, const std::string &) override
Definition: TotemRPSD.cc:269
TotemRPSD::hitExists
G4bool hitExists()
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TotemRPSD::Vz_
double Vz_
Definition: TotemRPSD.h:110
TotemRPSD::thePx_
double thePx_
Definition: TotemRPSD.h:101
TotemRPSD::TotemRPSD
TotemRPSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: TotemRPSD.cc:33
edm::ParameterSet
Definition: ParameterSet.h:47
TotemRPG4Hit.h
TotemRPSD::preStepPoint_
G4StepPoint * preStepPoint_
Definition: TotemRPSD.h:93
TotemRPG4HitCollection
G4THitsCollection< TotemRPG4Hit > TotemRPG4HitCollection
Definition: TotemRPG4HitCollection.h:13
BeginOfEvent.h
TotemRPSD::isPrimary
bool isPrimary(const G4Track *track)
Definition: TotemRPSD.cc:289
TotemRPSD::clear
void clear() override
Definition: TotemRPSD.cc:260
TrackingSlaveSD
Definition: TrackingSlaveSD.h:11
TotemRPSD::stepInfo
void stepInfo(const G4Step *aStep)
Definition: TotemRPSD.cc:125
BeginOfEvent
Definition: BeginOfEvent.h:6
TotemRPSD::Eloss_
double Eloss_
Definition: TotemRPSD.h:103
edm::EventSetup
Definition: EventSetup.h:57
TotemRPSD::update
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
Definition: TotemRPSD.cc:280
TotemRPSD::Vy_
double Vy_
Definition: TotemRPSD.h:110
TotemRPSD::postStepPoint_
G4StepPoint * postStepPoint_
Definition: TotemRPSD.h:94
TotemRPSD::unitID_
unsigned int unitID_
Definition: TotemRPSD.h:89
TotemRPSD::createNewHit
void createNewHit()
Definition: TotemRPSD.cc:190
generator_cfi.scheme
scheme
Definition: generator_cfi.py:22
TotemRPSD::primaryID_
G4int primaryID_
Definition: TotemRPSD.h:90
TotemRPSD::tSliceID_
G4int tSliceID_
Definition: TotemRPSD.h:90
TotemRPSD::updateHit
void updateHit()
TotemRPSD::thePz_
double thePz_
Definition: TotemRPSD.h:101
TotemRPSD::maxTotemHits_
static constexpr unsigned int maxTotemHits_
Definition: TotemRPSD.h:48
TotemRPSD::numberingScheme_
std::unique_ptr< TotemRPVDetectorOrganization > numberingScheme_
Definition: TotemRPSD.h:58
TotemRPVDetectorOrganization
Definition: TotemRPVDetectorOrganization.h:6
TotemRPSD::verbosity_
int verbosity_
Definition: TotemRPSD.h:61
TotemRPSD::incidentEnergy_
double incidentEnergy_
Definition: TotemRPSD.h:80
TotemRPSD::name_
G4String name_
Definition: TotemRPSD.h:82
TotemRPSD::summarize
void summarize()
Definition: TotemRPSD.cc:258
TotemRPSD::theLocalExitPoint_
G4ThreeVector theLocalExitPoint_
Definition: TotemRPSD.h:98
TotemRPSD::Initialize
void Initialize(G4HCofThisEvent *HCE) override
Definition: TotemRPSD.cc:67
TotemRPSD::Tof_
double Tof_
Definition: TotemRPSD.h:102
TotemRPSD::~TotemRPSD
~TotemRPSD() override
Definition: TotemRPSD.cc:65
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
TotemRPSD::rp_garage_position_
static constexpr double rp_garage_position_
Definition: TotemRPSD.h:45
TotemRPVDetectorOrganization.h
TotemRPSD::currentPV_
G4VPhysicalVolume * currentPV_
Definition: TotemRPSD.h:88
TotemRPSD::slave_
std::unique_ptr< TrackingSlaveSD > slave_
Definition: TotemRPSD.h:57
TotemRPG4HitCollection.h
TotemRPSD::hitPoint_
G4ThreeVector hitPoint_
Definition: TotemRPSD.h:95
TotemRPSD::ProcessHits
bool ProcessHits(G4Step *step, G4TouchableHistory *tHistory) override
Definition: TotemRPSD.cc:114
TotemRPSD::resetForNewPrimary
void resetForNewPrimary()
TotemRPSD::setToLocal
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
Definition: TotemRPSD.cc:230
TotemRPSD::eventno_
int eventno_
Definition: TotemRPSD.h:114
TotemRPSD::exitPoint_
G4ThreeVector exitPoint_
Definition: TotemRPSD.h:96