30 #include "G4SDManager.hh" 31 #include "G4VProcess.hh" 32 #include "G4EventManager.hh" 34 #include "G4ParticleTable.hh" 36 #include "G4SystemOfUnits.hh" 60 preStepPoint(nullptr),
61 postStepPoint(nullptr),
68 SetVerboseLevel(verbn);
72 if (
name ==
"FP420SI") {
74 edm::LogInfo(
"FP420Sim") <<
"name = FP420SI and new FP420NumberingSchem";
91 LogDebug(
"FP420Sim") <<
"FP420SD : Initialize called for " <<
name << std::endl;
107 if (aStep ==
nullptr) {
115 LogDebug(
"FP420Sim") <<
"FP420SD : number of hits = " <<
theHC->entries() << std::endl;
137 G4int particleCode =
theTrack->GetDefinition()->GetPDGEncoding();
145 edeposit = aStep->GetTotalEnergyDeposit();
154 Pabs = aStep->GetPreStepPoint()->GetMomentum().mag() / GeV;
156 Tof = aStep->GetPostStepPoint()->GetGlobalTime() / nanosecond;
157 Eloss = aStep->GetTotalEnergyDeposit() / GeV;
159 ThetaAtEntry = aStep->GetPreStepPoint()->GetPosition().theta() / deg;
160 PhiAtEntry = aStep->GetPreStepPoint()->GetPosition().phi() / deg;
194 G4bool
found =
false;
225 if (
hit ==
nullptr) {
236 LogDebug(
"FP420Sim") <<
"FP420SD CreateNewHit for" 240 <<
theTrack->GetTrackID() <<
" which is a " <<
theTrack->GetDefinition()->GetParticleName();
248 LogDebug(
"FP420Sim") <<
" and created by ";
252 LogDebug(
"FP420Sim") <<
"NO process";
299 LogDebug(
"FP420Sim") <<
"updateHit: add eloss " <<
Eloss << std::endl;
315 const G4VTouchable* touch =
preStepPoint->GetTouchable();
316 theEntryPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
322 theExitPoint = touch->GetHistory()->GetTopTransform().TransformPoint(globalPoint);
338 if ((fabs(aHit->
getTof()) > 780. && fabs(aHit->
getTof()) < 840.))
340 if ((fabs(aHit->
getTof()) > 1380. && fabs(aHit->
getTof()) < 1450.))
343 if ((fabs(aHit->
getTof()) > 780. && fabs(aHit->
getTof()) < 840. && nhitsHPS240 < 200.) ||
344 (fabs(aHit->
getTof()) > 1380. && fabs(aHit->
getTof()) < 1450. && nhitsFP420 < 200.)) {
347 LogDebug(
"FP420Sim") <<
"hit number" <<
j <<
"unit ID = " << aHit->
getUnitID() <<
"\n";
407 LogDebug(
"FP420Sim") <<
"FP420SD: Collection " <<
theHC->GetName() <<
"\n";
408 theHC->PrintAllHits();
426 LogDebug(
"ForwardSim") <<
" Dispatched BeginOfEvent for " << GetName() <<
" !";
428 eventno = (*i)()->GetEventID();
432 G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
float getThetaAtEntry() const
G4ThreeVector theExitPoint
G4ThreeVector SetToLocalExit(const G4ThreeVector &globalPoint)
void setPhiAtEntry(float f)
void setEntry(const G4ThreeVector &xyz)
virtual double getEnergyDeposit(G4Step *step)
G4ThreeVector hitPointExit
uint32_t cc[maxCellsPerHit]
G4StepPoint * preStepPoint
void ResetForNewPrimary()
unsigned int getUnitID() const
void addEnergyDeposit(double em, double hd)
T getUntrackedParameter(std::string const &, T const &) const
void setEnergyLoss(float e)
std::vector< PSimHit > & hits()
void clearHits() override
G4ThreeVector theEntryPoint
int getTimeSliceID() const
virtual void Initialize()
G4ThreeVector getEntry() const
void GetStepInfo(G4Step *aStep)
void fillHits(edm::PSimHitContainer &, const std::string &) override
FP420G4HitCollection * theHC
unsigned int getTrackID() const
int getParticleType() const
G4ThreeVector getEntryLocalP() const
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
void setTimeSlice(double d)
void setEntryLocalP(const G4ThreeVector &xyz1)
uint32_t setDetUnitId(const G4Step *) override
G4THitsCollection< FP420G4Hit > FP420G4HitCollection
void setIncidentEnergy(double e)
Log< level::Info, false > LogInfo
G4VPhysicalVolume * currentPV
void Initialize(G4HCofThisEvent *HCE) override
void setExitLocalP(const G4ThreeVector &xyz1)
unsigned int getUnitID(const G4Step *aStep) const
void setParticleType(short i)
void setThetaAtEntry(float t)
G4ThreeVector hitPointLocalExit
FP420NumberingScheme * numberingScheme
bool ProcessHits(G4Step *, G4TouchableHistory *) override
FP420SD(const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
G4ThreeVector SetToLocal(const G4ThreeVector &global)
void setUnitID(unsigned int i)
float getPhiAtEntry() const
G4ThreeVector entrancePoint
static TrackerG4SimHitNumberingScheme & numberingScheme(const GeometricDet &det)
virtual bool processHits(const PSimHit &)
std::vector< PSimHit > PSimHitContainer
float getEnergyLoss() const
Log< level::Warning, false > LogWarning
G4StepPoint * postStepPoint
G4ThreeVector hitPointLocal
void addEnergyLoss(float e)
void StoreHit(FP420G4Hit *)
G4ThreeVector getExitLocalP() const
void EndOfEvent(G4HCofThisEvent *eventHC) override