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
PPSPixelSD Class Reference

#include <SimG4CMS/PPS/interface/PPSPixelSD.h>

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

Public Member Functions

void clear () override
 
void DrawAll () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PSimHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
 PPSPixelSD (const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, SimTrackManager const *)
 
void PrintAll () override
 
bool ProcessHits (G4Step *, G4TouchableHistory *) override
 
uint32_t setDetUnitId (const G4Step *) override
 
 ~PPSPixelSD () 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
 
void createNewHit ()
 
bool hitExists ()
 
void resetForNewPrimary ()
 
G4ThreeVector setToLocal (const G4ThreeVector &globalPoint)
 
void stepInfo (const G4Step *aStep)
 
void storeHit (PPSPixelG4Hit *)
 
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

PPSPixelG4HitcurrentHit_
 
G4VPhysicalVolume * currentPV_
 
float edeposit_
 
float Eloss_
 
G4ThreeVector entrancePoint_
 
int eventno_
 
G4int hcID_
 
G4ThreeVector hitPoint_
 
float incidentEnergy_
 
std::string name_
 
std::unique_ptr
< PPSVDetectorOrganization
numberingScheme_
 
float Pabs_
 
int ParentId_
 
short ParticleType_
 
float PhiAtEntry_
 
G4ThreeVector position_
 
G4StepPoint * postStepPoint_
 
G4StepPoint * preStepPoint_
 
uint32_t previousUnitID_
 
int primaryID_
 
G4int primID_
 
std::unique_ptr< TrackingSlaveSDslave_
 
G4ThreeVector theEntryPoint_
 
G4ThreeVector theExitPoint_
 
PPSPixelG4HitCollectiontheHC_
 
const SimTrackManagertheManager_
 
float ThetaAtEntry_
 
G4Track * theTrack_
 
float Tof_
 
int tsID_
 
double tSlice_
 
int tSliceID_
 
uint32_t unitID_
 
float Vx_
 
float Vy_
 
float Vz_
 

Static Private Attributes

static constexpr unsigned int maxPixelHits_ = 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

Description: Stores hits of PPSPixel in appropriate container

Usage: Used in sensitive detector builder

Definition at line 46 of file PPSPixelSD.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file PPSPixelSD.cc.

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

41  : SensitiveTkDetector(name_, clg),
42  numberingScheme_(nullptr),
43  hcID_(-1),
44  theHC_(nullptr),
45  theManager_(manager),
46  currentHit_(nullptr),
47  theTrack_(nullptr),
48  currentPV_(nullptr),
49  unitID_(0),
50  previousUnitID_(0),
51  preStepPoint_(nullptr),
52  postStepPoint_(nullptr),
53  eventno_(0) {
54  //Add PPS Sentitive Detector Names
55  collectionName.insert(name_);
56 
57  //Parameters
58  edm::ParameterSet m_p = p.getParameter<edm::ParameterSet>("PPSPixelSD");
59  int verbn = m_p.getUntrackedParameter<int>("Verbosity");
60  SetVerboseLevel(verbn);
61  slave_ = std::make_unique<TrackingSlaveSD>(name_);
62  if (name_ == "CTPPSPixelHits") {
63  numberingScheme_ = std::make_unique<PPSPixelNumberingScheme>();
64  } else {
65  edm::LogWarning("PPSSim") << "PPSPixelSD: ReadoutName not supported\n";
66  }
67 
68  edm::LogInfo("PPSSim") << "PPSPixelSD: Instantiation completed";
69 }
T getUntrackedParameter(std::string const &, T const &) const
uint32_t previousUnitID_
Definition: PPSPixelSD.h:102
G4int hcID_
Definition: PPSPixelSD.h:94
G4VPhysicalVolume * currentPV_
Definition: PPSPixelSD.h:101
const SimTrackManager * theManager_
Definition: PPSPixelSD.h:96
G4StepPoint * preStepPoint_
Definition: PPSPixelSD.h:106
int eventno_
Definition: PPSPixelSD.h:125
PPSPixelG4Hit * currentHit_
Definition: PPSPixelSD.h:99
std::string const collectionName[nCollections]
Definition: Collections.h:59
G4Track * theTrack_
Definition: PPSPixelSD.h:100
std::unique_ptr< TrackingSlaveSD > slave_
Definition: PPSPixelSD.h:81
std::string name_
Definition: PPSPixelSD.h:93
PPSPixelG4HitCollection * theHC_
Definition: PPSPixelSD.h:95
Log< level::Info, false > LogInfo
std::unique_ptr< PPSVDetectorOrganization > numberingScheme_
Definition: PPSPixelSD.h:82
G4StepPoint * postStepPoint_
Definition: PPSPixelSD.h:107
uint32_t unitID_
Definition: PPSPixelSD.h:102
Log< level::Warning, false > LogWarning
SensitiveTkDetector(const std::string &iname, const SensitiveDetectorCatalog &clg)
PPSPixelSD::~PPSPixelSD ( )
override

