29 #include "G4SDManager.hh"
32 #include "G4VProcess.hh"
34 #include "G4PhysicalConstants.hh"
35 #include "G4SystemOfUnits.hh"
42 numberingScheme_(nullptr),
51 preStepPoint_(nullptr),
52 postStepPoint_(nullptr),
60 SetVerboseLevel(verbn);
62 if (name_ ==
"CTPPSPixelHits") {
68 edm::LogInfo(
"PPSSim") <<
"PPSPixelSD: Instantiation completed";
88 LogDebug(
"PPSSim") <<
"PPSPixelSD : Initialize called for " <<
name_;
106 LogDebug(
"PPSSim") <<
"HIT NUMERO " <<
j <<
"unit ID = " << aHit->
unitID() <<
"\n"
108 <<
"enrty z " << aHit->entry().
z() <<
"\n"
134 LogDebug(
"PPSSim") <<
"PPSPixelSD: Collection " <<
theHC_->GetName();
145 LogDebug(
"PPSSim") <<
" Dispatched BeginOfEvent for " << GetName() <<
" !";
155 G4ThreeVector localPoint;
157 localPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
169 LogDebug(
"PPSSim") <<
"theEntryPoint_ " << TheEntryPoint <<
"\n";
176 name_.assign(name_, 0, 4);
178 edeposit_ = aStep->GetTotalEnergyDeposit();
196 Pabs_ = aStep->GetPreStepPoint()->GetMomentum().mag() /
GeV;
197 Tof_ = aStep->GetPostStepPoint()->GetGlobalTime() / nanosecond;
199 Eloss_ = aStep->GetTotalEnergyDeposit() /
GeV;
202 ThetaAtEntry_ = aStep->GetPreStepPoint()->GetPosition().theta();
203 PhiAtEntry_ = aStep->GetPreStepPoint()->GetPosition().phi();
230 for (
int j = 0;
j < nhits && !
found;
j++) {
248 LogDebug(
"PPSSim") <<
"PPSPixelSD CreateNewHit for"
250 <<
" MVid = " <<
currentPV_->GetMother()->GetCopyNo() <<
" Unit " <<
unitID_ <<
"\n"
252 <<
theTrack_->GetTrackID() <<
" which is a " <<
theTrack_->GetDefinition()->GetParticleName();
310 if (hit ==
nullptr) {
311 edm::LogWarning(
"PPSSim") <<
"PPSPixelSD: hit to be stored is NULL !!";
void setParticleType(short i)
T getUntrackedParameter(std::string const &, T const &) const
PPSPixelSD(const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, SimTrackManager const *)
float thetaAtEntry() const
const edm::EventSetup & c
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
G4ThreeVector theEntryPoint_
uint32_t setDetUnitId(const G4Step *) override
void stepInfo(const G4Step *aStep)
const G4ThreeVector & exitPoint() const
void clearHits() override
void setExitPoint(const G4ThreeVector &)
G4VPhysicalVolume * currentPV_
G4StepPoint * preStepPoint_
void storeHit(PPSPixelG4Hit *)
bool ProcessHits(G4Step *, G4TouchableHistory *) override
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
PPSPixelG4Hit * currentHit_
std::string const collectionName[nCollections]
void setPhiAtEntry(float f)
void resetForNewPrimary()
Local3DPoint FinalStepPosition(const G4Step *step, coordinates) const
void Initialize(G4HCofThisEvent *HCE) override
const G4ThreeVector & entryPoint() const
std::unique_ptr< TrackingSlaveSD > slave_
void setTimeSlice(double d)
void setEntryPoint(const G4ThreeVector &)
PPSPixelG4HitCollection * theHC_
void setThetaAtEntry(float t)
Log< level::Info, false > LogInfo
std::unique_ptr< PPSVDetectorOrganization > numberingScheme_
G4ThreeVector theExitPoint_
void fillHits(edm::PSimHitContainer &, const std::string &) override
T getParameter(std::string const &) const
void setUnitID(uint32_t i)
G4THitsCollection< PPSPixelG4Hit > PPSPixelG4HitCollection
static constexpr unsigned int maxPixelHits_
G4StepPoint * postStepPoint_
std::vector< PSimHit > PSimHitContainer
void EndOfEvent(G4HCofThisEvent *eventHC) override
Log< level::Warning, false > LogWarning
void setIncidentEnergy(double e)
void setEnergyLoss(float e)
G4ThreeVector entrancePoint_
void setMeanPosition(const G4ThreeVector &a)
Local3DPoint InitialStepPosition(const G4Step *step, coordinates) const