CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
TotemSD Class Reference

#include <SimG4CMS/Forward/interface/TotemSD.h>

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

Public Member Functions

void clearHits () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PSimHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
void PrintAll () override
 
bool ProcessHits (G4Step *, G4TouchableHistory *) override
 
uint32_t setDetUnitId (const G4Step *) override
 
 TotemSD (const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
 ~TotemSD () override
 
- Public Member Functions inherited from SensitiveTkDetector
 SensitiveTkDetector (const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- 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 edm::EventSetup &es, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, bool calo)
 
 ~SensitiveDetector () override
 
- Public Member Functions inherited from Observer< const BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent * iT)
 
virtual ~Observer ()
 

Protected Member Functions

void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
- 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 > &)
 

Private Member Functions

void createNewHit ()
 
void createNewHitEvo ()
 
void getStepInfo (const G4Step *aStep)
 
bool hitExists ()
 
G4ThreeVector posizioEvo (const G4ThreeVector &, double, double, double, double, int &)
 
void resetForNewPrimary ()
 
G4ThreeVector setToLocal (const G4ThreeVector &globalPoint)
 
void storeHit (TotemG4Hit *)
 
void updateHit ()
 

Private Attributes

TotemG4HitcurrentHit
 
G4VPhysicalVolume * currentPV
 
float edeposit
 
float Eloss
 
G4ThreeVector entrancePoint
 
G4int hcID
 
G4ThreeVector hitPoint
 
float incidentEnergy
 
TotemVDetectorOrganizationnumberingScheme
 
float Pabs
 
int ParentId
 
short ParticleType
 
float PhiAtEntry
 
G4ThreeVector Posizio
 
const G4StepPoint * postStepPoint
 
const G4StepPoint * preStepPoint
 
uint32_t previousUnitID
 
int primaryID
 
G4int primID
 
TrackingSlaveSDslave
 
TotemG4HitCollectiontheHC
 
const SimTrackManagertheManager
 
float ThetaAtEntry
 
G4Track * theTrack
 
float Tof
 
int tsID
 
double tSlice
 
int tSliceID
 
uint32_t unitID
 
float Vx
 
float Vy
 
float Vz
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 

Detailed Description

Description: Stores hits of Totem in appropriate container

Usage: Used in sensitive detector builder

Definition at line 43 of file TotemSD.h.

Constructor & Destructor Documentation

◆ TotemSD()

TotemSD::TotemSD ( const std::string &  name,
const edm::EventSetup es,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager 
)

Definition at line 47 of file TotemSD.cc.

52  : SensitiveTkDetector(name, es, clg, p),
53  numberingScheme(nullptr),
54  hcID(-1),
55  theHC(nullptr),
56  theManager(manager),
57  currentHit(nullptr),
58  theTrack(nullptr),
59  currentPV(nullptr),
60  unitID(0),
61  previousUnitID(0),
62  preStepPoint(nullptr),
63  postStepPoint(nullptr) {
64  //Parameters
65  edm::ParameterSet m_p = p.getParameter<edm::ParameterSet>("TotemSD");
66  int verbn = m_p.getUntrackedParameter<int>("Verbosity");
67 
68  SetVerboseLevel(verbn);
69 
70  slave = new TrackingSlaveSD(name);
71 
72  if (name == "TotemHitsT1") {
73  numberingScheme = dynamic_cast<TotemVDetectorOrganization*>(new TotemT1NumberingScheme(1));
74  } else if (name == "TotemHitsT2Si") {
75  numberingScheme = dynamic_cast<TotemVDetectorOrganization*>(new TotemT2NumberingSchemeGem(3));
76  } else if (name == "TotemHitsT2Gem") {
77  numberingScheme = dynamic_cast<TotemVDetectorOrganization*>(new TotemT2NumberingSchemeGem(4));
78  } else if (name == "TotemHitsRP") {
79  numberingScheme = dynamic_cast<TotemVDetectorOrganization*>(new TotemRPNumberingScheme(3));
80  } else {
81  edm::LogWarning("ForwardSim") << "TotemSD: ReadoutName not supported\n";
82  }
83 }

References edm::ParameterSet::getUntrackedParameter(), Skims_PA_cff::name, numberingScheme, AlCaHLTBitMon_ParallelJobs::p, and slave.

◆ ~TotemSD()

TotemSD::~TotemSD ( )
override

Definition at line 85 of file TotemSD.cc.

85  {
86  delete slave;
87  delete numberingScheme;
88 }

References numberingScheme, and slave.

Member Function Documentation

◆ clearHits()

void TotemSD::clearHits ( )
overridevirtual

Implements SensitiveDetector.

Definition at line 161 of file TotemSD.cc.

161 { slave->Initialize(); }

References TrackingSlaveSD::Initialize(), and slave.

Referenced by update().

◆ createNewHit()

void TotemSD::createNewHit ( )
private

