CMS 3D CMS Logo

List of all members | Classes | 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

Classes

struct  Detector
 

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
 
bool isItFineCalo (const G4VTouchable *touch)
 
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 double EnergyCorrected (const G4Step &step, const G4Track *)
 
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 *)
 
void ignoreRejection ()
 
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
 
std::vector< DetectorfineDetectors_
 
int hcID
 
std::map< CaloHitID, CaloG4Hit * > hitMap
 
bool ignoreReject
 
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 33 of file CaloSD.cc.

40  : SensitiveCaloDetector(name, es, clg, p),
41  G4VGFlashSensitiveDetector(),
42  eminHit(0.),
43  currentHit(nullptr),
44  m_trackManager(manager),
45  theHC(nullptr),
46  ignoreTrackID(ignoreTkID),
47  hcID(-1),
48  timeSlice(timeSliceUnit),
49  eminHitD(0.) {
50  //Parameters
51  edm::ParameterSet m_CaloSD = p.getParameter<edm::ParameterSet>("CaloSD");
52  energyCut = m_CaloSD.getParameter<double>("EminTrack") * CLHEP::GeV;
53  tmaxHit = m_CaloSD.getParameter<double>("TmaxHit") * CLHEP::ns;
54  std::vector<double> eminHits = m_CaloSD.getParameter<std::vector<double>>("EminHits");
55  std::vector<double> tmaxHits = m_CaloSD.getParameter<std::vector<double>>("TmaxHits");
56  std::vector<std::string> hcn = m_CaloSD.getParameter<std::vector<std::string>>("HCNames");
57  std::vector<int> useResMap = m_CaloSD.getParameter<std::vector<int>>("UseResponseTables");
58  std::vector<double> eminHitX = m_CaloSD.getParameter<std::vector<double>>("EminHitsDepth");
59  suppressHeavy = m_CaloSD.getParameter<bool>("SuppressHeavy");
60  kmaxIon = m_CaloSD.getParameter<double>("IonThreshold") * CLHEP::MeV;
61  kmaxProton = m_CaloSD.getParameter<double>("ProtonThreshold") * CLHEP::MeV;
62  kmaxNeutron = m_CaloSD.getParameter<double>("NeutronThreshold") * CLHEP::MeV;
63  nCheckedHits = m_CaloSD.getUntrackedParameter<int>("CheckHits", 25);
64  useMap = m_CaloSD.getUntrackedParameter<bool>("UseMap", true);
65  int verbn = m_CaloSD.getUntrackedParameter<int>("Verbosity", 0);
66  corrTOFBeam = m_CaloSD.getParameter<bool>("CorrectTOFBeam");
67  double beamZ = m_CaloSD.getParameter<double>("BeamPosition") * CLHEP::cm;
68  correctT = beamZ / CLHEP::c_light / CLHEP::nanosecond;
69  useFineCaloID_ = m_CaloSD.getParameter<bool>("UseFineCaloID");
70 
71  SetVerboseLevel(verbn);
72  meanResponse.reset(nullptr);
73  for (unsigned int k = 0; k < hcn.size(); ++k) {
74  if (name == hcn[k]) {
75  if (k < eminHits.size())
76  eminHit = eminHits[k] * CLHEP::MeV;
77  if (k < eminHitX.size())
78  eminHitD = eminHitX[k] * CLHEP::MeV;
79  if (k < tmaxHits.size())
80  tmaxHit = tmaxHits[k] * CLHEP::ns;
81  if (k < useResMap.size() && useResMap[k] > 0) {
82  meanResponse = std::make_unique<CaloMeanResponse>(p);
83  break;
84  }
85  }
86  }
87  slave = std::make_unique<CaloSlaveSD>(name);
88 
91  isParameterized = false;
92 
93  entrancePoint.set(0., 0., 0.);
94  entranceLocal.set(0., 0., 0.);
95  posGlobal.set(0., 0., 0.);
97 
99  forceSave = false;
100 
101  edm::LogVerbatim("CaloSim") << "CaloSD: Minimum energy of track for saving it " << energyCut / CLHEP::GeV
102  << " GeV\n Use of HitID Map " << useMap << "\n Check last " << nCheckedHits
103  << " before saving the hit\n Correct TOF globally by " << correctT
104  << " ns (Flag =" << corrTOFBeam << ")\n Save hits recorded before " << tmaxHit
105  << " ns and if energy is above " << eminHit / CLHEP::MeV << " MeV (for depth 0) or "
106  << eminHitD / CLHEP::MeV << " MeV (for nonzero depths);\n Time Slice Unit "
107  << timeSlice << "\nIgnore TrackID Flag " << ignoreTrackID << " UseFineCaloID flag "
108  << useFineCaloID_;
109 
110  // Get pointer to CaloSimulationParameters
112  es.get<HcalParametersRcd>().get(csps);
113  if (csps.isValid()) {
114  const CaloSimulationParameters* csp = csps.product();
115  edm::LogVerbatim("CaloSim") << "CaloSD: " << csp->fCaloNames_.size() << " entries for fineCalorimeters:";
116  for (unsigned int i = 0; i < csp->fCaloNames_.size(); i++)
117  edm::LogVerbatim("CaloSim") << " [" << i << "] " << csp->fCaloNames_[i] << ":" << csp->fLevels_[i];
118 
119  const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
120  std::vector<G4LogicalVolume*>::const_iterator lvcite;
121  for (unsigned int i = 0; i < csp->fCaloNames_.size(); i++) {
122  G4LogicalVolume* lv = nullptr;
123  G4String name = static_cast<G4String>(csp->fCaloNames_[i]);
124  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++) {
125  if ((*lvcite)->GetName() == name) {
126  lv = (*lvcite);
127  break;
128  }
129  }
130  if (lv != nullptr) {
132  detector.name = name;
133  detector.lv = lv;
134  detector.level = csp->fLevels_[i];
135  fineDetectors_.emplace_back(detector);
136  }
137  }
138 #ifdef EDM_ML_DEBUG
139  edm::LogVerbatim("CaloSim") << "CaloSD::Loads information for " << fineDetectors_.size() << " fine detectors";
140  unsigned int k(0);
141  for (const auto& detector : fineDetectors_) {
142  edm::LogVerbatim("CaloSim") << "Detector[" << k << "] " << detector.name << " at level " << detector.level
143  << " pointer to LV: " << detector.lv;
144  }
145 #endif
146  } else {
147  edm::LogError("CaloSim") << "CaloSD: Cannot find CaloSimulationParameters";
148  throw cms::Exception("Unknown", "CaloSD") << "Cannot find CaloSimulationParameters\n";
149  }
150 }

