|
|
Go to the documentation of this file.
15 #include "G4SDManager.hh"
18 #include "G4VProcess.hh"
19 #include "G4ParticleDefinition.hh"
20 #include "G4ParticleTypes.hh"
22 #include "G4PhysicalConstants.hh"
23 #include "G4SystemOfUnits.hh"
34 numberingScheme_(nullptr),
41 preStepPoint_(nullptr),
42 postStepPoint_(nullptr),
48 LogDebug(
"PPSSimDiamond") <<
"*******************************************************\n"
50 <<
"* Constructing a PPSDiamondSD with name " <<
name_ <<
"\n"
52 <<
"*******************************************************"
57 if (
name_ ==
"CTPPSTimingHits") {
59 edm::LogInfo(
"PPSSimDiamond") <<
"Find CTPPSDiamondHits as name";
61 edm::LogWarning(
"PPSSimDiamond") <<
"PPSDiamondSD: ReadoutName not supported\n";
64 edm::LogInfo(
"PPSSimDiamond") <<
"PPSDiamondSD: Instantiation completed";
70 LogDebug(
"PPSSimDiamond") <<
"PPSDiamondSD : Initialize called for " <<
name_;
80 LogDebug(
"PPSSimDiamond") <<
theTrack_->GetDefinition()->GetParticleName() <<
" PPS_Timing_SD CreateNewHit for"
86 printf(
" PreStepPoint(%10f,%10f,%10f)",
90 printf(
" PosStepPoint(%10f,%10f,%10f)\n",
94 LogDebug(
"PPSSimDiamond") <<
" positions "
97 <<
" For Track " <<
theTrack_->GetTrackID() <<
" which is a "
98 <<
theTrack_->GetDefinition()->GetParticleName() <<
" ParentID is "
102 LogDebug(
"PPSSimDiamond") <<
" primary particle ";
107 LogDebug(
"PPSSimDiamond") <<
" and created by ";
109 if (
theTrack_->GetCreatorProcess() !=
nullptr)
112 LogDebug(
"PPSSimDiamond") <<
"NO process";
118 if (aStep ==
nullptr) {
119 LogDebug(
"PPSSimDiamond") <<
" There is no hit to process ";
122 LogDebug(
"PPSSimDiamond") <<
"*******************************************************\n"
124 <<
"* PPS Diamond Hit initialized with name " <<
name_ <<
"\n"
126 <<
"*******************************************************"
131 if (
theTrack_->GetDefinition()->GetPDGEncoding() == 2212) {
133 LogDebug(
"PPSSimDiamond") <<
" information imported to the hit ";
159 Pabs_ = (aStep->GetPreStepPoint()->GetMomentum().mag()) /
GeV;
160 thePx_ = (aStep->GetPreStepPoint()->GetMomentum().x()) /
GeV;
161 thePy_ = (aStep->GetPreStepPoint()->GetMomentum().y()) /
GeV;
162 thePz_ = (aStep->GetPreStepPoint()->GetMomentum().z()) /
GeV;
163 Tof_ = aStep->GetPreStepPoint()->GetGlobalTime() / nanosecond;
164 Eloss_ = (aStep->GetPreStepPoint()->GetTotalEnergy() / eV);
168 G4ThreeVector gmd = aStep->GetPreStepPoint()->GetMomentumDirection();
170 G4ThreeVector lmd = ((G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable()))
193 if (
hit ==
nullptr) {
195 LogDebug(
"PPSSimDiamond") <<
"PPSDiamond: hit to be stored is NULL !!"
233 G4ThreeVector localPoint;
235 localPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
268 LogDebug(
"PPSSimDiamond") <<
"PPSDiamond: Collection " <<
theHC_->GetName() <<
"\n";
278 LogDebug(
"PPSDiamond") <<
"PPSDiamondSD: updates numbering scheme for " << GetName();
283 LogDebug(
"PPSSimDiamond") <<
" Dispatched BeginOfEvent !"
void storeHit(PPSDiamondG4Hit *)
double thetaAtEntry() const
void setTimeSlice(double d)
G4THitsCollection< PPSDiamondG4Hit > PPSDiamondG4HitCollection
double energyLoss() const
void stepInfo(const G4Step *aStep)
static constexpr unsigned int maxDiamondHits_
unsigned int trackID() const
Geom::Theta< T > theta() const
void fillHits(edm::PSimHitContainer &, const std::string &) override
void clearTrack(G4Track *Track)
void setEnergyLoss(double e)
G4ThreeVector theLocalExitPoint_
G4ThreeVector theLocalEntryPoint_
const G4ThreeVector & localEntry() const
bool ProcessHits(G4Step *step, G4TouchableHistory *tHistory) override
PPSDiamondG4Hit * currentHit_
const G4ThreeVector & localExit() const
void EndOfEvent(G4HCofThisEvent *eventHC) override
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
void setNumberingScheme(PPSVDetectorOrganization *scheme)
std::unique_ptr< PPSVDetectorOrganization > numberingScheme_
void setExit(const G4ThreeVector &xyz)
G4StepPoint * preStepPoint_
double phiAtEntry() const
PPSDiamondG4HitCollection * theHC_
void setEntry(const G4ThreeVector &xyz)
void setLocalEntry(const G4ThreeVector &theLocalEntryPoint)
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
bool isPrimary(const G4Track *track)
G4VPhysicalVolume * currentPV_
Local3DPoint ConvertToLocal3DPoint(const G4ThreeVector &point) const
void setThetaAtEntry(double t)
void setUnitID(unsigned int i)
void setIncidentEnergy(double e)
PPSDiamondSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
void setParticleType(short i)
T getParameter(std::string const &) const
std::unique_ptr< TrackingSlaveSD > slave_
std::vector< PSimHit > PSimHitContainer
G4StepPoint * postStepPoint_
void Initialize(G4HCofThisEvent *HCE) override
uint32_t setDetUnitId(const G4Step *step) override
void setLocalExit(const G4ThreeVector &theLocalExitPoint)
void setPhiAtEntry(double f)
Geom::Phi< T > phi() const
void setGlobalTimehit(double h)
void clearHits() override