Definition at line 71 of file PPSPixelSD.cc.

71 {}

Member Function Documentation

void PPSPixelSD::clear ( void  )
override

Definition at line 129 of file PPSPixelSD.cc.

129 {}
void PPSPixelSD::clearHits ( )
overrideprivatevirtual

Implements SensitiveDetector.

Definition at line 152 of file PPSPixelSD.cc.

References slave_.

Referenced by update().

152 { slave_->Initialize(); }
std::unique_ptr< TrackingSlaveSD > slave_
Definition: PPSPixelSD.h:81
void PPSPixelSD::createNewHit ( )
private

Definition at line 246 of file PPSPixelSD.cc.

References currentHit_, currentPV_, Eloss_, incidentEnergy_, LogDebug, NULL, Pabs_, ParentId_, ParticleType_, PhiAtEntry_, position_, primaryID_, PPSPixelG4Hit::setEnergyLoss(), PPSPixelG4Hit::setEntryPoint(), PPSPixelG4Hit::setExitPoint(), PPSPixelG4Hit::setIncidentEnergy(), PPSPixelG4Hit::setMeanPosition(), PPSPixelG4Hit::setP(), PPSPixelG4Hit::setParentId(), PPSPixelG4Hit::setParticleType(), PPSPixelG4Hit::setPhiAtEntry(), PPSPixelG4Hit::setThetaAtEntry(), PPSPixelG4Hit::setTimeSlice(), PPSPixelG4Hit::setTof(), PPSPixelG4Hit::setTrackID(), PPSPixelG4Hit::setUnitID(), PPSPixelG4Hit::setVx(), PPSPixelG4Hit::setVy(), PPSPixelG4Hit::setVz(), storeHit(), theEntryPoint_, theExitPoint_, ThetaAtEntry_, theTrack_, Tof_, tSlice_, tSliceID_, unitID_, updateHit(), Vx_, Vy_, and Vz_.

Referenced by ProcessHits().