References cleanIndex, correctT, corrTOFBeam, currentID, hgcalTestNeighbor_cfi::detector, edepositEM, edepositHAD, eminHit, eminHitD, energyCut, entranceLocal, entrancePoint, Exception, CaloSimulationParameters::fCaloNames_, fineDetectors_, CaloSimulationParameters::fLevels_, forceSave, edm::EventSetup::get(), get, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), GeV, mps_fire::i, ignoreTrackID, incidentEnergy, isParameterized, edm::ESHandleBase::isValid(), dqmdumpme::k, kmaxIon, kmaxNeutron, kmaxProton, meanResponse, MeV, Skims_PA_cff::name, nCheckedHits, AlCaHLTBitMon_ParallelJobs::p, posGlobal, previousID, primAncestor, primIDSaved, edm::ESHandle< T >::product(), slave, suppressHeavy, timeSlice, tmaxHit, totalHits, useFineCaloID_, and useMap.

◆ ~CaloSD()

CaloSD::~CaloSD ( )
override

Definition at line 152 of file CaloSD.cc.

152 {}

Member Function Documentation

◆ checkHit()

bool CaloSD::checkHit ( )
protected

Definition at line 396 of file CaloSD.cc.

396  {
397  //look in the HitContainer whether a hit with the same ID already exists:
398  bool found = false;
399  if (useMap) {
400  std::map<CaloHitID, CaloG4Hit*>::const_iterator it = hitMap.find(currentID);
401  if (it != hitMap.end()) {
402  currentHit = it->second;
403  found = true;
404  }
405  } else if (nCheckedHits > 0) {
406  int nhits = theHC->entries();
407  int minhit = std::max(nhits - nCheckedHits, 0);
408  int maxhit = nhits - 1;
409 
410  for (int j = maxhit; j > minhit; --j) {
411  if ((*theHC)[j]->getID() == currentID) {
412  currentHit = (*theHC)[j];
413  found = true;
414  break;
415  }
416  }
417  }
418 
419  if (found) {
421  }
422  return found;
423 }

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 789 of file CaloSD.cc.

789  {
790  std::vector<CaloG4Hit*>* theCollection = theHC->GetVector();
791 
792 #ifdef EDM_ML_DEBUG
793  edm::LogVerbatim("CaloSim") << "CaloSD: collection before merging, size = " << theHC->entries();
794 #endif
795  if (reusehit.empty())
796  reusehit.reserve(theHC->entries() - cleanIndex);
797 
798  // if no map used, merge before hits to have the save situation as a map
799  if (!useMap) {
800  std::vector<CaloG4Hit*> hitvec;
801 
802  hitvec.swap(*theCollection);
803  sort((hitvec.begin() + cleanIndex), hitvec.end(), CaloG4HitLess());
804 #ifdef EDM_ML_DEBUG
805  edm::LogVerbatim("CaloSim") << "CaloSD::cleanHitCollection: sort hits in buffer starting from "
806  << "element = " << cleanIndex;
807  for (unsigned int i = 0; i < hitvec.size(); ++i)
808  edm::LogVerbatim("CaloSim") << i << " " << *hitvec[i];
809 #endif
811  for (unsigned int i = cleanIndex; i < hitvec.size(); ++i) {
812  int jump = 0;
813  for (unsigned int j = i + 1; j < hitvec.size() && equal(hitvec[i], hitvec[j]); ++j) {
814  ++jump;
815  // merge j to i
816  (*hitvec[i]).addEnergyDeposit(*hitvec[j]);
817  (*hitvec[j]).setEM(0.);
818  (*hitvec[j]).setHadr(0.);
819  reusehit.emplace_back(hitvec[j]);
820  hitvec[j] = nullptr;
821  }
822  i += jump;
823  }
824 #ifdef EDM_ML_DEBUG
825  edm::LogVerbatim("CaloSim") << "CaloSD: cleanHitCollection merge the hits in buffer ";
826  for (unsigned int i = 0; i < hitvec.size(); ++i)
827  edm::LogVerbatim("CaloSim") << i << " " << *hitvec[i];
828 #endif
829  //move all nullptr to end of list and then remove them
830  hitvec.erase(
831  std::stable_partition(hitvec.begin() + cleanIndex, hitvec.end(), [](CaloG4Hit* p) { return p != nullptr; }),
832  hitvec.end());
833 #ifdef EDM_ML_DEBUG
834  edm::LogVerbatim("CaloSim") << "CaloSD::cleanHitCollection: remove the merged hits in buffer,"
835  << " new size = " << hitvec.size();
836  for (unsigned int i = 0; i < hitvec.size(); ++i)
837  edm::LogVerbatim("CaloSim") << i << " " << *hitvec[i];
838 #endif
839  hitvec.swap(*theCollection);
840  totalHits = theHC->entries();
841  }
842 
843 #ifdef EDM_ML_DEBUG
844  edm::LogVerbatim("CaloSim") << "CaloSD: collection after merging, size= " << theHC->entries()
845  << " Size of reusehit= " << reusehit.size()
846  << "\n starting hit selection from index = " << cleanIndex;
847 #endif
848 
849  int addhit = 0;
850  for (unsigned int i = cleanIndex; i < theCollection->size(); ++i) {
851  CaloG4Hit* aHit((*theCollection)[i]);
852 
853  // selection
854 
855  double time = aHit->getTimeSlice();
856  if (corrTOFBeam)
857  time += correctT;
858  if (!filterHit(aHit, time)) {
859 #ifdef EDM_ML_DEBUG
860  edm::LogVerbatim("CaloSim") << "CaloSD: dropped CaloG4Hit "
861  << " " << *aHit;
862 #endif
863 
864  // create the list of hits to be reused
865 
866  reusehit.emplace_back((*theCollection)[i]);
867  (*theCollection)[i] = nullptr;
868  ++addhit;
869  }
870  }
871 
872 #ifdef EDM_ML_DEBUG
873  edm::LogVerbatim("CaloSim") << "CaloSD: Size of reusehit after selection = " << reusehit.size()
874  << " Number of added hit = " << addhit;
875 #endif
876  if (useMap) {
877  if (addhit > 0) {
878  int offset = reusehit.size() - addhit;
879  for (int ii = addhit - 1; ii >= 0; --ii) {
880  CaloHitID theID = reusehit[offset + ii]->getID();
881  hitMap.erase(theID);
882  }
883  }
884  }
885 
886  //move all nullptr to end of list and then remove them
887  theCollection->erase(
888  std::stable_partition(
889  theCollection->begin() + cleanIndex, theCollection->end(), [](CaloG4Hit* p) { return p != nullptr; }),
890  theCollection->end());
891 #ifdef EDM_ML_DEBUG
892  edm::LogVerbatim("CaloSim") << "CaloSD: hit collection after selection, size = " << theHC->entries();
893  theHC->PrintAllHits();
894 #endif
895 
896  cleanIndex = theHC->entries();
897 }

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 351 of file CaloSD.cc.