Definition at line 246 of file TotemSD.cc.

246  {
247 #ifdef debug
248  LogDebug("ForwardSim") << "TotemSD 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("ForwardSim") << " of energy " << theTrack->GetTotalEnergy();
256  } else {
257  LogDebug("ForwardSim") << " daughter of part. " << theTrack->GetParentID();
258  }
259 
260  if (theTrack->GetCreatorProcess() != nullptr)
261  LogDebug("ForwardSim") << theTrack->GetCreatorProcess()->GetProcessName();
262  else
263  LogDebug("ForwardSim") << "NO process";
264 #endif
265 
266  currentHit = new TotemG4Hit;
271 
278 
279  currentHit->setEntry(Posizio.x(), Posizio.y(), Posizio.z());
280 
282  currentHit->setVx(Vx);
283  currentHit->setVy(Vy);
284  currentHit->setVz(Vz);
285 
286  updateHit();
287 
289 }

References currentHit, currentPV, Eloss, incidentEnergy, LogDebug, Pabs, ParentId, ParticleType, PhiAtEntry, Posizio, primaryID, TotemG4Hit::setEnergyLoss(), TotemG4Hit::setEntry(), TotemG4Hit::setIncidentEnergy(), TotemG4Hit::setPabs(), TotemG4Hit::setParentId(), TotemG4Hit::setParticleType(), TotemG4Hit::setPhiAtEntry(), TotemG4Hit::setThetaAtEntry(), TotemG4Hit::setTimeSlice(), TotemG4Hit::setTof(), TotemG4Hit::setTrackID(), TotemG4Hit::setUnitID(), TotemG4Hit::setVx(), TotemG4Hit::setVy(), TotemG4Hit::setVz(), storeHit(), ThetaAtEntry, theTrack, Tof, tSlice, tSliceID, unitID, updateHit(), Vx, Vy, and Vz.

Referenced by ProcessHits().

◆ createNewHitEvo()

void TotemSD::createNewHitEvo ( )
private

Definition at line 291 of file TotemSD.cc.

291  {
292  // LogDebug("ForwardSim") << "INSIDE CREATE NEW HIT EVO ";
293 
294  currentHit = new TotemG4Hit;
299 
306 
307  // LogDebug("ForwardSim") << Posizio.x() << " " << Posizio.y() << " " << Posizio.z();
308 
310  currentHit->setVx(Vx);
311  currentHit->setVy(Vy);
312  currentHit->setVz(Vz);
313 
314  G4ThreeVector _PosizioEvo;
315  int flagAcc = 0;
316  _PosizioEvo = posizioEvo(Posizio, Vx, Vy, Vz, Pabs, flagAcc);
317 
318  if (flagAcc == 1) {
319  currentHit->setEntry(_PosizioEvo.x(), _PosizioEvo.y(), _PosizioEvo.z());
320 
321  updateHit();
322 
324  }
325  // LogDebug("ForwardSim") << "STORED HIT IN: " << unitID;
326 }

References currentHit, Eloss, incidentEnergy, Pabs, ParentId, ParticleType, PhiAtEntry, Posizio, posizioEvo(), primaryID, TotemG4Hit::setEnergyLoss(), TotemG4Hit::setEntry(), TotemG4Hit::setIncidentEnergy(), TotemG4Hit::setPabs(), TotemG4Hit::setParentId(), TotemG4Hit::setParticleType(), TotemG4Hit::setPhiAtEntry(), TotemG4Hit::setThetaAtEntry(), TotemG4Hit::setTimeSlice(), TotemG4Hit::setTof(), TotemG4Hit::setTrackID(), TotemG4Hit::setUnitID(), TotemG4Hit::setVx(), TotemG4Hit::setVy(), TotemG4Hit::setVz(), storeHit(), ThetaAtEntry, Tof, tSlice, unitID, updateHit(), Vx, Vy, and Vz.

Referenced by ProcessHits().

◆ EndOfEvent()

void TotemSD::EndOfEvent ( G4HCofThisEvent *  eventHC)
override

Definition at line 118 of file TotemSD.cc.

118  {
119  // here we loop over transient hits and make them persistent
120  int thehc_entries = theHC->entries();
121  for (int j = 0; j < thehc_entries && j < 15000; j++) {
122  TotemG4Hit* aHit = (*theHC)[j];
123 #ifdef ddebug
124  LogDebug("ForwardSim") << "HIT NUMERO " << j << "unit ID = " << aHit->getUnitID() << "\n"
125  << " "
126  << "enrty z " << aHit->getEntry().z() << "\n"
127  << " "
128  << "theta " << aHit->getThetaAtEntry() << "\n";
129 #endif
130  Local3DPoint theExitPoint(0, 0, 0);
131  Local3DPoint Entrata(aHit->getEntry().x(), aHit->getEntry().y(), aHit->getEntry().z());
132  slave->processHits(PSimHit(Entrata,
133  theExitPoint,
134  aHit->getPabs(),
135  aHit->getTof(),
136  aHit->getEnergyLoss(),
137  aHit->getParticleType(),
138  aHit->getUnitID(),
139  aHit->getTrackID(),
140  aHit->getThetaAtEntry(),
141  aHit->getPhiAtEntry()));
142  }
143 }

