1121 {
1122
1123 LArG4Identifier
result = LArG4Identifier();
1124
1125
1126
1127 const G4StepPoint *thisStepPoint = a_step->GetPreStepPoint();
1128 const G4StepPoint *thisStepBackPoint = a_step->GetPostStepPoint();
1129 const G4ThreeVector startPoint = thisStepPoint->GetPosition();
1130 const G4ThreeVector endPoint = thisStepBackPoint->GetPosition();
1131 const G4ThreeVector
p = (thisStepPoint->GetPosition() + thisStepBackPoint->GetPosition()) * 0.5;
1132
1133#ifdef DEBUGHITS
1134 ATH_MSG_VERBOSE(
"Position of the step in the ATLAS frame (x,y,z) --> " <<
p.x() <<
" " <<
p.y() <<
" " <<
p.z());
1135 ATH_MSG_VERBOSE(
"Eta and Phi in the ATLAS frame --> " <<
p.eta() <<
" " <<
p.phi());
1136#endif
1137
1138
1139
1140 const G4NavigationHistory* g4navigation = thisStepPoint->GetTouchable()->GetHistory();
1141 const G4AffineTransform transformation = g4navigation->GetTransform(indECAM);
1142 const G4ThreeVector startPointinLocal = transformation.TransformPoint(startPoint);
1143 const G4ThreeVector endPointinLocal = transformation.TransformPoint (endPoint);
1144 const G4ThreeVector midinLocal = (startPointinLocal+endPointinLocal)*0.5;
1145
1146#ifdef DEBUGHITS
1147 ATH_MSG_VERBOSE(
"Position of the step in the LOCAL frame (x,y,z) --> " << midinLocal.x() <<
" " << midinLocal.y() <<
" " << midinLocal.z());
1148 ATH_MSG_VERBOSE(
"Eta and Phi of the step in LOCAL frame --> " << midinLocal.eta() <<
" " << midinLocal.phi());
1149#endif
1150
1151
1152
1153 const G4double xZpos = midinLocal.x();
1154 const G4double yZpos = midinLocal.y();
1155 const G4double zZpos = midinLocal.z();
1156 const G4double etaZpos = midinLocal.pseudoRapidity();
1157 const G4double phiZpos = (midinLocal.phi()<0.) ? midinLocal.phi() + 2.*
M_PI : midinLocal.phi();
1158 const G4double radius2Zpos = xZpos*xZpos + yZpos*yZpos;
1159 const G4double radiusZpos = sqrt(radius2Zpos);
1160
1161 CalcData currentCellData;
1163 currentCellData.zSide = 1;
1164 }
1165 else {
1166 currentCellData.zSide = zside;
1167 }
1168
1169
1170
1171
1174
1175#ifdef DEBUGHITS
1177#endif
1178
1179
1180
1181
1182
1183 const bool MapDetail(false);
1184 this->
findCell( currentCellData, xZpos, yZpos, zZpos, radiusZpos, etaZpos, phiZpos, MapDetail );
1185
1186
1187
1188 if( currentCellData.zSide == -1 )
1189 {
1190 if( currentCellData.sampling == 1 && currentCellData.region ==0 )
1191 {
1192 currentCellData.phiBin = 31 - currentCellData.phiBin;
1193 if(currentCellData.phiBin < 0 ) currentCellData.phiBin += 64;
1194 }
1195 if( currentCellData.sampling == 1 && currentCellData.region ==1 )
1196 {
1197 currentCellData.phiBin = 127 - currentCellData.phiBin;
1198 if(currentCellData.phiBin < 0 ) currentCellData.phiBin += 256;
1199 }
1200 if( currentCellData.sampling >= 2 )
1201 {
1202 currentCellData.phiBin = 127 - currentCellData.phiBin;
1203 if(currentCellData.phiBin < 0 ) currentCellData.phiBin += 256;
1204 }
1205 }
1206
1207
1208
1209
1210 if (currentCellData.sampling==1 && currentCellData.region==0 && currentCellData.etaBin==0) {
1211 currentCellData.etaBin=1;
1212 }
1213
1215 << 1
1216 << currentCellData.zSide
1217 << currentCellData.sampling
1218 << currentCellData.region
1219 << currentCellData.etaBin
1220 << currentCellData.phiBin;
1221
1222#ifdef DEBUGHITS
1225 ATH_MSG_VERBOSE(
"currentCellData.zSide ----> " << currentCellData.zSide);
1226 ATH_MSG_VERBOSE(
"currentCellData.sampling ----> " << currentCellData.sampling);
1227 ATH_MSG_VERBOSE(
"currentCellData.region ----> " << currentCellData.region);
1228 ATH_MSG_VERBOSE(
"currentCellData.etaBin ----> " << currentCellData.etaBin);
1229 ATH_MSG_VERBOSE(
"currentCellData.phiBin ----> " << currentCellData.phiBin);
1230 ATH_MSG_VERBOSE(
"And also etafirst ----> " << thisStepPoint->GetPosition().pseudoRapidity());
1231#endif
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241 }
1242
1243 else {
1244
1245 G4int sampling=0;
1246 G4int region=0;
1247 const G4int numDeadPhiBins = 64;
1248 double abs_eta = std::fabs(etaZpos);
1249 const double DM1EtaWidth = 0.1 ;
1250 const double DM1PhiWidth = 2.*
M_PI / numDeadPhiBins ;
1251 currentCellData.etaBin = (G4int) ( abs_eta * (1./DM1EtaWidth) ) ;
1252 currentCellData.phiBin = (G4int) (phiZpos/ DM1PhiWidth );
1254
1255 if (currentCellData.phiBin==numDeadPhiBins) currentCellData.phiBin=currentCellData.phiBin-1;
1256
1257
1258
1259 if ( currentCellData.zSide == -1 ) {
1260 currentCellData.phiBin = 31 - currentCellData.phiBin;
1261 if (currentCellData.phiBin < 0 ) currentCellData.phiBin +=64 ;
1262 }
1263
1264
1266 sampling =1 ;
1267 region = 3 ;
1268 if (currentCellData.etaBin > 14) currentCellData.etaBin=14;
1269
1270#ifdef DEBUGHITS
1271 ATH_MSG_VERBOSE(
"This hit is in the ECAM volume in front of the accordion (DEAD MATERIAL) !!!!! ");
1272#endif
1273
1275 sampling = 2;
1276
1277 if (abs_eta < 1.0 ) {
1278 region = 0 ;
1279#ifdef DEBUGHITS
1280 ATH_MSG_VERBOSE(
"This hit is in the ECAM volume behind accordion (DEAD MATERIAL 0) !!!!! ");
1281#endif
1282 } else if ( abs_eta >= 1.0 && abs_eta < 1.5) {
1283 region = 2;
1284 currentCellData.etaBin = currentCellData.etaBin - 10;
1285#ifdef DEBUGHITS
1286 ATH_MSG_VERBOSE(
"This hit is in the ECAM volume behind accordion (DEAD MATERIAL 2) !!!!! ");
1287#endif
1288 } else {
1289 ATH_MSG_ERROR(
" LArBarrelGeometry: hit behind accordion at eta>1.5 !!! ");
1290 region = 2;
1291 currentCellData.etaBin = 4;
1292 }
1293
1296 region=0;
1297 const G4int phisave=currentCellData.phiBin;
1298 const G4bool MapDetail(false);
1299 this->
findCell( currentCellData, xZpos, yZpos, zZpos, radiusZpos, etaZpos, phiZpos, MapDetail );
1300 sampling = currentCellData.sampling;
1301 currentCellData.etaBin=0;
1302 currentCellData.phiBin=phisave;
1303
1305 if (abs_eta >1.0 && abs_eta < 1.5) {
1306 sampling=2;
1307 region=2;
1308 currentCellData.etaBin = currentCellData.etaBin - 10;
1309 } else if (abs_eta < 1.6) {
1310 sampling=1;
1311 region=4;
1312 currentCellData.etaBin=0;
1313 } else {
1315 sampling=1;
1316 region=4;
1317 currentCellData.etaBin=0;
1318 }
1319 } else {
1321 const G4double thisStepEnergyDeposit = a_step->GetTotalEnergyDeposit() * a_step->GetTrack()->GetWeight();
1322 std::ostringstream dmLog;
1323 dmLog << "LArBarrelGeometry: cannot find region for DM hit..." << std::endl;
1324 dmLog << "LArBarrelGeometry: cannot find region for DM hit..." << std::endl;
1325 dmLog <<
"m_zMinBarrel: " <<
m_zMinBarrel << std::endl;
1326 dmLog <<
"m_zMaxBarrel: " <<
m_zMaxBarrel << std::endl;
1329 dmLog << "r,z,eta,phi " << radiusZpos << " " << zZpos << " " << etaZpos << " " << phiZpos << std::endl;
1330 dmLog <<
"x,y,z (Atlas) " <<
p.x() <<
" " <<
p.y() <<
" " <<
p.z() << std::endl;
1331 dmLog << " inSTAC " << inSTAC << std::endl;
1332 dmLog << " eDeposited " << thisStepEnergyDeposit << std::endl;
1333 const G4VPhysicalVolume* vol = thisStepPoint->GetPhysicalVolume();
1334 const G4String volName = vol->GetName();
1335 dmLog << " volName " << volName << std::endl;
1336 const G4int ndep = g4navigation->GetDepth();
1337 for (G4int ii=0;ii<=ndep;ii++) {
1338 const G4VPhysicalVolume* v1 = g4navigation->GetVolume(ii);
1339 const G4String vname = v1->GetName();
1340 dmLog << "vname " << vname << std::endl;
1341 }
1342 if (thisStepEnergyDeposit > 1.*CLHEP::MeV) {
1344 } else {
1346 }
1347 }
1348
1349
1350 else
1351 {
1352 G4bool MapDetail=false;
1353 this->
findCell( currentCellData, xZpos, yZpos, zZpos, radiusZpos, etaZpos, phiZpos, MapDetail );
1354
1355
1356
1357
1358 if (currentCellData.sampling==1 && currentCellData.region==0 && currentCellData.etaBin==0) {
1359 currentCellData.etaBin=1;
1360
1361
1362 }
1364 << 1
1365 << currentCellData.zSide
1366 << currentCellData.sampling
1367 << currentCellData.region
1368 << currentCellData.etaBin
1369 << currentCellData.phiBin;
1371 }
1372 }
1373
1375 << currentCellData.zSide * 4
1377 << sampling
1378 << region
1379 << currentCellData.etaBin
1380 << currentCellData.phiBin;
1381
1382#ifdef DEBUGHITS
1383 ATH_MSG_VERBOSE(
"Here the identifier for the barrel DEAD materials ---->");
1390#endif
1391
1392
1393
1394
1395
1396
1397
1398
1399 }
1400
1402
1403 }
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
double m_zMaxBarrelDMMargin
Gaudi::Property< bool > m_testbeam
virtual void findCell(CalcData ¤tCellData, const double &x, const double &y, const double &z, const double &r, const double &eta, const double &phi, const bool detail) const override final