CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
PPSDiamondSD Class Reference

#include <PPSDiamondSD.h>

Inheritance diagram for PPSDiamondSD:
SensitiveTkDetector Observer< const BeginOfEvent * > Observer< const EndOfEvent * > SensitiveDetector

Public Member Functions

void clear () override
 
void clearTrack (G4Track *Track)
 
void DrawAll () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PSimHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
 PPSDiamondSD (const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
void PrintAll () override
 
void printHitInfo ()
 
 ~PPSDiamondSD () override
 
- Public Member Functions inherited from SensitiveTkDetector
 SensitiveTkDetector (const std::string &iname, const SensitiveDetectorCatalog &clg)
 
- Public Member Functions inherited from SensitiveDetector
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
const std::vector< std::string > & getNames () const
 
void Initialize (G4HCofThisEvent *eventHC) override
 
bool isCaloSD () const
 
 SensitiveDetector (const std::string &iname, const SensitiveDetectorCatalog &, bool calo)
 
 ~SensitiveDetector () override
 
- Public Member Functions inherited from Observer< const BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent *iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent *iT)
 
virtual ~Observer ()
 

Private Member Functions

void clearHits () override
 
G4bool hitExists ()
 
void importInfoToHit ()
 
bool isPrimary (const G4Track *track)
 
bool ProcessHits (G4Step *step, G4TouchableHistory *tHistory) override
 
void resetForNewPrimary ()
 
uint32_t setDetUnitId (const G4Step *step) override
 
void setNumberingScheme (PPSVDetectorOrganization *scheme)
 
G4ThreeVector setToLocal (const G4ThreeVector &globalPoint)
 
void stepInfo (const G4Step *aStep)
 
void storeHit (PPSDiamondG4Hit *)
 
void summarize ()
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const ::EndOfEvent *) override
 
void updateHit ()
 

Private Attributes

PPSDiamondG4HitcurrentHit_
 
G4VPhysicalVolume * currentPV_
 
double Eloss_
 
G4ThreeVector entrancePoint_
 
int eventno_
 
G4ThreeVector exitPoint_
 
double Globaltimehit_
 
G4int hcID_
 
G4ThreeVector hitPoint_
 
double incidentEnergy_
 
G4String name_
 
std::unique_ptr
< PPSVDetectorOrganization
numberingScheme_
 
double Pabs_
 
int ParentId_
 
short ParticleType_
 
double PhiAtEntry_
 
G4StepPoint * postStepPoint_
 
G4StepPoint * preStepPoint_
 
G4int primaryID_
 
std::unique_ptr< TrackingSlaveSDslave_
 
double theglobaltimehit_
 
PPSDiamondG4HitCollectiontheHC_
 
G4ThreeVector theLocalEntryPoint_
 
G4ThreeVector theLocalExitPoint_
 
int theMPDebug_
 
double thePx_
 
double thePy_
 
double thePz_
 
double ThetaAtEntry_
 
G4Track * theTrack_
 
double Tof_
 
G4double tSlice_
 
G4int tSliceID_
 
unsigned int unitID_
 
int verbosity_
 
double Vx_
 
double Vy_
 
double Vz_
 

Static Private Attributes

static constexpr unsigned int maxDiamondHits_ = 15000
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Protected Member Functions inherited from SensitiveDetector
TrackInformationcmsTrackInformation (const G4Track *aTrack)
 
Local3DPoint ConvertToLocal3DPoint (const G4ThreeVector &point) const
 
Local3DPoint FinalStepPosition (const G4Step *step, coordinates) const
 
Local3DPoint InitialStepPosition (const G4Step *step, coordinates) const
 
Local3DPoint LocalPostStepPosition (const G4Step *step) const
 
Local3DPoint LocalPreStepPosition (const G4Step *step) const
 
void NaNTrap (const G4Step *step) const
 
void setNames (const std::vector< std::string > &)
 
- Protected Member Functions inherited from Observer< const EndOfEvent * >
virtual void update (const EndOfEvent *)=0
 This routine will be called when the appropriate signal arrives. More...
 

Detailed Description

Definition at line 31 of file PPSDiamondSD.h.

Constructor & Destructor Documentation

PPSDiamondSD::PPSDiamondSD ( const std::string &  name_,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager 
)

Definition at line 28 of file PPSDiamondSD.cc.

