3 #include "G4LogicalVolume.hh"
4 #include "G4ProductionCuts.hh"
5 #include "G4GDMLParser.hh"
6 #include "G4VRangeToEnergyConverter.hh"
7 #include "G4RToEConvForGamma.hh"
8 #include "G4RToEConvForElectron.hh"
9 #include "G4RToEConvForPositron.hh"
10 #include "G4RToEConvForProton.hh"
11 #include "G4SystemOfUnits.hh"
21 const G4LogicalVolume*
const glv)
23 xercesc::DOMElement* auxiliaryElement = 0;
25 const char* cutnames[4] = {
"pcutg",
"pcutem",
"pcutep",
"pcutp"};
26 static G4VRangeToEnergyConverter *converter[4];
27 static G4bool ifirst =
true;
29 converter[0] =
new G4RToEConvForGamma();
30 converter[1] =
new G4RToEConvForElectron();
31 converter[2] =
new G4RToEConvForPositron();
32 converter[3] =
new G4RToEConvForProton();
36 auxiliaryElement = NewElement(
"auxiliary");
37 auxiliaryElement->setAttributeNode(NewAttribute(
"auxtype",
"G4Region"));
38 auxiliaryElement->setAttributeNode(NewAttribute(
"auxvalue",glv->GetRegion()->GetName()));
39 volumeElement->appendChild(auxiliaryElement);
41 auxiliaryElement = NewElement(
"auxiliary");
42 auxiliaryElement->setAttributeNode(NewAttribute(
"auxtype",
"pcutunit"));
43 auxiliaryElement->setAttributeNode(NewAttribute(
"auxvalue",
"GeV"));
44 volumeElement->appendChild(auxiliaryElement);
48 G4ProductionCuts *
cuts = glv->GetRegion()->GetProductionCuts();
50 for(G4int ic=0; ic<4; ++ic) {
51 G4cout << ic <<
". " << cutnames[ic] <<
" converter: " << converter[ic]
52 <<
" cuts: " << cuts <<
" glv: " << glv << G4endl;
53 ss.clear(); ss.str(
"");
54 ss << converter[ic]->Convert(cuts->GetProductionCut(ic),glv->GetMaterial())/
CLHEP::GeV;
56 auxiliaryElement = NewElement(
"auxiliary");
57 auxiliaryElement->setAttributeNode(NewAttribute(
"auxtype",cutnames[ic]));
58 auxiliaryElement->setAttributeNode(NewAttribute(
"auxvalue",ss.str()));
59 volumeElement->appendChild(auxiliaryElement);
virtual ~CMSGDMLWriteStructure()
virtual void AddExtension(xercesc::DOMElement *volumeElement, const G4LogicalVolume *const glv)