246  {
247 #ifdef debug
248  LogDebug("PPSSim") << "PPSPixelSD CreateNewHit for"
249  << " PV " << currentPV_->GetName() << " PVid = " << currentPV_->GetCopyNo()
250  << " MVid = " << currentPV_->GetMother()->GetCopyNo() << " Unit " << unitID_ << "\n"
251  << " primary " << primaryID_ << " time slice " << tSliceID_ << " For Track "
252  << theTrack_->GetTrackID() << " which is a " << theTrack_->GetDefinition()->GetParticleName();
253 
254  if (theTrack_->GetTrackID() == 1) {
255  LogDebug("PPSSim") << " of energy " << theTrack_->GetTotalEnergy();
256  } else {
257  LogDebug("PPSSim") << " daughter of part. " << theTrack_->GetParentID();
258  }
259 
260  if (theTrack_->GetCreatorProcess() != NULL)
261  LogDebug("PPSSim") << theTrack_->GetCreatorProcess()->GetProcessName();
262  else
263  LogDebug("PPSSim") << "NO process";
264 #endif
265 
271 
278 
282 
287 
288  updateHit();
289 
291 }
void setParticleType(short i)
G4ThreeVector theEntryPoint_
Definition: PPSPixelSD.h:112
float Pabs_
Definition: PPSPixelSD.h:114
float Tof_
Definition: PPSPixelSD.h:115
void setExitPoint(const G4ThreeVector &)
G4VPhysicalVolume * currentPV_
Definition: PPSPixelSD.h:101
float Vy_
Definition: PPSPixelSD.h:123
#define NULL
Definition: scimark2.h:8
short ParticleType_
Definition: PPSPixelSD.h:117
void setP(float e)
void storeHit(PPSPixelG4Hit *)
Definition: PPSPixelSD.cc:307
int ParentId_
Definition: PPSPixelSD.h:122
void setVy(float p)
float Vx_
Definition: PPSPixelSD.h:123
int primaryID_
Definition: PPSPixelSD.h:103
PPSPixelG4Hit * currentHit_
Definition: PPSPixelSD.h:99
void setPhiAtEntry(float f)
G4Track * theTrack_
Definition: PPSPixelSD.h:100
void setParentId(int p)
float incidentEnergy_
Definition: PPSPixelSD.h:90
void setTof(float e)
void setTimeSlice(double d)
void setEntryPoint(const G4ThreeVector &)
double tSlice_
Definition: PPSPixelSD.h:104
float Eloss_
Definition: PPSPixelSD.h:116
void setThetaAtEntry(float t)
float PhiAtEntry_
Definition: PPSPixelSD.h:120
G4ThreeVector theExitPoint_
Definition: PPSPixelSD.h:113
void setVx(float p)
G4ThreeVector position_
Definition: PPSPixelSD.h:111
void setTrackID(int i)
int tSliceID_
Definition: PPSPixelSD.h:103
void setUnitID(uint32_t i)
void setVz(float p)
uint32_t unitID_
Definition: PPSPixelSD.h:102
void updateHit()
Definition: PPSPixelSD.cc:293
void setIncidentEnergy(double e)
void setEnergyLoss(float e)
float ThetaAtEntry_
Definition: PPSPixelSD.h:119
float Vz_
Definition: PPSPixelSD.h:123
void setMeanPosition(const G4ThreeVector &a)
Definition: PPSPixelG4Hit.h:54
#define LogDebug(id)
void PPSPixelSD::DrawAll ( )
override

Definition at line 131 of file PPSPixelSD.cc.

131 {}
void PPSPixelSD::EndOfEvent ( G4HCofThisEvent *  eventHC)
override

Definition at line 101 of file PPSPixelSD.cc.

References PPSPixelG4Hit::energyLoss(), PPSPixelG4Hit::entryPoint(), PPSPixelG4Hit::exitPoint(), dqmiolumiharvest::j, LogDebug, maxPixelHits_, PPSPixelG4Hit::p(), PPSPixelG4Hit::particleType(), PPSPixelG4Hit::phiAtEntry(), slave_, summarize(), theHC_, PPSPixelG4Hit::thetaAtEntry(), PPSPixelG4Hit::tof(), PPSPixelG4Hit::trackID(), PPSPixelG4Hit::unitID(), and PPSPixelG4Hit::z().

101  {
102  // here we loop over transient hits and make them persistent
103  for (unsigned int j = 0; j < (unsigned int)theHC_->entries() && j < maxPixelHits_; j++) {
104  PPSPixelG4Hit* aHit = (*theHC_)[j];
105 #ifdef debug
106  LogDebug("PPSSim") << "HIT NUMERO " << j << "unit ID = " << aHit->unitID() << "\n"
107  << " "
108  << "enrty z " << aHit->entry().z() << "\n"
109  << " "
110  << "theta " << aHit->thetaAtEntry() << "\n";
111 #endif
112 
113  Local3DPoint Enter(aHit->entryPoint().x(), aHit->entryPoint().y(), aHit->entryPoint().z());
114  Local3DPoint Exit(aHit->exitPoint().x(), aHit->exitPoint().y(), aHit->exitPoint().z());
115  slave_->processHits(PSimHit(Enter,
116  Exit,
117  aHit->p(),
118  aHit->tof(),
119  aHit->energyLoss(),
120  aHit->particleType(),
121  aHit->unitID(),
122  aHit->trackID(),
123  aHit->thetaAtEntry(),
124  aHit->phiAtEntry()));
125  }
126  summarize();
127 }
float thetaAtEntry() const
const G4ThreeVector & exitPoint() const
float phiAtEntry() const
float energyLoss() const
const G4ThreeVector & entryPoint() const
std::unique_ptr< TrackingSlaveSD > slave_
Definition: PPSPixelSD.h:81
float z() const
int particleType() const
PPSPixelG4HitCollection * theHC_
Definition: PPSPixelSD.h:95
float tof() const
uint32_t unitID() const
int trackID() const
static constexpr unsigned int maxPixelHits_
Definition: PPSPixelSD.h:70
float p() const
void summarize()
Definition: PPSPixelSD.cc:324
#define LogDebug(id)
void PPSPixelSD::fillHits ( edm::PSimHitContainer c,
const std::string &  n 
)
overridevirtual