References ecaldqm::collectionName, edm::ParameterSet::getParameter(), LogDebug, name_, numberingScheme_, slave_, and verbosity_.

32  : SensitiveTkDetector(name_, clg),
33  numberingScheme_(nullptr),
34  hcID_(-1),
35  theHC_(nullptr),
36  currentHit_(nullptr),
37  theTrack_(nullptr),
38  currentPV_(nullptr),
39  unitID_(0),
40  preStepPoint_(nullptr),
41  postStepPoint_(nullptr),
42  eventno_(0) {
43  collectionName.insert(name_);
44  edm::ParameterSet m_Anal = p.getParameter<edm::ParameterSet>("PPSDiamondSD");
45  verbosity_ = m_Anal.getParameter<int>("Verbosity");
46 
47  LogDebug("PPSSimDiamond") << "*******************************************************\n"
48  << "* *\n"
49  << "* Constructing a PPSDiamondSD with name " << name_ << "\n"
50  << "* *\n"
51  << "*******************************************************"
52  << "\n";
53 
54  slave_ = std::make_unique<TrackingSlaveSD>(name_);
55 
56  if (name_ == "CTPPSTimingHits") {
57  numberingScheme_ = std::make_unique<PPSDiamondNumberingScheme>();
58  edm::LogInfo("PPSSimDiamond") << "Find CTPPSDiamondHits as name";
59  } else {
60  edm::LogWarning("PPSSimDiamond") << "PPSDiamondSD: ReadoutName not supported\n";
61  }
62 
63  edm::LogInfo("PPSSimDiamond") << "PPSDiamondSD: Instantiation completed";
64 }
G4VPhysicalVolume * currentPV_
Definition: PPSDiamondSD.h:80
unsigned int unitID_
Definition: PPSDiamondSD.h:81
PPSDiamondG4Hit * currentHit_
Definition: PPSDiamondSD.h:78
std::unique_ptr< TrackingSlaveSD > slave_
Definition: PPSDiamondSD.h:57
std::unique_ptr< PPSVDetectorOrganization > numberingScheme_
Definition: PPSDiamondSD.h:58
G4String name_
Definition: PPSDiamondSD.h:75
std::string const collectionName[nCollections]
Definition: Collections.h:47
G4Track * theTrack_
Definition: PPSDiamondSD.h:79
PPSDiamondG4HitCollection * theHC_
Definition: PPSDiamondSD.h:77
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
G4StepPoint * postStepPoint_
Definition: PPSDiamondSD.h:86
G4StepPoint * preStepPoint_
Definition: PPSDiamondSD.h:85
Log< level::Warning, false > LogWarning
SensitiveTkDetector(const std::string &iname, const SensitiveDetectorCatalog &clg)
#define LogDebug(id)
PPSDiamondSD::~PPSDiamondSD ( )
override

Definition at line 66 of file PPSDiamondSD.cc.

66 {}

Member Function Documentation

void PPSDiamondSD::clear ( void  )
override

Definition at line 262 of file PPSDiamondSD.cc.

262 {}
void PPSDiamondSD::clearHits ( )
overrideprivatevirtual

Implements SensitiveDetector.

Definition at line 292 of file PPSDiamondSD.cc.

References slave_.

Referenced by update().

292 { slave_->Initialize(); }
std::unique_ptr< TrackingSlaveSD > slave_
Definition: PPSDiamondSD.h:57
void PPSDiamondSD::clearTrack ( G4Track *  Track)

Definition at line 290 of file PPSDiamondSD.cc.

290 { track->SetTrackStatus(fStopAndKill); }
void PPSDiamondSD::DrawAll ( )
override

Definition at line 264 of file PPSDiamondSD.cc.

264 {}
void PPSDiamondSD::EndOfEvent ( G4HCofThisEvent *  eventHC)
override

Definition at line 239 of file PPSDiamondSD.cc.

References PPSDiamondG4Hit::energyLoss(), mps_splice::entry, beamvalidation::exit(), dqmiolumiharvest::j, PPSDiamondG4Hit::localEntry(), PPSDiamondG4Hit::localExit(), maxDiamondHits_, PPSDiamondG4Hit::p(), PPSDiamondG4Hit::particleType(), PPSDiamondG4Hit::phiAtEntry(), slave_, summarize(), theHC_, PPSDiamondG4Hit::thetaAtEntry(), PPSDiamondG4Hit::tof(), PPSDiamondG4Hit::trackID(), and PPSDiamondG4Hit::unitID().

