CMS 3D CMS Logo

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

#include <CMSGDMLWriteStructure.h>

Inheritance diagram for CMSGDMLWriteStructure:

Public Member Functions

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

Private Attributes

G4VRangeToEnergyConverter * converter [4]
 

Detailed Description

Definition at line 10 of file CMSGDMLWriteStructure.h.

Constructor & Destructor Documentation

CMSGDMLWriteStructure::CMSGDMLWriteStructure ( )

Definition at line 13 of file CMSGDMLWriteStructure.cc.

References converter.

13  {
14  converter[0] = new G4RToEConvForGamma();
15  converter[1] = new G4RToEConvForElectron();
16  converter[2] = new G4RToEConvForPositron();
17  converter[3] = new G4RToEConvForProton();
18 }
G4VRangeToEnergyConverter * converter[4]
CMSGDMLWriteStructure::~CMSGDMLWriteStructure ( )
override

Definition at line 20 of file CMSGDMLWriteStructure.cc.

20 {}

Member Function Documentation

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

Definition at line 22 of file CMSGDMLWriteStructure.cc.

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

22  {
23  xercesc::DOMElement* auxiliaryElement = nullptr;
24  std::stringstream ss;
25  const char* cutnames[4] = {"pcutg", "pcutem", "pcutep", "pcutp"};
26 
27  auxiliaryElement = NewElement("auxiliary");
28  auxiliaryElement->setAttributeNode(NewAttribute("auxtype", "G4Region"));
29  auxiliaryElement->setAttributeNode(NewAttribute("auxvalue", glv->GetRegion()->GetName()));
30  volumeElement->appendChild(auxiliaryElement);
31 
32  auxiliaryElement = NewElement("auxiliary");
33  auxiliaryElement->setAttributeNode(NewAttribute("auxtype", "pcutunit"));
34  auxiliaryElement->setAttributeNode(NewAttribute("auxvalue", "GeV"));
35  volumeElement->appendChild(auxiliaryElement);
36 
37  // G4cout << "I have been called " << glv->GetName() << " in region "
38  // << glv->GetRegion()->GetName() << G4endl;
39  G4ProductionCuts* cuts = glv->GetRegion()->GetProductionCuts();
40 
41  for (G4int ic = 0; ic < 4; ++ic) {
42  G4cout << ic << ". " << cutnames[ic] << " converter: " << converter[ic] << " cuts: " << cuts << " glv: " << glv
43  << G4endl;
44  ss.clear();
45  ss.str("");
46  ss << converter[ic]->Convert(cuts->GetProductionCut(ic), glv->GetMaterial()) / CLHEP::GeV;
47  // G4cout << cutnames[ic] << " = " << ss.str() << G4endl;
48  auxiliaryElement = NewElement("auxiliary");
49  auxiliaryElement->setAttributeNode(NewAttribute("auxtype", cutnames[ic]));
50  auxiliaryElement->setAttributeNode(NewAttribute("auxvalue", ss.str()));
51  volumeElement->appendChild(auxiliaryElement);
52  }
53 }
const double GeV
Definition: MathUtil.h:16
TkSoA const *__restrict__ CAHitNtupletGeneratorKernelsGPU::QualityCuts cuts
G4VRangeToEnergyConverter * converter[4]

Member Data Documentation

G4VRangeToEnergyConverter* CMSGDMLWriteStructure::converter[4]
private

Definition at line 19 of file CMSGDMLWriteStructure.h.

Referenced by AddExtension(), and CMSGDMLWriteStructure().