351 {}

◆ clearHits()

void CaloSD::clearHits ( )
overridevirtual

Implements SensitiveDetector.

Definition at line 632 of file CaloSD.cc.

632  {
633  cleanIndex = 0;
634  previousID.reset();
635  primIDSaved = -99;
636 #ifdef EDM_ML_DEBUG
637  edm::LogVerbatim("CaloSim") << "CaloSD: Clears hit vector for " << GetName()
638  << " and initialise slave: " << slave.get()->name();
639 #endif
640  slave.get()->Initialize();
641 }

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 427 of file CaloSD.cc.

427  {
428 #ifdef EDM_ML_DEBUG
429  edm::LogVerbatim("CaloSim") << "CaloSD::CreateNewHit " << getNumberOfHits() << " for " << GetName()
430  << " Unit:" << currentID.unitID() << " " << currentID.depth() << " Edep= " << edepositEM
431  << " " << edepositHAD << " primaryID= " << currentID.trackID()
432  << " timeSlice= " << currentID.timeSliceID() << " ID= " << theTrack->GetTrackID() << " "
433  << theTrack->GetDefinition()->GetParticleName()
434  << " E(GeV)= " << theTrack->GetKineticEnergy() / CLHEP::GeV
435  << " parentID= " << theTrack->GetParentID() << "\n Ein= " << incidentEnergy
436  << " entranceGlobal: " << entrancePoint << " entranceLocal: " << entranceLocal
437  << " posGlobal: " << posGlobal;
438 #endif
439 
440  CaloG4Hit* aHit;
441  if (!reusehit.empty()) {
442  aHit = reusehit.back().release();
443  aHit->setEM(0.f);
444  aHit->setHadr(0.f);
445  reusehit.pop_back();
446  } else {
447  aHit = new CaloG4Hit;
448  }
449 
450  aHit->setID(currentID);
451  aHit->setEntry(entrancePoint.x(), entrancePoint.y(), entrancePoint.z());
453  aHit->setPosition(posGlobal.x(), posGlobal.y(), posGlobal.z());
455  updateHit(aHit);
456 
457  storeHit(aHit);
458  double etrack = 0;
459  if (currentID.trackID() == primIDSaved) { // The track is saved; nothing to be done
460  } else if (currentID.trackID() == theTrack->GetTrackID()) {
461  etrack = theTrack->GetKineticEnergy();
462 #ifdef EDM_ML_DEBUG
463  edm::LogVerbatim("CaloSim") << "CaloSD: set save the track " << currentID.trackID() << " etrack " << etrack
464  << " eCut " << energyCut << " force: " << forceSave
465  << " save: " << (etrack >= energyCut || forceSave);
466 #endif
467  if (etrack >= energyCut || forceSave) {
468  TrackInformation* trkInfo = cmsTrackInformation(theTrack);
469  trkInfo->storeTrack(true);
470  trkInfo->putInHistory();
471  }
472  } else {
474 #ifdef EDM_ML_DEBUG
475  edm::LogVerbatim("CaloSim") << "CaloSD : TrackwithHistory pointer for " << currentID.trackID() << " is " << trkh;
476 #endif
477  if (trkh != nullptr) {
478  etrack = sqrt(trkh->momentum().Mag2());
479  if (etrack >= energyCut) {
480  trkh->save();
481 #ifdef EDM_ML_DEBUG
482  edm::LogVerbatim("CaloSim") << "CaloSD: set save the track " << currentID.trackID() << " with Hit";
483 #endif
484  }
485  }
486  }
488  if (useMap)
489  ++totalHits;
490  return aHit;
491 }

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 353 of file CaloSD.cc.

353 {}

◆ endEvent()

void CaloSD::endEvent ( )
protectedvirtual

Reimplemented in HGCSD.

Definition at line 653 of file CaloSD.cc.

653 {}

Referenced by update().

◆ EndOfEvent()

void CaloSD::EndOfEvent ( G4HCofThisEvent *  eventHC)
override

Definition at line 341 of file CaloSD.cc.

341  {
342  // clean the hits for the last tracks
343 
345 
346 #ifdef EDM_ML_DEBUG
347  edm::LogVerbatim("CaloSim") << "CaloSD: EndofEvent entered with " << theHC->entries() << " entries";
348 #endif
349 }

References cleanHitCollection(), and theHC.

◆ EnergyCorrected()

double CaloSD::EnergyCorrected ( const G4Step &  step,
const G4Track *   
)
protectedvirtual

Reimplemented in ECalSD.

Definition at line 299 of file CaloSD.cc.

299 { return aStep.GetTotalEnergyDeposit(); }

Referenced by ProcessHits().

◆ fillHits()

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

Implements SensitiveCaloDetector.

Definition at line 362 of file CaloSD.cc.

362  {
363 #ifdef EDM_ML_DEBUG
364  edm::LogVerbatim("CaloSim") << "CaloSD: Tries to transfer " << slave.get()->hits().size() << " hits for "
365  << slave.get()->name() << " " << hname;
366 #endif
367  if (slave.get()->name() == hname) {
368  cc = slave.get()->hits();
369  }
370  slave.get()->Clean();
371 }

References slave.

◆ filterHit()

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

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

Definition at line 698 of file CaloSD.cc.

698  {
699  double emin(eminHit);
700  if (hit->getDepth() > 0)
701  emin = eminHitD;
702 #ifdef EDM_ML_DEBUG
703  edm::LogVerbatim("CaloSim") << "CaloSD::filterHit(..) Depth " << hit->getDepth() << " Emin = " << emin << " ("
704  << eminHit << ", " << eminHitD << ")";
705 #endif
706  return ((time <= tmaxHit) && (hit->getEnergyDeposit() > emin));
707 }

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 517 of file CaloSD.cc.

517  {
518  double weight = 1.;
519  double charge = aStep->GetPreStepPoint()->GetCharge();
520  double length = aStep->GetStepLength();
521 
522  if (charge != 0. && length > 0.) {
523  double density = aStep->GetPreStepPoint()->GetMaterial()->GetDensity();
524  double dedx = aStep->GetTotalEnergyDeposit() / length;
525  double rkb = birk1 / density;
526  double c = birk2 * rkb * rkb;
527  if (std::abs(charge) >= 2.)
528  rkb /= birk3; // based on alpha particle data
529  weight = 1. / (1. + rkb * dedx + c * dedx * dedx);
530 #ifdef EDM_ML_DEBUG
531  edm::LogVerbatim("CaloSim") << "CaloSD::getAttenuation in " << aStep->GetPreStepPoint()->GetMaterial()->GetName()
532  << " Charge " << charge << " dE/dx " << dedx << " Birk Const " << rkb << ", " << c
533  << " Weight = " << weight << " dE " << aStep->GetTotalEnergyDeposit();
534 #endif
535  }
536  return weight;
537 }

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 696 of file CaloSD.cc.

