98{
100 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
101 MsgStream log(
msgSvc,
"BesCgemConstruction::Construct()");
102
103
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
123 G4SDManager* gv_SDman = G4SDManager::GetSDMpointer();
124 G4String lvs_cgemSDname = "BesCgemSD";
125
126 m_CgemSD =
new BesCgemSD(lvs_cgemSDname);
128
129 gv_SDman->AddNewDetector(m_CgemSD);
130
131
132
134 {
135 log<< MSG::INFO << "BesCgemConstruction::Construct, Tunning! DO NOT CONSTRUCT CGEM!" << endreq;
136 return ;
137 }
138
139
141 {
142 log<< MSG::INFO << "BesCgemConstruciton::Construct, Construct CGEM from GDML!" << endreq;
143 }
144
145 else
146 {
147 log<< MSG::INFO << "BesCgemConstruction::Construct, Construct CGEM from G4code!" << endreq;
148 ConstructMaterial();
149 G4LogicalVolume *logicCgem = ConstructFromCode(logicContainer,m_CgemSD);
150
152 }
153}
void setGeomPtr(CgemGeomSvc *geomSvc)