6 #include "G4ProductionCuts.hh" 7 #include "G4RegionStore.hh" 14 : map_(map), m_Verbosity(verb) {
28 const std::pair<G4LogicalVolume*, DDLogicalPart>&
p2) {
30 if (p1.second.name().ns() > p2.second.name().ns()) {
33 if (p1.second.name().ns() == p2.second.name().ns()) {
34 if (p1.second.name().name() > p2.second.name().name()) {
37 if (p1.second.name().name() == p2.second.name().name()) {
38 if (p1.first->GetName() > p2.first->GetName()) {
50 for (G4LogicalVolumeToDDLogicalPartMap::Vector::iterator tit =
vec_.begin(); tit !=
vec_.end(); tit++) {
63 LogDebug(
"Physics") <<
" DDG4ProductionCuts (New) : starting\n" 64 <<
" DDG4ProductionCuts : Got " <<
vec_.size() <<
" region roots.\n" 65 <<
" DDG4ProductionCuts : List of all roots:";
67 LogDebug(
"Physics") <<
" DDG4ProductionCuts : root=" <<
vec_[
jj].second.name();
71 for (G4LogicalVolumeToDDLogicalPartMap::Vector::iterator tit =
vec_.begin(); tit !=
vec_.end(); tit++) {
76 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::initialize: Problem with Region tags.");
79 region->AddRootLogicalVolume((*tit).first);
82 LogDebug(
"Physics") <<
" MakeRegions: added " << ((*tit).first)->GetName() <<
" to region " << region->GetName();
88 LogDebug(
"Physics") <<
" DDG4ProductionCuts: inside setProdCuts";
90 G4Region* region =
nullptr;
96 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::setProdCuts: Problem with Region tags.");
99 LogDebug(
"Physics") <<
"Using region " << regionName;
110 double protoncut = 0.0;
115 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForGamma.");
117 temp =
map_.
toDouble(
"ProdCutsForElectrons", lpart, electroncut);
121 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForElectrons.");
123 temp =
map_.
toDouble(
"ProdCutsForPositrons", lpart, positroncut);
127 " DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForPositrons.");
133 prodCuts->SetProductionCut(gammacut, idxG4GammaCut);
134 prodCuts->SetProductionCut(electroncut, idxG4ElectronCut);
135 prodCuts->SetProductionCut(positroncut, idxG4PositronCut);
138 protoncut = electroncut;
140 prodCuts->SetProductionCut(protoncut, idxG4ProtonCut);
142 LogDebug(
"Physics") <<
"DDG4ProductionCuts : Setting cuts for " << regionName <<
"\n Electrons: " << electroncut
143 <<
"\n Positrons: " << positroncut <<
"\n Gamma : " << gammacut;
148 G4Region* reg = G4RegionStore::GetInstance()->FindOrCreateRegion(regName);
153 G4ProductionCuts* prodCuts = reg->GetProductionCuts();
155 prodCuts =
new G4ProductionCuts();
156 reg->SetProductionCuts(prodCuts);
G4LogicalVolumeToDDLogicalPartMap map_
T getUntrackedParameter(std::string const &, T const &) const
bool dd_is_greater(const std::pair< G4LogicalVolume *, DDLogicalPart > &p1, const std::pair< G4LogicalVolume *, DDLogicalPart > &p2)
void setProdCuts(const DDLogicalPart lpart, G4LogicalVolume *lvolume)
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
std::string m_KeywordRegion
G4ProductionCuts * getProductionCuts(G4Region *region)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
DDG4ProductionCuts(const G4LogicalVolumeToDDLogicalPartMap &, int, const edm::ParameterSet &p)
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
G4LogicalVolumeToDDLogicalPartMap::Vector vec_
G4Region * getRegion(const std::string ®ion)
Vector all(const std::string &name, const std::string &value) const
get all std::mapped instances which have a specific 'name' with value 'value'