Implements SensitiveTkDetector.

Definition at line 138 of file PPSPixelSD.cc.

References dqmiodumpmetadata::n, and slave_.

138  {
139  if (slave_->name() == n) {
140  c = slave_->hits();
141  }
142 }
const edm::EventSetup & c
std::unique_ptr< TrackingSlaveSD > slave_
Definition: PPSPixelSD.h:81
bool PPSPixelSD::hitExists ( )
private

Definition at line 211 of file PPSPixelSD.cc.

References currentHit_, newFWLiteAna::found, dqmiolumiharvest::j, nhits, previousUnitID_, primaryID_, primID_, resetForNewPrimary(), theHC_, PPSPixelG4Hit::timeSliceID(), PPSPixelG4Hit::trackID(), tsID_, tSliceID_, PPSPixelG4Hit::unitID(), unitID_, and updateHit().

Referenced by ProcessHits().

211  {
212  if (primaryID_ < 1) {
213  edm::LogWarning("PPSSim") << "***** PPSPixelSD error: primaryID = " << primaryID_ << " maybe detector name changed";
214  }
215 
216  // Update if in the same detector, time-slice and for same track
217  if (tSliceID_ == tsID_ && unitID_ == previousUnitID_) {
218  updateHit();
219  return true;
220  }
221 
222  // Reset entry point for new primary
223  if (primaryID_ != primID_)
225 
226  //look in the HitContainer whether a hit with the same primID_, unitID_,
227  //tSliceID_ already exists:
228  bool found = false;
229  int nhits = theHC_->entries();
230  for (int j = 0; j < nhits && !found; j++) {
231  PPSPixelG4Hit* aPreviousHit = (*theHC_)[j];
232  if (aPreviousHit->trackID() == primaryID_ && aPreviousHit->timeSliceID() == tSliceID_ &&
233  aPreviousHit->unitID() == unitID_) {
234  currentHit_ = aPreviousHit;
235  found = true;
236  }
237  }
238 
239  if (found) {
240  updateHit();
241  return true;
242  }
243  return false;
244 }
uint32_t previousUnitID_
Definition: PPSPixelSD.h:102
int primaryID_
Definition: PPSPixelSD.h:103
PPSPixelG4Hit * currentHit_
Definition: PPSPixelSD.h:99
G4int primID_
Definition: PPSPixelSD.h:91
void resetForNewPrimary()
Definition: PPSPixelSD.cc:318
int timeSliceID() const
PPSPixelG4HitCollection * theHC_
Definition: PPSPixelSD.h:95
uint32_t unitID() const
int tSliceID_
Definition: PPSPixelSD.h:103
int trackID() const
uint32_t unitID_
Definition: PPSPixelSD.h:102
Log< level::Warning, false > LogWarning
void updateHit()
Definition: PPSPixelSD.cc:293
void PPSPixelSD::Initialize ( G4HCofThisEvent *  HCE)
override

Definition at line 87 of file PPSPixelSD.cc.

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

87  {
88  LogDebug("PPSSim") << "PPSPixelSD : Initialize called for " << name_;
89 
90  theHC_ = new PPSPixelG4HitCollection(GetName(), collectionName[0]);
91  G4SDManager::GetSDMpointer()->AddNewCollection(name_, collectionName[0]);
92 
93  if (hcID_ < 0)
94  hcID_ = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
95  HCE->AddHitsCollection(hcID_, theHC_);
96 
97  tsID_ = -2;
98  primID_ = -2;
99 }
G4int hcID_
Definition: PPSPixelSD.h:94
std::string const collectionName[nCollections]
Definition: Collections.h:59
G4int primID_
Definition: PPSPixelSD.h:91
std::string name_
Definition: PPSPixelSD.h:93
PPSPixelG4HitCollection * theHC_
Definition: PPSPixelSD.h:95
G4THitsCollection< PPSPixelG4Hit > PPSPixelG4HitCollection
#define LogDebug(id)
void PPSPixelSD::PrintAll ( )
override

Definition at line 133 of file PPSPixelSD.cc.

References LogDebug, and theHC_.

133  {
134  LogDebug("PPSSim") << "PPSPixelSD: Collection " << theHC_->GetName();
135  theHC_->PrintAllHits();
136 }
PPSPixelG4HitCollection * theHC_
Definition: PPSPixelSD.h:95
#define LogDebug(id)
bool PPSPixelSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
overridevirtual

Implements SensitiveDetector.

Definition at line 73 of file PPSPixelSD.cc.

References createNewHit(), edeposit_, hitExists(), and stepInfo().

73  {
74  if (!aStep)
75  return true;
76 
77  stepInfo(aStep);
78  if (!hitExists() && edeposit_ > 0.)
79  createNewHit();
80  return true;
81 }
void stepInfo(const G4Step *aStep)
Definition: PPSPixelSD.cc:161
void createNewHit()
Definition: PPSPixelSD.cc:246
bool hitExists()
Definition: PPSPixelSD.cc:211
float edeposit_
Definition: PPSPixelSD.h:108
void PPSPixelSD::resetForNewPrimary ( )
private

Definition at line 318 of file PPSPixelSD.cc.

References entrancePoint_, hitPoint_, incidentEnergy_, preStepPoint_, and setToLocal().

Referenced by hitExists().

318  {
320 
321  incidentEnergy_ = preStepPoint_->GetKineticEnergy();
322 }
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
Definition: PPSPixelSD.cc:154
G4StepPoint * preStepPoint_
Definition: PPSPixelSD.h:106
float incidentEnergy_
Definition: PPSPixelSD.h:90
G4ThreeVector hitPoint_
Definition: PPSPixelSD.h:109
G4ThreeVector entrancePoint_
Definition: PPSPixelSD.h:89
uint32_t PPSPixelSD::setDetUnitId ( const G4Step *  aStep)
overridevirtual

Implements SensitiveDetector.

Definition at line 83 of file PPSPixelSD.cc.

References numberingScheme_.

Referenced by stepInfo().

83  {
84  return (numberingScheme_ == nullptr ? 0 : numberingScheme_->unitID(aStep));
85 }
std::unique_ptr< PPSVDetectorOrganization > numberingScheme_
Definition: PPSPixelSD.h:82
G4ThreeVector PPSPixelSD::setToLocal ( const G4ThreeVector &  globalPoint)
private

Definition at line 154 of file PPSPixelSD.cc.

References preStepPoint_.

Referenced by resetForNewPrimary().

154  {
155  G4ThreeVector localPoint;
156  const G4VTouchable* touch = preStepPoint_->GetTouchable();
157  localPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
158  return localPoint;
159 }
G4StepPoint * preStepPoint_
Definition: PPSPixelSD.h:106
void PPSPixelSD::stepInfo ( const G4Step *  aStep)
private

Definition at line 161 of file PPSPixelSD.cc.

References currentPV_, edeposit_, Eloss_, SensitiveDetector::FinalStepPosition(), hitPoint_, SensitiveDetector::InitialStepPosition(), SensitiveDetector::LocalCoordinates, LogDebug, name_, Pabs_, ParentId_, HLT_FULL_cff::particleType, ParticleType_, PhiAtEntry_, position_, postStepPoint_, preStepPoint_, primaryID_, setDetUnitId(), theEntryPoint_, theExitPoint_, ThetaAtEntry_, theTrack_, Tof_, tSlice_, tSliceID_, unitID_, Vx_, Vy_, Vz_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by ProcessHits().