References TotemG4Hit::getEnergyLoss(), TotemG4Hit::getEntry(), TotemG4Hit::getPabs(), TotemG4Hit::getParticleType(), TotemG4Hit::getPhiAtEntry(), TotemG4Hit::getThetaAtEntry(), TotemG4Hit::getTof(), TotemG4Hit::getTrackID(), TotemG4Hit::getUnitID(), dqmiolumiharvest::j, LogDebug, TrackingSlaveSD::processHits(), slave, and theHC.

◆ fillHits()

void TotemSD::fillHits ( edm::PSimHitContainer cc,
const std::string &  hname 
)
overridevirtual

Implements SensitiveTkDetector.

Definition at line 150 of file TotemSD.cc.

150  {
151  if (slave->name() == hname) {
152  cc = slave->hits();
153  }
154 }

References TrackingSlaveSD::hits(), TrackingSlaveSD::name(), and slave.

◆ getStepInfo()

void TotemSD::getStepInfo ( const G4Step *  aStep)
private

Definition at line 170 of file TotemSD.cc.

170  {
171  preStepPoint = aStep->GetPreStepPoint();
172  postStepPoint = aStep->GetPostStepPoint();
173  theTrack = aStep->GetTrack();
174  hitPoint = preStepPoint->GetPosition();
175  currentPV = preStepPoint->GetPhysicalVolume();
176 
177  // double weight = 1;
178  G4String name = currentPV->GetName();
179  name.assign(name, 0, 4);
180  G4String particleType = theTrack->GetDefinition()->GetParticleName();
181  edeposit = aStep->GetTotalEnergyDeposit();
182 
183  tSlice = (postStepPoint->GetGlobalTime()) / nanosecond;
184  tSliceID = (int)tSlice;
185  unitID = setDetUnitId(aStep);
186 #ifdef debug
187  LogDebug("ForwardSim") << "UNITa " << unitID;
188 #endif
189  primaryID = theTrack->GetTrackID();
190 
191  Posizio = hitPoint;
192  Pabs = aStep->GetPreStepPoint()->GetMomentum().mag() / GeV;
193  Tof = aStep->GetPostStepPoint()->GetGlobalTime() / nanosecond;
194 
195  Eloss = aStep->GetTotalEnergyDeposit() / GeV;
196  ParticleType = theTrack->GetDefinition()->GetPDGEncoding();
197 
198  ThetaAtEntry = aStep->GetPreStepPoint()->GetPosition().theta() / deg;
199  PhiAtEntry = aStep->GetPreStepPoint()->GetPosition().phi() / deg;
200 
201  ParentId = theTrack->GetParentID();
202  Vx = theTrack->GetVertexPosition().x();
203  Vy = theTrack->GetVertexPosition().y();
204  Vz = theTrack->GetVertexPosition().z();
205 }

References currentPV, edeposit, Eloss, GeV, hitPoint, createfilelist::int, LogDebug, Skims_PA_cff::name, Pabs, ParentId, PbPb_ZMuSkimMuonDPG_cff::particleType, ParticleType, PhiAtEntry, Posizio, postStepPoint, preStepPoint, primaryID, setDetUnitId(), ThetaAtEntry, theTrack, Tof, tSlice, tSliceID, unitID, Vx, Vy, and Vz.

Referenced by ProcessHits().

◆ hitExists()

bool TotemSD::hitExists ( )
private

Definition at line 207 of file TotemSD.cc.

207  {
208  if (primaryID < 1) {
209  edm::LogWarning("ForwardSim") << "***** TotemSD error: primaryID = " << primaryID << " maybe detector name changed";
210  }
211 
212  // Update if in the same detector, time-slice and for same track
213  // if (primaryID == primID && tSliceID == tsID && unitID==previousUnitID) {
214  if (tSliceID == tsID && unitID == previousUnitID) {
215  updateHit();
216  return true;
217  }
218 
219  // Reset entry point for new primary
220  if (primaryID != primID)
222 
223  //look in the HitContainer whether a hit with the same primID, unitID,
224  //tSliceID already exists:
225 
226  bool found = false;
227  int thehc_entries = theHC->entries();
228  for (int j = 0; j < thehc_entries && !found; j++) {
229  TotemG4Hit* aPreviousHit = (*theHC)[j];
230  if (aPreviousHit->getTrackID() == primaryID && aPreviousHit->getTimeSliceID() == tSliceID &&
231  aPreviousHit->getUnitID() == unitID) {
232  currentHit = aPreviousHit;
233  found = true;
234  break;
235  }
236  }
237 
238  if (found) {
239  updateHit();
240  return true;
241  } else {
242  return false;
243  }
244 }

