5 #include "G4ProductionCuts.hh"
6 #include "G4RegionStore.hh"
11 :
map_(map), m_Verbosity(verb) {
26 const std::pair<G4LogicalVolume*, DDLogicalPart> &
p2) {
28 if (p1.second.name().ns() > p2.second.name().ns()) {
31 if (p1.second.name().ns() == p2.second.name().ns()) {
32 if (p1.second.name().name() > p2.second.name().name()) {
35 if (p1.second.name().name() == p2.second.name().name()) {
36 if (p1.first->GetName() > p2.first->GetName()) {
48 for (G4LogicalVolumeToDDLogicalPartMap::Vector::iterator tit =
vec_.begin();
49 tit !=
vec_.end(); tit++){
64 LogDebug(
"Physics") <<
" DDG4ProductionCuts (New) : starting\n"
65 <<
" DDG4ProductionCuts : Got "<<
vec_.size()
67 <<
" DDG4ProductionCuts : List of all roots:";
69 LogDebug(
"Physics") <<
" DDG4ProductionCuts : root="
74 for (G4LogicalVolumeToDDLogicalPartMap::Vector::iterator tit =
vec_.begin();
75 tit !=
vec_.end(); tit++) {
81 throw SimG4Exception(
"DDG4ProductionCuts: Problem with Region tags.");
84 region->AddRootLogicalVolume((*tit).first);
87 LogDebug(
"Physics") <<
" MakeRegions: added " <<((*tit).first)->GetName()
88 <<
" to region " << region->GetName();
94 G4LogicalVolume* lvol ) {
97 LogDebug(
"Physics") <<
" DDG4ProductionCuts: inside setProdCuts";
105 throw SimG4Exception(
"DDG4ProductionCuts: Problem with Region tags.");
118 double protoncut = 0.0;
121 throw SimG4Exception(
"DDG4ProductionCuts: Problem with Region tags: no/more than one ProdCutsForGamma.");
123 temp =
map_.
toDouble(
"ProdCutsForElectrons",lpart,electroncut);
125 throw SimG4Exception(
"DDG4ProductionCuts: Problem with Region tags: no/more than one ProdCutsForElectrons.");
127 temp =
map_.
toDouble(
"ProdCutsForPositrons",lpart,positroncut);
129 throw SimG4Exception(
"DDG4ProductionCuts: Problem with Region tags: no/more than one ProdCutsForPositrons.");
135 prodCuts->SetProductionCut( gammacut, idxG4GammaCut );
136 prodCuts->SetProductionCut( electroncut, idxG4ElectronCut );
137 prodCuts->SetProductionCut( positroncut, idxG4PositronCut );
140 prodCuts->SetProductionCut( protoncut, idxG4ProtonCut );
142 LogDebug(
"Physics") <<
"DDG4ProductionCuts : Setting cuts for "
143 << regionName <<
"\n Electrons: " << electroncut
144 <<
"\n Positrons: " << positroncut
145 <<
"\n Gamma : " << gammacut;
150 G4Region * reg = G4RegionStore::GetInstance()->FindOrCreateRegion (regName);
156 G4ProductionCuts * prodCuts = reg->GetProductionCuts();
158 prodCuts =
new G4ProductionCuts();
159 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'