|
|
Go to the documentation of this file.
30 #include "G4SDManager.hh"
31 #include "G4VProcess.hh"
32 #include "G4EventManager.hh"
34 #include "G4ParticleTable.hh"
36 #include "G4SystemOfUnits.hh"
61 preStepPoint(nullptr),
62 postStepPoint(nullptr),
69 SetVerboseLevel(verbn);
73 if (
name ==
"FP420SI") {
75 edm::LogInfo(
"FP420Sim") <<
"name = FP420SI and new FP420NumberingSchem";
92 LogDebug(
"FP420Sim") <<
"FP420SD : Initialize called for " <<
name << std::endl;
108 if (aStep ==
nullptr) {
116 LogDebug(
"FP420Sim") <<
"FP420SD : number of hits = " <<
theHC->entries() << std::endl;
138 G4int particleCode =
theTrack->GetDefinition()->GetPDGEncoding();
146 edeposit = aStep->GetTotalEnergyDeposit();
155 Pabs = aStep->GetPreStepPoint()->GetMomentum().mag() /
GeV;
157 Tof = aStep->GetPostStepPoint()->GetGlobalTime() / nanosecond;
158 Eloss = aStep->GetTotalEnergyDeposit() /
GeV;
160 ThetaAtEntry = aStep->GetPreStepPoint()->GetPosition().theta() / deg;
161 PhiAtEntry = aStep->GetPreStepPoint()->GetPosition().phi() / deg;
195 G4bool
found =
false;
226 if (
hit ==
nullptr) {
237 LogDebug(
"FP420Sim") <<
"FP420SD CreateNewHit for"
241 <<
theTrack->GetTrackID() <<
" which is a " <<
theTrack->GetDefinition()->GetParticleName();
249 LogDebug(
"FP420Sim") <<
" and created by ";
253 LogDebug(
"FP420Sim") <<
"NO process";
300 LogDebug(
"FP420Sim") <<
"updateHit: add eloss " <<
Eloss << std::endl;
316 const G4VTouchable* touch =
preStepPoint->GetTouchable();
317 theEntryPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
323 theExitPoint = touch->GetHistory()->GetTopTransform().TransformPoint(globalPoint);
339 if ((fabs(aHit->
getTof()) > 780. && fabs(aHit->
getTof()) < 840.))
341 if ((fabs(aHit->
getTof()) > 1380. && fabs(aHit->
getTof()) < 1450.))
344 if ((fabs(aHit->
getTof()) > 780. && fabs(aHit->
getTof()) < 840. && nhitsHPS240 < 200.) ||
345 (fabs(aHit->
getTof()) > 1380. && fabs(aHit->
getTof()) < 1450. && nhitsFP420 < 200.)) {
348 LogDebug(
"FP420Sim") <<
"hit number" <<
j <<
"unit ID = " << aHit->
getUnitID() <<
"\n";
408 LogDebug(
"FP420Sim") <<
"FP420SD: Collection " <<
theHC->GetName() <<
"\n";
409 theHC->PrintAllHits();
427 LogDebug(
"ForwardSim") <<
" Dispatched BeginOfEvent for " << GetName() <<
" !";
429 eventno = (*i)()->GetEventID();
433 G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
G4ThreeVector hitPointLocalExit
float getEnergyLoss() const
float getThetaAtEntry() const
int getParticleType() const
G4THitsCollection< FP420G4Hit > FP420G4HitCollection
G4ThreeVector theEntryPoint
G4StepPoint * postStepPoint
G4ThreeVector hitPointExit
T getUntrackedParameter(std::string const &, T const &) const
G4ThreeVector hitPointLocal
void setEntry(const G4ThreeVector &xyz)
unsigned int getUnitID() const
void addEnergyDeposit(double em, double hd)
G4ThreeVector getEntry() const
void GetStepInfo(G4Step *aStep)
virtual unsigned int getUnitID(const G4Step *aStep) const
FP420SD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
virtual double getEnergyDeposit(G4Step *step)
void setExitLocalP(const G4ThreeVector &xyz1)
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
FP420NumberingScheme * numberingScheme
virtual void Initialize()
G4ThreeVector entrancePoint
G4VPhysicalVolume * currentPV
void ResetForNewPrimary()
FP420G4HitCollection * theHC
int getTimeSliceID() const
virtual bool processHits(const PSimHit &)
static TrackerG4SimHitNumberingScheme & numberingScheme(const GeometricDet &det)
void fillHits(edm::PSimHitContainer &, const std::string &) override
G4ThreeVector getEntryLocalP() const
void Initialize(G4HCofThisEvent *HCE) override
G4ThreeVector getExitLocalP() const
void setUnitID(unsigned int i)
void setEntryLocalP(const G4ThreeVector &xyz1)
void setParticleType(short i)
void StoreHit(FP420G4Hit *)
G4ThreeVector SetToLocal(const G4ThreeVector &global)
void clearHits() override
void EndOfEvent(G4HCofThisEvent *eventHC) override
G4StepPoint * preStepPoint
float getPhiAtEntry() const
G4ThreeVector SetToLocalExit(const G4ThreeVector &globalPoint)
bool ProcessHits(G4Step *, G4TouchableHistory *) override
void setPhiAtEntry(float f)
std::vector< PSimHit > & hits()
std::vector< PSimHit > PSimHitContainer
void addEnergyLoss(float e)
uint32_t setDetUnitId(const G4Step *) override
void setTimeSlice(double d)
unsigned int getTrackID() const
void setEnergyLoss(float e)
G4ThreeVector theExitPoint
void setThetaAtEntry(float t)
void setIncidentEnergy(double e)