696 { return 0; }

Referenced by ProcessHits().

◆ getEnergyDeposit()

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

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

Definition at line 297 of file CaloSD.cc.

297 { return aStep->GetTotalEnergyDeposit(); }

Referenced by ProcessHits().

◆ getFromLibrary()

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

Reimplemented in HCalSD, CastorSD, and ZdcSD.

Definition at line 301 of file CaloSD.cc.

301 { return false; }

Referenced by ProcessHits().

◆ getNumberOfHits()

int CaloSD::getNumberOfHits ( )
protected

Definition at line 425 of file CaloSD.cc.

425 { 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 655 of file CaloSD.cc.

655  {
656  int primaryID = 0;
657  forceSave = false;
658  TrackInformation* trkInfo = cmsTrackInformation(aTrack);
659  if (trkInfo) {
660  primaryID = (useFineCaloID_) ? trkInfo->getIDfineCalo() : trkInfo->getIDonCaloSurface();
661 #ifdef EDM_ML_DEBUG
662  edm::LogVerbatim("CaloSim") << "Track ID: " << trkInfo->getIDfineCalo() << ":" << trkInfo->getIDonCaloSurface()
663  << ":" << aTrack->GetTrackID() << ":" << primaryID;
664 #endif
665  } else {
666  primaryID = aTrack->GetTrackID();
667 #ifdef EDM_ML_DEBUG
668  edm::LogWarning("CaloSim") << "CaloSD: Problem with primaryID **** set by force to TkID **** " << primaryID;
669 #endif
670  }
671  return primaryID;
672 }

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 381 of file CaloSD.cc.

381  {
382  // Update if in the same detector, time-slice and for same track
383  if (currentID == previousID) {
385  return true;
386  }
387 
388  // Reset entry point for new primary
389  posGlobal = aStep->GetPreStepPoint()->GetPosition();
390  if (currentID.trackID() != previousID.trackID()) {
391  resetForNewPrimary(aStep);
392  }
393  return checkHit();
394 }

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

Referenced by ProcessHits().

◆ ignoreRejection()

void CaloSD::ignoreRejection ( )
inlineprotected

Definition at line 102 of file CaloSD.h.

102 { ignoreReject = true; }

References ignoreReject.

Referenced by HGCalSD::setDetUnitId().

◆ initEvent()

void CaloSD::initEvent ( const BeginOfEvent )
protectedvirtual

Reimplemented in HGCSD.

Definition at line 651 of file CaloSD.cc.

651 {}

Referenced by update().

◆ Initialize()

void CaloSD::Initialize ( G4HCofThisEvent *  HCE)
override

Definition at line 323 of file CaloSD.cc.

323  {
324  totalHits = 0;
325 
326 #ifdef EDM_ML_DEBUG
327  edm::LogVerbatim("CaloSim") << "CaloSD : Initialize called for " << GetName();
328 #endif
329 
330  //This initialization is performed at the beginning of an event
331  //------------------------------------------------------------
332  theHC = new CaloG4HitCollection(GetName(), collectionName[0]);
333 
334  if (hcID < 0) {
335  hcID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
336  }
337  //theHC ownership is transfered here to HCE
338  HCE->AddHitsCollection(hcID, theHC);
339 }

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 649 of file CaloSD.cc.

649 {}

Referenced by update().

◆ isItFineCalo()

bool CaloSD::isItFineCalo ( const G4VTouchable *  touch)

Definition at line 303 of file CaloSD.cc.

303  {
304  bool ok(false);
305  int level = ((touch->GetHistoryDepth()) + 1);
306  for (const auto& detector : fineDetectors_) {
307  if (level > 0 && level >= detector.level) {
308  int ii = level - detector.level;
309  G4LogicalVolume* lv = touch->GetVolume(ii)->GetLogicalVolume();
310  ok = (lv == detector.lv);
311 #ifdef EDM_ML_DEBUG
312  std::string name1 = (lv == 0) ? "Unknown" : lv->GetName();
313  edm::LogVerbatim("CaloSim") << "CaloSD: volume " << name1 << ":" << detector.name << " at Level "
314  << detector.level << " Flag " << ok;
315 #endif
316  if (ok)
317  break;
318  }
319  }
320  return ok;
321 }

References hgcalTestNeighbor_cfi::detector, fineDetectors_, cuy::ii, personalPlayback::level, convertSQLiteXML::ok, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ PrintAll()

void CaloSD::PrintAll ( )
override

Definition at line 355 of file CaloSD.cc.

355  {
356 #ifdef EDM_ML_DEBUG
357  edm::LogVerbatim("CaloSim") << "CaloSD: Collection " << theHC->GetName();
358 #endif
359  theHC->PrintAllHits();
360 }

References theHC.

◆ processHit()

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

Definition at line 107 of file CaloSD.h.

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

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 232 of file CaloSD.cc.

232  {
233  edepositEM = edepositHAD = 0.f;
234  const G4Track* track = aSpot->GetOriginatorTrack()->GetPrimaryTrack();
235 
236  double edep = aSpot->GetEnergySpot()->GetEnergy();
237  if (edep <= 0.0) {
238  return false;
239  }
240 
241  G4Step fFakeStep;
242  G4StepPoint* fFakePreStepPoint = fFakeStep.GetPreStepPoint();
243  G4StepPoint* fFakePostStepPoint = fFakeStep.GetPostStepPoint();
244  fFakePreStepPoint->SetPosition(aSpot->GetPosition());
245  fFakePostStepPoint->SetPosition(aSpot->GetPosition());
246 
247  G4TouchableHandle fTouchableHandle = aSpot->GetTouchableHandle();
248  fFakePreStepPoint->SetTouchableHandle(fTouchableHandle);
249  fFakeStep.SetTotalEnergyDeposit(edep);
250  edep = EnergyCorrected(fFakeStep, track);
251  if (edep <= 0.0) {
252  return false;
253  }
254 
256  edepositEM = edep;
257  } else {
258  edepositHAD = edep;
259  }
260 
261  unsigned int unitID = setDetUnitId(&fFakeStep);
262 
263  if (unitID > 0) {
264  double time = 0;
265  int primaryID = getTrackID(track);
266  uint16_t depth = getDepth(&fFakeStep);
267  currentID.setID(unitID, time, primaryID, depth);
268 #ifdef EDM_ML_DEBUG
269  edm::LogVerbatim("CaloSim") << "CaloSD:: GetSpotInfo for Unit 0x" << std::hex << currentID.unitID() << std::dec
270  << " Edeposit = " << edepositEM << " " << edepositHAD;
271 #endif
272  // Update if in the same detector, time-slice and for same track
273  if (currentID == previousID) {
275  } else {
276  posGlobal = aSpot->GetEnergySpot()->GetPosition();
277  // Reset entry point for new primary
278  if (currentID.trackID() != previousID.trackID()) {
279  entrancePoint = aSpot->GetPosition();
280  entranceLocal = aSpot->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(entrancePoint);
281  incidentEnergy = track->GetKineticEnergy();
282 #ifdef EDM_ML_DEBUG
283  edm::LogVerbatim("CaloSim") << "CaloSD: Incident energy " << incidentEnergy / CLHEP::GeV << " GeV and"
284  << " entrance point " << entrancePoint << " (Global) " << entranceLocal
285  << " (Local)";
286 #endif
287  }
288  if (!checkHit()) {
289  currentHit = createNewHit(&fFakeStep, track);
290  }
291  }
292  return true;
293  }
294  return false;
295 }

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

