CMS 3D CMS Logo

CaloSD.cc
Go to the documentation of this file.
1 // File: CaloSD.cc
3 // Description: Sensitive Detector class for calorimeters
5 
11 
12 #include "G4EventManager.hh"
13 #include "G4SDManager.hh"
14 #include "G4Step.hh"
15 #include "G4Track.hh"
16 #include "G4VProcess.hh"
17 #include "G4GFlashSpot.hh"
18 #include "G4ParticleTable.hh"
19 
20 #include "G4SystemOfUnits.hh"
21 #include "G4PhysicalConstants.hh"
22 
23 #include <fstream>
24 
25 //#define EDM_ML_DEBUG
26 
28  const edm::EventSetup& es,
29  const SensitiveDetectorCatalog& clg,
30  edm::ParameterSet const& p,
31  const SimTrackManager* manager,
32  float timeSliceUnit,
33  bool ignoreTkID)
34  : SensitiveCaloDetector(name, es, clg, p),
35  G4VGFlashSensitiveDetector(),
36  eminHit(0.),
37  currentHit(nullptr),
38  m_trackManager(manager),
39  theHC(nullptr),
40  ignoreTrackID(ignoreTkID),
41  hcID(-1),
42  timeSlice(timeSliceUnit),
43  eminHitD(0.) {
44  //Parameters
45  edm::ParameterSet m_CaloSD = p.getParameter<edm::ParameterSet>("CaloSD");
46  energyCut = m_CaloSD.getParameter<double>("EminTrack") * CLHEP::GeV;
47  tmaxHit = m_CaloSD.getParameter<double>("TmaxHit") * CLHEP::ns;
48  std::vector<double> eminHits = m_CaloSD.getParameter<std::vector<double>>("EminHits");
49  std::vector<double> tmaxHits = m_CaloSD.getParameter<std::vector<double>>("TmaxHits");
50  std::vector<std::string> hcn = m_CaloSD.getParameter<std::vector<std::string>>("HCNames");
51  std::vector<int> useResMap = m_CaloSD.getParameter<std::vector<int>>("UseResponseTables");
52  std::vector<double> eminHitX = m_CaloSD.getParameter<std::vector<double>>("EminHitsDepth");
53  suppressHeavy = m_CaloSD.getParameter<bool>("SuppressHeavy");
54  kmaxIon = m_CaloSD.getParameter<double>("IonThreshold") * CLHEP::MeV;
55  kmaxProton = m_CaloSD.getParameter<double>("ProtonThreshold") * CLHEP::MeV;
56  kmaxNeutron = m_CaloSD.getParameter<double>("NeutronThreshold") * CLHEP::MeV;
57  nCheckedHits = m_CaloSD.getUntrackedParameter<int>("CheckHits", 25);
58  useMap = m_CaloSD.getUntrackedParameter<bool>("UseMap", true);
59  int verbn = m_CaloSD.getUntrackedParameter<int>("Verbosity", 0);
60  corrTOFBeam = m_CaloSD.getParameter<bool>("CorrectTOFBeam");
61  double beamZ = m_CaloSD.getParameter<double>("BeamPosition") * CLHEP::cm;
62  correctT = beamZ / CLHEP::c_light / CLHEP::nanosecond;
63  useFineCaloID_ = m_CaloSD.getParameter<bool>("UseFineCaloID");
64 
65  SetVerboseLevel(verbn);
66  meanResponse.reset(nullptr);
67  for (unsigned int k = 0; k < hcn.size(); ++k) {
68  if (name == hcn[k]) {
69  if (k < eminHits.size())
70  eminHit = eminHits[k] * CLHEP::MeV;
71  if (k < eminHitX.size())
72  eminHitD = eminHitX[k] * CLHEP::MeV;
73  if (k < tmaxHits.size())
74  tmaxHit = tmaxHits[k] * CLHEP::ns;
75  if (k < useResMap.size() && useResMap[k] > 0) {
76  meanResponse.reset(new CaloMeanResponse(p));
77  break;
78  }
79  }
80  }
81  slave.reset(new CaloSlaveSD(name));
82 
85  isParameterized = false;
86 
87  entrancePoint.set(0., 0., 0.);
88  entranceLocal.set(0., 0., 0.);
89  posGlobal.set(0., 0., 0.);
91 
93  forceSave = false;
94 
95  edm::LogVerbatim("CaloSim") << "CaloSD: Minimum energy of track for saving it " << energyCut / CLHEP::GeV
96  << " GeV\n Use of HitID Map " << useMap << "\n Check last " << nCheckedHits
97  << " before saving the hit\n Correct TOF globally by " << correctT
98  << " ns (Flag =" << corrTOFBeam << ")\n Save hits recorded before " << tmaxHit
99  << " ns and if energy is above " << eminHit / CLHEP::MeV << " MeV (for depth 0) or "
100  << eminHitD / CLHEP::MeV << " MeV (for nonzero depths);\n Time Slice Unit "
101  << timeSlice << "\nIgnore TrackID Flag " << ignoreTrackID << " UseFineCaloID flag "
102  << useFineCaloID_;
103 }
104 
106 
107 G4bool CaloSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) {
108  NaNTrap(aStep);
109 
110 #ifdef EDM_ML_DEBUG
111  edm::LogVerbatim("CaloSim") << "CaloSD::" << GetName() << " ID= " << aStep->GetTrack()->GetTrackID()
112  << " prID= " << aStep->GetTrack()->GetParentID()
113  << " Eprestep= " << aStep->GetPreStepPoint()->GetKineticEnergy()
114  << " step= " << aStep->GetStepLength() << " Edep= " << aStep->GetTotalEnergyDeposit();
115 #endif
116  // apply shower library or parameterisation
117  if (isParameterized) {
118  if (getFromLibrary(aStep)) {
119  // for parameterized showers the primary track should be killed
120  aStep->GetTrack()->SetTrackStatus(fStopAndKill);
121  auto tv = aStep->GetSecondary();
122  auto vol = aStep->GetPreStepPoint()->GetPhysicalVolume();
123  for (auto& tk : *tv) {
124  if (tk->GetVolume() == vol) {
125  tk->SetTrackStatus(fStopAndKill);
126  }
127  }
128  return true;
129  }
130  }
131 
132  // ignore steps without energy deposit
133  edepositEM = edepositHAD = 0.f;
134  unsigned int unitID = setDetUnitId(aStep);
135  auto const theTrack = aStep->GetTrack();
136  uint16_t depth = getDepth(aStep);
137 
138  double time = theTrack->GetGlobalTime() / nanosecond;
139  int primaryID = getTrackID(theTrack);
140  if (unitID > 0) {
141  currentID.setID(unitID, time, primaryID, depth);
142  } else {
143  if (aStep->GetTotalEnergyDeposit() > 0.0) {
144  const G4TouchableHistory* touch = static_cast<const G4TouchableHistory*>(theTrack->GetTouchable());
145  edm::LogVerbatim("CaloSim") << "CaloSD::ProcessHits: unitID= " << unitID << " currUnit= " << currentID.unitID()
146  << " Detector: " << GetName() << " trackID= " << theTrack->GetTrackID() << " "
147  << theTrack->GetDefinition()->GetParticleName()
148  << "\n Edep= " << aStep->GetTotalEnergyDeposit()
149  << " PV: " << touch->GetVolume(0)->GetName()
150  << " PVid= " << touch->GetReplicaNumber(0) << " MVid= " << touch->GetReplicaNumber(1);
151  }
152  return false;
153  }
154 
155  if (aStep->GetTotalEnergyDeposit() == 0.0) {
156  return false;
157  }
158 
159  double energy = getEnergyDeposit(aStep);
160  if (energy > 0.0) {
162  edepositEM = energy;
163  } else {
165  }
166 #ifdef EDM_ML_DEBUG
167  G4TouchableHistory* touch = (G4TouchableHistory*)(theTrack->GetTouchable());
168  edm::LogVerbatim("CaloSim") << "CaloSD::" << GetName() << " PV:" << touch->GetVolume(0)->GetName()
169  << " PVid=" << touch->GetReplicaNumber(0) << " MVid=" << touch->GetReplicaNumber(1)
170  << " Unit:" << std::hex << unitID << std::dec << " Edep=" << edepositEM << " "
171  << edepositHAD << " ID=" << theTrack->GetTrackID() << " pID=" << theTrack->GetParentID()
172  << " E=" << theTrack->GetKineticEnergy() << " S=" << aStep->GetStepLength() << "\n "
173  << theTrack->GetDefinition()->GetParticleName() << " primaryID= " << primaryID
174  << " currentID= (" << currentID << ") previousID= (" << previousID << ")";
175 #endif
176  if (!hitExists(aStep)) {
177  currentHit = createNewHit(aStep, aStep->GetTrack());
178  }
179  return true;
180  }
181  return false;
182 }
183 
184 bool CaloSD::ProcessHits(G4GFlashSpot* aSpot, G4TouchableHistory*) {
185  edepositEM = edepositHAD = 0.f;
186  const G4Track* track = aSpot->GetOriginatorTrack()->GetPrimaryTrack();
188  return false;
189  }
190  double edep = aSpot->GetEnergySpot()->GetEnergy();
191  if (edep <= 0.0) {
192  return false;
193  }
194  edepositEM = edep;
195  G4Step fFakeStep;
196  G4StepPoint* fFakePreStepPoint = fFakeStep.GetPreStepPoint();
197  G4StepPoint* fFakePostStepPoint = fFakeStep.GetPostStepPoint();
198  fFakePreStepPoint->SetPosition(aSpot->GetPosition());
199  fFakePostStepPoint->SetPosition(aSpot->GetPosition());
200 
201  G4TouchableHandle fTouchableHandle = aSpot->GetTouchableHandle();
202  fFakePreStepPoint->SetTouchableHandle(fTouchableHandle);
203  fFakeStep.SetTotalEnergyDeposit(edep);
204 
205  unsigned int unitID = setDetUnitId(&fFakeStep);
206 
207  if (unitID > 0) {
208  double time = 0;
209  int primaryID = getTrackID(track);
210  uint16_t depth = getDepth(&fFakeStep);
211  currentID.setID(unitID, time, primaryID, depth);
212 #ifdef EDM_ML_DEBUG
213  edm::LogVerbatim("CaloSim") << "CaloSD:: GetSpotInfo for Unit 0x" << std::hex << currentID.unitID() << std::dec
214  << " Edeposit = " << edepositEM << " " << edepositHAD;
215 #endif
216  // Update if in the same detector, time-slice and for same track
217  if (currentID == previousID) {
219  } else {
220  posGlobal = aSpot->GetEnergySpot()->GetPosition();
221  // Reset entry point for new primary
222  if (currentID.trackID() != previousID.trackID()) {
223  entrancePoint = aSpot->GetPosition();
224  entranceLocal = aSpot->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(entrancePoint);
225  incidentEnergy = track->GetKineticEnergy();
226 #ifdef EDM_ML_DEBUG
227  edm::LogVerbatim("CaloSim") << "CaloSD: Incident energy " << incidentEnergy / CLHEP::GeV << " GeV and"
228  << " entrance point " << entrancePoint << " (Global) " << entranceLocal
229  << " (Local)";
230 #endif
231  }
232  if (!checkHit()) {
233  currentHit = createNewHit(&fFakeStep, track);
234  }
235  }
236  return true;
237  }
238  return false;
239 }
240 
241 double CaloSD::getEnergyDeposit(const G4Step* aStep) { return aStep->GetTotalEnergyDeposit(); }
242 
243 bool CaloSD::getFromLibrary(const G4Step*) { return false; }
244 
245 void CaloSD::Initialize(G4HCofThisEvent* HCE) {
246  totalHits = 0;
247 
248 #ifdef EDM_ML_DEBUG
249  edm::LogVerbatim("CaloSim") << "CaloSD : Initialize called for " << GetName();
250 #endif
251 
252  //This initialization is performed at the beginning of an event
253  //------------------------------------------------------------
254  theHC = new CaloG4HitCollection(GetName(), collectionName[0]);
255 
256  if (hcID < 0) {
257  hcID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
258  }
259  //theHC ownership is transfered here to HCE
260  HCE->AddHitsCollection(hcID, theHC);
261 }
262 
263 void CaloSD::EndOfEvent(G4HCofThisEvent*) {
264  // clean the hits for the last tracks
265 
267 
268 #ifdef EDM_ML_DEBUG
269  edm::LogVerbatim("CaloSim") << "CaloSD: EndofEvent entered with " << theHC->entries() << " entries";
270 #endif
271 }
272 
273 void CaloSD::clear() {}
274 
276 
278 #ifdef EDM_ML_DEBUG
279  edm::LogVerbatim("CaloSim") << "CaloSD: Collection " << theHC->GetName();
280 #endif
281  theHC->PrintAllHits();
282 }
283 
285  if (slave.get()->name() == hname) {
286  cc = slave.get()->hits();
287  }
288  slave.get()->Clean();
289 }
290 
291 G4ThreeVector CaloSD::setToLocal(const G4ThreeVector& global, const G4VTouchable* touch) const {
292  return touch->GetHistory()->GetTopTransform().TransformPoint(global);
293 }
294 
295 G4ThreeVector CaloSD::setToGlobal(const G4ThreeVector& local, const G4VTouchable* touch) const {
296  return touch->GetHistory()->GetTopTransform().Inverse().TransformPoint(local);
297 }
298 
299 bool CaloSD::hitExists(const G4Step* aStep) {
300  // Update if in the same detector, time-slice and for same track
301  if (currentID == previousID) {
303  return true;
304  }
305 
306  // Reset entry point for new primary
307  posGlobal = aStep->GetPreStepPoint()->GetPosition();
308  if (currentID.trackID() != previousID.trackID()) {
309  resetForNewPrimary(aStep);
310  }
311  return checkHit();
312 }
313 
315  //look in the HitContainer whether a hit with the same ID already exists:
316  bool found = false;
317  if (useMap) {
318  std::map<CaloHitID, CaloG4Hit*>::const_iterator it = hitMap.find(currentID);
319  if (it != hitMap.end()) {
320  currentHit = it->second;
321  found = true;
322  }
323  } else if (nCheckedHits > 0) {
324  int nhits = theHC->entries();
325  int minhit = std::max(nhits - nCheckedHits, 0);
326  int maxhit = nhits - 1;
327 
328  for (int j = maxhit; j > minhit; --j) {
329  if ((*theHC)[j]->getID() == currentID) {
330  currentHit = (*theHC)[j];
331  found = true;
332  break;
333  }
334  }
335  }
336 
337  if (found) {
339  }
340  return found;
341 }
342 
343 int CaloSD::getNumberOfHits() { return theHC->entries(); }
344 
345 CaloG4Hit* CaloSD::createNewHit(const G4Step* aStep, const G4Track* theTrack) {
346 #ifdef EDM_ML_DEBUG
347  edm::LogVerbatim("CaloSim") << "CaloSD::CreateNewHit " << getNumberOfHits() << " for " << GetName()
348  << " Unit:" << currentID.unitID() << " " << currentID.depth() << " Edep= " << edepositEM
349  << " " << edepositHAD << " primaryID= " << currentID.trackID()
350  << " timeSlice= " << currentID.timeSliceID() << " ID= " << theTrack->GetTrackID() << " "
351  << theTrack->GetDefinition()->GetParticleName()
352  << " E(GeV)= " << theTrack->GetKineticEnergy() / CLHEP::GeV
353  << " parentID= " << theTrack->GetParentID() << "\n Ein= " << incidentEnergy
354  << " entranceGlobal: " << entrancePoint << " entranceLocal: " << entranceLocal
355  << " posGlobal: " << posGlobal;
356 #endif
357 
358  CaloG4Hit* aHit;
359  if (!reusehit.empty()) {
360  aHit = reusehit.back().release();
361  aHit->setEM(0.f);
362  aHit->setHadr(0.f);
363  reusehit.pop_back();
364  } else {
365  aHit = new CaloG4Hit;
366  }
367 
368  aHit->setID(currentID);
369  aHit->setEntry(entrancePoint.x(), entrancePoint.y(), entrancePoint.z());
371  aHit->setPosition(posGlobal.x(), posGlobal.y(), posGlobal.z());
373  updateHit(aHit);
374 
375  storeHit(aHit);
376  double etrack = 0;
377  if (currentID.trackID() == primIDSaved) { // The track is saved; nothing to be done
378  } else if (currentID.trackID() == theTrack->GetTrackID()) {
379  etrack = theTrack->GetKineticEnergy();
380 #ifdef EDM_ML_DEBUG
381  edm::LogVerbatim("CaloSim") << "CaloSD: set save the track " << currentID.trackID() << " etrack " << etrack
382  << " eCut " << energyCut << " force: " << forceSave
383  << " save: " << (etrack >= energyCut || forceSave);
384 #endif
385  if (etrack >= energyCut || forceSave) {
386  TrackInformation* trkInfo = cmsTrackInformation(theTrack);
387  trkInfo->storeTrack(true);
388  trkInfo->putInHistory();
389  }
390  } else {
392 #ifdef EDM_ML_DEBUG
393  edm::LogVerbatim("CaloSim") << "CaloSD : TrackwithHistory pointer for " << currentID.trackID() << " is " << trkh;
394 #endif
395  if (trkh != nullptr) {
396  etrack = sqrt(trkh->momentum().Mag2());
397  if (etrack >= energyCut) {
398  trkh->save();
399 #ifdef EDM_ML_DEBUG
400  edm::LogVerbatim("CaloSim") << "CaloSD: set save the track " << currentID.trackID() << " with Hit";
401 #endif
402  }
403  }
404  }
406  if (useMap)
407  ++totalHits;
408  return aHit;
409 }
410 
413 #ifdef EDM_ML_DEBUG
414  edm::LogVerbatim("CaloSim") << "CaloSD:" << GetName() << " Add energy deposit in " << currentID
415  << " Edep_em(MeV)= " << edepositEM << " Edep_had(MeV)= " << edepositHAD;
416 #endif
417 
418  // buffer for next steps:
420 }
421 
422 void CaloSD::resetForNewPrimary(const G4Step* aStep) {
423  auto const preStepPoint = aStep->GetPreStepPoint();
424  entrancePoint = preStepPoint->GetPosition();
425  entranceLocal = setToLocal(entrancePoint, preStepPoint->GetTouchable());
426  incidentEnergy = preStepPoint->GetKineticEnergy();
427 #ifdef EDM_ML_DEBUG
428  edm::LogVerbatim("CaloSim") << "CaloSD::resetForNewPrimary for " << GetName()
429  << " ID= " << aStep->GetTrack()->GetTrackID() << " Ein= " << incidentEnergy / CLHEP::GeV
430  << " GeV and"
431  << " entrance point global: " << entrancePoint << " local: " << entranceLocal;
432 #endif
433 }
434 
435 double CaloSD::getAttenuation(const G4Step* aStep, double birk1, double birk2, double birk3) const {
436  double weight = 1.;
437  double charge = aStep->GetPreStepPoint()->GetCharge();
438  double length = aStep->GetStepLength();
439 
440  if (charge != 0. && length > 0.) {
441  double density = aStep->GetPreStepPoint()->GetMaterial()->GetDensity();
442  double dedx = aStep->GetTotalEnergyDeposit() / length;
443  double rkb = birk1 / density;
444  double c = birk2 * rkb * rkb;
445  if (std::abs(charge) >= 2.)
446  rkb /= birk3; // based on alpha particle data
447  weight = 1. / (1. + rkb * dedx + c * dedx * dedx);
448 #ifdef EDM_ML_DEBUG
449  edm::LogVerbatim("CaloSim") << "CaloSD::getAttenuation in " << aStep->GetPreStepPoint()->GetMaterial()->GetName()
450  << " Charge " << charge << " dE/dx " << dedx << " Birk Const " << rkb << ", " << c
451  << " Weight = " << weight << " dE " << aStep->GetTotalEnergyDeposit();
452 #endif
453  }
454  return weight;
455 }
456 
457 void CaloSD::update(const BeginOfRun*) { initRun(); }
458 
459 void CaloSD::update(const BeginOfEvent* g4Event) {
460 #ifdef EDM_ML_DEBUG
461  edm::LogVerbatim("CaloSim") << "CaloSD: Dispatched BeginOfEvent for " << GetName() << " !";
462 #endif
463  clearHits();
464  initEvent(g4Event);
465 }
466 
467 void CaloSD::update(const EndOfTrack* trk) {
468  int id = (*trk)()->GetTrackID();
469  TrackInformation* trkI = cmsTrackInformation((*trk)());
470  int lastTrackID = -1;
471  if (trkI)
472  lastTrackID = trkI->getIDonCaloSurface();
473  if (id == lastTrackID) {
474  const TrackContainer* trksForThisEvent = m_trackManager->trackContainer();
475  if (trksForThisEvent != nullptr) {
476  int it = (int)(trksForThisEvent->size()) - 1;
477  if (it >= 0) {
478  TrackWithHistory* trkH = (*trksForThisEvent)[it];
479  if (trkH->trackID() == (unsigned int)(id))
480  tkMap[id] = trkH;
481 #ifdef EDM_ML_DEBUG
482  edm::LogVerbatim("CaloSim") << "CaloSD: get track " << it << " from Container of size "
483  << trksForThisEvent->size() << " with ID " << trkH->trackID();
484  } else {
485  edm::LogVerbatim("CaloSim") << "CaloSD: get track " << it << " from Container of size "
486  << trksForThisEvent->size() << " with no ID";
487 #endif
488  }
489  }
490  }
491 }
492 
493 void CaloSD::update(const ::EndOfEvent*) {
494  endEvent();
495  slave.get()->ReserveMemory(theHC->entries());
496 
497  int count(0);
498  int wrong(0);
499  double eEM(0.0);
500  double eHAD(0.0);
501  double eEM2(0.0);
502  double eHAD2(0.0);
503  double tt(0.0);
504  double zloc(0.0);
505  double zglob(0.0);
506  double ee(0.0);
507  int hc_entries = theHC->entries();
508  for (int i = 0; i < hc_entries; ++i) {
509  if (!saveHit((*theHC)[i])) {
510  ++wrong;
511  }
512  ++count;
513  double x = (*theHC)[i]->getEM();
514  eEM += x;
515  eEM2 += x * x;
516  x = (*theHC)[i]->getHadr();
517  eHAD += x;
518  eHAD2 += x * x;
519  tt += (*theHC)[i]->getTimeSlice();
520  ee += (*theHC)[i]->getIncidentEnergy();
521  zglob += std::abs((*theHC)[i]->getEntry().z());
522  zloc += std::abs((*theHC)[i]->getEntryLocal().z());
523  }
524 
525  double norm = (count > 0) ? 1.0 / count : 0.0;
526  eEM *= norm;
527  eEM2 *= norm;
528  eHAD *= norm;
529  eHAD2 *= norm;
530  eEM2 = std::sqrt(eEM2 - eEM * eEM);
531  eHAD2 = std::sqrt(eHAD2 - eHAD * eHAD);
532  tt *= norm;
533  ee *= norm;
534  zglob *= norm;
535  zloc *= norm;
536 
537 #ifdef EDM_ML_DEBUG
538  edm::LogVerbatim("CaloSim") << "CaloSD: " << GetName() << " store " << count << " hits; " << wrong
539  << " track IDs not given properly and " << totalHits - count
540  << " hits not passing cuts\n EmeanEM= " << eEM << " ErmsEM= " << eEM2
541  << "\n EmeanHAD= " << eHAD << " ErmsHAD= " << eHAD2 << " TimeMean= " << tt
542  << " E0mean= " << ee << " Zglob= " << zglob << " Zloc= " << zloc << " ";
543 #endif
544  tkMap.erase(tkMap.begin(), tkMap.end());
545  std::vector<std::unique_ptr<CaloG4Hit>>().swap(reusehit);
546  if (useMap)
547  hitMap.erase(hitMap.begin(), hitMap.end());
548 }
549 
551  cleanIndex = 0;
552  previousID.reset();
553  primIDSaved = -99;
554 #ifdef EDM_ML_DEBUG
555  edm::LogVerbatim("CaloSim") << "CaloSD: Clears hit vector for " << GetName()
556  << " and initialise slave: " << slave.get()->name();
557 #endif
558  slave.get()->Initialize();
559 }
560 
562  if (fpCaloG4HitAllocator) {
563  fpCaloG4HitAllocator->ResetStorage();
564  }
565 }
566 
568 
570 
572 
573 int CaloSD::getTrackID(const G4Track* aTrack) {
574  int primaryID = 0;
575  forceSave = false;
576  TrackInformation* trkInfo = cmsTrackInformation(aTrack);
577  if (trkInfo) {
578  primaryID = (useFineCaloID_) ? trkInfo->getIDfineCalo() : trkInfo->getIDonCaloSurface();
579 #ifdef EDM_ML_DEBUG
580  edm::LogVerbatim("CaloSim") << "Track ID: " << trkInfo->getIDfineCalo() << ":" << trkInfo->getIDonCaloSurface()
581  << ":" << aTrack->GetTrackID() << ":" << primaryID;
582 #endif
583  } else {
584  primaryID = aTrack->GetTrackID();
585 #ifdef EDM_ML_DEBUG
586  edm::LogWarning("CaloSim") << "CaloSD: Problem with primaryID **** set by force to TkID **** " << primaryID;
587 #endif
588  }
589  return primaryID;
590 }
591 
592 int CaloSD::setTrackID(const G4Step* aStep) {
593  auto const theTrack = aStep->GetTrack();
594  TrackInformation* trkInfo = cmsTrackInformation(theTrack);
595  int primaryID = (useFineCaloID_) ? trkInfo->getIDfineCalo() : trkInfo->getIDonCaloSurface();
596  if (primaryID <= 0) {
597  primaryID = theTrack->GetTrackID();
598  }
599 #ifdef EDM_ML_DEBUG
600  edm::LogVerbatim("CaloSim") << "Track ID: " << trkInfo->getIDfineCalo() << ":" << trkInfo->getIDonCaloSurface() << ":"
601  << theTrack->GetTrackID() << ":" << primaryID;
602 #endif
603 
604  if (primaryID != previousID.trackID()) {
605  resetForNewPrimary(aStep);
606  }
607 #ifdef EDM_ML_DEBUG
608  edm::LogVerbatim("CaloSim") << "CaloSD::setTrackID for " << GetName()
609  << " trackID= " << aStep->GetTrack()->GetTrackID() << " primaryID= " << primaryID;
610 #endif
611  return primaryID;
612 }
613 
614 uint16_t CaloSD::getDepth(const G4Step*) { return 0; }
615 
617  double emin(eminHit);
618  if (hit->getDepth() > 0)
619  emin = eminHitD;
620 #ifdef EDM_ML_DEBUG
621  edm::LogVerbatim("CaloSim") << "CaloSD::filterHit(..) Depth " << hit->getDepth() << " Emin = " << emin << " ("
622  << eminHit << ", " << eminHitD << ")";
623 #endif
624  return ((time <= tmaxHit) && (hit->getEnergyDeposit() > emin));
625 }
626 
627 double CaloSD::getResponseWt(const G4Track* aTrack) {
628  double wt = 1.0;
629  if (meanResponse.get()) {
630  TrackInformation* trkInfo = cmsTrackInformation(aTrack);
631  wt = meanResponse.get()->getWeight(trkInfo->genParticlePID(), trkInfo->genParticleP());
632  }
633  return wt;
634 }
635 
637  if (hit == nullptr || previousID.trackID() < 0) {
638  edm::LogWarning("CaloSim") << "CaloSD: hit to be stored is nullptr !!"
639  << " previousID.trackID()= " << previousID.trackID();
640  return;
641  }
642 
643  theHC->insert(hit);
644  if (useMap)
645  hitMap.insert(std::pair<CaloHitID, CaloG4Hit*>(previousID, hit));
646 }
647 
649  int tkID;
650  bool ok = true;
651  if (m_trackManager) {
652  tkID = m_trackManager->giveMotherNeeded(aHit->getTrackID());
653  if (tkID == 0) {
654  if (m_trackManager->trackExists(aHit->getTrackID()))
655  tkID = (aHit->getTrackID());
656  else {
657  ok = false;
658  }
659  }
660  } else {
661  tkID = aHit->getTrackID();
662  ok = false;
663  }
664 #ifdef EDM_ML_DEBUG
665  if (!ok)
666  edm::LogWarning("CaloSim") << "CaloSD:Cannot find track ID for " << aHit->getTrackID();
667  edm::LogVerbatim("CaloSim") << "CalosD: Track ID " << aHit->getTrackID() << " changed to " << tkID
668  << " by SimTrackManager Status " << ok;
669 #endif
670  double time = aHit->getTimeSlice();
671  if (corrTOFBeam)
672  time += correctT;
673  slave.get()->processHits(
674  aHit->getUnitID(), aHit->getEM() / CLHEP::GeV, aHit->getHadr() / CLHEP::GeV, time, tkID, aHit->getDepth());
675 #ifdef EDM_ML_DEBUG
676  edm::LogVerbatim("CaloSim") << "CaloSD: Store Hit at " << std::hex << aHit->getUnitID() << std::dec << " "
677  << aHit->getDepth() << " due to " << tkID << " in time " << time << " of energy "
678  << aHit->getEM() / CLHEP::GeV << " GeV (EM) and " << aHit->getHadr() / CLHEP::GeV
679  << " GeV (Hadr)";
680 #endif
681  return ok;
682 }
683 
684 void CaloSD::update(const BeginOfTrack* trk) {
685  int primary = -1;
686  TrackInformation* trkInfo = cmsTrackInformation((*trk)());
687  if (trkInfo->isPrimary())
688  primary = (*trk)()->GetTrackID();
689 
690 #ifdef EDM_ML_DEBUG
691  edm::LogVerbatim("CaloSim") << "New track: isPrimary " << trkInfo->isPrimary() << " primary ID = " << primary
692  << " primary ancestor ID " << primAncestor;
693 #endif
694 
695  // update the information if a different primary track ID
696 
697  if (primary > 0 && primary != primAncestor) {
698  primAncestor = primary;
699 
700  // clean the hits information
701 
702  if (theHC->entries() > 0)
704  }
705 }
706 
708  std::vector<CaloG4Hit*>* theCollection = theHC->GetVector();
709 
710 #ifdef EDM_ML_DEBUG
711  edm::LogVerbatim("CaloSim") << "CaloSD: collection before merging, size = " << theHC->entries();
712 #endif
713  if (reusehit.empty())
714  reusehit.reserve(theHC->entries() - cleanIndex);
715 
716  // if no map used, merge before hits to have the save situation as a map
717  if (!useMap) {
718  std::vector<CaloG4Hit*> hitvec;
719 
720  hitvec.swap(*theCollection);
721  sort((hitvec.begin() + cleanIndex), hitvec.end(), CaloG4HitLess());
722 #ifdef EDM_ML_DEBUG
723  edm::LogVerbatim("CaloSim") << "CaloSD::cleanHitCollection: sort hits in buffer starting from "
724  << "element = " << cleanIndex;
725  for (unsigned int i = 0; i < hitvec.size(); ++i)
726  edm::LogVerbatim("CaloSim") << i << " " << *hitvec[i];
727 #endif
729  for (unsigned int i = cleanIndex; i < hitvec.size(); ++i) {
730  int jump = 0;
731  for (unsigned int j = i + 1; j < hitvec.size() && equal(hitvec[i], hitvec[j]); ++j) {
732  ++jump;
733  // merge j to i
734  (*hitvec[i]).addEnergyDeposit(*hitvec[j]);
735  (*hitvec[j]).setEM(0.);
736  (*hitvec[j]).setHadr(0.);
737  reusehit.emplace_back(hitvec[j]);
738  hitvec[j] = nullptr;
739  }
740  i += jump;
741  }
742 #ifdef EDM_ML_DEBUG
743  edm::LogVerbatim("CaloSim") << "CaloSD: cleanHitCollection merge the hits in buffer ";
744  for (unsigned int i = 0; i < hitvec.size(); ++i)
745  edm::LogVerbatim("CaloSim") << i << " " << *hitvec[i];
746 #endif
747  //move all nullptr to end of list and then remove them
748  hitvec.erase(
749  std::stable_partition(hitvec.begin() + cleanIndex, hitvec.end(), [](CaloG4Hit* p) { return p != nullptr; }),
750  hitvec.end());
751 #ifdef EDM_ML_DEBUG
752  edm::LogVerbatim("CaloSim") << "CaloSD::cleanHitCollection: remove the merged hits in buffer,"
753  << " new size = " << hitvec.size();
754  for (unsigned int i = 0; i < hitvec.size(); ++i)
755  edm::LogVerbatim("CaloSim") << i << " " << *hitvec[i];
756 #endif
757  hitvec.swap(*theCollection);
758  totalHits = theHC->entries();
759  }
760 
761 #ifdef EDM_ML_DEBUG
762  edm::LogVerbatim("CaloSim") << "CaloSD: collection after merging, size= " << theHC->entries()
763  << " Size of reusehit= " << reusehit.size()
764  << "\n starting hit selection from index = " << cleanIndex;
765 #endif
766 
767  int addhit = 0;
768  for (unsigned int i = cleanIndex; i < theCollection->size(); ++i) {
769  CaloG4Hit* aHit((*theCollection)[i]);
770 
771  // selection
772 
773  double time = aHit->getTimeSlice();
774  if (corrTOFBeam)
775  time += correctT;
776  if (!filterHit(aHit, time)) {
777 #ifdef EDM_ML_DEBUG
778  edm::LogVerbatim("CaloSim") << "CaloSD: dropped CaloG4Hit "
779  << " " << *aHit;
780 #endif
781 
782  // create the list of hits to be reused
783 
784  reusehit.emplace_back((*theCollection)[i]);
785  (*theCollection)[i] = nullptr;
786  ++addhit;
787  }
788  }
789 
790 #ifdef EDM_ML_DEBUG
791  edm::LogVerbatim("CaloSim") << "CaloSD: Size of reusehit after selection = " << reusehit.size()
792  << " Number of added hit = " << addhit;
793 #endif
794  if (useMap) {
795  if (addhit > 0) {
796  int offset = reusehit.size() - addhit;
797  for (int ii = addhit - 1; ii >= 0; --ii) {
798  CaloHitID theID = reusehit[offset + ii]->getID();
799  hitMap.erase(theID);
800  }
801  }
802  }
803 
804  //move all nullptr to end of list and then remove them
805  theCollection->erase(
806  std::stable_partition(
807  theCollection->begin() + cleanIndex, theCollection->end(), [](CaloG4Hit* p) { return p != nullptr; }),
808  theCollection->end());
809 #ifdef EDM_ML_DEBUG
810  edm::LogVerbatim("CaloSim") << "CaloSD: hit collection after selection, size = " << theHC->entries();
811  theHC->PrintAllHits();
812 #endif
813 
814  cleanIndex = theHC->entries();
815 }
CaloSD::tkMap
std::map< int, TrackWithHistory * > tkMap
Definition: CaloSD.h:168
CaloSlaveSD.h
CaloSD::filterHit
virtual bool filterHit(CaloG4Hit *, double)
Definition: CaloSD.cc:616
CaloG4Hit::setIncidentEnergy
void setIncidentEnergy(double e)
Definition: CaloG4Hit.h:62
CaloSD::edepositHAD
float edepositHAD
Definition: CaloSD.h:129
SimTrackManager
Definition: SimTrackManager.h:35
CaloSD::tmaxHit
double tmaxHit
Definition: CaloSD.h:133
CaloG4Hit::getTrackID
int getTrackID() const
Definition: CaloG4Hit.h:64
mps_fire.i
i
Definition: mps_fire.py:355
CaloSD::storeHit
void storeHit(CaloG4Hit *)
Definition: CaloSD.cc:636
TrackInformation::getIDonCaloSurface
int getIDonCaloSurface() const
Definition: TrackInformation.h:39
CaloSD::setToGlobal
G4ThreeVector setToGlobal(const G4ThreeVector &, const G4VTouchable *) const
Definition: CaloSD.cc:295
CaloSD::currentHit
CaloG4Hit * currentHit
Definition: CaloSD.h:135
CaloSD::ProcessHits
G4bool ProcessHits(G4Step *step, G4TouchableHistory *) override
Definition: CaloSD.cc:107
CaloSD::kmaxProton
double kmaxProton
Definition: CaloSD.h:138
CaloSD::saveHit
bool saveHit(CaloG4Hit *)
Definition: CaloSD.cc:648
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
SensitiveDetector::NaNTrap
void NaNTrap(const G4Step *step) const
Definition: SensitiveDetector.cc:110
CaloHitID::depth
uint16_t depth() const
Definition: CaloHitID.h:24
CaloSD::useFineCaloID_
bool useFineCaloID_
Definition: CaloSD.h:165
CaloG4Hit::getUnitID
uint32_t getUnitID() const
Definition: CaloG4Hit.h:65
CaloSD::cleanIndex
int cleanIndex
Definition: CaloSD.h:157
SimTrackManager::trackExists
bool trackExists(unsigned int i) const
Definition: SimTrackManager.h:94
mps_merge.weight
weight
Definition: mps_merge.py:88
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
TrackWithHistory
Definition: TrackWithHistory.h:16
CaloSD::initRun
virtual void initRun()
Definition: CaloSD.cc:567
CaloSD::update
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
Definition: CaloSD.cc:457
CaloSD::nCheckedHits
int nCheckedHits
Definition: CaloSD.h:160
CaloHitID::trackID
int trackID() const
Definition: CaloHitID.h:23
CaloSD::getAttenuation
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
Definition: CaloSD.cc:435
CaloSD::edepositEM
float edepositEM
Definition: CaloSD.h:129
CaloSD::hitExists
bool hitExists(const G4Step *)
Definition: CaloSD.cc:299
MeV
const double MeV
CaloSlaveSD
Definition: CaloSlaveSD.h:16
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
TrackInformation::putInHistory
void putInHistory()
Definition: TrackInformation.h:33
TrackInformation::genParticlePID
int genParticlePID() const
Definition: TrackInformation.h:59
CaloHitID::unitID
uint32_t unitID() const
Definition: CaloHitID.h:20
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
CaloG4Hit::getTimeSlice
double getTimeSlice() const
Definition: CaloG4Hit.h:66
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
CaloSD::kmaxIon
double kmaxIon
Definition: CaloSD.h:138
EndOfTrack
Definition: EndOfTrack.h:6
SimTrackManager::giveMotherNeeded
int giveMotherNeeded(int i) const
Definition: SimTrackManager.h:84
G4TrackToParticleID::isGammaElectronPositron
static bool isGammaElectronPositron(int pdgCode)
Definition: G4TrackToParticleID.cc:17
CaloSD::setTrackID
virtual int setTrackID(const G4Step *)
Definition: CaloSD.cc:592
CaloG4HitEqual
Definition: CaloG4Hit.h:106
CaloSD::getResponseWt
double getResponseWt(const G4Track *)
Definition: CaloSD.cc:627
SensitiveCaloDetector
Definition: SensitiveCaloDetector.h:10
CaloSD::setDetUnitId
uint32_t setDetUnitId(const G4Step *step) override=0
CaloSD::useMap
bool useMap
Definition: CaloSD.h:152
CaloHitID::setID
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:40
TrackInformation::isPrimary
bool isPrimary() const
Definition: TrackInformation.h:23
CaloSD::setToLocal
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *) const
Definition: CaloSD.cc:291
CaloSD::isParameterized
bool isParameterized
Definition: CaloSD.h:151
fpCaloG4HitAllocator
G4ThreadLocal G4Allocator< CaloG4Hit > * fpCaloG4HitAllocator
Definition: CaloG4Hit.cc:11
CaloSD::~CaloSD
~CaloSD() override
Definition: CaloSD.cc:105
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
CaloSD::primIDSaved
int primIDSaved
Definition: CaloSD.h:159
CaloSD::PrintAll
void PrintAll() override
Definition: CaloSD.cc:277
BeginOfTrack
Definition: BeginOfTrack.h:6
CaloSD::entrancePoint
G4ThreeVector entrancePoint
Definition: CaloSD.h:125
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
TrackWithHistory::save
void save()
Definition: TrackWithHistory.h:27
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
CaloSD::posGlobal
G4ThreeVector posGlobal
Definition: CaloSD.h:127
dqmdumpme.k
k
Definition: dqmdumpme.py:60
CaloSD::clearHits
void clearHits() override
Definition: CaloSD.cc:550
CaloSD::meanResponse
std::unique_ptr< CaloMeanResponse > meanResponse
Definition: CaloSD.h:146
bysipixelclustmulteventfilter_cfi.collectionName
collectionName
Definition: bysipixelclustmulteventfilter_cfi.py:5
nhits
Definition: HIMultiTrackSelector.h:42
CaloSD::currentID
CaloHitID currentID
Definition: CaloSD.h:131
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
CaloSD::energyCut
double energyCut
Definition: CaloSD.h:133
CaloSD::reset
void reset() override
Definition: CaloSD.cc:561
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
CaloSD::eminHit
double eminHit
Definition: CaloSD.h:133
CaloSD::EndOfEvent
void EndOfEvent(G4HCofThisEvent *eventHC) override
Definition: CaloSD.cc:263
CaloG4Hit::getEM
double getEM() const
Definition: CaloG4Hit.h:55
edm::ParameterSet
Definition: ParameterSet.h:36
CaloSD::hitMap
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:167
CaloSD.h
CaloSD::theHC
CaloG4HitCollection * theHC
Definition: CaloSD.h:148
CaloSD::ignoreTrackID
bool ignoreTrackID
Definition: CaloSD.h:150
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
CaloSD::totalHits
int totalHits
Definition: CaloSD.h:158
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
CaloSD::incidentEnergy
float incidentEnergy
Definition: CaloSD.h:128
GeV
const double GeV
Definition: MathUtil.h:16
CaloSD::kmaxNeutron
double kmaxNeutron
Definition: CaloSD.h:138
CaloG4Hit::setEntryLocal
void setEntryLocal(double x, double y, double z)
Definition: CaloG4Hit.h:50
TrackInformation::getIDfineCalo
int getIDfineCalo() const
Definition: TrackInformation.h:55
CaloSD::timeSlice
float timeSlice
Definition: CaloSD.h:162
CaloSD::getEnergyDeposit
virtual double getEnergyDeposit(const G4Step *step)
Definition: CaloSD.cc:241
CaloSD::slave
std::unique_ptr< CaloSlaveSD > slave
Definition: CaloSD.h:145
TrackInformation
Definition: TrackInformation.h:8
createfilelist.int
int
Definition: createfilelist.py:10
CaloSD::CaloSD
CaloSD(const std::string &aSDname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:27
CaloG4Hit::setEntry
void setEntry(double x, double y, double z)
Definition: CaloG4Hit.h:47
CaloMeanResponse
Definition: CaloMeanResponse.h:10
edm::LogVerbatim
Definition: MessageLogger.h:297
CaloSD::resetForNewPrimary
void resetForNewPrimary(const G4Step *)
Definition: CaloSD.cc:422
BeginOfEvent
Definition: BeginOfEvent.h:6
TrackInformation::storeTrack
bool storeTrack() const
Definition: TrackInformation.h:14
BeginOfRun
Definition: BeginOfRun.h:6
CaloSD::getDepth
virtual uint16_t getDepth(const G4Step *)
Definition: CaloSD.cc:614
CaloSD::hcID
int hcID
Definition: CaloSD.h:155
CaloSD::eminHitD
double eminHitD
Definition: CaloSD.h:163
edm::EventSetup
Definition: EventSetup.h:57
CaloSD::DrawAll
void DrawAll() override
Definition: CaloSD.cc:275
CaloSD::reusehit
std::vector< std::unique_ptr< CaloG4Hit > > reusehit
Definition: CaloSD.h:169
TrackInformation.h
CaloG4Hit
Definition: CaloG4Hit.h:32
CaloG4Hit::setHadr
void setHadr(double e)
Definition: CaloG4Hit.h:59
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
TrackInformation::genParticleP
double genParticleP() const
Definition: TrackInformation.h:61
cc
CaloSD::corrTOFBeam
bool corrTOFBeam
Definition: CaloSD.h:153
CaloHitID::timeSliceID
int timeSliceID() const
Definition: CaloHitID.h:21
CaloG4HitLess
Definition: CaloG4Hit.h:91
CaloSD::m_trackManager
const SimTrackManager * m_trackManager
Definition: CaloSD.h:143
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TrackWithHistory::trackID
unsigned int trackID() const
Definition: TrackWithHistory.h:28
TrackContainer
std::vector< TrackWithHistory * > TrackContainer
Definition: TrackContainer.h:8
CaloSD::getTrackID
virtual int getTrackID(const G4Track *)
Definition: CaloSD.cc:573
SensitiveDetector::cmsTrackInformation
TrackInformation * cmsTrackInformation(const G4Track *aTrack)
Definition: SensitiveDetector.cc:96
G4TrackToParticleID.h
CaloSD::clear
void clear() override
Definition: CaloSD.cc:273
CaloSD::getNumberOfHits
int getNumberOfHits()
Definition: CaloSD.cc:343
CaloSD::cleanHitCollection
void cleanHitCollection()
Definition: CaloSD.cc:707
CaloSD::primAncestor
int primAncestor
Definition: CaloSD.h:156
CaloHitID::reset
void reset()
Definition: CaloHitID.cc:48
SimTrackManager.h
CaloHitID
Definition: CaloHitID.h:11
TrackWithHistory::momentum
const math::XYZVectorD & momentum() const
Definition: TrackWithHistory.h:32
CaloSD::entranceLocal
G4ThreeVector entranceLocal
Definition: CaloSD.h:126
edm::PCaloHitContainer
std::vector< PCaloHit > PCaloHitContainer
Definition: PCaloHitContainer.h:8
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CaloG4HitCollection
G4THitsCollection< CaloG4Hit > CaloG4HitCollection
Definition: CaloG4HitCollection.h:11
CaloSD::correctT
double correctT
Definition: CaloSD.h:164
CaloSD::getFromLibrary
virtual bool getFromLibrary(const G4Step *step)
Definition: CaloSD.cc:243
CaloSD::Initialize
void Initialize(G4HCofThisEvent *HCE) override
Definition: CaloSD.cc:245
CaloSD::checkHit
bool checkHit()
Definition: CaloSD.cc:314
CaloSD::forceSave
bool forceSave
Definition: CaloSD.h:140
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
cscdqm::timeSlice
CSCCFEBTimeSlice const *const timeSlice(T const &data, int nCFEB, int nSample)
Definition: CSCDQM_EventProcessor_processCSC.cc:29
CaloSD::fillHits
void fillHits(edm::PCaloHitContainer &, const std::string &) override
Definition: CaloSD.cc:284
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::roottree::getEntry
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:496
CaloG4Hit::setEM
void setEM(double e)
Definition: CaloG4Hit.h:56
CaloSD::initEvent
virtual void initEvent(const BeginOfEvent *)
Definition: CaloSD.cc:569
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CaloG4Hit::setID
void setID(uint32_t i, double d, int j, uint16_t k=0)
Definition: CaloG4Hit.h:71
ntuplemaker.time
time
Definition: ntuplemaker.py:310
CaloSD::updateHit
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:411
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
CaloSD::suppressHeavy
bool suppressHeavy
Definition: CaloSD.h:137
cond::serialization::equal
bool equal(const T &first, const T &second)
Definition: Equal.h:32
CaloG4Hit::getHadr
double getHadr() const
Definition: CaloG4Hit.h:58
CaloG4Hit::addEnergyDeposit
void addEnergyDeposit(double em, double hd)
Definition: CaloG4Hit.cc:45
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
cuy.ii
ii
Definition: cuy.py:590
weight
Definition: weight.py:1
SimTrackManager::trackContainer
const TrackContainer * trackContainer() const
Definition: SimTrackManager.h:52
hit
Definition: SiStripHitEffFromCalibTree.cc:88
CaloSD::endEvent
virtual void endEvent()
Definition: CaloSD.cc:571
CaloG4Hit::setPosition
void setPosition(double x, double y, double z)
Definition: CaloG4Hit.h:53
CaloG4Hit::getDepth
uint16_t getDepth() const
Definition: CaloG4Hit.h:68
fastSimProducer_cff.density
density
Definition: fastSimProducer_cff.py:61
CaloSD::createNewHit
CaloG4Hit * createNewHit(const G4Step *, const G4Track *)
Definition: CaloSD.cc:345
CaloSD::previousID
CaloHitID previousID
Definition: CaloSD.h:131