CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
BesCgemConstruction Class Reference

#include <BesCgemConstruction.hh>

+ Inheritance diagram for BesCgemConstruction:

Public Member Functions

 BesCgemConstruction ()
 
 ~BesCgemConstruction ()
 
void Construct (G4LogicalVolume *)
 
- Public Member Functions inherited from BesSubdetector
 BesSubdetector ()
 
virtual ~BesSubdetector ()
 
virtual void Construct (G4LogicalVolume *bes)=0
 
G4LogicalVolume * FindLogicalVolume (const G4String &vn)
 

Additional Inherited Members

- Protected Attributes inherited from BesSubdetector
SAXProcessor m_sxp
 
ProcessingConfigurator m_config
 

Detailed Description

Definition at line 50 of file BesCgemConstruction.hh.

Constructor & Destructor Documentation

◆ BesCgemConstruction()

BesCgemConstruction::BesCgemConstruction ( )

Definition at line 72 of file BesCgemConstruction.cc.

73: m_CheckOverlaps(true), m_CreateHole(false)
74{
75 IMessageSvc* msgSvc;
76 Gaudi::svcLocator() -> service("MessageSvc", msgSvc);
77 MsgStream log(msgSvc, "BesCgemConstruction::BesCgemConstruction(): initialization of the geometry service");
78
79 ISvcLocator* svcLocator = Gaudi::svcLocator();
80 ICgemGeomSvc* ISvc;
81 StatusCode sc=svcLocator->service("CgemGeomSvc", ISvc);
82
83 m_cgem_geomsvc=dynamic_cast<CgemGeomSvc *>(ISvc);
84 if (!sc.isSuccess()) log<< MSG::INFO << "BesCgemConsruction::BesCgemConstruction(): could not open geometry file" << endreq;
85
86 m_CreateHole=true;
87
88
89}
IMessageSvc * msgSvc()

◆ ~BesCgemConstruction()

BesCgemConstruction::~BesCgemConstruction ( )

Definition at line 92 of file BesCgemConstruction.cc.

93{
94}

Member Function Documentation

◆ Construct()

void BesCgemConstruction::Construct ( G4LogicalVolume *  logicBes)
virtual

Implements BesSubdetector.

Definition at line 97 of file BesCgemConstruction.cc.

98{
99 IMessageSvc* msgSvc;
100 Gaudi::svcLocator() -> service("MessageSvc", msgSvc);
101 MsgStream log(msgSvc, "BesCgemConstruction::Construct()");
102
103 // ---------------------- CHECK
104 G4LogicalVolume *logicContainer = NULL; cout << "logicBes daughters " << logicBes->GetNoDaughters() << endl;
105
106 for(int i=0; i<logicBes->GetNoDaughters(); i++) {
107 G4VPhysicalVolume *daughter = logicBes->GetDaughter(i);
108 if(daughter->GetName()=="physicalMdc") {
109 logicContainer = daughter->GetLogicalVolume();
110 }
111 }
112 if(logicContainer == NULL) {
113 log<< MSG::INFO << "BesCgemConstruction::Construct, CGEM must stay inside MDC mother volume, you must build MDC!" << endreq;
114 cout<< "BesCgemConstruction::Construct, MDC not built --> put CGEM in WORLD" << endl;
115 logicContainer= logicBes;
116 }
117 else cout<< "BesCgemConstruction::Construct, MDC built --> put CGEM in MDC container logical volume" << endl;
118 // -------------------------
119
120
121
122 /* Construct Sensitive detectors */
123 G4SDManager* gv_SDman = G4SDManager::GetSDMpointer();
124 G4String lvs_cgemSDname = "BesCgemSD";
125 //G4String lvs_CuSDname = "CuSD";
126 m_CgemSD = new BesCgemSD(lvs_cgemSDname);
127 m_CgemSD->setGeomPtr(m_cgem_geomsvc);
128 //m_CuSD = new BesCgemSD(lvs_CuSDname);
129 gv_SDman->AddNewDetector(m_CgemSD);
130 //gv_SDman->AddNewDetector(m_CuSD);
131
132 /* When tuning, no construct CGEM */
134 {
135 log<< MSG::INFO << "BesCgemConstruction::Construct, Tunning! DO NOT CONSTRUCT CGEM!" << endreq;
136 return ;
137 }
138
139 /* Construct CGEM from GDML */
140 if (ReadBoostRoot::GetCgem()==2)
141 {
142 log<< MSG::INFO << "BesCgemConstruciton::Construct, Construct CGEM from GDML!" << endreq;
143 }
144 /* Construct CGEM from G4code */
145 else
146 {
147 log<< MSG::INFO << "BesCgemConstruction::Construct, Construct CGEM from G4code!" << endreq;
148 ConstructMaterial();
149 G4LogicalVolume *logicCgem = ConstructFromCode(logicContainer,m_CgemSD);
150 //if(m_cgem_geomsvc->isPassive() == true && ReadBoostRoot::GetCgem()!=3) ConstructPassiveElements(logicCgem);
151 if(ReadBoostRoot::GetCgem()!=3) ConstructPassiveElements(logicCgem);
152 }
153}
void setGeomPtr(CgemGeomSvc *geomSvc)
Definition: BesCgemSD.hh:68
static G4int GetCgem()
static G4int GetTuning()

Referenced by BesDetectorConstruction::Construct().


The documentation for this class was generated from the following files: