96{
98 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
99 MsgStream log(
msgSvc,
"BesCgemConstruction::Construct()");
100
101
102 G4LogicalVolume *logicContainer = NULL; cout << "logicBes daughters " << logicBes->GetNoDaughters() << endl;
103
104 for(int i=0; i<logicBes->GetNoDaughters(); i++) {
105 G4VPhysicalVolume *daughter = logicBes->GetDaughter(i);
106 if(daughter->GetName()=="physicalMdc") {
107 logicContainer = daughter->GetLogicalVolume();
108 }
109 }
110 if(logicContainer == NULL) {
111 log<< MSG::INFO << "BesCgemConstruction::Construct, CGEM must stay inside MDC mother volume, you must build MDC!" << endreq;
112 cout<< "BesCgemConstruction::Construct, MDC not built --> put CGEM in WORLD" << endl;
113 logicContainer= logicBes;
114 }
115 else cout<< "BesCgemConstruction::Construct, MDC built --> put CGEM in MDC container logical volume" << endl;
116
117
118
119
120
121 G4SDManager* gv_SDman = G4SDManager::GetSDMpointer();
122 G4String lvs_cgemSDname = "BesCgemSD";
123
124 m_CgemSD =
new BesCgemSD(lvs_cgemSDname);
125
126 gv_SDman->AddNewDetector(m_CgemSD);
127
128
129
131 {
132 log<< MSG::INFO << "BesCgemConstruction::Construct, Tunning! DO NOT CONSTRUCT CGEM!" << endreq;
133 return ;
134 }
135
136
138 {
139 log<< MSG::INFO << "BesCgemConstruciton::Construct, Construct CGEM from GDML!" << endreq;
140 }
141
142 else
143 {
144 log<< MSG::INFO << "BesCgemConstruction::Construct, Construct CGEM from G4code!" << endreq;
145 ConstructMaterial();
146 G4LogicalVolume *logicCgem = ConstructFromCode(logicContainer,m_CgemSD);
147
149 }
150}