6 #include "G4ProductionCuts.hh" 7 #include "G4RegionStore.hh" 12 :
map_(map), m_Verbosity(verb) {
27 const std::pair<G4LogicalVolume*, DDLogicalPart> &
p2) {
29 if (p1.second.name().ns() > p2.second.name().ns()) {
32 if (p1.second.name().ns() == p2.second.name().ns()) {
33 if (p1.second.name().name() > p2.second.name().name()) {
36 if (p1.second.name().name() == p2.second.name().name()) {
37 if (p1.first->GetName() > p2.first->GetName()) {
49 for (G4LogicalVolumeToDDLogicalPartMap::Vector::iterator tit =
vec_.begin();
50 tit !=
vec_.end(); tit++){
65 LogDebug(
"Physics") <<
" DDG4ProductionCuts (New) : starting\n" 66 <<
" DDG4ProductionCuts : Got "<<
vec_.size()
68 <<
" DDG4ProductionCuts : List of all roots:";
70 LogDebug(
"Physics") <<
" DDG4ProductionCuts : root=" 75 for (G4LogicalVolumeToDDLogicalPartMap::Vector::iterator tit =
vec_.begin();
76 tit !=
vec_.end(); tit++) {
82 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::initialize: Problem with Region tags.");
84 G4Region * region =
getRegion(regionName);
85 region->AddRootLogicalVolume((*tit).first);
88 LogDebug(
"Physics") <<
" MakeRegions: added " <<((*tit).first)->GetName()
89 <<
" to region " << region->GetName();
95 G4LogicalVolume* lvol ) {
98 LogDebug(
"Physics") <<
" DDG4ProductionCuts: inside setProdCuts";
100 G4Region * region =
nullptr;
106 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::setProdCuts: Problem with Region tags.");
119 double protoncut = 0.0;
122 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForGamma.");
124 temp =
map_.
toDouble(
"ProdCutsForElectrons",lpart,electroncut);
126 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForElectrons.");
128 temp =
map_.
toDouble(
"ProdCutsForPositrons",lpart,positroncut);
130 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForPositrons.");
136 prodCuts->SetProductionCut( gammacut, idxG4GammaCut );
137 prodCuts->SetProductionCut( electroncut, idxG4ElectronCut );
138 prodCuts->SetProductionCut( positroncut, idxG4PositronCut );
141 prodCuts->SetProductionCut( protoncut, idxG4ProtonCut );
143 LogDebug(
"Physics") <<
"DDG4ProductionCuts : Setting cuts for " 144 << regionName <<
"\n Electrons: " << electroncut
145 <<
"\n Positrons: " << positroncut
146 <<
"\n Gamma : " << gammacut;
151 G4Region * reg = G4RegionStore::GetInstance()->FindOrCreateRegion (regName);
157 G4ProductionCuts * prodCuts = reg->GetProductionCuts();
159 prodCuts =
new G4ProductionCuts();
160 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'