239  {
240  // here we loop over transient hits and make them persistent
241  for (unsigned int j = 0; j < (unsigned int)theHC_->entries() && j < maxDiamondHits_; j++) {
242  PPSDiamondG4Hit* aHit = (*theHC_)[j];
243 
244  Local3DPoint entry(aHit->localEntry().x(), aHit->localEntry().y(), aHit->localEntry().z());
245  Local3DPoint exit(aHit->localExit().x(), aHit->localExit().y(), aHit->localExit().z());
246  slave_->processHits(PSimHit(entry,
247  exit,
248  aHit->p(),
249  aHit->tof(),
250  aHit->energyLoss(),
251  aHit->particleType(),
252  aHit->unitID(),
253  aHit->trackID(),
254  aHit->thetaAtEntry(),
255  aHit->phiAtEntry()));
256  }
257  summarize();
258 }
const G4ThreeVector & localEntry() const
double tof() const
const G4ThreeVector & localExit() const
double energyLoss() const
unsigned int trackID() const
std::unique_ptr< TrackingSlaveSD > slave_
Definition: PPSDiamondSD.h:57
double p() const
static constexpr unsigned int maxDiamondHits_
Definition: PPSDiamondSD.h:48
int particleType() const
void summarize()
PPSDiamondG4HitCollection * theHC_
Definition: PPSDiamondSD.h:77
list entry
Definition: mps_splice.py:68
double thetaAtEntry() const
int unitID() const
double phiAtEntry() const
void PPSDiamondSD::fillHits ( edm::PSimHitContainer c,
const std::string &  n 
)
overridevirtual

Implements SensitiveTkDetector.

Definition at line 271 of file PPSDiamondSD.cc.

References dqmiodumpmetadata::n, and slave_.

271  {
272  if (slave_->name() == n)
273  c = slave_->hits();
274 }
const edm::EventSetup & c
std::unique_ptr< TrackingSlaveSD > slave_
Definition: PPSDiamondSD.h:57
G4bool PPSDiamondSD::hitExists ( )
private
void PPSDiamondSD::importInfoToHit ( )
private

Definition at line 202 of file PPSDiamondSD.cc.

References currentHit_, Eloss_, exitPoint_, Globaltimehit_, hitPoint_, incidentEnergy_, LogDebug, Pabs_, ParentId_, ParticleType_, PhiAtEntry_, primaryID_, PPSDiamondG4Hit::setEnergyLoss(), PPSDiamondG4Hit::setEntry(), PPSDiamondG4Hit::setExit(), PPSDiamondG4Hit::setGlobalTimehit(), PPSDiamondG4Hit::setIncidentEnergy(), PPSDiamondG4Hit::setLocalEntry(), PPSDiamondG4Hit::setLocalExit(), PPSDiamondG4Hit::setP(), PPSDiamondG4Hit::setParentId(), PPSDiamondG4Hit::setParticleType(), PPSDiamondG4Hit::setPhiAtEntry(), PPSDiamondG4Hit::setPx(), PPSDiamondG4Hit::setPy(), PPSDiamondG4Hit::setPz(), PPSDiamondG4Hit::setThetaAtEntry(), PPSDiamondG4Hit::setTimeSlice(), PPSDiamondG4Hit::setTof(), PPSDiamondG4Hit::setTrackID(), PPSDiamondG4Hit::setUnitID(), PPSDiamondG4Hit::setVx(), PPSDiamondG4Hit::setVy(), PPSDiamondG4Hit::setVz(), storeHit(), theLocalEntryPoint_, theLocalExitPoint_, thePx_, thePy_, thePz_, ThetaAtEntry_, Tof_, tSlice_, unitID_, Vx_, Vy_, and Vz_.

Referenced by ProcessHits().