References currentHit, newFWLiteAna::found, TotemG4Hit::getTimeSliceID(), TotemG4Hit::getTrackID(), TotemG4Hit::getUnitID(), dqmiolumiharvest::j, previousUnitID, primaryID, primID, resetForNewPrimary(), theHC, tsID, tSliceID, unitID, and updateHit().

Referenced by ProcessHits().

◆ Initialize()

void TotemSD::Initialize ( G4HCofThisEvent *  HCE)
override

Definition at line 106 of file TotemSD.cc.

106  {
107  LogDebug("ForwardSim") << "TotemSD : Initialize called for " << GetName();
108 
109  theHC = new TotemG4HitCollection(GetName(), collectionName[0]);
110  if (hcID < 0)
111  hcID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
112  HCE->AddHitsCollection(hcID, theHC);
113 
114  tsID = -2;
115  primID = -2;
116 }

References bysipixelclustmulteventfilter_cfi::collectionName, hcID, LogDebug, primID, theHC, and tsID.

◆ posizioEvo()

G4ThreeVector TotemSD::posizioEvo ( const G4ThreeVector &  Pos,
double  vx,
double  vy,
double  vz,
double  pabs,
int &  accettanza 
)
private

Definition at line 328 of file TotemSD.cc.

329  {
330  accettanza = 0;
331  //Pos.xyz() in mm
332  G4ThreeVector PosEvo;
333  double ThetaX = std::atan((Pos.x() - vx) / (Pos.z() - vz));
334  double ThetaY = std::atan((Pos.y() - vy) / (Pos.z() - vz));
335  double X_at_0 = (vx - ((Pos.x() - vx) / (Pos.z() - vz)) * vz) / 1000.;
336  double Y_at_0 = (vy - ((Pos.y() - vy) / (Pos.z() - vz)) * vz) / 1000.;
337 
338  // double temp_evo_X;
339  // double temp_evo_Y;
340  // double temp_evo_Z;
341  // temp_evo_Z = std::abs(Pos.z())/Pos.z()*220000.;
342 
343  //csi=-dp/d
344  double csi = std::abs((7000. - pabs) / 7000.);
345 
346  // all in m
347  const int no_rp = 4;
348  double x_par[no_rp + 1];
349  double y_par[no_rp + 1];
350  //rp z position
351  double rp[no_rp] = {141., 149., 198., 220.};
352  //{lx0,mlx} for each rp; Lx=lx0+mlx*csi
353  double leffx[][2] = {{122.5429, -46.9312}, {125.4194, -49.1849}, {152.6, -81.157}, {98.8914, -131.8390}};
354  //{ly0,mly} for each rp; Ly=ly0+mly*csi
355  double leffy[][2] = {{124.2314, -55.4852}, {127.7825, -57.4503}, {179.455, -76.274}, {273.0931, -40.4626}};
356  //{vx0,mvx0} for each rp; vx=vx0+mvx*csi
357  double avx[][2] = {{0.515483, -1.0123}, {0.494122, -1.0534}, {0.2217, -1.483}, {0.004633, -1.0719}};
358  //{vy0,mvy0} for each rp; vy=vy0+mvy*csi
359  double avy[][2] = {{0.371418, -1.6327}, {0.349035, -1.6955}, {0.0815, -2.59}, {0.007592, -4.0841}};
360  //{D0,md,a,b} for each rp; D=D0+(md+a*thetax)*csi+b*thetax
361  double ddx[][4] = {{-0.082336, -0.092513, 112.3436, -82.5029},
362  {-0.086927, -0.097670, 114.9513, -82.9835},
363  {-0.092117, -0.0915, 180.6236, -82.443},
364  {-0.050470, 0.058837, 208.1106, 20.8198}};
365  // {10sigma_x+0.5mm,10sigma_y+0.5mm}
366  double detlim[][2] = {{0, 0}, {0.0028, 0.0021}, {0, 0}, {0.0008, 0.0013}};
367  //{rmax,dmax}
368  double pipelim[][2] = {{0.026, 0.026}, {0.04, 0.04}, {0.0226, 0.0177}, {0.04, 0.04}};
369 
370  for (int j = 0; j < no_rp; j++) {
371  //y=Ly*thetay+vy*y0
372  //x=Lx*thetax+vx*x0-csi*D
373  y_par[j] = ThetaY * (leffy[j][0] + leffy[j][1] * csi) + (avy[j][0] + avy[j][1] * csi) * Y_at_0;
374  x_par[j] = ThetaX * (leffx[j][0] + leffx[j][1] * csi) + (avx[j][0] + avx[j][1] * csi) * X_at_0 -
375  csi * (ddx[j][0] + (ddx[j][1] + ddx[j][2] * ThetaX) * csi + ddx[j][3] * ThetaX);
376  }
377 
378  //pass TAN@141
379  if (std::abs(y_par[0]) < pipelim[0][1] && sqrt((y_par[0] * y_par[0]) + (x_par[0] * x_par[0])) < pipelim[0][0]) {
380  //pass 149
381  if ((sqrt((y_par[1] * y_par[1]) + (x_par[1] * x_par[1])) < pipelim[1][0]) &&
382  (std::abs(y_par[1]) > detlim[1][1] || x_par[1] > detlim[1][0])) {
383  accettanza = 1;
384  }
385  }
386 
387  //pass TAN@141
388  if (std::abs(y_par[0]) < pipelim[0][1] && sqrt((y_par[0]) * (y_par[0]) + (x_par[0]) * (x_par[0])) < pipelim[0][0]) {
389  //pass Q5@198
390  if (std::abs(y_par[2]) < pipelim[2][1] && sqrt((y_par[2] * y_par[2]) + (x_par[2] * x_par[2])) < pipelim[2][0]) {
391  //pass 220
392  if ((sqrt((y_par[3] * y_par[3]) + (x_par[3] * x_par[3])) < pipelim[3][0]) &&
393  (std::abs(y_par[3]) > detlim[3][1] || x_par[3] > detlim[3][0])) {
394  accettanza = 1;
395 
396  PosEvo.setX(1000 * x_par[3]);
397  PosEvo.setY(1000 * y_par[3]);
398  PosEvo.setZ(1000 * rp[3]);
399  if (Pos.z() < vz)
400  PosEvo.setZ(-1000 * rp[3]);
401  }
402  }
403  }
404  /*
405  LogDebug("ForwardSim") << "\n"
406  << "ACCETTANZA: "<<accettanza << "\n"
407  << "CSI: "<< csi << "\n"
408  << "Theta_X: " << ThetaX << "\n"
409  << "Theta_Y: " << ThetaY << "\n"
410  << "X_at_0: "<< X_at_0 << "\n"
411  << "Y_at_0: "<< Y_at_0 << "\n"
412  << "x_par[3]: "<< x_par[3] << "\n"
413  << "y_par[3]: "<< y_par[3] << "\n"
414  << "pos " << Pos.x() << " " << Pos.y() << " "
415  << Pos.z() << "\n" << "V "<< vx << " " << vy << " "
416  << vz << "\n"
417 */
418  // --------------
419  return PosEvo;
420 }

