test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
CMSGDMLWriteStructure Class Reference

#include <CMSGDMLWriteStructure.h>

Inheritance diagram for CMSGDMLWriteStructure:

Public Member Functions

virtual void AddExtension (xercesc::DOMElement *volumeElement, const G4LogicalVolume *const glv)
 
 CMSGDMLWriteStructure ()
 
virtual ~CMSGDMLWriteStructure ()
 

Detailed Description

Definition at line 9 of file CMSGDMLWriteStructure.h.

Constructor & Destructor Documentation

CMSGDMLWriteStructure::CMSGDMLWriteStructure ( )

Definition at line 13 of file CMSGDMLWriteStructure.cc.

14 {}
CMSGDMLWriteStructure::~CMSGDMLWriteStructure ( )
virtual

Definition at line 16 of file CMSGDMLWriteStructure.cc.

17 {}

Member Function Documentation

void CMSGDMLWriteStructure::AddExtension ( xercesc::DOMElement *  volumeElement,
const G4LogicalVolume *const  glv 
)
virtual

Definition at line 20 of file CMSGDMLWriteStructure.cc.

References hpstanc_transforms::cuts, GeV, and contentValuesCheck::ss.

22 {
23  xercesc::DOMElement* auxiliaryElement = 0;
24  std::stringstream ss;
25  const char* cutnames[4] = {"pcutg","pcutem","pcutep","pcutp"};
26  static G4VRangeToEnergyConverter *converter[4];
27  static G4bool ifirst = true;
28  if(ifirst) {
29  converter[0] = new G4RToEConvForGamma();
30  converter[1] = new G4RToEConvForElectron();
31  converter[2] = new G4RToEConvForPositron();
32  converter[3] = new G4RToEConvForProton();
33  ifirst = false;
34  }
35 
36  auxiliaryElement = NewElement("auxiliary");
37  auxiliaryElement->setAttributeNode(NewAttribute("auxtype","G4Region"));
38  auxiliaryElement->setAttributeNode(NewAttribute("auxvalue",glv->GetRegion()->GetName()));
39  volumeElement->appendChild(auxiliaryElement);
40 
41  auxiliaryElement = NewElement("auxiliary");
42  auxiliaryElement->setAttributeNode(NewAttribute("auxtype","pcutunit"));
43  auxiliaryElement->setAttributeNode(NewAttribute("auxvalue","GeV"));
44  volumeElement->appendChild(auxiliaryElement);
45 
46  // G4cout << "I have been called " << glv->GetName() << " in region "
47  // << glv->GetRegion()->GetName() << G4endl;
48  G4ProductionCuts *cuts = glv->GetRegion()->GetProductionCuts();
49 
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;
55  // G4cout << cutnames[ic] << " = " << ss.str() << G4endl;
56  auxiliaryElement = NewElement("auxiliary");
57  auxiliaryElement->setAttributeNode(NewAttribute("auxtype",cutnames[ic]));
58  auxiliaryElement->setAttributeNode(NewAttribute("auxvalue",ss.str()));
59  volumeElement->appendChild(auxiliaryElement);
60  }
61 }
const double GeV
Definition: MathUtil.h:16