5 #include "G4ProductionCuts.hh"
6 #include "G4RegionStore.hh"
24 const std::pair<G4LogicalVolume*, DDLogicalPart> &
p2) {
26 if (p1.second.name().ns() > p2.second.name().ns()) {
29 if (p1.second.name().ns() == p2.second.name().ns()) {
30 if (p1.second.name().name() > p2.second.name().name()) {
33 if (p1.second.name().name() == p2.second.name().name()) {
34 if (p1.first->GetName() > p2.first->GetName()) {
46 for (G4LogicalVolumeToDDLogicalPartMap::Vector::iterator tit =
vec_.begin();
47 tit !=
vec_.end(); tit++){
62 LogDebug(
"Physics") <<
" DDG4ProductionCuts (New) : starting\n"
63 <<
" DDG4ProductionCuts : Got "<<
vec_.size()
65 <<
" DDG4ProductionCuts : List of all roots:";
67 LogDebug(
"Physics") <<
" DDG4ProductionCuts : root="
72 for (G4LogicalVolumeToDDLogicalPartMap::Vector::iterator tit =
vec_.begin();
73 tit !=
vec_.end(); tit++) {
75 std::string regionName;
79 throw SimG4Exception(
"DDG4ProductionCuts: Problem with Region tags.");
81 G4Region * region =
getRegion(regionName);
82 region->AddRootLogicalVolume((*tit).first);
85 LogDebug(
"Physics") <<
" MakeRegions: added " <<((*tit).first)->GetName()
86 <<
" to region " << region->GetName();
92 G4LogicalVolume* lvol ) {
95 LogDebug(
"Physics") <<
" DDG4ProductionCuts: inside setProdCuts";
97 G4Region * region = 0;
99 std::string regionName;
103 throw SimG4Exception(
"DDG4ProductionCuts: Problem with Region tags.");
118 throw SimG4Exception(
"DDG4ProductionCuts: Problem with Region tags: no/more than one ProdCutsForGamma.");
120 temp =
map_.
toDouble(
"ProdCutsForElectrons",lpart,electroncut);
122 throw SimG4Exception(
"DDG4ProductionCuts: Problem with Region tags: no/more than one ProdCutsForElectrons.");
124 temp =
map_.
toDouble(
"ProdCutsForPositrons",lpart,positroncut);
126 throw SimG4Exception(
"DDG4ProductionCuts: Problem with Region tags: no/more than one ProdCutsForPositrons.");
132 prodCuts->SetProductionCut( gammacut, idxG4GammaCut );
133 prodCuts->SetProductionCut( electroncut, idxG4ElectronCut );
134 prodCuts->SetProductionCut( positroncut, idxG4PositronCut );
136 LogDebug(
"Physics") <<
"DDG4ProductionCuts : Setting cuts for "
137 << regionName <<
"\n Electrons: " << electroncut
138 <<
"\n Positrons: " << positroncut
139 <<
"\n Gamma : " << gammacut;
144 G4Region * reg = G4RegionStore::GetInstance()->FindOrCreateRegion (regName);
150 G4ProductionCuts * prodCuts = reg->GetProductionCuts();
152 prodCuts =
new G4ProductionCuts();
153 reg->SetProductionCuts(prodCuts);
G4LogicalVolumeToDDLogicalPartMap map_
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 ...
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_
DDG4ProductionCuts(const G4LogicalVolumeToDDLogicalPartMap &, int)
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'