References funct::abs(), dqmiolumiharvest::j, and mathSSE::sqrt().

Referenced by createNewHitEvo().

◆ PrintAll()

void TotemSD::PrintAll ( )
override

Definition at line 145 of file TotemSD.cc.

145  {
146  LogDebug("ForwardSim") << "TotemSD: Collection " << theHC->GetName();
147  theHC->PrintAllHits();
148 }

References LogDebug, and theHC.

◆ ProcessHits()

bool TotemSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
overridevirtual

Implements SensitiveDetector.

Definition at line 90 of file TotemSD.cc.

90  {
91  getStepInfo(aStep);
92  if (!hitExists() && edeposit > 0.) {
93  createNewHit();
94  return true;
95  }
96  if (!hitExists() && (((unitID == 1111 || unitID == 2222) && ParentId == 0 && ParticleType == 2212))) {
98  }
99  return true;
100 }

References createNewHit(), createNewHitEvo(), edeposit, getStepInfo(), hitExists(), ParentId, ParticleType, and unitID.

◆ resetForNewPrimary()

void TotemSD::resetForNewPrimary ( )
private

Definition at line 450 of file TotemSD.cc.

450  {
452  incidentEnergy = preStepPoint->GetKineticEnergy();
453 }

References entrancePoint, hitPoint, incidentEnergy, preStepPoint, and setToLocal().

Referenced by hitExists().

◆ setDetUnitId()

uint32_t TotemSD::setDetUnitId ( const G4Step *  aStep)
overridevirtual

Implements SensitiveDetector.

Definition at line 102 of file TotemSD.cc.

102  {
103  return (numberingScheme == nullptr ? 0 : numberingScheme->getUnitID(aStep));
104 }

References TotemVDetectorOrganization::getUnitID(), and numberingScheme.

Referenced by getStepInfo().

◆ setToLocal()

G4ThreeVector TotemSD::setToLocal ( const G4ThreeVector &  globalPoint)
private

Definition at line 163 of file TotemSD.cc.

163  {
164  G4ThreeVector localPoint;
165  const G4VTouchable* touch = preStepPoint->GetTouchable();
166  localPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
167  return localPoint;
168 }

References preStepPoint.

Referenced by resetForNewPrimary().

◆ storeHit()

void TotemSD::storeHit ( TotemG4Hit hit)
private

Definition at line 439 of file TotemSD.cc.