202  {
226 
228  LogDebug("PPSSimDiamond") << "STORED HIT IN: " << unitID_ << "\n";
229 }
unsigned int unitID_
Definition: PPSDiamondSD.h:81
void setP(double e)
PPSDiamondG4Hit * currentHit_
Definition: PPSDiamondSD.h:78
void setTof(double e)
G4ThreeVector hitPoint_
Definition: PPSDiamondSD.h:87
void setVy(double p)
void setPz(double p)
G4int primaryID_
Definition: PPSDiamondSD.h:82
void setEntry(const G4ThreeVector &xyz)
double ThetaAtEntry_
Definition: PPSDiamondSD.h:96
G4ThreeVector theLocalEntryPoint_
Definition: PPSDiamondSD.h:89
void setIncidentEnergy(double e)
void setThetaAtEntry(double t)
void setVz(double p)
G4ThreeVector theLocalExitPoint_
Definition: PPSDiamondSD.h:90
void setPy(double p)
double Eloss_
Definition: PPSDiamondSD.h:94
void setUnitID(unsigned int i)
void setEnergyLoss(double e)
short ParticleType_
Definition: PPSDiamondSD.h:95
void setExit(const G4ThreeVector &xyz)
void setVx(double p)
G4ThreeVector exitPoint_
Definition: PPSDiamondSD.h:88
double thePy_
Definition: PPSDiamondSD.h:92
double PhiAtEntry_
Definition: PPSDiamondSD.h:97
G4double tSlice_
Definition: PPSDiamondSD.h:83
void storeHit(PPSDiamondG4Hit *)
void setPhiAtEntry(double f)
void setTrackID(int i)
void setParticleType(short i)
void setParentId(int p)
void setGlobalTimehit(double h)
void setLocalEntry(const G4ThreeVector &theLocalEntryPoint)
double Globaltimehit_
Definition: PPSDiamondSD.h:100
double thePz_
Definition: PPSDiamondSD.h:92
double incidentEnergy_
Definition: PPSDiamondSD.h:74
double thePx_
Definition: PPSDiamondSD.h:92
double Pabs_
Definition: PPSDiamondSD.h:91
void setLocalExit(const G4ThreeVector &theLocalExitPoint)
void setPx(double p)
void setTimeSlice(double d)
#define LogDebug(id)
void PPSDiamondSD::Initialize ( G4HCofThisEvent *  HCE)
override

Definition at line 68 of file PPSDiamondSD.cc.

References ecaldqm::collectionName, hcID_, LogDebug, name_, and theHC_.

68  {
69  LogDebug("PPSSimDiamond") << "PPSDiamondSD : Initialize called for " << name_;
70 
72  G4SDManager::GetSDMpointer()->AddNewCollection(name_, collectionName[0]);
73  if (hcID_ < 0)
74  hcID_ = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
75  HCE->AddHitsCollection(hcID_, theHC_);
76 }
G4String name_
Definition: PPSDiamondSD.h:75
std::string const collectionName[nCollections]
Definition: Collections.h:47
PPSDiamondG4HitCollection * theHC_
Definition: PPSDiamondSD.h:77
G4THitsCollection< PPSDiamondG4Hit > PPSDiamondG4HitCollection
#define LogDebug(id)
bool PPSDiamondSD::isPrimary ( const G4Track *  track)
private

Definition at line 294 of file PPSDiamondSD.cc.

References info(), and TrackInformation::isPrimary().

Referenced by stepInfo().

294  {
295  TrackInformation* info = dynamic_cast<TrackInformation*>(track->GetUserInformation());
296  return info && info->isPrimary();
297 }
static const TGPicture * info(bool iBackgroundIsBlack)
bool isPrimary() const
void PPSDiamondSD::PrintAll ( )
override

Definition at line 266 of file PPSDiamondSD.cc.

References LogDebug, and theHC_.

266  {
267  LogDebug("PPSSimDiamond") << "PPSDiamond: Collection " << theHC_->GetName() << "\n";
268  theHC_->PrintAllHits();
269 }
PPSDiamondG4HitCollection * theHC_
Definition: PPSDiamondSD.h:77
#define LogDebug(id)
void PPSDiamondSD::printHitInfo ( )

Definition at line 78 of file PPSDiamondSD.cc.

References currentPV_, Eloss_, LogDebug, postStepPoint_, preStepPoint_, primaryID_, gpuVertexFinder::printf(), theTrack_, tSliceID_, and unitID_.

