CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
CaloSD Class Referenceabstract

#include <CaloSD.h>

Inheritance diagram for CaloSD:
SensitiveCaloDetector Observer< const BeginOfRun * > Observer< const BeginOfEvent * > Observer< const BeginOfTrack * > Observer< const EndOfTrack * > Observer< const EndOfEvent * > SensitiveDetector AHCalSD CastorSD DreamSD ECalSD EcalTBH4BeamSD HCalSD HcalTB02SD HcalTB06BeamSD HFNoseSD HGCalSD HGCalTB16SD01 HGCScintSD HGCSD TotemT2ScintSD ZdcSD

Public Member Functions

 CaloSD (const std::string &aSDname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
 
void clear () override
 
void clearHits () override
 
void DrawAll () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PCaloHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
void PrintAll () override
 
bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *) override
 
G4bool ProcessHits (G4Step *step, G4TouchableHistory *) override
 
void reset () override
 
uint32_t setDetUnitId (const G4Step *step) override=0
 
 ~CaloSD () override
 
- Public Member Functions inherited from SensitiveCaloDetector
 SensitiveCaloDetector (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 BeginOfRun * >
 Observer ()
 
void slotForUpdate (const BeginOfRun * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfTrack * >
 Observer ()
 
void slotForUpdate (const BeginOfTrack * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfTrack * >
 Observer ()
 
void slotForUpdate (const EndOfTrack * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent * iT)
 
virtual ~Observer ()
 

Protected Member Functions

bool checkHit ()
 
CaloG4HitcreateNewHit (const G4Step *, const G4Track *)
 
virtual void endEvent ()
 
virtual bool filterHit (CaloG4Hit *, double)
 
double getAttenuation (const G4Step *aStep, double birk1, double birk2, double birk3) const
 
virtual uint16_t getDepth (const G4Step *)
 
virtual double getEnergyDeposit (const G4Step *step)
 
virtual bool getFromLibrary (const G4Step *step)
 
int getNumberOfHits ()
 
double getResponseWt (const G4Track *)
 
virtual int getTrackID (const G4Track *)
 
bool hitExists (const G4Step *)
 
virtual void initEvent (const BeginOfEvent *)
 
virtual void initRun ()
 
void processHit (const G4Step *step)
 
void resetForNewPrimary (const G4Step *)
 
void setNumberCheckedHits (int val)
 
void setParameterized (bool val)
 
G4ThreeVector setToGlobal (const G4ThreeVector &, const G4VTouchable *) const
 
G4ThreeVector setToLocal (const G4ThreeVector &, const G4VTouchable *) const
 
virtual int setTrackID (const G4Step *)
 
void setUseMap (bool val)
 
void update (const ::EndOfEvent *) override
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfRun *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void updateHit (CaloG4Hit *)
 
- 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...
 

Protected Attributes

CaloG4HitcurrentHit
 
CaloHitID currentID
 
float edepositEM
 
float edepositHAD
 
double eminHit
 
double energyCut
 
G4ThreeVector entranceLocal
 
G4ThreeVector entrancePoint
 
bool forceSave
 
float incidentEnergy
 
double kmaxIon
 
double kmaxNeutron
 
double kmaxProton
 
G4ThreeVector posGlobal
 
CaloHitID previousID
 
bool suppressHeavy
 
double tmaxHit
 

Private Member Functions

void cleanHitCollection ()
 
bool saveHit (CaloG4Hit *)
 
void storeHit (CaloG4Hit *)
 

Private Attributes

int cleanIndex
 
double correctT
 
bool corrTOFBeam
 
double eminHitD
 
int hcID
 
std::map< CaloHitID, CaloG4Hit * > hitMap
 
bool ignoreTrackID
 
bool isParameterized
 
const SimTrackManagerm_trackManager
 
std::unique_ptr< CaloMeanResponsemeanResponse
 
int nCheckedHits
 
int primAncestor
 
int primIDSaved
 
std::vector< std::unique_ptr< CaloG4Hit > > reusehit
 
std::unique_ptr< CaloSlaveSDslave
 
CaloG4HitCollectiontheHC
 
float timeSlice
 
std::map< int, TrackWithHistory * > tkMap
 
int totalHits
 
bool useFineCaloID_
 
bool useMap
 

Additional Inherited Members

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

Detailed Description

Definition at line 38 of file CaloSD.h.

Constructor & Destructor Documentation

◆ CaloSD()

CaloSD::CaloSD ( const std::string &  aSDname,
const edm::EventSetup es,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager,
float  timeSlice = 1.,
bool  ignoreTkID = false 
)

Definition at line 27 of file CaloSD.cc.

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 }

References cleanIndex, correctT, corrTOFBeam, currentID, edepositEM, edepositHAD, eminHit, eminHitD, energyCut, entranceLocal, entrancePoint, forceSave, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), GeV, ignoreTrackID, incidentEnergy, isParameterized, dqmdumpme::k, kmaxIon, kmaxNeutron, kmaxProton, meanResponse, MeV, Skims_PA_cff::name, nCheckedHits, AlCaHLTBitMon_ParallelJobs::p, posGlobal, previousID, primAncestor, primIDSaved, slave, suppressHeavy, timeSlice, tmaxHit, totalHits, useFineCaloID_, and useMap.

◆ ~CaloSD()

CaloSD::~CaloSD ( )
override

Definition at line 105 of file CaloSD.cc.

105 {}

Member Function Documentation

◆ checkHit()

bool CaloSD::checkHit ( )
protected

Definition at line 314 of file CaloSD.cc.

314  {
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 }

References currentHit, currentID, newFWLiteAna::found, hitMap, dqmiolumiharvest::j, SiStripPI::max, nCheckedHits, nhits, theHC, updateHit(), and useMap.

Referenced by hitExists(), processHit(), and ProcessHits().

◆ cleanHitCollection()

void CaloSD::cleanHitCollection ( )
private

Definition at line 707 of file CaloSD.cc.

707  {
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 }

References cleanIndex, correctT, corrTOFBeam, cond::serialization::equal(), filterHit(), CaloG4Hit::getTimeSlice(), hitMap, mps_fire::i, cuy::ii, dqmiolumiharvest::j, hltrates_dqm_sourceclient-live_cfg::offset, AlCaHLTBitMon_ParallelJobs::p, reusehit, theHC, ntuplemaker::time, totalHits, and useMap.

Referenced by EndOfEvent(), and update().

◆ clear()

void CaloSD::clear ( void  )
override

Definition at line 273 of file CaloSD.cc.

273 {}

◆ clearHits()

void CaloSD::clearHits ( )
overridevirtual

Implements SensitiveDetector.

Definition at line 550 of file CaloSD.cc.

550  {
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 }

References cleanIndex, previousID, primIDSaved, CaloHitID::reset(), and slave.

Referenced by update().

◆ createNewHit()

CaloG4Hit * CaloSD::createNewHit ( const G4Step *  aStep,
const G4Track *  theTrack 
)
protected

Definition at line 345 of file CaloSD.cc.

345  {
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 }

References SensitiveDetector::cmsTrackInformation(), currentID, CaloHitID::depth(), edepositEM, edepositHAD, energyCut, entranceLocal, entrancePoint, f, forceSave, getNumberOfHits(), GeV, incidentEnergy, TrackWithHistory::momentum(), posGlobal, primIDSaved, TrackInformation::putInHistory(), reusehit, TrackWithHistory::save(), CaloG4Hit::setEM(), CaloG4Hit::setEntry(), CaloG4Hit::setEntryLocal(), CaloG4Hit::setHadr(), CaloG4Hit::setID(), CaloG4Hit::setIncidentEnergy(), CaloG4Hit::setPosition(), mathSSE::sqrt(), storeHit(), TrackInformation::storeTrack(), CaloHitID::timeSliceID(), tkMap, totalHits, CaloHitID::trackID(), CaloHitID::unitID(), updateHit(), and useMap.

Referenced by processHit(), and ProcessHits().

◆ DrawAll()

void CaloSD::DrawAll ( )
override

Definition at line 275 of file CaloSD.cc.

275 {}

◆ endEvent()

void CaloSD::endEvent ( )
protectedvirtual

Reimplemented in HGCSD.

Definition at line 571 of file CaloSD.cc.

571 {}

Referenced by update().

◆ EndOfEvent()

void CaloSD::EndOfEvent ( G4HCofThisEvent *  eventHC)
override

Definition at line 263 of file CaloSD.cc.

263  {
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 }

References cleanHitCollection(), and theHC.

◆ fillHits()

void CaloSD::fillHits ( edm::PCaloHitContainer cc,
const std::string &  hname 
)
overridevirtual

Implements SensitiveCaloDetector.

Definition at line 284 of file CaloSD.cc.

284  {
285  if (slave.get()->name() == hname) {
286  cc = slave.get()->hits();
287  }
288  slave.get()->Clean();
289 }

References slave.

◆ filterHit()

bool CaloSD::filterHit ( CaloG4Hit hit,
double  time 
)
protectedvirtual

Reimplemented in HCalSD, HGCSD, AHCalSD, HFNoseSD, HGCalSD, and HGCScintSD.

Definition at line 616 of file CaloSD.cc.

616  {
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 }

References eminHit, eminHitD, ntuplemaker::time, and tmaxHit.

Referenced by cleanHitCollection().

◆ getAttenuation()

double CaloSD::getAttenuation ( const G4Step *  aStep,
double  birk1,
double  birk2,
double  birk3 
) const
protected

Definition at line 435 of file CaloSD.cc.

435  {
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 }

References funct::abs(), HltBtagPostValidation_cff::c, ALCARECOTkAlJpsiMuMu_cff::charge, fastSimProducer_cff::density, and mps_merge::weight.

Referenced by TotemT2ScintSD::getEnergyDeposit(), DreamSD::getEnergyDeposit(), HGCalTB16SD01::getEnergyDeposit(), HcalTB06BeamSD::getEnergyDeposit(), HGCScintSD::getEnergyDeposit(), EcalTBH4BeamSD::getEnergyDeposit(), AHCalSD::getEnergyDeposit(), HcalTB02SD::getEnergyDeposit(), ECalSD::getEnergyDeposit(), and HCalSD::getEnergyDeposit().

◆ getDepth()

uint16_t CaloSD::getDepth ( const G4Step *  )
protectedvirtual

Reimplemented in ECalSD.

Definition at line 614 of file CaloSD.cc.

614 { return 0; }

Referenced by ProcessHits().

◆ getEnergyDeposit()

double CaloSD::getEnergyDeposit ( const G4Step *  step)
protectedvirtual

Reimplemented in HCalSD, ECalSD, CastorSD, HcalTB02SD, AHCalSD, HGCSD, HFNoseSD, HGCalSD, EcalTBH4BeamSD, HGCScintSD, HcalTB06BeamSD, ZdcSD, HGCalTB16SD01, DreamSD, and TotemT2ScintSD.

Definition at line 241 of file CaloSD.cc.

241 { return aStep->GetTotalEnergyDeposit(); }

Referenced by ProcessHits().

◆ getFromLibrary()

bool CaloSD::getFromLibrary ( const G4Step *  step)
protectedvirtual

Reimplemented in HCalSD, CastorSD, and ZdcSD.

Definition at line 243 of file CaloSD.cc.

243 { return false; }

Referenced by ProcessHits().

◆ getNumberOfHits()

int CaloSD::getNumberOfHits ( )
protected

Definition at line 343 of file CaloSD.cc.

343 { return theHC->entries(); }

References theHC.

Referenced by createNewHit(), and HCalSD::getFromLibrary().

◆ getResponseWt()

double CaloSD::getResponseWt ( const G4Track *  aTrack)
protected

◆ getTrackID()

int CaloSD::getTrackID ( const G4Track *  aTrack)
protectedvirtual

Reimplemented in ECalSD.

Definition at line 573 of file CaloSD.cc.

573  {
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 }

References SensitiveDetector::cmsTrackInformation(), forceSave, TrackInformation::getIDfineCalo(), TrackInformation::getIDonCaloSurface(), and useFineCaloID_.

Referenced by ECalSD::getTrackID(), and ProcessHits().

◆ hitExists()

bool CaloSD::hitExists ( const G4Step *  aStep)
protected

Definition at line 299 of file CaloSD.cc.

299  {
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 }

References checkHit(), currentHit, currentID, posGlobal, previousID, resetForNewPrimary(), CaloHitID::trackID(), and updateHit().

Referenced by ProcessHits().

◆ initEvent()

void CaloSD::initEvent ( const BeginOfEvent )
protectedvirtual

Reimplemented in HGCSD.

Definition at line 569 of file CaloSD.cc.

569 {}

Referenced by update().

◆ Initialize()

void CaloSD::Initialize ( G4HCofThisEvent *  HCE)
override

Definition at line 245 of file CaloSD.cc.

245  {
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 }

References bysipixelclustmulteventfilter_cfi::collectionName, hcID, theHC, and totalHits.

◆ initRun()

void CaloSD::initRun ( )
protectedvirtual

Reimplemented in HCalSD, HGCSD, HFNoseSD, HGCalSD, HGCScintSD, ZdcSD, and DreamSD.

Definition at line 567 of file CaloSD.cc.

567 {}

Referenced by update().

◆ PrintAll()

void CaloSD::PrintAll ( )
override

Definition at line 277 of file CaloSD.cc.

277  {
278 #ifdef EDM_ML_DEBUG
279  edm::LogVerbatim("CaloSim") << "CaloSD: Collection " << theHC->GetName();
280 #endif
281  theHC->PrintAllHits();
282 }

References theHC.

◆ processHit()

void CaloSD::processHit ( const G4Step *  step)
inlineprotected

Definition at line 103 of file CaloSD.h.

103  {
104  // check if it is in the same unit and timeslice as the previous one
105  if (currentID == previousID) {
107  } else if (!checkHit()) {
108  currentHit = createNewHit(step, step->GetTrack());
109  }
110  }

References checkHit(), createNewHit(), currentHit, currentID, previousID, and updateHit().

Referenced by HCalSD::getFromHFLibrary(), ZdcSD::getFromLibrary(), CastorSD::getFromLibrary(), HCalSD::getFromParam(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), and HCalSD::hitForFibre().

◆ ProcessHits() [1/2]

bool CaloSD::ProcessHits ( G4GFlashSpot *  aSpot,
G4TouchableHistory *   
)
override

Definition at line 184 of file CaloSD.cc.

184  {
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 }

References checkHit(), createNewHit(), currentHit, currentID, TauDecayModes::dec, LEDCalibrationChannels::depth, edepositEM, edepositHAD, entranceLocal, entrancePoint, getDepth(), getTrackID(), GeV, incidentEnergy, G4TrackToParticleID::isGammaElectronPositron(), posGlobal, previousID, setDetUnitId(), CaloHitID::setID(), ntuplemaker::time, HLT_2018_cff::track, CaloHitID::trackID(), CaloHitID::unitID(), and updateHit().

◆ ProcessHits() [2/2]

G4bool CaloSD::ProcessHits ( G4Step *  step,
G4TouchableHistory *   
)
overridevirtual

Implements SensitiveDetector.

Definition at line 107 of file CaloSD.cc.

107  {
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 }

References createNewHit(), currentHit, currentID, TauDecayModes::dec, LEDCalibrationChannels::depth, edepositEM, edepositHAD, HCALHighEnergyHPDFilter_cfi::energy, getDepth(), getEnergyDeposit(), getFromLibrary(), getTrackID(), hitExists(), G4TrackToParticleID::isGammaElectronPositron(), isParameterized, SensitiveDetector::NaNTrap(), previousID, setDetUnitId(), CaloHitID::setID(), ntuplemaker::time, and CaloHitID::unitID().

◆ reset()

void CaloSD::reset ( void  )
overridevirtual

Reimplemented from SensitiveCaloDetector.

Definition at line 561 of file CaloSD.cc.

561  {
562  if (fpCaloG4HitAllocator) {
563  fpCaloG4HitAllocator->ResetStorage();
564  }
565 }

References fpCaloG4HitAllocator.

◆ resetForNewPrimary()

void CaloSD::resetForNewPrimary ( const G4Step *  aStep)
protected

Definition at line 422 of file CaloSD.cc.

422  {
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 }

References entranceLocal, entrancePoint, GeV, incidentEnergy, and setToLocal().

Referenced by HCalSD::getFromHFLibrary(), ZdcSD::getFromLibrary(), CastorSD::getFromLibrary(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), hitExists(), and setTrackID().

◆ saveHit()

bool CaloSD::saveHit ( CaloG4Hit aHit)
private

Definition at line 648 of file CaloSD.cc.

648  {
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 }

References correctT, corrTOFBeam, TauDecayModes::dec, CaloG4Hit::getDepth(), CaloG4Hit::getEM(), CaloG4Hit::getHadr(), CaloG4Hit::getTimeSlice(), CaloG4Hit::getTrackID(), CaloG4Hit::getUnitID(), GeV, SimTrackManager::giveMotherNeeded(), m_trackManager, convertSQLiteXML::ok, slave, ntuplemaker::time, and SimTrackManager::trackExists().

Referenced by update().

◆ setDetUnitId()

uint32_t CaloSD::setDetUnitId ( const G4Step *  step)
overridepure virtual

◆ setNumberCheckedHits()

void CaloSD::setNumberCheckedHits ( int  val)
inlineprotected

Definition at line 112 of file CaloSD.h.

112 { nCheckedHits = val; }

References nCheckedHits, and heppy_batch::val.

Referenced by HFNoseSD::HFNoseSD(), HGCalSD::HGCalSD(), HGCScintSD::HGCScintSD(), and HGCSD::HGCSD().

◆ setParameterized()

void CaloSD::setParameterized ( bool  val)
inlineprotected

Definition at line 100 of file CaloSD.h.

100 { isParameterized = val; }

References isParameterized, and heppy_batch::val.

Referenced by CastorSD::CastorSD(), HCalSD::HCalSD(), and ZdcSD::ZdcSD().

◆ setToGlobal()

G4ThreeVector CaloSD::setToGlobal ( const G4ThreeVector &  local,
const G4VTouchable *  touch 
) const
protected

Definition at line 295 of file CaloSD.cc.

295  {
296  return touch->GetHistory()->GetTopTransform().Inverse().TransformPoint(local);
297 }

References DTRecHitClients_cfi::local.

◆ setToLocal()

G4ThreeVector CaloSD::setToLocal ( const G4ThreeVector &  global,
const G4VTouchable *  touch 
) const
protected

Definition at line 291 of file CaloSD.cc.

291  {
292  return touch->GetHistory()->GetTopTransform().TransformPoint(global);
293 }

Referenced by DreamSD::curve_LY(), HcalTB02SD::curve_LY(), ECalSD::getDepth(), ECalSD::getRadiationLength(), resetForNewPrimary(), and HcalTB06BeamSD::setDetUnitId().

◆ setTrackID()

int CaloSD::setTrackID ( const G4Step *  aStep)
protectedvirtual

Definition at line 592 of file CaloSD.cc.

592  {
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 }

References SensitiveDetector::cmsTrackInformation(), TrackInformation::getIDfineCalo(), TrackInformation::getIDonCaloSurface(), previousID, resetForNewPrimary(), CaloHitID::trackID(), and useFineCaloID_.

Referenced by HCalSD::getFromHFLibrary(), ZdcSD::getFromLibrary(), CastorSD::getFromLibrary(), HCalSD::getFromParam(), and HCalSD::hitForFibre().

◆ setUseMap()

void CaloSD::setUseMap ( bool  val)
inlineprotected

Definition at line 101 of file CaloSD.h.

101 { useMap = val; }

References useMap, and heppy_batch::val.

Referenced by HFNoseSD::HFNoseSD(), HGCalSD::HGCalSD(), HGCScintSD::HGCScintSD(), and HGCSD::HGCSD().

◆ storeHit()

void CaloSD::storeHit ( CaloG4Hit hit)
private

Definition at line 636 of file CaloSD.cc.

636  {
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 }

References hitMap, previousID, theHC, CaloHitID::trackID(), and useMap.

Referenced by createNewHit().

◆ update() [1/5]

void CaloSD::update ( const ::EndOfEvent )
overrideprotected

Definition at line 493 of file CaloSD.cc.

493  {
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 }

References funct::abs(), KineDebug3::count(), endEvent(), edm::roottree::getEntry(), hitMap, mps_fire::i, reusehit, saveHit(), slave, mathSSE::sqrt(), edm::swap(), theHC, tkMap, totalHits, groupFilesInBlocks::tt, useMap, x, and z.

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

◆ update() [2/5]

void CaloSD::update ( const BeginOfEvent )
overrideprotectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 459 of file CaloSD.cc.

459  {
460 #ifdef EDM_ML_DEBUG
461  edm::LogVerbatim("CaloSim") << "CaloSD: Dispatched BeginOfEvent for " << GetName() << " !";
462 #endif
463  clearHits();
464  initEvent(g4Event);
465 }

References clearHits(), and initEvent().

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

◆ update() [3/5]

void CaloSD::update ( const BeginOfRun )
overrideprotectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 457 of file CaloSD.cc.

457 { initRun(); }

References initRun().

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

◆ update() [4/5]

void CaloSD::update ( const BeginOfTrack )
overrideprotectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 684 of file CaloSD.cc.

684  {
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 }

References cleanHitCollection(), SensitiveDetector::cmsTrackInformation(), TrackInformation::isPrimary(), primAncestor, and theHC.

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

◆ update() [5/5]

void CaloSD::update ( const EndOfTrack )
overrideprotectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 467 of file CaloSD.cc.

467  {
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 }

References SensitiveDetector::cmsTrackInformation(), TrackInformation::getIDonCaloSurface(), createfilelist::int, m_trackManager, tkMap, SimTrackManager::trackContainer(), and TrackWithHistory::trackID().

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

◆ updateHit()

void CaloSD::updateHit ( CaloG4Hit aHit)
protected

Definition at line 411 of file CaloSD.cc.

411  {
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 }

References CaloG4Hit::addEnergyDeposit(), currentID, edepositEM, edepositHAD, and previousID.

Referenced by checkHit(), createNewHit(), hitExists(), processHit(), and ProcessHits().

Member Data Documentation

◆ cleanIndex

int CaloSD::cleanIndex
private

Definition at line 157 of file CaloSD.h.

Referenced by CaloSD(), cleanHitCollection(), and clearHits().

◆ correctT

double CaloSD::correctT
private

Definition at line 164 of file CaloSD.h.

Referenced by CaloSD(), cleanHitCollection(), and saveHit().

◆ corrTOFBeam

bool CaloSD::corrTOFBeam
private

Definition at line 153 of file CaloSD.h.

Referenced by CaloSD(), cleanHitCollection(), and saveHit().

◆ currentHit

CaloG4Hit* CaloSD::currentHit
protected

Definition at line 135 of file CaloSD.h.

Referenced by checkHit(), ZdcSD::getFromLibrary(), hitExists(), processHit(), and ProcessHits().

◆ currentID

CaloHitID CaloSD::currentID
protected

◆ edepositEM

float CaloSD::edepositEM
protected

◆ edepositHAD

float CaloSD::edepositHAD
protected

◆ eminHit

double CaloSD::eminHit
protected

Definition at line 133 of file CaloSD.h.

Referenced by CaloSD(), filterHit(), and HGCSD::HGCSD().

◆ eminHitD

double CaloSD::eminHitD
private

Definition at line 163 of file CaloSD.h.

Referenced by CaloSD(), and filterHit().

◆ energyCut

double CaloSD::energyCut
protected

Definition at line 133 of file CaloSD.h.

Referenced by CaloSD(), createNewHit(), HCalSD::getHitFibreBundle(), and HCalSD::getHitPMT().

◆ entranceLocal

G4ThreeVector CaloSD::entranceLocal
protected

◆ entrancePoint

G4ThreeVector CaloSD::entrancePoint
protected

◆ forceSave

bool CaloSD::forceSave
protected

Definition at line 140 of file CaloSD.h.

Referenced by CaloSD(), createNewHit(), ECalSD::getTrackID(), and getTrackID().

◆ hcID

int CaloSD::hcID
private

Definition at line 155 of file CaloSD.h.

Referenced by Initialize().

◆ hitMap

std::map<CaloHitID, CaloG4Hit*> CaloSD::hitMap
private

Definition at line 167 of file CaloSD.h.

Referenced by checkHit(), cleanHitCollection(), storeHit(), and update().

◆ ignoreTrackID

bool CaloSD::ignoreTrackID
private

Definition at line 150 of file CaloSD.h.

Referenced by CaloSD().

◆ incidentEnergy

float CaloSD::incidentEnergy
protected

◆ isParameterized

bool CaloSD::isParameterized
private

Definition at line 151 of file CaloSD.h.

Referenced by CaloSD(), ProcessHits(), and setParameterized().

◆ kmaxIon

double CaloSD::kmaxIon
protected

◆ kmaxNeutron

double CaloSD::kmaxNeutron
protected

◆ kmaxProton

double CaloSD::kmaxProton
protected

◆ m_trackManager

const SimTrackManager* CaloSD::m_trackManager
private

Definition at line 143 of file CaloSD.h.

Referenced by saveHit(), and update().

◆ meanResponse

std::unique_ptr<CaloMeanResponse> CaloSD::meanResponse
private

Definition at line 146 of file CaloSD.h.

Referenced by CaloSD(), and getResponseWt().

◆ nCheckedHits

int CaloSD::nCheckedHits
private

Definition at line 160 of file CaloSD.h.

Referenced by CaloSD(), checkHit(), and setNumberCheckedHits().

◆ posGlobal

G4ThreeVector CaloSD::posGlobal
protected

Definition at line 127 of file CaloSD.h.

Referenced by CaloSD(), createNewHit(), ZdcSD::getFromLibrary(), hitExists(), and ProcessHits().

◆ previousID

CaloHitID CaloSD::previousID
protected

◆ primAncestor

int CaloSD::primAncestor
private

Definition at line 156 of file CaloSD.h.

Referenced by CaloSD(), and update().

◆ primIDSaved

int CaloSD::primIDSaved
private

Definition at line 159 of file CaloSD.h.

Referenced by CaloSD(), clearHits(), and createNewHit().

◆ reusehit

std::vector<std::unique_ptr<CaloG4Hit> > CaloSD::reusehit
private

Definition at line 169 of file CaloSD.h.

Referenced by cleanHitCollection(), createNewHit(), and update().

◆ slave

std::unique_ptr<CaloSlaveSD> CaloSD::slave
private

Definition at line 145 of file CaloSD.h.

Referenced by CaloSD(), clearHits(), fillHits(), saveHit(), and update().

◆ suppressHeavy

bool CaloSD::suppressHeavy
protected

◆ theHC

CaloG4HitCollection* CaloSD::theHC
private

◆ timeSlice

float CaloSD::timeSlice
private

Definition at line 162 of file CaloSD.h.

Referenced by CaloSD().

◆ tkMap

std::map<int, TrackWithHistory*> CaloSD::tkMap
private

Definition at line 168 of file CaloSD.h.

Referenced by createNewHit(), and update().

◆ tmaxHit

double CaloSD::tmaxHit
protected

◆ totalHits

int CaloSD::totalHits
private

Definition at line 158 of file CaloSD.h.

Referenced by CaloSD(), cleanHitCollection(), createNewHit(), Initialize(), and update().

◆ useFineCaloID_

bool CaloSD::useFineCaloID_
private

Definition at line 165 of file CaloSD.h.

Referenced by CaloSD(), getTrackID(), and setTrackID().

◆ useMap

bool CaloSD::useMap
private

Definition at line 152 of file CaloSD.h.

Referenced by CaloSD(), checkHit(), cleanHitCollection(), createNewHit(), setUseMap(), storeHit(), and update().

CaloSD::tkMap
std::map< int, TrackWithHistory * > tkMap
Definition: CaloSD.h:168
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
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::currentHit
CaloG4Hit * currentHit
Definition: CaloSD.h:135
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
step
step
Definition: StallMonitor.cc:94
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::nCheckedHits
int nCheckedHits
Definition: CaloSD.h:160
CaloHitID::trackID
int trackID() const
Definition: CaloHitID.h:23
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
SimTrackManager::giveMotherNeeded
int giveMotherNeeded(int i) const
Definition: SimTrackManager.h:84
G4TrackToParticleID::isGammaElectronPositron
static bool isGammaElectronPositron(int pdgCode)
Definition: G4TrackToParticleID.cc:17
CaloG4HitEqual
Definition: CaloG4Hit.h:106
SensitiveCaloDetector::SensitiveCaloDetector
SensitiveCaloDetector(const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
Definition: SensitiveCaloDetector.h:12
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
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
CaloSD::primIDSaved
int primIDSaved
Definition: CaloSD.h:159
CaloSD::entrancePoint
G4ThreeVector entrancePoint
Definition: CaloSD.h:125
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
edm::LogWarning
Definition: MessageLogger.h:141
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
CaloSD::eminHit
double eminHit
Definition: CaloSD.h:133
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::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
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
TrackInformation::storeTrack
bool storeTrack() const
Definition: TrackInformation.h:14
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
CaloSD::reusehit
std::vector< std::unique_ptr< CaloG4Hit > > reusehit
Definition: CaloSD.h:169
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
heppy_batch.val
val
Definition: heppy_batch.py:351
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
CaloHitID
Definition: CaloHitID.h:11
TrackWithHistory::momentum
const math::XYZVectorD & momentum() const
Definition: TrackWithHistory.h:32
CaloSD::entranceLocal
G4ThreeVector entranceLocal
Definition: CaloSD.h:126
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::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
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:78
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