439  {
440  if (primID < 0)
441  return;
442  if (hit == nullptr) {
443  edm::LogWarning("ForwardSim") << "TotemSD: hit to be stored is NULL !!";
444  return;
445  }
446 
447  theHC->insert(hit);
448 }

References primID, and theHC.

Referenced by createNewHit(), and createNewHitEvo().

◆ update()

void TotemSD::update ( const BeginOfEvent )
overrideprotectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 156 of file TotemSD.cc.

156  {
157  LogDebug("ForwardSim") << " Dispatched BeginOfEvent for " << GetName() << " !";
158  clearHits();
159 }

References clearHits(), and LogDebug.

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

◆ updateHit()

void TotemSD::updateHit ( )
private

Definition at line 422 of file TotemSD.cc.

422  {
423  //
424  if (Eloss > 0.) {
425 #ifdef debug
426  LogDebug("ForwardSim") << "G4TotemT1SD updateHit: add eloss " << Eloss << "\nCurrentHit=" << currentHit
427  << ", PostStepPoint=" << postStepPoint->GetPosition();
428 #endif
429 
431  }
432 
433  // buffer for next steps:
434  tsID = tSliceID;
435  primID = primaryID;
437 }

References currentHit, Eloss, LogDebug, postStepPoint, previousUnitID, primaryID, primID, TotemG4Hit::setEnergyLoss(), tsID, tSliceID, and unitID.

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

Member Data Documentation

◆ currentHit

TotemG4Hit* TotemSD::currentHit
private

Definition at line 94 of file TotemSD.h.

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

◆ currentPV

G4VPhysicalVolume* TotemSD::currentPV
private

Definition at line 96 of file TotemSD.h.

Referenced by createNewHit(), and getStepInfo().

◆ edeposit

float TotemSD::edeposit
private

Definition at line 103 of file TotemSD.h.

Referenced by getStepInfo(), and ProcessHits().

◆ Eloss

float TotemSD::Eloss
private

Definition at line 109 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), getStepInfo(), and updateHit().

◆ entrancePoint

G4ThreeVector TotemSD::entrancePoint
private

Definition at line 85 of file TotemSD.h.

Referenced by resetForNewPrimary().

◆ hcID

G4int TotemSD::hcID
private

Definition at line 89 of file TotemSD.h.

Referenced by Initialize().

◆ hitPoint

G4ThreeVector TotemSD::hitPoint
private

Definition at line 104 of file TotemSD.h.

Referenced by getStepInfo(), and resetForNewPrimary().

◆ incidentEnergy

float TotemSD::incidentEnergy
private

Definition at line 86 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), and resetForNewPrimary().

◆ numberingScheme

TotemVDetectorOrganization* TotemSD::numberingScheme
private

Definition at line 78 of file TotemSD.h.

Referenced by setDetUnitId(), TotemSD(), and ~TotemSD().

◆ Pabs

float TotemSD::Pabs
private

Definition at line 107 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), and getStepInfo().

◆ ParentId

int TotemSD::ParentId
private

Definition at line 115 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), getStepInfo(), and ProcessHits().

◆ ParticleType

short TotemSD::ParticleType
private

Definition at line 110 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), getStepInfo(), and ProcessHits().

◆ PhiAtEntry

float TotemSD::PhiAtEntry
private

Definition at line 113 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), and getStepInfo().

◆ Posizio

G4ThreeVector TotemSD::Posizio
private

Definition at line 106 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), and getStepInfo().

◆ postStepPoint

const G4StepPoint* TotemSD::postStepPoint
private

Definition at line 102 of file TotemSD.h.

Referenced by getStepInfo(), and updateHit().

◆ preStepPoint

const G4StepPoint* TotemSD::preStepPoint
private

Definition at line 101 of file TotemSD.h.

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

◆ previousUnitID

uint32_t TotemSD::previousUnitID
private

Definition at line 97 of file TotemSD.h.

Referenced by hitExists(), and updateHit().

◆ primaryID

int TotemSD::primaryID
private

Definition at line 98 of file TotemSD.h.

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

◆ primID

G4int TotemSD::primID
private

Definition at line 87 of file TotemSD.h.

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

◆ slave

TrackingSlaveSD* TotemSD::slave
private

Definition at line 77 of file TotemSD.h.

Referenced by clearHits(), EndOfEvent(), fillHits(), TotemSD(), and ~TotemSD().

◆ theHC

TotemG4HitCollection* TotemSD::theHC
private

Definition at line 90 of file TotemSD.h.

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

◆ theManager

const SimTrackManager* TotemSD::theManager
private

Definition at line 91 of file TotemSD.h.

◆ ThetaAtEntry

float TotemSD::ThetaAtEntry
private

Definition at line 112 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), and getStepInfo().

◆ theTrack

G4Track* TotemSD::theTrack
private

Definition at line 95 of file TotemSD.h.

