|
|
#include <ECalSD.h>
|
| ECalSD (const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, const SimTrackManager *) |
|
uint32_t | setDetUnitId (const G4Step *) override |
|
void | setNumberingScheme (EcalNumberingScheme *) |
|
| ~ECalSD () override |
|
| 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 |
|
| ~CaloSD () override |
|
| SensitiveCaloDetector (const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p) |
|
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 |
|
| Observer () |
|
void | slotForUpdate (const BeginOfRun * iT) |
|
virtual | ~Observer () |
|
| Observer () |
|
void | slotForUpdate (const BeginOfEvent * iT) |
|
virtual | ~Observer () |
|
| Observer () |
|
void | slotForUpdate (const BeginOfTrack * iT) |
|
virtual | ~Observer () |
|
| Observer () |
|
void | slotForUpdate (const EndOfTrack * iT) |
|
virtual | ~Observer () |
|
| Observer () |
|
void | slotForUpdate (const EndOfEvent * iT) |
|
virtual | ~Observer () |
|
|
double | EnergyCorrected (const G4Step &, const G4Track *) override |
|
uint16_t | getDepth (const G4Step *) override |
|
double | getEnergyDeposit (const G4Step *) override |
|
int | getTrackID (const G4Track *) override |
|
bool | checkHit () |
|
CaloG4Hit * | createNewHit (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 bool | getFromLibrary (const G4Step *step) |
|
int | getNumberOfHits () |
|
double | getResponseWt (const G4Track *) |
|
void | hitBookkeepingFineCalo (const G4Step *step, const G4Track *currentTrack, CaloG4Hit *hit) |
|
bool | hitExists (const G4Step *) |
|
void | ignoreRejection () |
|
virtual void | initEvent (const BeginOfEvent *) |
|
virtual void | initRun () |
|
void | printDetectorLevels (const G4VTouchable *) const |
|
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 *) |
|
TrackInformation * | cmsTrackInformation (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 > &) |
|
virtual void | update (const EndOfEvent *)=0 |
| This routine will be called when the appropriate signal arrives. More...
|
|
Definition at line 29 of file ECalSD.h.
◆ ECalSD()
Definition at line 42 of file ECalSD.cc.
80 int dumpGeom = m_EC.getUntrackedParameter<
int>(
"DumpGeometry", 0);
95 edm::LogError(
"EcalSim") <<
"ECalSD : Cannot find EcalSimulationParameters for " <<
name;
96 throw cms::Exception(
"Unknown",
"ECalSD") <<
"Cannot find EcalSimulationParameters for " <<
name <<
"\n";
114 }
else if (
name ==
"EcalHitsEB") {
117 dump = ((dumpGeom % 10) > 0);
118 }
else if (
name ==
"EcalHitsEE") {
121 dump = (((dumpGeom / 10) % 10) > 0);
122 }
else if (
name ==
"EcalHitsES") {
129 dump = (((dumpGeom / 100) % 10) > 0);
133 int type0 = dumpGeom / 1000;
134 type += (10 * type0);
139 edm::LogVerbatim(
"EcalSim") <<
"Constructing a ECalSD with name " << GetName();
143 <<
" with three constants kB = " <<
birk1 / bunit <<
", C1 = " <<
birk2
144 <<
", C2 = " <<
birk3 <<
"\n Use of L3 parametrization " <<
useBirkL3
146 <<
" Slope for Light yield is set to " <<
slopeLY;
149 <<
" by Birk or light yield curve";
163 if (
tfile.isAvailable()) {
165 static const std::string ctype[4] = {
"EB",
"EBref",
"EE",
"EERef"};
166 for (
int k = 0;
k < 4; ++
k) {
169 double xmin = (
k > 1) ? 3000.0 : 1000.0;
173 for (
int k = 0;
k < 4; ++
k)
References ageing, ageingWithSlopeLY, birk1, birk2, birk3, birkCut, birkSlope, crystalMat, depth1Name, EcalSimulationParameters::depth1Name_, depth2Name, EcalSimulationParameters::depth2Name_, FrontierConditions_GlobalTag_cff::dump, ecalSimParameters_, Exception, g, relativeConstraints::geom, edm::EventSetup::get(), get, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), initMap(), edm::ESHandleBase::isValid(), dqmdumpme::k, CaloSD::kmaxIon, CaloSD::kmaxNeutron, CaloSD::kmaxProton, SensitiveDetectorCatalog::logicalNames(), TFileDirectory::make(), MeV, Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), scaleRL, generator_cfi::scheme, EnergyResolutionVsLumi::setLumies(), setNumberingScheme(), slopeLY, storeLayerTimeSim, storeRL, storeTrack, AlCaHLTBitMon_QueryRunRegistry::string, CaloSD::suppressHeavy, compare::tfile, runGCPTkAlMap::title, useBirk, useBirkL3, useWeight, EcalSimulationParameters::useWeight_, and TrackerOfflineValidation_Dqm_cff::xmin.
◆ ~ECalSD()
◆ curve_LY()
double ECalSD::curve_LY |
( |
const G4LogicalVolume * |
lv | ) |
|
|
private |
Definition at line 435 of file ECalSD.cc.
447 edm::LogWarning(
"EcalSim") <<
"ECalSD: light coll curve : wrong distance "
449 <<
" crystal name = " << lv->GetName() <<
" " << dd4hep::dd::noNamespace(lv->GetName())
455 <<
" crystal name = " << lv->GetName() <<
" " << dd4hep::dd::noNamespace(lv->GetName())
References ageing, ageingWithSlopeLY, EnergyResolutionVsLumi::calcLightCollectionEfficiencyWeighted(), crystalDepth, crystalLength, CaloSD::currentID, currentLocalPoint, slopeLY, CaloHitID::unitID(), and mps_merge::weight.
Referenced by EnergyCorrected(), and getEnergyDeposit().
◆ EnergyCorrected()
double ECalSD::EnergyCorrected |
( |
const G4Step & |
step, |
|
|
const G4Track * |
track |
|
) |
| |
|
overrideprotectedvirtual |
Reimplemented from CaloSD.
Definition at line 235 of file ECalSD.cc.
236 double edep =
step.GetTotalEnergyDeposit();
237 const G4StepPoint* hitPoint =
step.GetPreStepPoint();
238 const G4LogicalVolume* lv = hitPoint->GetTouchable()->GetVolume(0)->GetLogicalVolume();
References funct::abs(), any(), crystalDepth, crystalLength, currentLocalPoint, curve_LY(), CaloSD::getResponseWt(), noWeight, CaloSD::setToLocal(), HLT_FULL_cff::track, useWeight, and xtalLMap.
◆ getBaseNumber()
void ECalSD::getBaseNumber |
( |
const G4Step * |
aStep | ) |
|
|
private |
◆ getBirkL3()
double ECalSD::getBirkL3 |
( |
const G4Step * |
aStep | ) |
|
|
private |
◆ getDepth()
uint16_t ECalSD::getDepth |
( |
const G4Step * |
aStep | ) |
|
|
overrideprotectedvirtual |
Reimplemented from CaloSD.
Definition at line 261 of file ECalSD.cc.
263 const G4StepPoint* hitPoint = aStep->GetPreStepPoint();
265 const G4LogicalVolume* lv = hitPoint->GetTouchable()->GetVolume(0)->GetLogicalVolume();
271 uint16_t depth1(0), depth2(0);
283 <<
std::dec <<
" Global " << (hitPoint->GetPosition()).
rho() <<
":"
287 <<
" L " << (ite ==
xtalLMap.end()) <<
":" << ite->second <<
" local "
References funct::abs(), any(), crystalDepth, crystalLength, currentLocalPoint, TauDecayModes::dec, depth, getLayerIDForTimeSim(), getRadiationLength(), isXtal(), PCaloHit::kEcalDepthMask, PCaloHit::kEcalDepthOffset, PCaloHit::kEcalDepthRefz, rho, setDetUnitId(), CaloSD::setToLocal(), storeLayerTimeSim, storeRL, useDepth1, useDepth2, xtalLMap, and z.
◆ getEnergyDeposit()
double ECalSD::getEnergyDeposit |
( |
const G4Step * |
aStep | ) |
|
|
overrideprotectedvirtual |
Reimplemented from CaloSD.
Definition at line 186 of file ECalSD.cc.
187 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
188 const G4Track* theTrack = aStep->GetTrack();
189 double edep = aStep->GetTotalEnergyDeposit();
196 int pdg = theTrack->GetDefinition()->GetPDGEncoding();
198 double ke = theTrack->GetKineticEnergy();
199 if (((
pdg / 1000000000 == 1 && ((
pdg / 10000) % 100) > 0 && ((
pdg / 10) % 100) > 0)) && (
ke <
kmaxIon))
208 const G4LogicalVolume* lv = preStepPoint->GetTouchable()->GetVolume(0)->GetLogicalVolume();
222 double wt2 = theTrack->GetWeight();
227 edm::LogVerbatim(
"EcalSim") << lv->GetName() <<
" " << dd4hep::dd::noNamespace(lv->GetName())
228 <<
" Light Collection Efficiency " <<
weight <<
":" << wt1 <<
" wt2= " << wt2
229 <<
" Weighted Energy Deposit " << edep /
CLHEP::MeV <<
" MeV at "
230 << preStepPoint->GetPosition();
References any(), birk1, birk2, birk3, curve_LY(), CaloSD::getAttenuation(), getBirkL3(), CaloSD::getResponseWt(), TrackInformation::isPrimary(), ke, CaloSD::kmaxIon, CaloSD::kmaxNeutron, CaloSD::kmaxProton, MeV, noWeight, CaloSD::suppressHeavy, useBirk, useBirkL3, and useWeight.
◆ getLayerIDForTimeSim()
uint16_t ECalSD::getLayerIDForTimeSim |
( |
| ) |
|
|
private |
◆ getRadiationLength()
uint16_t ECalSD::getRadiationLength |
( |
const G4StepPoint * |
hitPoint, |
|
|
const G4LogicalVolume * |
lv |
|
) |
| |
|
private |
Definition at line 293 of file ECalSD.cc.
296 double radl = hitPoint->GetMaterial()->GetRadlen();
299 const std::string& lvname = dd4hep::dd::noNamespace(lv->GetName());
300 int k1 = (lvname.find(
"EFRY") != std::string::npos) ? 2 : 0;
301 int k2 = (lvname.find(
"refl") != std::string::npos) ? 1 : 0;
303 double rz = (k1 == 0) ? (hitPoint->GetPosition()).
rho() :
std::abs((hitPoint->GetPosition()).
z());
304 edm::LogVerbatim(
"EcalSim") << lvname <<
" # " << k1 <<
":" << k2 <<
":" <<
kk <<
" rz " << rz <<
" D " << thisX0;
305 g2L_[
kk]->Fill(rz, thisX0);
308 G4ThreeVector localPoint =
setToLocal(hitPoint->GetPosition(), hitPoint->GetTouchable());
309 edm::LogVerbatim(
"EcalSim") << lv->GetName() <<
" " << dd4hep::dd::noNamespace(lv->GetName()) <<
" Global "
310 << hitPoint->GetPosition() <<
":" << (hitPoint->GetPosition()).
rho() <<
" Local "
311 << localPoint <<
" Crystal Length " <<
crystalLength <<
" Radl " << radl
312 <<
" crystalDepth " <<
crystalDepth <<
" Index " << thisX0 <<
" : "
References funct::abs(), crystalDepth, crystalLength, getLayerIDForTimeSim(), GetRecoTauVFromDQM_MC_cff::kk, rho, scaleRL, CaloSD::setToLocal(), AlCaHLTBitMon_QueryRunRegistry::string, useWeight, and z.
Referenced by getDepth().
◆ getTrackID()
int ECalSD::getTrackID |
( |
const G4Track * |
aTrack | ) |
|
|
overrideprotectedvirtual |
◆ initMap()
Definition at line 342 of file ECalSD.cc.
343 std::vector<const G4LogicalVolume*> lvused;
344 const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
345 std::map<const std::string, const G4LogicalVolume*> nameMap;
346 for (
auto lvi = lvs->begin(), lve = lvs->end(); lvi != lve; ++lvi)
347 nameMap.emplace(dd4hep::dd::noNamespace((*lvi)->GetName()), *lvi);
352 const G4LogicalVolume* lv = nameMap[lvname];
353 int ibec = (lvname.find(
"EFRY") == std::string::npos) ? 0 : 1;
354 int iref = (lvname.find(
"refl") == std::string::npos) ? 0 : 1;
355 int type = (ibec + iref == 1) ? 1 : -1;
357 if (strncmp(lvname.c_str(),
depth1Name.c_str(), 4) == 0) {
361 edm::LogVerbatim(
"EcalSim") <<
"ECalSD::initMap Logical Volume " << lvname <<
" in Depth 1 volume list";
364 const G4LogicalVolume* lvr = nameMap[lvname +
"_refl"];
368 edm::LogVerbatim(
"EcalSim") <<
"ECalSD::initMap Logical Volume " << lvname <<
"_refl"
369 <<
" in Depth 1 volume list";
375 if (strncmp(lvname.c_str(),
depth2Name.c_str(), 4) == 0) {
379 edm::LogVerbatim(
"EcalSim") <<
"ECalSD::initMap Logical Volume " << lvname <<
" in Depth 2 volume list";
382 const G4LogicalVolume* lvr = nameMap[lvname +
"_refl"];
386 edm::LogVerbatim(
"EcalSim") <<
"ECalSD::initMap Logical Volume " << lvname <<
"_refl"
387 <<
" in Depth 2 volume list";
394 if (!
any(lvused, lv)) {
395 lvused.push_back(lv);
397 xtalLMap.insert(std::pair<const G4LogicalVolume*, double>(lv,
dz *
type));
398 lv = nameMap[lvname +
"_refl"];
400 xtalLMap.insert(std::pair<const G4LogicalVolume*, double>(lv, -
dz *
type));
407 edm::LogVerbatim(
"EcalSim") <<
"ECalSD::initMap Logical Volume " << lvname <<
" Material " << matname
408 <<
" in noWeight list";
411 lv = nameMap[lvname];
415 edm::LogVerbatim(
"EcalSim") <<
"ECalSD::initMap Logical Volume " << lvname <<
" Material " << matname
416 <<
" in noWeight list";
427 if (ite.first !=
nullptr)
428 name = dd4hep::dd::noNamespace((ite.first)->GetName());
References any(), crystalMat, depth1Name, depth2Name, PVValHelper::dz, EcalSimulationParameters::dzs_, ecalSimParameters_, mps_fire::i, EcalSimulationParameters::lvNames_, EcalSimulationParameters::matNames_, Skims_PA_cff::name, noWeight, AlCaHLTBitMon_QueryRunRegistry::string, useDepth1, useDepth2, and xtalLMap.
Referenced by ECalSD().
◆ isXtal()
bool ECalSD::isXtal |
( |
const G4LogicalVolume * |
lv | ) |
|
|
private |
◆ setDetUnitId()
uint32_t ECalSD::setDetUnitId |
( |
const G4Step * |
aStep | ) |
|
|
overridevirtual |
◆ setNumberingScheme()
◆ ageing
◆ ageingWithSlopeLY
bool ECalSD::ageingWithSlopeLY |
|
private |
◆ birk1
◆ birk2
◆ birk3
◆ birkCut
◆ birkSlope
◆ crystalDepth
double ECalSD::crystalDepth |
|
private |
◆ crystalLength
double ECalSD::crystalLength |
|
private |
◆ crystalMat
std::string ECalSD::crystalMat |
|
private |
◆ currentLocalPoint
G4ThreeVector ECalSD::currentLocalPoint |
|
private |
◆ depth
◆ depth1Name
std::string ECalSD::depth1Name |
|
private |
◆ depth2Name
std::string ECalSD::depth2Name |
|
private |
◆ ecalSimParameters_
◆ noWeight
std::vector<const G4LogicalVolume *> ECalSD::noWeight |
|
private |
◆ numberingScheme_
◆ scaleRL
◆ slopeLY
◆ storeLayerTimeSim
bool ECalSD::storeLayerTimeSim |
|
private |
◆ storeRL
◆ storeTrack
◆ theBaseNumber
◆ useBirk
◆ useBirkL3
◆ useDepth1
std::vector<const G4LogicalVolume *> ECalSD::useDepth1 |
|
private |
◆ useDepth2
std::vector<const G4LogicalVolume *> ECalSD::useDepth2 |
|
private |
◆ useWeight
◆ xtalLMap
std::map<const G4LogicalVolume *, double> ECalSD::xtalLMap |
|
private |
T const * product() const
G4ThreeVector currentLocalPoint
EcalNumberingScheme * numberingScheme_
T * make(const Args &... args) const
make new ROOT object
double calcLightCollectionEfficiencyWeighted(DetId id, double z)
void addLevel(const std::string &name, const int ©Number)
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
uint16_t getRadiationLength(const G4StepPoint *hitPoint, const G4LogicalVolume *lv)
static const int kEcalDepthOffset
T getUntrackedParameter(std::string const &, T const &) const
bool isXtal(const G4LogicalVolume *)
Log< level::Warning, false > LogWarning
double curve_LY(const G4LogicalVolume *)
std::vector< double > dzs_
bool any(const std::vector< T > &v, const T &what)
std::vector< const G4LogicalVolume * > useDepth2
double getResponseWt(const G4Track *)
std::vector< const G4LogicalVolume * > noWeight
uint32_t setDetUnitId(const G4Step *) override
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *) const
const EcalSimulationParameters * ecalSimParameters_
void setNumberingScheme(EcalNumberingScheme *)
void getBaseNumber(const G4Step *)
void setLumies(double x, double y)
EcalBaseNumber theBaseNumber
CaloSD(const std::string &aSDname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
static const int kEcalDepthMask
Log< level::Error, false > LogError
EnergyResolutionVsLumi ageing
virtual int getTrackID(const G4Track *)
std::vector< std::string > matNames_
Log< level::Info, true > LogVerbatim
std::vector< std::string > lvNames_
const std::vector< std::string_view > logicalNames(const std::string &readoutName) const
virtual uint32_t getUnitID(const EcalBaseNumber &baseNumber) const =0
T getParameter(std::string const &) const
std::vector< const G4LogicalVolume * > useDepth1
Abs< T >::type abs(const T &t)
double getBirkL3(const G4Step *)
void setSize(const int &size)
static const int kEcalDepthRefz
uint16_t getLayerIDForTimeSim()
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
std::map< const G4LogicalVolume *, double > xtalLMap