78  {
79  LogDebug("PPSSimDiamond") << theTrack_->GetDefinition()->GetParticleName() << " PPS_Timing_SD CreateNewHit for"
80  << " PV " << currentPV_->GetName() << " PVid = " << currentPV_->GetCopyNo() << " Unit "
81  << unitID_ << "\n";
82  LogDebug("PPSSimDiamond") << " primary " << primaryID_ << " time slice " << tSliceID_ << " of energy "
83  << theTrack_->GetTotalEnergy() << " Eloss_ " << Eloss_ << " positions "
84  << "\n";
85  printf(" PreStepPoint(%10f,%10f,%10f)",
86  preStepPoint_->GetPosition().x(),
87  preStepPoint_->GetPosition().y(),
88  preStepPoint_->GetPosition().z());
89  printf(" PosStepPoint(%10f,%10f,%10f)\n",
90  postStepPoint_->GetPosition().x(),
91  postStepPoint_->GetPosition().y(),
92  postStepPoint_->GetPosition().z());
93  LogDebug("PPSSimDiamond") << " positions "
94  << "(" << postStepPoint_->GetPosition().x() << "," << postStepPoint_->GetPosition().y()
95  << "," << postStepPoint_->GetPosition().z() << ")"
96  << " For Track " << theTrack_->GetTrackID() << " which is a "
97  << theTrack_->GetDefinition()->GetParticleName() << " ParentID is "
98  << theTrack_->GetParentID() << "\n";
99 
100  if (theTrack_->GetTrackID() == 1) {
101  LogDebug("PPSSimDiamond") << " primary particle ";
102  } else {
103  LogDebug("PPSSimDiamond") << " daughter of part. " << theTrack_->GetParentID();
104  }
105 
106  LogDebug("PPSSimDiamond") << " and created by ";
107 
108  if (theTrack_->GetCreatorProcess() != nullptr)
109  LogDebug("PPSSimDiamond") << theTrack_->GetCreatorProcess()->GetProcessName();
110  else
111  LogDebug("PPSSimDiamond") << "NO process";
112 
113  LogDebug("PPSSimDiamond") << "\n";
114 }
G4VPhysicalVolume * currentPV_
Definition: PPSDiamondSD.h:80
unsigned int unitID_
Definition: PPSDiamondSD.h:81
G4int primaryID_
Definition: PPSDiamondSD.h:82
double Eloss_
Definition: PPSDiamondSD.h:94
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
G4Track * theTrack_
Definition: PPSDiamondSD.h:79
G4StepPoint * postStepPoint_
Definition: PPSDiamondSD.h:86
G4StepPoint * preStepPoint_
Definition: PPSDiamondSD.h:85
G4int tSliceID_
Definition: PPSDiamondSD.h:82
#define LogDebug(id)
bool PPSDiamondSD::ProcessHits ( G4Step *  step,
G4TouchableHistory *  tHistory 
)
overrideprivatevirtual

Implements SensitiveDetector.

Definition at line 116 of file PPSDiamondSD.cc.

References importInfoToHit(), LogDebug, name_, stepInfo(), and theTrack_.

116  {
117  if (aStep == nullptr) {
118  LogDebug("PPSSimDiamond") << " There is no hit to process ";
119  return true;
120  } else {
121  LogDebug("PPSSimDiamond") << "*******************************************************\n"
122  << "* *\n"
123  << "* PPS Diamond Hit initialized with name " << name_ << "\n"
124  << "* *\n"
125  << "*******************************************************"
126  << "\n";
127 
128  stepInfo(aStep);
129 
130  if (theTrack_->GetDefinition()->GetPDGEncoding() == 2212) {
131  importInfoToHit(); //in addtion to import info to hit it STORE hit as well
132  LogDebug("PPSSimDiamond") << " information imported to the hit ";
133  }
134 
135  return true;
136  }
137 }
void stepInfo(const G4Step *aStep)
G4String name_
Definition: PPSDiamondSD.h:75
G4Track * theTrack_
Definition: PPSDiamondSD.h:79
void importInfoToHit()
#define LogDebug(id)
void PPSDiamondSD::resetForNewPrimary ( )
private
uint32_t PPSDiamondSD::setDetUnitId ( const G4Step *  step)
overrideprivatevirtual

Implements SensitiveDetector.

Definition at line 187 of file PPSDiamondSD.cc.

References numberingScheme_.

Referenced by stepInfo().