Referenced by createNewHit(), and getStepInfo().

◆ Tof

float TotemSD::Tof
private

Definition at line 108 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), and getStepInfo().

◆ tsID

int TotemSD::tsID
private

Definition at line 93 of file TotemSD.h.

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

◆ tSlice

double TotemSD::tSlice
private

Definition at line 99 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), and getStepInfo().

◆ tSliceID

int TotemSD::tSliceID
private

Definition at line 98 of file TotemSD.h.

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

◆ unitID

uint32_t TotemSD::unitID
private

Definition at line 97 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), getStepInfo(), hitExists(), ProcessHits(), and updateHit().

◆ Vx

float TotemSD::Vx
private

Definition at line 116 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), and getStepInfo().

◆ Vy

float TotemSD::Vy
private

Definition at line 116 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), and getStepInfo().

◆ Vz

float TotemSD::Vz
private

Definition at line 116 of file TotemSD.h.

Referenced by createNewHit(), createNewHitEvo(), and getStepInfo().

TotemG4Hit::setParticleType
void setParticleType(short i)
Definition: TotemG4Hit.cc:150
TotemG4Hit::setUnitID
void setUnitID(uint32_t i)
Definition: TotemG4Hit.cc:129
TotemG4Hit::setTof
void setTof(float e)
Definition: TotemG4Hit.cc:148
TotemSD::posizioEvo
G4ThreeVector posizioEvo(const G4ThreeVector &, double, double, double, double, int &)
Definition: TotemSD.cc:328
TotemSD::previousUnitID
uint32_t previousUnitID
Definition: TotemSD.h:97
TotemSD::incidentEnergy
float incidentEnergy
Definition: TotemSD.h:86
TotemSD::hcID
G4int hcID
Definition: TotemSD.h:89
TotemSD::slave
TrackingSlaveSD * slave
Definition: TotemSD.h:77
TotemG4Hit::getThetaAtEntry
float getThetaAtEntry() const
Definition: TotemG4Hit.cc:152
TotemSD::Eloss
float Eloss
Definition: TotemSD.h:109
TotemT1NumberingScheme
Definition: TotemT1NumberingScheme.h:28
TotemG4Hit::setTimeSlice
void setTimeSlice(double d)
Definition: TotemG4Hit.cc:132
TotemG4Hit::getTrackID
int getTrackID() const
Definition: TotemG4Hit.cc:125
TotemG4Hit::getUnitID
uint32_t getUnitID() const
Definition: TotemG4Hit.cc:128
TotemG4Hit::getEntry
math::XYZPoint getEntry() const
Definition: TotemG4Hit.cc:114
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TotemG4Hit::setVy
void setVy(float p)
Definition: TotemG4Hit.cc:174
TotemSD::theManager
const SimTrackManager * theManager
Definition: TotemSD.h:91
TotemG4Hit::setParentId
void setParentId(int p)
Definition: TotemG4Hit.cc:168
TotemSD::Tof
float Tof
Definition: TotemSD.h:108
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
TotemG4Hit::setEntry
void setEntry(double x, double y, double z)
Definition: TotemG4Hit.h:55
TotemSD::resetForNewPrimary
void resetForNewPrimary()
Definition: TotemSD.cc:450
TotemRPNumberingScheme
Definition: TotemRPNumberingScheme.h:28
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
TotemSD::Pabs
float Pabs
Definition: TotemSD.h:107
TotemSD::ThetaAtEntry
float ThetaAtEntry
Definition: TotemSD.h:112
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
TotemSD::hitPoint
G4ThreeVector hitPoint
Definition: TotemSD.h:104
TotemSD::preStepPoint
const G4StepPoint * preStepPoint
Definition: TotemSD.h:101
TotemSD::tsID
int tsID
Definition: TotemSD.h:93
TotemSD::createNewHitEvo
void createNewHitEvo()
Definition: TotemSD.cc:291
TotemG4Hit::setTrackID
void setTrackID(int i)
Definition: TotemG4Hit.cc:126
TotemG4Hit::setEnergyLoss
void setEnergyLoss(float e)
Definition: TotemG4Hit.cc:149
TotemSD::tSlice
double tSlice
Definition: TotemSD.h:99
TotemG4Hit::setPhiAtEntry
void setPhiAtEntry(float f)
Definition: TotemG4Hit.cc:156
TotemG4Hit::getTimeSliceID
int getTimeSliceID() const
Definition: TotemG4Hit.cc:133
TotemSD::currentHit
TotemG4Hit * currentHit
Definition: TotemSD.h:94
TotemSD::getStepInfo
void getStepInfo(const G4Step *aStep)
Definition: TotemSD.cc:170
TotemG4Hit::getPhiAtEntry
float getPhiAtEntry() const
Definition: TotemG4Hit.cc:153
SensitiveTkDetector::SensitiveTkDetector
SensitiveTkDetector(const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
Definition: SensitiveTkDetector.h:10
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
TotemG4Hit::getPabs
float getPabs() const
Definition: TotemG4Hit.cc:142
TotemG4Hit::getTof
float getTof() const
Definition: TotemG4Hit.cc:143
TotemSD::PhiAtEntry
float PhiAtEntry
Definition: TotemSD.h:113
Point3DBase< float, LocalTag >
bysipixelclustmulteventfilter_cfi.collectionName
collectionName
Definition: bysipixelclustmulteventfilter_cfi.py:5
TotemG4Hit::setVx
void setVx(float p)
Definition: TotemG4Hit.cc:171
TotemSD::Posizio
G4ThreeVector Posizio
Definition: TotemSD.h:106
TotemSD::updateHit
void updateHit()
Definition: TotemSD.cc:422
TrackingSlaveSD::Initialize
virtual void Initialize()
Definition: TrackingSlaveSD.cc:17
TotemSD::storeHit
void storeHit(TotemG4Hit *)
Definition: TotemSD.cc:439
TotemSD::currentPV
G4VPhysicalVolume * currentPV
Definition: TotemSD.h:96
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
TotemSD::theHC
TotemG4HitCollection * theHC
Definition: TotemSD.h:90
TrackingSlaveSD::processHits
virtual bool processHits(const PSimHit &)
Definition: TrackingSlaveSD.cc:52
TotemSD::createNewHit
void createNewHit()
Definition: TotemSD.cc:246
GeV
const double GeV
Definition: MathUtil.h:16
TotemSD::setToLocal
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
Definition: TotemSD.cc:163
createfilelist.int
int
Definition: createfilelist.py:10
TotemSD::Vx
float Vx
Definition: TotemSD.h:116
TotemG4Hit::setThetaAtEntry
void setThetaAtEntry(float t)
Definition: TotemG4Hit.cc:155
TotemG4Hit::setVz
void setVz(float p)
Definition: TotemG4Hit.cc:177
TrackingSlaveSD
Definition: TrackingSlaveSD.h:11
TotemSD::ParticleType
short ParticleType
Definition: TotemSD.h:110
TotemSD::tSliceID
int tSliceID
Definition: TotemSD.h:98
TotemG4HitCollection
G4THitsCollection< TotemG4Hit > TotemG4HitCollection
Definition: TotemG4HitCollection.h:26
TotemSD::numberingScheme
TotemVDetectorOrganization * numberingScheme
Definition: TotemSD.h:78
TotemSD::Vy
float Vy
Definition: TotemSD.h:116
cc
TotemSD::hitExists
bool hitExists()
Definition: TotemSD.cc:207
TotemSD::postStepPoint
const G4StepPoint * postStepPoint
Definition: TotemSD.h:102
TotemSD::clearHits
void clearHits() override
Definition: TotemSD.cc:161
TotemSD::primID
G4int primID
Definition: TotemSD.h:87
TotemSD::primaryID
int primaryID
Definition: TotemSD.h:98
TotemSD::entrancePoint
G4ThreeVector entrancePoint
Definition: TotemSD.h:85
TotemG4Hit::getEnergyLoss
float getEnergyLoss() const
Definition: TotemG4Hit.cc:144
TotemG4Hit::getParticleType
int getParticleType() const
Definition: TotemG4Hit.cc:145
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
TotemSD::Vz
float Vz
Definition: TotemSD.h:116
TotemSD::edeposit
float edeposit
Definition: TotemSD.h:103
TrackingSlaveSD::name
std::string name() const
Definition: TrackingSlaveSD.h:21
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrackingSlaveSD::hits
std::vector< PSimHit > & hits()
Definition: TrackingSlaveSD.h:22
TotemG4Hit
Definition: TotemG4Hit.h:39
TotemVDetectorOrganization::getUnitID
virtual uint32_t getUnitID(const G4Step *aStep) const =0
TotemSD::theTrack
G4Track * theTrack
Definition: TotemSD.h:95
PSimHit
Definition: PSimHit.h:15
PbPb_ZMuSkimMuonDPG_cff.particleType
particleType
Definition: PbPb_ZMuSkimMuonDPG_cff.py:27
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TotemSD::ParentId
int ParentId
Definition: TotemSD.h:115
TotemSD::unitID
uint32_t unitID
Definition: TotemSD.h:97
TotemT2NumberingSchemeGem
Definition: TotemT2NumberingSchemeGem.h:28
TotemG4Hit::setPabs
void setPabs(float e)
Definition: TotemG4Hit.cc:147
TotemG4Hit::setIncidentEnergy
void setIncidentEnergy(double e)
Definition: TotemG4Hit.cc:123
TotemSD::setDetUnitId
uint32_t setDetUnitId(const G4Step *) override
Definition: TotemSD.cc:102
hit
Definition: SiStripHitEffFromCalibTree.cc:88