◆ ProcessHits() [2/2]

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

Implements SensitiveDetector.

Definition at line 154 of file CaloSD.cc.

154  {
155  NaNTrap(aStep);
156  ignoreReject = false;
157 
158 #ifdef EDM_ML_DEBUG
159  edm::LogVerbatim("CaloSim") << "CaloSD::" << GetName() << " ID= " << aStep->GetTrack()->GetTrackID()
160  << " prID= " << aStep->GetTrack()->GetParentID()
161  << " Eprestep= " << aStep->GetPreStepPoint()->GetKineticEnergy()
162  << " step= " << aStep->GetStepLength() << " Edep= " << aStep->GetTotalEnergyDeposit();
163 #endif
164  // apply shower library or parameterisation
165  if (isParameterized) {
166  if (getFromLibrary(aStep)) {
167  // for parameterized showers the primary track should be killed
168  aStep->GetTrack()->SetTrackStatus(fStopAndKill);
169  auto tv = aStep->GetSecondary();
170  auto vol = aStep->GetPreStepPoint()->GetPhysicalVolume();
171  for (auto& tk : *tv) {
172  if (tk->GetVolume() == vol) {
173  tk->SetTrackStatus(fStopAndKill);
174  }
175  }
176  return true;
177  }
178  }
179 
180  // ignore steps without energy deposit
181  edepositEM = edepositHAD = 0.f;
182  unsigned int unitID = setDetUnitId(aStep);
183  auto const theTrack = aStep->GetTrack();
184  uint16_t depth = getDepth(aStep);
185 
186  double time = theTrack->GetGlobalTime() / nanosecond;
187  int primaryID = getTrackID(theTrack);
188  if (unitID > 0) {
189  currentID.setID(unitID, time, primaryID, depth);
190  } else {
191  if (aStep->GetTotalEnergyDeposit() > 0.0 && (!ignoreReject)) {
192  const G4TouchableHistory* touch = static_cast<const G4TouchableHistory*>(theTrack->GetTouchable());
193  edm::LogVerbatim("CaloSim") << "CaloSD::ProcessHits: unitID= " << unitID << " currUnit= " << currentID.unitID()
194  << " Detector: " << GetName() << " trackID= " << theTrack->GetTrackID() << " "
195  << theTrack->GetDefinition()->GetParticleName()
196  << "\n Edep= " << aStep->GetTotalEnergyDeposit()
197  << " PV: " << touch->GetVolume(0)->GetName()
198  << " PVid= " << touch->GetReplicaNumber(0) << " MVid= " << touch->GetReplicaNumber(1);
199  }
200  return false;
201  }
202 
203  if (aStep->GetTotalEnergyDeposit() == 0.0) {
204  return false;
205  }
206 
207  double energy = getEnergyDeposit(aStep);
208  if (energy > 0.0) {
210  edepositEM = energy;
211  } else {
213  }
214 #ifdef EDM_ML_DEBUG
215  G4TouchableHistory* touch = (G4TouchableHistory*)(theTrack->GetTouchable());
216  edm::LogVerbatim("CaloSim") << "CaloSD::" << GetName() << " PV:" << touch->GetVolume(0)->GetName()
217  << " PVid=" << touch->GetReplicaNumber(0) << " MVid=" << touch->GetReplicaNumber(1)
218  << " Unit:" << std::hex << unitID << std::dec << " Edep=" << edepositEM << " "
219  << edepositHAD << " ID=" << theTrack->GetTrackID() << " pID=" << theTrack->GetParentID()
220  << " E=" << theTrack->GetKineticEnergy() << " S=" << aStep->GetStepLength() << "\n "
221  << theTrack->GetDefinition()->GetParticleName() << " primaryID= " << primaryID
222  << " currentID= (" << currentID << ") previousID= (" << previousID << ")";
223 #endif
224  if (!hitExists(aStep)) {
225  currentHit = createNewHit(aStep, aStep->GetTrack());
226  }
227  return true;
228  }
229  return false;
230 }

References createNewHit(), currentHit, currentID, TauDecayModes::dec, LEDCalibrationChannels::depth, edepositEM, edepositHAD, HCALHighEnergyHPDFilter_cfi::energy, getDepth(), getEnergyDeposit(), getFromLibrary(), getTrackID(), hitExists(), ignoreReject, 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 643 of file CaloSD.cc.

643  {
644  if (fpCaloG4HitAllocator) {
645  fpCaloG4HitAllocator->ResetStorage();
646  }
647 }

References fpCaloG4HitAllocator.

◆ resetForNewPrimary()

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

Definition at line 504 of file CaloSD.cc.

504  {
505  auto const preStepPoint = aStep->GetPreStepPoint();
506  entrancePoint = preStepPoint->GetPosition();
507  entranceLocal = setToLocal(entrancePoint, preStepPoint->GetTouchable());
508  incidentEnergy = preStepPoint->GetKineticEnergy();
509 #ifdef EDM_ML_DEBUG
510  edm::LogVerbatim("CaloSim") << "CaloSD::resetForNewPrimary for " << GetName()
511  << " ID= " << aStep->GetTrack()->GetTrackID() << " Ein= " << incidentEnergy / CLHEP::GeV
512  << " GeV and"
513  << " entrance point global: " << entrancePoint << " local: " << entranceLocal;
514 #endif
515 }

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 730 of file CaloSD.cc.

