CMS 3D CMS Logo

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.

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

Definition at line 21 of file CMSGDMLWriteStructure.cc.

22 {}

Member Function Documentation

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

Definition at line 25 of file CMSGDMLWriteStructure.cc.

References particleFlowClusterECALTimeSelected_cfi::cuts, ecalTB2006H4_GenSimDigiReco_cfg::G4cout, and GeV.

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

Member Data Documentation

G4VRangeToEnergyConverter* CMSGDMLWriteStructure::converter[4]
private

Definition at line 24 of file CMSGDMLWriteStructure.h.