#include <DDG4ProductionCuts.h>
Definition at line 15 of file DDG4ProductionCuts.h.
◆ DDG4ProductionCuts() [1/2]
◆ DDG4ProductionCuts() [2/2]
DDG4ProductionCuts::DDG4ProductionCuts |
( |
const dd4hep::SpecParRegistry * |
specPars, |
|
|
const dd4hep::sim::Geant4GeometryMaps::VolumeMap * |
map, |
|
|
int |
verb, |
|
|
bool |
pcut |
|
) |
| |
|
explicit |
◆ dd4hepInitialize()
void DDG4ProductionCuts::dd4hepInitialize |
( |
| ) |
|
|
private |
Definition at line 120 of file DDG4ProductionCuts.cc.
121 dd4hep::SpecParRefs
specs;
126 for (
auto const& pit :
fit.second->paths) {
127 const std::string_view
selection = dd4hep::dd::realTopName(pit);
128 const std::string_view
name = dd4hep::dd::noNamespace(it.first.name());
132 dd4hepVec_.emplace_back(std::make_pair<G4LogicalVolume*, const dd4hep::SpecPar*>(&*it.second, &*
fit.second));
143 G4Region*
region = G4RegionStore::GetInstance()->FindOrCreateRegion({regName.data(), regName.size()});
144 region->AddRootLogicalVolume(it.first);
146 edm::LogVerbatim(
"Geometry") <<
" MakeRegions: added " << it.first->GetName() <<
" to region " <<
region->GetName();
148 for (
auto const& sit : it.second->spars) {
149 log << sit.first <<
" = " << sit.second[0] <<
"\n";
156 edm::LogVerbatim(
"SimG4CoreGeometry") <<
" DDG4ProductionCuts (New) : starting\n"
157 <<
" DDG4ProductionCuts : Got " <<
dd4hepVec_.size() <<
" region roots.\n"
158 <<
" DDG4ProductionCuts : List of all roots:";
References dd4hepMap_, dd4hepVec_, mps_fire::end, findQualityFiles::jj, keywordRegion_, dqm-mbProfile::log, Skims_PA_cff::name, HLT_FULL_cff::region, corrVsCorr::selection, setProdCuts(), specPars_, HistogramManager_cfi::specs, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity_.
Referenced by DDG4ProductionCuts().
◆ initialize()
void DDG4ProductionCuts::initialize |
( |
void |
| ) |
|
|
private |
Definition at line 74 of file DDG4ProductionCuts.cc.
80 sort(
vec_.begin(),
vec_.end(), &dd_is_greater);
82 edm::LogVerbatim(
"Geometry") <<
" DDG4ProductionCuts : got " <<
vec_.size() <<
" region roots.\n"
83 <<
" DDG4ProductionCuts : List of all roots:";
84 for (
auto const& vv :
vec_)
85 edm::LogVerbatim(
"Geometry") <<
" " << vv.first->GetName() <<
" : " << vv.second.name();
91 G4Region*
region =
nullptr;
92 G4RegionStore* store = G4RegionStore::GetInstance();
93 for (
auto const& vv :
vec_) {
95 edm::LogVerbatim(
"Geometry") <<
" num " <<
num <<
" regionName: " << regionName <<
", the store of size "
98 throw cms::Exception(
"SimG4CoreGeometry",
" DDG4ProductionCuts::initialize: Problem with Region tags.");
100 if (regionName != curName) {
101 edm::LogVerbatim(
"Geometry") <<
"DDG4ProductionCuts : regionName " << regionName <<
", the store of size "
103 region = store->FindOrCreateRegion(regionName);
106 throw cms::Exception(
"SimG4CoreGeometry",
" DDG4ProductionCuts::initialize: Problem with Region tags.");
108 curName = regionName;
109 edm::LogVerbatim(
"Geometry") <<
"DDG4ProductionCuts : new G4Region " << vv.first->GetName();
113 region->AddRootLogicalVolume(vv.first);
References DDMapper< KeyType, ValueType >::all(), Exception, keywordRegion_, map_, EgammaValidation_cff::num, HLT_FULL_cff::region, setProdCuts(), AlCaHLTBitMon_QueryRunRegistry::string, DDMapper< KeyType, ValueType >::toString(), vec_, and verbosity_.
Referenced by DDG4ProductionCuts().
◆ setProdCuts() [1/2]
void DDG4ProductionCuts::setProdCuts |
( |
const dd4hep::SpecPar * |
spec, |
|
|
G4Region * |
region |
|
) |
| |
|
private |
Definition at line 226 of file DDG4ProductionCuts.cc.
230 G4ProductionCuts* prodCuts =
region->GetProductionCuts();
236 double gammacut = spec->dblValue(
"ProdCutsForGamma") /
MM_2_CM;
237 double electroncut = spec->dblValue(
"ProdCutsForElectrons") /
MM_2_CM;
238 double positroncut = spec->dblValue(
"ProdCutsForPositrons") /
MM_2_CM;
239 double protoncut = spec->dblValue(
"ProdCutsForProtons") /
MM_2_CM;
240 if (protoncut == 0) {
241 protoncut = electroncut;
244 prodCuts =
new G4ProductionCuts();
245 region->SetProductionCuts(prodCuts);
247 prodCuts->SetProductionCut(gammacut, idxG4GammaCut);
248 prodCuts->SetProductionCut(electroncut, idxG4ElectronCut);
249 prodCuts->SetProductionCut(positroncut, idxG4PositronCut);
250 prodCuts->SetProductionCut(protoncut, idxG4ProtonCut);
253 <<
"\n Electrons: " << electroncut <<
"\n Positrons: " << positroncut
254 <<
"\n Gamma : " << gammacut <<
"\n Proton : " << protoncut;
259 <<
"DDG4ProductionCuts : Cuts are already set for " <<
region->GetName()
260 <<
"\n Electrons: " <<
region->GetProductionCuts()->GetProductionCut(idxG4ElectronCut)
261 <<
"\n Positrons: " <<
region->GetProductionCuts()->GetProductionCut(idxG4PositronCut)
262 <<
"\n Gamma : " <<
region->GetProductionCuts()->GetProductionCut(idxG4GammaCut)
263 <<
"\n Proton : " <<
region->GetProductionCuts()->GetProductionCut(idxG4ProtonCut);
References MM_2_CM, HLT_FULL_cff::region, and verbosity_.
◆ setProdCuts() [2/2]
void DDG4ProductionCuts::setProdCuts |
( |
const DDLogicalPart |
lpart, |
|
|
G4Region * |
region |
|
) |
| |
|
private |
Definition at line 165 of file DDG4ProductionCuts.cc.
170 double gammacut = 0.0;
171 double electroncut = 0.0;
172 double positroncut = 0.0;
173 double protoncut = 0.0;
178 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForGamma.");
184 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForElectrons.");
190 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForPositrons.");
197 protoncut = electroncut;
201 }
else if (
temp != 1) {
204 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - more than one ProdCutsForProtons.");
210 G4ProductionCuts* prodCuts =
region->GetProductionCuts();
212 prodCuts =
new G4ProductionCuts();
213 region->SetProductionCuts(prodCuts);
215 prodCuts->SetProductionCut(gammacut, idxG4GammaCut);
216 prodCuts->SetProductionCut(electroncut, idxG4ElectronCut);
217 prodCuts->SetProductionCut(positroncut, idxG4PositronCut);
218 prodCuts->SetProductionCut(protoncut, idxG4ProtonCut);
221 <<
"\n Electrons: " << electroncut <<
"\n Positrons: " << positroncut
222 <<
"\n Gamma : " << gammacut <<
"\n Proton : " << protoncut;
References Exception, map_, protonCut_, HLT_FULL_cff::region, groupFilesInBlocks::temp, DDMapper< KeyType, ValueType >::toDouble(), and verbosity_.
Referenced by dd4hepInitialize(), and initialize().
◆ dd4hepMap_
const dd4hep::sim::Geant4GeometryMaps::VolumeMap* DDG4ProductionCuts::dd4hepMap_ = nullptr |
|
private |
◆ dd4hepVec_
std::vector<std::pair<G4LogicalVolume*, const dd4hep::SpecPar*> > DDG4ProductionCuts::dd4hepVec_ |
|
private |
◆ keywordRegion_
const std::string DDG4ProductionCuts::keywordRegion_ |
|
private |
◆ map_
◆ protonCut_
const bool DDG4ProductionCuts::protonCut_ |
|
private |
◆ specPars_
const dd4hep::SpecParRegistry* DDG4ProductionCuts::specPars_ |
|
private |
◆ vec_
◆ verbosity_
const int DDG4ProductionCuts::verbosity_ |
|
private |
unsigned int toDouble(const std::string &name, const KeyType &key, double &value, unsigned int pos=0) const
returns the number specific parameters named 'name' and the corrsponding double
unsigned int toString(const std::string &name, const KeyType &key, std::string &value, unsigned int pos=0) const
same as toDouble but for std::string-valued values of named parameters