730  {
731  int tkID;
732  bool ok = true;
733  if (m_trackManager) {
734  tkID = m_trackManager->giveMotherNeeded(aHit->getTrackID());
735  if (tkID == 0) {
736  if (m_trackManager->trackExists(aHit->getTrackID()))
737  tkID = (aHit->getTrackID());
738  else {
739  ok = false;
740  }
741  }
742  } else {
743  tkID = aHit->getTrackID();
744  ok = false;
745  }
746 #ifdef EDM_ML_DEBUG
747  if (!ok)
748  edm::LogWarning("CaloSim") << "CaloSD:Cannot find track ID for " << aHit->getTrackID();
749  edm::LogVerbatim("CaloSim") << "CalosD: Track ID " << aHit->getTrackID() << " changed to " << tkID
750  << " by SimTrackManager Status " << ok;
751 #endif
752  double time = aHit->getTimeSlice();
753  if (corrTOFBeam)
754  time += correctT;
755  slave.get()->processHits(
756  aHit->getUnitID(), aHit->getEM() / CLHEP::GeV, aHit->getHadr() / CLHEP::GeV, time, tkID, aHit->getDepth());
757 #ifdef EDM_ML_DEBUG
758  edm::LogVerbatim("CaloSim") << "CaloSD: Store Hit at " << std::hex << aHit->getUnitID() << std::dec << " "
759  << aHit->getDepth() << " due to " << tkID << " in time " << time << " of energy "
760  << aHit->getEM() / CLHEP::GeV << " GeV (EM) and " << aHit->getHadr() / CLHEP::GeV
761  << " GeV (Hadr)";
762 #endif
763  return ok;
764 }

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 116 of file CaloSD.h.