187  {
188  return (numberingScheme_ == nullptr ? 0 : numberingScheme_->unitID(aStep));
189 }
std::unique_ptr< PPSVDetectorOrganization > numberingScheme_
Definition: PPSDiamondSD.h:58
void PPSDiamondSD::setNumberingScheme ( PPSVDetectorOrganization scheme)
private

Definition at line 275 of file PPSDiamondSD.cc.

References LogDebug, and numberingScheme_.

275  {
276  if (scheme) {
277  LogDebug("PPSDiamond") << "PPSDiamondSD: updates numbering scheme for " << GetName();
278  numberingScheme_.reset(scheme);
279  }
280 }
std::unique_ptr< PPSVDetectorOrganization > numberingScheme_
Definition: PPSDiamondSD.h:58
#define LogDebug(id)
G4ThreeVector PPSDiamondSD::setToLocal ( const G4ThreeVector &  globalPoint)
private

Definition at line 231 of file PPSDiamondSD.cc.

References preStepPoint_.

Referenced by stepInfo().

231  {
232  G4ThreeVector localPoint;
233  const G4VTouchable* touch = preStepPoint_->GetTouchable();
234  localPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
235 
236  return localPoint;
237 }
G4StepPoint * preStepPoint_
Definition: PPSDiamondSD.h:85
void PPSDiamondSD::stepInfo ( const G4Step *  aStep)
private

Definition at line 139 of file PPSDiamondSD.cc.

References SensitiveDetector::ConvertToLocal3DPoint(), currentPV_, Eloss_, exitPoint_, GeV, hitPoint_, incidentEnergy_, isPrimary(), LogDebug, Pabs_, ParentId_, ParticleType_, PV3DBase< T, PVType, FrameType >::phi(), PhiAtEntry_, postStepPoint_, preStepPoint_, primaryID_, setDetUnitId(), setToLocal(), theglobaltimehit_, theLocalEntryPoint_, theLocalExitPoint_, thePx_, thePy_, thePz_, PV3DBase< T, PVType, FrameType >::theta(), ThetaAtEntry_, theTrack_, Tof_, tSlice_, tSliceID_, unitID_, verbosity_, Vx_, Vy_, and Vz_.

Referenced by ProcessHits().