161  {
162  preStepPoint_ = aStep->GetPreStepPoint();
163  postStepPoint_ = aStep->GetPostStepPoint();
164  theTrack_ = aStep->GetTrack();
167 
168 #ifdef _PRINT_HITS_
169  LogDebug("PPSSim") << "theEntryPoint_ " << TheEntryPoint << "\n";
170  LogDebug("PPSSim") << "position " << preStepPoint_->GetPosition() << "\n";
171 #endif
172  hitPoint_ = preStepPoint_->GetPosition();
173  currentPV_ = preStepPoint_->GetPhysicalVolume();
174 
175  G4String name_ = currentPV_->GetName();
176  name_.assign(name_, 0, 4);
177  G4String particleType = theTrack_->GetDefinition()->GetParticleName();
178  edeposit_ = aStep->GetTotalEnergyDeposit();
179 
180  tSlice_ = (postStepPoint_->GetGlobalTime()) / nanosecond;
181  tSliceID_ = (int)tSlice_;
182  unitID_ = setDetUnitId(aStep);
183 #ifdef debug
184  LogDebug("PPSSim") << "UNIT ID " << unitID_;
185 #endif
186  primaryID_ = theTrack_->GetTrackID();
187 
188  theEntryPoint_.setX(TheEntryPoint.x());
189  theEntryPoint_.setY(TheEntryPoint.y());
190  theEntryPoint_.setZ(TheEntryPoint.z());
191  theExitPoint_.setX(TheExitPoint.x());
192  theExitPoint_.setY(TheExitPoint.y());
193  theExitPoint_.setZ(TheExitPoint.z());
194 
196  Pabs_ = aStep->GetPreStepPoint()->GetMomentum().mag() / GeV;
197  Tof_ = aStep->GetPostStepPoint()->GetGlobalTime() / nanosecond;
198 
199  Eloss_ = aStep->GetTotalEnergyDeposit() / GeV;
200  ParticleType_ = theTrack_->GetDefinition()->GetPDGEncoding();
201 
202  ThetaAtEntry_ = aStep->GetPreStepPoint()->GetPosition().theta();
203  PhiAtEntry_ = aStep->GetPreStepPoint()->GetPosition().phi();
204 
205  ParentId_ = theTrack_->GetParentID();
206  Vx_ = theTrack_->GetVertexPosition().x();
207  Vy_ = theTrack_->GetVertexPosition().y();
208  Vz_ = theTrack_->GetVertexPosition().z();
209 }
G4ThreeVector theEntryPoint_
Definition: PPSPixelSD.h:112
uint32_t setDetUnitId(const G4Step *) override
Definition: PPSPixelSD.cc:83
float Pabs_
Definition: PPSPixelSD.h:114
float Tof_
Definition: PPSPixelSD.h:115
G4VPhysicalVolume * currentPV_
Definition: PPSPixelSD.h:101
float Vy_
Definition: PPSPixelSD.h:123
T y() const
Definition: PV3DBase.h:60
G4StepPoint * preStepPoint_
Definition: PPSPixelSD.h:106
short ParticleType_
Definition: PPSPixelSD.h:117
int ParentId_
Definition: PPSPixelSD.h:122
float Vx_
Definition: PPSPixelSD.h:123
int primaryID_
Definition: PPSPixelSD.h:103
G4Track * theTrack_
Definition: PPSPixelSD.h:100
Local3DPoint FinalStepPosition(const G4Step *step, coordinates) const
T z() const
Definition: PV3DBase.h:61
std::string name_
Definition: PPSPixelSD.h:93
double tSlice_
Definition: PPSPixelSD.h:104
float Eloss_
Definition: PPSPixelSD.h:116
float PhiAtEntry_
Definition: PPSPixelSD.h:120
G4ThreeVector theExitPoint_
Definition: PPSPixelSD.h:113
G4ThreeVector position_
Definition: PPSPixelSD.h:111
int tSliceID_
Definition: PPSPixelSD.h:103
G4ThreeVector hitPoint_
Definition: PPSPixelSD.h:109
G4StepPoint * postStepPoint_
Definition: PPSPixelSD.h:107
uint32_t unitID_
Definition: PPSPixelSD.h:102
float edeposit_
Definition: PPSPixelSD.h:108
T x() const
Definition: PV3DBase.h:59
float ThetaAtEntry_
Definition: PPSPixelSD.h:119
float Vz_
Definition: PPSPixelSD.h:123
#define LogDebug(id)
Local3DPoint InitialStepPosition(const G4Step *step, coordinates) const
void PPSPixelSD::storeHit ( PPSPixelG4Hit hit)
private