116 { 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 104 of file CaloSD.h.

104 { 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 377 of file CaloSD.cc.

377  {
378  return touch->GetHistory()->GetTopTransform().Inverse().TransformPoint(local);
379 }

References DTRecHitClients_cfi::local.

◆ setToLocal()

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

Definition at line 373 of file CaloSD.cc.

373  {
374  return touch->GetHistory()->GetTopTransform().TransformPoint(global);
375 }

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

◆ setTrackID()

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

Definition at line 674 of file CaloSD.cc.

674  {
675  auto const theTrack = aStep->GetTrack();
676  TrackInformation* trkInfo = cmsTrackInformation(theTrack);
677  int primaryID = (useFineCaloID_) ? trkInfo->getIDfineCalo() : trkInfo->getIDonCaloSurface();
678  if (primaryID <= 0) {
679  primaryID = theTrack->GetTrackID();
680  }
681 #ifdef EDM_ML_DEBUG
682  edm::LogVerbatim("CaloSim") << "Track ID: " << trkInfo->getIDfineCalo() << ":" << trkInfo->getIDonCaloSurface() << ":"
683  << theTrack->GetTrackID() << ":" << primaryID;
684 #endif
685 
686  if (primaryID != previousID.trackID()) {
687  resetForNewPrimary(aStep);
688  }
689 #ifdef EDM_ML_DEBUG
690  edm::LogVerbatim("CaloSim") << "CaloSD::setTrackID for " << GetName()
691  << " trackID= " << aStep->GetTrack()->GetTrackID() << " primaryID= " << primaryID;
692 #endif
693  return primaryID;
694 }

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 105 of file CaloSD.h.

105 { 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 718 of file CaloSD.cc.

718  {
719  if (hit == nullptr || previousID.trackID() < 0) {
720  edm::LogWarning("CaloSim") << "CaloSD: hit to be stored is nullptr !!"
721  << " previousID.trackID()= " << previousID.trackID();
722  return;
723  }
724 
725  theHC->insert(hit);
726  if (useMap)
727  hitMap.insert(std::pair<CaloHitID, CaloG4Hit*>(previousID, hit));
728 }

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

Referenced by createNewHit().

◆ update() [1/5]

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

Definition at line 575 of file CaloSD.cc.

575  {
576  endEvent();
577  slave.get()->ReserveMemory(theHC->entries());
578 
579  int count(0);
580  int wrong(0);
581  double eEM(0.0);
582  double eHAD(0.0);
583  double eEM2(0.0);
584  double eHAD2(0.0);
585  double tt(0.0);
586  double zloc(0.0);
587  double zglob(0.0);
588  double ee(0.0);
589  int hc_entries = theHC->entries();
590  for (int i = 0; i < hc_entries; ++i) {
591  if (!saveHit((*theHC)[i])) {
592  ++wrong;
593  }
594  ++count;
595  double x = (*theHC)[i]->getEM();
596  eEM += x;
597  eEM2 += x * x;
598  x = (*theHC)[i]->getHadr();
599  eHAD += x;
600  eHAD2 += x * x;
601  tt += (*theHC)[i]->getTimeSlice();
602  ee += (*theHC)[i]->getIncidentEnergy();
603  zglob += std::abs((*theHC)[i]->getEntry().z());
604  zloc += std::abs((*theHC)[i]->getEntryLocal().z());
605  }
606 
607  double norm = (count > 0) ? 1.0 / count : 0.0;
608  eEM *= norm;
609  eEM2 *= norm;
610  eHAD *= norm;
611  eHAD2 *= norm;
612  eEM2 = std::sqrt(eEM2 - eEM * eEM);
613  eHAD2 = std::sqrt(eHAD2 - eHAD * eHAD);
614  tt *= norm;
615  ee *= norm;
616  zglob *= norm;
617  zloc *= norm;
618 
619 #ifdef EDM_ML_DEBUG
620  edm::LogVerbatim("CaloSim") << "CaloSD: " << GetName() << " store " << count << " hits; " << wrong
621  << " track IDs not given properly and " << totalHits - count
622  << " hits not passing cuts\n EmeanEM= " << eEM << " ErmsEM= " << eEM2
623  << "\n EmeanHAD= " << eHAD << " ErmsHAD= " << eHAD2 << " TimeMean= " << tt
624  << " E0mean= " << ee << " Zglob= " << zglob << " Zloc= " << zloc << " ";
625 #endif
626  tkMap.erase(tkMap.begin(), tkMap.end());
627  std::vector<std::unique_ptr<CaloG4Hit>>().swap(reusehit);
628  if (useMap)
629  hitMap.erase(hitMap.begin(), hitMap.end());
630 }

References funct::abs(), submitPVResolutionJobs::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 541 of file CaloSD.cc.

541  {
542 #ifdef EDM_ML_DEBUG
543  edm::LogVerbatim("CaloSim") << "CaloSD: Dispatched BeginOfEvent for " << GetName() << " !";
544 #endif
545  clearHits();
546  initEvent(g4Event);
547 }

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 539 of file CaloSD.cc.

539 { 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 766 of file CaloSD.cc.

766  {
767  int primary = -1;
768  TrackInformation* trkInfo = cmsTrackInformation((*trk)());
769  if (trkInfo->isPrimary())
770  primary = (*trk)()->GetTrackID();
771 
772 #ifdef EDM_ML_DEBUG
773  edm::LogVerbatim("CaloSim") << "New track: isPrimary " << trkInfo->isPrimary() << " primary ID = " << primary
774  << " primary ancestor ID " << primAncestor;
775 #endif
776 
777  // update the information if a different primary track ID
778 
779  if (primary > 0 && primary != primAncestor) {
780  primAncestor = primary;
781 
782  // clean the hits information
783 
784  if (theHC->entries() > 0)
786  }
787 }

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 549 of file CaloSD.cc.

549  {
550  int id = (*trk)()->GetTrackID();
551  TrackInformation* trkI = cmsTrackInformation((*trk)());
552  int lastTrackID = -1;
553  if (trkI)
554  lastTrackID = trkI->getIDonCaloSurface();
555  if (id == lastTrackID) {
556  const TrackContainer* trksForThisEvent = m_trackManager->trackContainer();
557  if (trksForThisEvent != nullptr) {
558  int it = (int)(trksForThisEvent->size()) - 1;
559  if (it >= 0) {
560  TrackWithHistory* trkH = (*trksForThisEvent)[it];
561  if (trkH->trackID() == (unsigned int)(id))
562  tkMap[id] = trkH;
563 #ifdef EDM_ML_DEBUG
564  edm::LogVerbatim("CaloSim") << "CaloSD: get track " << it << " from Container of size "
565  << trksForThisEvent->size() << " with ID " << trkH->trackID();
566  } else {
567  edm::LogVerbatim("CaloSim") << "CaloSD: get track " << it << " from Container of size "
568  << trksForThisEvent->size() << " with no ID";
569 #endif
570  }
571  }
572  }
573 }

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 493 of file CaloSD.cc.

493  {
495 #ifdef EDM_ML_DEBUG
496  edm::LogVerbatim("CaloSim") << "CaloSD:" << GetName() << " Add energy deposit in " << currentID
497  << " Edep_em(MeV)= " << edepositEM << " Edep_had(MeV)= " << edepositHAD;
498 #endif
499 
500  // buffer for next steps:
502 }

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 169 of file CaloSD.h.

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

◆ correctT

double CaloSD::correctT
private

Definition at line 176 of file CaloSD.h.

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

◆ corrTOFBeam

bool CaloSD::corrTOFBeam
private

Definition at line 165 of file CaloSD.h.

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

◆ currentHit

CaloG4Hit* CaloSD::currentHit
protected

Definition at line 139 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 137 of file CaloSD.h.

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

◆ eminHitD

double CaloSD::eminHitD
private

Definition at line 175 of file CaloSD.h.

Referenced by CaloSD(), and filterHit().

◆ energyCut

double CaloSD::energyCut
protected

Definition at line 137 of file CaloSD.h.

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

◆ entranceLocal

G4ThreeVector CaloSD::entranceLocal
protected

◆ entrancePoint

G4ThreeVector CaloSD::entrancePoint
protected

◆ fineDetectors_

std::vector<Detector> CaloSD::fineDetectors_
private

Definition at line 182 of file CaloSD.h.

Referenced by CaloSD(), and isItFineCalo().

◆ forceSave

bool CaloSD::forceSave
protected

Definition at line 144 of file CaloSD.h.

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

◆ hcID

int CaloSD::hcID
private

Definition at line 167 of file CaloSD.h.

Referenced by Initialize().

◆ hitMap

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

Definition at line 179 of file CaloSD.h.

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

◆ ignoreReject

bool CaloSD::ignoreReject
private

Definition at line 163 of file CaloSD.h.

Referenced by ignoreRejection(), and ProcessHits().

◆ ignoreTrackID

bool CaloSD::ignoreTrackID
private

Definition at line 161 of file CaloSD.h.

Referenced by CaloSD().

◆ incidentEnergy

float CaloSD::incidentEnergy
protected

◆ isParameterized

bool CaloSD::isParameterized
private

Definition at line 162 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 154 of file CaloSD.h.

Referenced by saveHit(), and update().

◆ meanResponse

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

Definition at line 157 of file CaloSD.h.

Referenced by CaloSD(), and getResponseWt().

◆ nCheckedHits

int CaloSD::nCheckedHits
private

Definition at line 172 of file CaloSD.h.

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

◆ posGlobal

G4ThreeVector CaloSD::posGlobal
protected

Definition at line 131 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 168 of file CaloSD.h.

Referenced by CaloSD(), and update().

◆ primIDSaved

int CaloSD::primIDSaved
private

Definition at line 171 of file CaloSD.h.

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

◆ reusehit

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

Definition at line 181 of file CaloSD.h.

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

◆ slave

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

Definition at line 156 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 174 of file CaloSD.h.

Referenced by CaloSD().

◆ tkMap

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

Definition at line 180 of file CaloSD.h.

Referenced by createNewHit(), and update().

◆ tmaxHit

double CaloSD::tmaxHit
protected

◆ totalHits

int CaloSD::totalHits
private

Definition at line 170 of file CaloSD.h.

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

◆ useFineCaloID_

bool CaloSD::useFineCaloID_
private

Definition at line 177 of file CaloSD.h.

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

◆ useMap

bool CaloSD::useMap
private

Definition at line 164 of file CaloSD.h.

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

personalPlayback.level
level
Definition: personalPlayback.py:22
CaloSD::tkMap
std::map< int, TrackWithHistory * > tkMap
Definition: CaloSD.h:180
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
CaloSD::filterHit
virtual bool filterHit(CaloG4Hit *, double)
Definition: CaloSD.cc:698
CaloG4Hit::setIncidentEnergy
void setIncidentEnergy(double e)
Definition: CaloG4Hit.h:62
CaloSD::edepositHAD
float edepositHAD
Definition: CaloSD.h:133
CaloSD::tmaxHit
double tmaxHit
Definition: CaloSD.h:137
CaloG4Hit::getTrackID
int getTrackID() const
Definition: CaloG4Hit.h:64
mps_fire.i
i
Definition: mps_fire.py:428
CaloSimulationParameters
Definition: CaloSimulationParameters.h:6
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
CaloSD::storeHit
void storeHit(CaloG4Hit *)
Definition: CaloSD.cc:718
TrackInformation::getIDonCaloSurface
int getIDonCaloSurface() const
Definition: TrackInformation.h:39
CaloSD::currentHit
CaloG4Hit * currentHit
Definition: CaloSD.h:139
CaloSD::kmaxProton
double kmaxProton
Definition: CaloSD.h:142
CaloSD::saveHit
bool saveHit(CaloG4Hit *)
Definition: CaloSD.cc:730
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:177
CaloG4Hit::getUnitID
uint32_t getUnitID() const
Definition: CaloG4Hit.h:65
CaloSD::cleanIndex
int cleanIndex
Definition: CaloSD.h:169
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:649
CaloSD::nCheckedHits
int nCheckedHits
Definition: CaloSD.h:172
CaloHitID::trackID
int trackID() const
Definition: CaloHitID.h:23
CaloSD::edepositEM
float edepositEM
Definition: CaloSD.h:133
CaloSD::hitExists
bool hitExists(const G4Step *)
Definition: CaloSD.cc:381
MeV
const double MeV
HcalParametersRcd
Definition: HcalParametersRcd.h:8
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
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
CaloSD::kmaxIon
double kmaxIon
Definition: CaloSD.h:142
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:164
CaloHitID::setID
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:40
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
TrackInformation::isPrimary
bool isPrimary() const
Definition: TrackInformation.h:23
CaloSimulationParameters::fLevels_
std::vector< int > fLevels_
Definition: CaloSimulationParameters.h:18
CaloSD::setToLocal
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *) const
Definition: CaloSD.cc:373
CaloSD::isParameterized
bool isParameterized
Definition: CaloSD.h:162
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:171
edm::ESHandle
Definition: DTSurvey.h:22
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
CaloSD::entrancePoint
G4ThreeVector entrancePoint
Definition: CaloSD.h:129
TrackWithHistory::save
void save()
Definition: TrackWithHistory.h:27
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
CaloSD::posGlobal
G4ThreeVector posGlobal
Definition: CaloSD.h:131
dqmdumpme.k
k
Definition: dqmdumpme.py:60
CaloSD::clearHits
void clearHits() override
Definition: CaloSD.cc:632
CaloSD::meanResponse
std::unique_ptr< CaloMeanResponse > meanResponse
Definition: CaloSD.h:157
bysipixelclustmulteventfilter_cfi.collectionName
collectionName
Definition: bysipixelclustmulteventfilter_cfi.py:5
nhits
Definition: HIMultiTrackSelector.h:42
CaloSD::currentID
CaloHitID currentID
Definition: CaloSD.h:135
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
CaloSD::energyCut
double energyCut
Definition: CaloSD.h:137
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
CaloSD::eminHit
double eminHit
Definition: CaloSD.h:137
CaloG4Hit::getEM
double getEM() const
Definition: CaloG4Hit.h:55
edm::ParameterSet
Definition: ParameterSet.h:47
CaloSD::hitMap
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:179
CaloSD::theHC
CaloG4HitCollection * theHC
Definition: CaloSD.h:159
CaloSD::ignoreTrackID
bool ignoreTrackID
Definition: CaloSD.h:161
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
CaloSD::totalHits
int totalHits
Definition: CaloSD.h:170
CaloSD::incidentEnergy
float incidentEnergy
Definition: CaloSD.h:132
GeV
const double GeV
Definition: MathUtil.h:16
CaloSD::kmaxNeutron
double kmaxNeutron
Definition: CaloSD.h:142
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:174
CaloSD::getEnergyDeposit
virtual double getEnergyDeposit(const G4Step *step)
Definition: CaloSD.cc:297
CaloSD::slave
std::unique_ptr< CaloSlaveSD > slave
Definition: CaloSD.h:156
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
CaloSD::resetForNewPrimary
void resetForNewPrimary(const G4Step *)
Definition: CaloSD.cc:504
TrackInformation::storeTrack
bool storeTrack() const
Definition: TrackInformation.h:14
CaloSD::getDepth
virtual uint16_t getDepth(const G4Step *)
Definition: CaloSD.cc:696
CaloSD::hcID
int hcID
Definition: CaloSD.h:167
CaloSD::eminHitD
double eminHitD
Definition: CaloSD.h:175
CaloSD::reusehit
std::vector< std::unique_ptr< CaloG4Hit > > reusehit
Definition: CaloSD.h:181
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
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
cc
CaloSD::corrTOFBeam
bool corrTOFBeam
Definition: CaloSD.h:165
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
CaloHitID::timeSliceID
int timeSliceID() const
Definition: CaloHitID.h:21
CaloG4HitLess
Definition: CaloG4Hit.h:91
CaloSD::m_trackManager
const SimTrackManager * m_trackManager
Definition: CaloSD.h:154
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:655
SensitiveDetector::cmsTrackInformation
TrackInformation * cmsTrackInformation(const G4Track *aTrack)
Definition: SensitiveDetector.cc:96
heppy_batch.val
val
Definition: heppy_batch.py:351
CaloSD::Detector
Definition: CaloSD.h:147
CaloSD::getNumberOfHits
int getNumberOfHits()
Definition: CaloSD.cc:425
CaloSD::cleanHitCollection
void cleanHitCollection()
Definition: CaloSD.cc:789
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
CaloSD::primAncestor
int primAncestor
Definition: CaloSD.h:168
CaloHitID::reset
void reset()
Definition: CaloHitID.cc:48
CaloHitID
Definition: CaloHitID.h:11
CaloSD::fineDetectors_
std::vector< Detector > fineDetectors_
Definition: CaloSD.h:182
Exception
Definition: hltDiff.cc:246
TrackWithHistory::momentum
const math::XYZVectorD & momentum() const
Definition: TrackWithHistory.h:32
CaloSD::entranceLocal
G4ThreeVector entranceLocal
Definition: CaloSD.h:130
CaloSimulationParameters::fCaloNames_
std::vector< std::string > fCaloNames_
Definition: CaloSimulationParameters.h:17
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CaloG4HitCollection
G4THitsCollection< CaloG4Hit > CaloG4HitCollection
Definition: CaloG4HitCollection.h:11
CaloSD::correctT
double correctT
Definition: CaloSD.h:176
CaloSD::getFromLibrary
virtual bool getFromLibrary(const G4Step *step)
Definition: CaloSD.cc:301
CaloSD::checkHit
bool checkHit()
Definition: CaloSD.cc:396
CaloSD::forceSave
bool forceSave
Definition: CaloSD.h:144
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
CaloSD::ignoreReject
bool ignoreReject
Definition: CaloSD.h:163
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:651
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:493
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
CaloSD::suppressHeavy
bool suppressHeavy
Definition: CaloSD.h:141
cond::serialization::equal
bool equal(const T &first, const T &second)
Definition: Equal.h:32
CaloSD::EnergyCorrected
virtual double EnergyCorrected(const G4Step &step, const G4Track *)
Definition: CaloSD.cc:299
edm::Log
Definition: MessageLogger.h:70
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:653
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:427
CaloSD::previousID
CaloHitID previousID
Definition: CaloSD.h:135