139  {
140  theTrack_ = aStep->GetTrack();
141  preStepPoint_ = aStep->GetPreStepPoint();
142  postStepPoint_ = aStep->GetPostStepPoint();
143  hitPoint_ = preStepPoint_->GetPosition();
144  exitPoint_ = postStepPoint_->GetPosition();
145  currentPV_ = preStepPoint_->GetPhysicalVolume();
148  theglobaltimehit_ = preStepPoint_->GetGlobalTime() / nanosecond;
149  incidentEnergy_ = (aStep->GetPreStepPoint()->GetTotalEnergy() / eV);
150  tSlice_ = (postStepPoint_->GetGlobalTime()) / nanosecond;
151  tSliceID_ = (int)tSlice_;
152  unitID_ = setDetUnitId(aStep);
153 
154  if (verbosity_)
155  LogDebug("PPSSimDiamond") << "UNIT " << unitID_ << "\n";
156 
157  primaryID_ = theTrack_->GetTrackID();
158  Pabs_ = (aStep->GetPreStepPoint()->GetMomentum().mag()) / GeV;
159  thePx_ = (aStep->GetPreStepPoint()->GetMomentum().x()) / GeV;
160  thePy_ = (aStep->GetPreStepPoint()->GetMomentum().y()) / GeV;
161  thePz_ = (aStep->GetPreStepPoint()->GetMomentum().z()) / GeV;
162  Tof_ = aStep->GetPreStepPoint()->GetGlobalTime() / nanosecond;
163  Eloss_ = (aStep->GetPreStepPoint()->GetTotalEnergy() / eV); //pps added
164  ParticleType_ = theTrack_->GetDefinition()->GetPDGEncoding();
165 
166  //corrected phi and theta treatment
167  G4ThreeVector gmd = aStep->GetPreStepPoint()->GetMomentumDirection();
168  // convert it to local frame
169  G4ThreeVector lmd = ((G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable()))
170  ->GetHistory()
171  ->GetTopTransform()
172  .TransformAxis(gmd);
174  ThetaAtEntry_ = lnmd.theta();
175  PhiAtEntry_ = lnmd.phi();
176 
177  if (isPrimary(theTrack_))
178  ParentId_ = 0;
179  else
180  ParentId_ = theTrack_->GetParentID();
181 
182  Vx_ = theTrack_->GetVertexPosition().x() / mm;
183  Vy_ = theTrack_->GetVertexPosition().y() / mm;
184  Vz_ = theTrack_->GetVertexPosition().z() / mm;
185 }
bool isPrimary(const G4Track *track)
G4VPhysicalVolume * currentPV_
Definition: PPSDiamondSD.h:80
unsigned int unitID_
Definition: PPSDiamondSD.h:81
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
const double GeV
Definition: MathUtil.h:16
G4ThreeVector hitPoint_
Definition: PPSDiamondSD.h:87
Local3DPoint ConvertToLocal3DPoint(const G4ThreeVector &point) const
G4int primaryID_
Definition: PPSDiamondSD.h:82
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
double ThetaAtEntry_
Definition: PPSDiamondSD.h:96
G4ThreeVector theLocalEntryPoint_
Definition: PPSDiamondSD.h:89
G4ThreeVector theLocalExitPoint_
Definition: PPSDiamondSD.h:90
uint32_t setDetUnitId(const G4Step *step) override
double Eloss_
Definition: PPSDiamondSD.h:94
double theglobaltimehit_
Definition: PPSDiamondSD.h:101
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
short ParticleType_
Definition: PPSDiamondSD.h:95
G4ThreeVector exitPoint_
Definition: PPSDiamondSD.h:88
double thePy_
Definition: PPSDiamondSD.h:92
double PhiAtEntry_
Definition: PPSDiamondSD.h:97
G4double tSlice_
Definition: PPSDiamondSD.h:83
G4Track * theTrack_
Definition: PPSDiamondSD.h:79
double thePz_
Definition: PPSDiamondSD.h:92
G4StepPoint * postStepPoint_
Definition: PPSDiamondSD.h:86
double incidentEnergy_
Definition: PPSDiamondSD.h:74
G4StepPoint * preStepPoint_
Definition: PPSDiamondSD.h:85
double thePx_
Definition: PPSDiamondSD.h:92
double Pabs_
Definition: PPSDiamondSD.h:91
G4int tSliceID_
Definition: PPSDiamondSD.h:82
#define LogDebug(id)
void PPSDiamondSD::storeHit ( PPSDiamondG4Hit hit)
private

Definition at line 191 of file PPSDiamondSD.cc.

References LogDebug, theHC_, and verbosity_.

Referenced by importInfoToHit().

191  {
192  if (hit == nullptr) {
193  if (verbosity_)
194  LogDebug("PPSSimDiamond") << "PPSDiamond: hit to be stored is NULL !!"
195  << "\n";
196  return;
197  }
198 
199  theHC_->insert(hit);
200 }
PPSDiamondG4HitCollection * theHC_
Definition: PPSDiamondSD.h:77
#define LogDebug(id)
void PPSDiamondSD::summarize ( )
private

Definition at line 260 of file PPSDiamondSD.cc.

Referenced by EndOfEvent().

260 {}
void PPSDiamondSD::update ( const BeginOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 281 of file PPSDiamondSD.cc.

References clearHits(), eventno_, and LogDebug.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

281  {
282  LogDebug("PPSSimDiamond") << " Dispatched BeginOfEvent !"
283  << "\n";
284  clearHits();
285  eventno_ = (*i)()->GetEventID();
286 }
void clearHits() override
#define LogDebug(id)
void PPSDiamondSD::update ( const ::EndOfEvent )
overrideprivate
void PPSDiamondSD::updateHit ( )
private

Member Data Documentation

PPSDiamondG4Hit* PPSDiamondSD::currentHit_
private

Definition at line 78 of file PPSDiamondSD.h.

Referenced by importInfoToHit().

G4VPhysicalVolume* PPSDiamondSD::currentPV_
private

Definition at line 80 of file PPSDiamondSD.h.

Referenced by printHitInfo(), and stepInfo().

double PPSDiamondSD::Eloss_
private

Definition at line 94 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), printHitInfo(), and stepInfo().

G4ThreeVector PPSDiamondSD::entrancePoint_
private

Definition at line 73 of file PPSDiamondSD.h.

int PPSDiamondSD::eventno_
private

Definition at line 102 of file PPSDiamondSD.h.

Referenced by update().