Definition at line 307 of file PPSPixelSD.cc.

References primID_, and theHC_.

Referenced by createNewHit().

307  {
308  if (primID_ < 0)
309  return;
310  if (hit == nullptr) {
311  edm::LogWarning("PPSSim") << "PPSPixelSD: hit to be stored is NULL !!";
312  return;
313  }
314 
315  theHC_->insert(hit);
316 }
G4int primID_
Definition: PPSPixelSD.h:91
PPSPixelG4HitCollection * theHC_
Definition: PPSPixelSD.h:95
Log< level::Warning, false > LogWarning
void PPSPixelSD::summarize ( )
private

Definition at line 324 of file PPSPixelSD.cc.

Referenced by EndOfEvent().

324 {}
void PPSPixelSD::update ( const BeginOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 144 of file PPSPixelSD.cc.

References clearHits(), eventno_, and LogDebug.

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

144  {
145  LogDebug("PPSSim") << " Dispatched BeginOfEvent for " << GetName() << " !";
146  clearHits();
147  eventno_ = (*i)()->GetEventID();
148 }
void clearHits() override
Definition: PPSPixelSD.cc:152
int eventno_
Definition: PPSPixelSD.h:125
#define LogDebug(id)
void PPSPixelSD::update ( const ::EndOfEvent )
overrideprivate
void PPSPixelSD::updateHit ( )
private

Definition at line 293 of file PPSPixelSD.cc.

References currentHit_, Eloss_, LogDebug, postStepPoint_, previousUnitID_, primaryID_, primID_, PPSPixelG4Hit::setEnergyLoss(), tsID_, tSliceID_, and unitID_.

Referenced by createNewHit(), and hitExists().

293  {
294  if (Eloss_ > 0.) {
295 #ifdef debug
296  LogDebug("PPSSim") << "G4PPSPixelSD updateHit: add eloss " << Eloss_ << "\nCurrentHit=" << currentHit_
297  << ", PostStepPoint=" << postStepPoint_->GetPosition();
298 #endif
300  }
301  // buffer for next steps:
302  tsID_ = tSliceID_;
305 }
uint32_t previousUnitID_
Definition: PPSPixelSD.h:102
int primaryID_
Definition: PPSPixelSD.h:103
PPSPixelG4Hit * currentHit_
Definition: PPSPixelSD.h:99
G4int primID_
Definition: PPSPixelSD.h:91
float Eloss_
Definition: PPSPixelSD.h:116
int tSliceID_
Definition: PPSPixelSD.h:103
G4StepPoint * postStepPoint_
Definition: PPSPixelSD.h:107
uint32_t unitID_
Definition: PPSPixelSD.h:102
void setEnergyLoss(float e)
#define LogDebug(id)

Member Data Documentation

PPSPixelG4Hit* PPSPixelSD::currentHit_
private

Definition at line 99 of file PPSPixelSD.h.

Referenced by createNewHit(), hitExists(), and updateHit().

G4VPhysicalVolume* PPSPixelSD::currentPV_
private

Definition at line 101 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

float PPSPixelSD::edeposit_
private

Definition at line 108 of file PPSPixelSD.h.

Referenced by ProcessHits(), and stepInfo().

float PPSPixelSD::Eloss_
private

Definition at line 116 of file PPSPixelSD.h.

Referenced by createNewHit(), stepInfo(), and updateHit().

G4ThreeVector PPSPixelSD::entrancePoint_
private

Definition at line 89 of file PPSPixelSD.h.

Referenced by resetForNewPrimary().

int PPSPixelSD::eventno_
private

Definition at line 125 of file PPSPixelSD.h.

Referenced by update().

G4int PPSPixelSD::hcID_
private

Definition at line 94 of file PPSPixelSD.h.

Referenced by Initialize().

G4ThreeVector PPSPixelSD::hitPoint_
private

Definition at line 109 of file PPSPixelSD.h.

Referenced by resetForNewPrimary(), and stepInfo().

float PPSPixelSD::incidentEnergy_
private

Definition at line 90 of file PPSPixelSD.h.

Referenced by createNewHit(), and resetForNewPrimary().

constexpr unsigned int PPSPixelSD::maxPixelHits_ = 15000
staticprivate

Definition at line 70 of file PPSPixelSD.h.

Referenced by EndOfEvent().

std::string PPSPixelSD::name_
private

Definition at line 93 of file PPSPixelSD.h.

Referenced by Initialize(), PPSPixelSD(), and stepInfo().

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

Definition at line 82 of file PPSPixelSD.h.

Referenced by PPSPixelSD(), and setDetUnitId().

float PPSPixelSD::Pabs_
private

Definition at line 114 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

int PPSPixelSD::ParentId_
private

Definition at line 122 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

short PPSPixelSD::ParticleType_
private

Definition at line 117 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

float PPSPixelSD::PhiAtEntry_
private

Definition at line 120 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

G4ThreeVector PPSPixelSD::position_
private

Definition at line 111 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

G4StepPoint* PPSPixelSD::postStepPoint_
private

Definition at line 107 of file PPSPixelSD.h.

Referenced by stepInfo(), and updateHit().

G4StepPoint* PPSPixelSD::preStepPoint_
private

Definition at line 106 of file PPSPixelSD.h.

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

uint32_t PPSPixelSD::previousUnitID_
private

Definition at line 102 of file PPSPixelSD.h.

Referenced by hitExists(), and updateHit().

int PPSPixelSD::primaryID_
private

Definition at line 103 of file PPSPixelSD.h.

Referenced by createNewHit(), hitExists(), stepInfo(), and updateHit().

G4int PPSPixelSD::primID_
private

Definition at line 91 of file PPSPixelSD.h.

Referenced by hitExists(), Initialize(), storeHit(), and updateHit().

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

Definition at line 81 of file PPSPixelSD.h.

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

G4ThreeVector PPSPixelSD::theEntryPoint_
private

Definition at line 112 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

G4ThreeVector PPSPixelSD::theExitPoint_
private

Definition at line 113 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

PPSPixelG4HitCollection* PPSPixelSD::theHC_
private

Definition at line 95 of file PPSPixelSD.h.

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

const SimTrackManager* PPSPixelSD::theManager_
private

Definition at line 96 of file PPSPixelSD.h.

float PPSPixelSD::ThetaAtEntry_
private

Definition at line 119 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

G4Track* PPSPixelSD::theTrack_
private

Definition at line 100 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

float PPSPixelSD::Tof_
private

Definition at line 115 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

int PPSPixelSD::tsID_
private

Definition at line 98 of file PPSPixelSD.h.

Referenced by hitExists(), Initialize(), and updateHit().

double PPSPixelSD::tSlice_
private

Definition at line 104 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

int PPSPixelSD::tSliceID_
private

Definition at line 103 of file PPSPixelSD.h.

Referenced by createNewHit(), hitExists(), stepInfo(), and updateHit().

uint32_t PPSPixelSD::unitID_
private

Definition at line 102 of file PPSPixelSD.h.

Referenced by createNewHit(), hitExists(), stepInfo(), and updateHit().

float PPSPixelSD::Vx_
private

Definition at line 123 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

float PPSPixelSD::Vy_
private

Definition at line 123 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().

float PPSPixelSD::Vz_
private

Definition at line 123 of file PPSPixelSD.h.

Referenced by createNewHit(), and stepInfo().