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