6 #include "G4ProductionCuts.hh" 7 #include "G4RegionStore.hh" 13 :
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();
51 tit !=
vec_.end(); tit++){
66 LogDebug(
"Physics") <<
" DDG4ProductionCuts (New) : starting\n" 67 <<
" DDG4ProductionCuts : Got "<<
vec_.size()
69 <<
" DDG4ProductionCuts : List of all roots:";
71 LogDebug(
"Physics") <<
" DDG4ProductionCuts : root=" 76 for (G4LogicalVolumeToDDLogicalPartMap::Vector::iterator tit =
vec_.begin();
77 tit !=
vec_.end(); tit++) {
83 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::initialize: Problem with Region tags.");
85 G4Region * region =
getRegion(regionName);
86 region->AddRootLogicalVolume((*tit).first);
89 LogDebug(
"Physics") <<
" MakeRegions: added " <<((*tit).first)->GetName()
90 <<
" to region " << region->GetName();
96 G4LogicalVolume* lvol ) {
99 LogDebug(
"Physics") <<
" DDG4ProductionCuts: inside setProdCuts";
101 G4Region * region =
nullptr;
107 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::setProdCuts: Problem with Region tags.");
120 double protoncut = 0.0;
123 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForGamma.");
125 temp =
map_.
toDouble(
"ProdCutsForElectrons",lpart,electroncut);
127 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForElectrons.");
129 temp =
map_.
toDouble(
"ProdCutsForPositrons",lpart,positroncut);
131 throw cms::Exception(
"SimG4CorePhysics",
" DDG4ProductionCuts::setProdCuts: Problem with Region tags - no/more than one ProdCutsForPositrons.");
137 prodCuts->SetProductionCut( gammacut, idxG4GammaCut );
138 prodCuts->SetProductionCut( electroncut, idxG4ElectronCut );
139 prodCuts->SetProductionCut( positroncut, idxG4PositronCut );
142 prodCuts->SetProductionCut( protoncut, idxG4ProtonCut );
144 LogDebug(
"Physics") <<
"DDG4ProductionCuts : Setting cuts for " 145 << regionName <<
"\n Electrons: " << electroncut
146 <<
"\n Positrons: " << positroncut
147 <<
"\n Gamma : " << gammacut;
152 G4Region * reg = G4RegionStore::GetInstance()->FindOrCreateRegion (regName);
158 G4ProductionCuts * prodCuts = reg->GetProductionCuts();
160 prodCuts =
new G4ProductionCuts();
161 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'