21 #include "G4SDManager.hh" 24 #include "G4VProcess.hh" 26 #include "G4PhysicalConstants.hh" 27 #include "G4SystemOfUnits.hh" 56 if (name_ ==
"TotemHitsRP") {
62 edm::LogInfo(
"TotemRP") <<
"TotemRPSD: Instantiation completed";
68 LogDebug(
"TotemRP") <<
"TotemRPSD : Initialize called for " <<
name_;
79 LogDebug(
"TotemRP") <<
theTrack_->GetDefinition()->GetParticleName() <<
" TotemRPSD CreateNewHit for" 83 <<
theTrack_->GetTotalEnergy() <<
" Eloss_ " <<
Eloss_ <<
" positions ";
84 printf(
"(%10f,%10f,%10f)",
88 printf(
"(%10f,%10f,%10f)",
95 <<
" For Track " <<
theTrack_->GetTrackID() <<
" which is a " 96 <<
theTrack_->GetDefinition()->GetParticleName();
99 LogDebug(
"TotemRP") <<
" primary particle ";
104 LogDebug(
"TotemRP") <<
" and created by ";
106 if (
theTrack_->GetCreatorProcess() !=
nullptr)
109 LogDebug(
"TotemRP") <<
"NO process";
115 if (aStep ==
nullptr) {
136 name_.assign(name_, 0, 4);
147 Pabs_ = (aStep->GetPreStepPoint()->GetMomentum().mag()) /
GeV;
148 thePx_ = (aStep->GetPreStepPoint()->GetMomentum().x()) /
GeV;
149 thePy_ = (aStep->GetPreStepPoint()->GetMomentum().y()) /
GeV;
150 thePz_ = (aStep->GetPreStepPoint()->GetMomentum().z()) /
GeV;
152 Tof_ = aStep->GetPostStepPoint()->GetGlobalTime() / nanosecond;
153 Eloss_ = aStep->GetTotalEnergyDeposit() /
GeV;
157 G4ThreeVector gmd = aStep->GetPreStepPoint()->GetMomentumDirection();
159 G4ThreeVector lmd = ((G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable()))
182 if (hit ==
nullptr) {
184 LogDebug(
"TotemRP") <<
"TotemRPSD: hit to be stored is NULL !!" << std::endl;
231 G4ThreeVector localPoint;
233 localPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
265 LogDebug(
"TotemRP") <<
"TotemRPSD: Collection " <<
theHC_->GetName() << std::endl;
276 LogDebug(
"TotemRP") <<
"TotemRPSD: updates numbering scheme for " << GetName();
void setEntry(G4ThreeVector xyz)
G4ThreeVector localEntry() const
T getParameter(std::string const &) const
void fillHits(edm::PSimHitContainer &, const std::string &) override
unsigned int trackID() const
G4THitsCollection< TotemRPG4Hit > TotemRPG4HitCollection
Local3DPoint ConvertToLocal3DPoint(const G4ThreeVector &point) const
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
void setIncidentEnergy(double e)
G4VPhysicalVolume * currentPV_
std::unique_ptr< TotemRPVDetectorOrganization > numberingScheme_
void storeHit(TotemRPG4Hit *)
Geom::Phi< T > phi() const
bool ProcessHits(G4Step *step, G4TouchableHistory *tHistory) override
TotemRPSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
TotemRPG4HitCollection * theHC_
Geom::Theta< T > theta() const
void setLocalEntry(const G4ThreeVector &theLocalEntryPoint)
void stepInfo(const G4Step *aStep)
void clearHits() override
void Initialize(G4HCofThisEvent *HCE) override
void EndOfEvent(G4HCofThisEvent *eventHC) override
double phiAtEntry() const
void setExit(G4ThreeVector xyz)
G4ThreeVector theLocalEntryPoint_
uint32_t setDetUnitId(const G4Step *step) override
G4StepPoint * postStepPoint_
void setLocalExit(const G4ThreeVector &theLocalExitPoint)
void setThetaAtEntry(double t)
void setNumberingScheme(TotemRPVDetectorOrganization *scheme)
G4StepPoint * preStepPoint_
void setUnitID(unsigned int i)
static unsigned int maxTotemHits_
double energyLoss() const
static double rp_garage_position_
G4ThreeVector theLocalExitPoint_
double thetaAtEntry() const
void setPhiAtEntry(double f)
G4ThreeVector localExit() const
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
void setParticleType(short i)
std::vector< PSimHit > PSimHitContainer
bool isPrimary(const G4Track *track)
void setEnergyLoss(double e)
std::unique_ptr< TrackingSlaveSD > slave_
TotemRPG4Hit * currentHit_
void setTimeSlice(double d)