G4ThreeVector PPSDiamondSD::exitPoint_
private

Definition at line 88 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

double PPSDiamondSD::Globaltimehit_
private

Definition at line 100 of file PPSDiamondSD.h.

Referenced by importInfoToHit().

G4int PPSDiamondSD::hcID_
private

Definition at line 76 of file PPSDiamondSD.h.

Referenced by Initialize().

G4ThreeVector PPSDiamondSD::hitPoint_
private

Definition at line 87 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

double PPSDiamondSD::incidentEnergy_
private

Definition at line 74 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

constexpr unsigned int PPSDiamondSD::maxDiamondHits_ = 15000
staticprivate

Definition at line 48 of file PPSDiamondSD.h.

Referenced by EndOfEvent().

G4String PPSDiamondSD::name_
private

Definition at line 75 of file PPSDiamondSD.h.

Referenced by Initialize(), PPSDiamondSD(), and ProcessHits().

std::unique_ptr<PPSVDetectorOrganization> PPSDiamondSD::numberingScheme_
private

Definition at line 58 of file PPSDiamondSD.h.

Referenced by PPSDiamondSD(), setDetUnitId(), and setNumberingScheme().

double PPSDiamondSD::Pabs_
private

Definition at line 91 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

int PPSDiamondSD::ParentId_
private

Definition at line 98 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

short PPSDiamondSD::ParticleType_
private

Definition at line 95 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

double PPSDiamondSD::PhiAtEntry_
private

Definition at line 97 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

G4StepPoint* PPSDiamondSD::postStepPoint_
private

Definition at line 86 of file PPSDiamondSD.h.

Referenced by printHitInfo(), and stepInfo().

G4StepPoint* PPSDiamondSD::preStepPoint_
private

Definition at line 85 of file PPSDiamondSD.h.

Referenced by printHitInfo(), setToLocal(), and stepInfo().

G4int PPSDiamondSD::primaryID_
private

Definition at line 82 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), printHitInfo(), and stepInfo().

std::unique_ptr<TrackingSlaveSD> PPSDiamondSD::slave_
private

Definition at line 57 of file PPSDiamondSD.h.

Referenced by clearHits(), EndOfEvent(), fillHits(), and PPSDiamondSD().

double PPSDiamondSD::theglobaltimehit_
private

Definition at line 101 of file PPSDiamondSD.h.

Referenced by stepInfo().

PPSDiamondG4HitCollection* PPSDiamondSD::theHC_
private

Definition at line 77 of file PPSDiamondSD.h.

Referenced by EndOfEvent(), Initialize(), PrintAll(), and storeHit().

G4ThreeVector PPSDiamondSD::theLocalEntryPoint_
private

Definition at line 89 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

G4ThreeVector PPSDiamondSD::theLocalExitPoint_
private

Definition at line 90 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

int PPSDiamondSD::theMPDebug_
private

Definition at line 61 of file PPSDiamondSD.h.

double PPSDiamondSD::thePx_
private

Definition at line 92 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

double PPSDiamondSD::thePy_
private

Definition at line 92 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

double PPSDiamondSD::thePz_
private

Definition at line 92 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

double PPSDiamondSD::ThetaAtEntry_
private

Definition at line 96 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

G4Track* PPSDiamondSD::theTrack_
private

Definition at line 79 of file PPSDiamondSD.h.

Referenced by printHitInfo(), ProcessHits(), and stepInfo().

double PPSDiamondSD::Tof_
private

Definition at line 93 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

G4double PPSDiamondSD::tSlice_
private

Definition at line 83 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

G4int PPSDiamondSD::tSliceID_
private

Definition at line 82 of file PPSDiamondSD.h.

Referenced by printHitInfo(), and stepInfo().

unsigned int PPSDiamondSD::unitID_
private

Definition at line 81 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), printHitInfo(), and stepInfo().

int PPSDiamondSD::verbosity_
private

Definition at line 60 of file PPSDiamondSD.h.

Referenced by PPSDiamondSD(), stepInfo(), and storeHit().

double PPSDiamondSD::Vx_
private

Definition at line 99 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

double PPSDiamondSD::Vy_
private

Definition at line 99 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().

double PPSDiamondSD::Vz_
private

Definition at line 99 of file PPSDiamondSD.h.

Referenced by importInfoToHit(), and stepInfo().