29 #include "G4SDManager.hh" 32 #include "G4VProcess.hh" 34 #include "G4PhysicalConstants.hh" 35 #include <CLHEP/Units/SystemOfUnits.h> 48 SetVerboseLevel(verbn);
50 if (
pname ==
"CTPPSPixelHits") {
61 eloss_ = aStep->GetTotalEnergyDeposit();
65 LogDebug(
"PPSSim") <<
"PPSPixelSD: ProcessHits: edep=" <<
eloss_ <<
" " 66 <<
theTrack_->GetDefinition()->GetParticleName();
78 LogDebug(
"PPSSim") <<
"PPSPixelSD : Initialize called for " << GetName();
81 G4SDManager::GetSDMpointer()->AddNewCollection(GetName(),
collectionName[0]);
93 for (
unsigned int j = 0;
j < (
unsigned int)
theHC_->entries(); ++
j) {
96 LogDebug(
"PPSSim") <<
"HIT NUMERO " <<
j <<
"unit ID = " << aHit->
unitID() <<
"\n" 98 <<
"enrty z " << aHit->entry().
z() <<
"\n" 119 LogDebug(
"PPSSim") <<
"PPSPixelSD: Collection " <<
theHC_->GetName();
130 LogDebug(
"PPSSim") <<
"PPSPixelSD: dispatched BeginOfEvent for " << GetName();
140 G4ThreeVector localPoint;
142 localPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
168 pabs_ = aStep->GetPreStepPoint()->GetMomentum().mag() / CLHEP::GeV;
169 tof_ = aStep->GetPostStepPoint()->GetGlobalTime() / CLHEP::nanosecond;
173 thetaAtEntry_ = aStep->GetPreStepPoint()->GetPosition().theta();
174 phiAtEntry_ = aStep->GetPreStepPoint()->GetPosition().phi();
205 LogDebug(
"PPSSim") <<
"PPSPixelSD::CreateNewHit for" 207 <<
" MVid = " <<
currentPV_->GetMother()->GetCopyNo() <<
" Unit " <<
unitID_ <<
"\n" 209 <<
" which is a " <<
theTrack_->GetDefinition()->GetParticleName();
214 LogDebug(
"PPSSim") <<
" daughter of track: " << parentID;
217 if (
theTrack_->GetCreatorProcess() !=
nullptr)
261 if (
hit ==
nullptr) {
262 edm::LogWarning(
"PPSSim") <<
"PPSPixelSD: hit to be stored is NULL !!";
void setParticleType(short i)
Log< level::Info, true > LogVerbatim
PPSPixelSD(const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, SimTrackManager const *)
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
uint32_t setDetUnitId(const G4Step *) override
void stepInfo(const G4Step *aStep)
void clearHits() override
void setExitPoint(const G4ThreeVector &)
G4VPhysicalVolume * currentPV_
G4StepPoint * preStepPoint_
void storeHit(PPSPixelG4Hit *)
bool ProcessHits(G4Step *, G4TouchableHistory *) override
T getUntrackedParameter(std::string const &, T const &) const
const G4ThreeVector & entryPoint() const
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
const G4ThreeVector & exitPoint() const
PPSPixelG4Hit * currentHit_
void setPhiAtEntry(float f)
G4ThreeVector theLocalExitPoint_
float thetaAtEntry() const
void Initialize(G4HCofThisEvent *HCE) override
std::unique_ptr< TrackingSlaveSD > slave_
void setTimeSlice(double d)
void setEntryPoint(const G4ThreeVector &)
PPSPixelG4HitCollection * theHC_
void setThetaAtEntry(float t)
std::unique_ptr< PPSVDetectorOrganization > numberingScheme_
void fillHits(edm::PSimHitContainer &, const std::string &) override
void setUnitID(uint32_t i)
G4THitsCollection< PPSPixelG4Hit > PPSPixelG4HitCollection
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 theLocalEntryPoint_
void setMeanPosition(const G4ThreeVector &a)