ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
LArG4::Barrel::Geometry Class Reference

#include <LArBarrelGeometry.h>

Inheritance diagram for LArG4::Barrel::Geometry:
Collaboration diagram for LArG4::Barrel::Geometry:

Public Member Functions

 Geometry (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~Geometry ()
 
virtual StatusCode initialize () override final
 
virtual StatusCode finalize () override final
 
virtual void initializeForSDCreation () override final
 
virtual LArG4Identifier CalculateIdentifier (const G4Step *) const override final
 
virtual void findCell (CalcData &currentCellData, const double &x, const double &y, const double &z, const double &r, const double &eta, const double &phi, const bool detail) const override final
 

Protected Member Functions

 Geometry ()
 

Private Member Functions

LArG4Identifier CalculateECAMIdentifier (const G4Step *, const G4int indEcam, const bool inSTAC=true, int zside=1) const
 
bool CheckLArIdentifier (int sampling, int region, int eta, int phi) const
 
bool CheckDMIdentifier (int type, int sampling, int region, int eta, int phi) const
 
double Distance_Ele (const double &x, const double &y, const int &PhiC, int &Num_Straight, const int &Num_Coude, double &xl) const
 
double Distance_Abs (const double &x, const double &y, const int &nabs, const int &Num_Straight, const int &Num_Coude) const
 
G4int SampSeg (G4double, G4double, G4double, G4int &, G4int &, G4int &, G4int &, G4int &) const
 
void GetRphi ()
 phi vs r of first absorber in nominal geometry More...
 
G4double Phi0 (G4double) const
 
G4int PhiGap (const double &, const double &, const double &) const
 

Private Attributes

std::string m_detectorName
 
G4String m_ecamName
 
double m_rMinAccordion
 
double m_rMaxAccordion
 
double m_zMinBarrel
 
double m_zMaxBarrel
 
double m_zMaxBarrelDMMargin
 
double m_etaMaxBarrel
 
int m_NCellTot
 
int m_NCellMax
 
int m_Nbrt
 
int m_Nbrt1
 
double m_gam0
 
double m_rint_eleFib
 
double * m_rc
 
double * m_phic
 
double * m_xc
 
double * m_yc
 
double * m_delta
 
int m_parity
 
const LArCoudeElectrodesm_coudeelec
 
const LArCoudeAbsorbersm_coudeabs
 
const LArStraightElectrodesm_electrode
 
const LArStraightAbsorbersm_absorber
 
bool m_testbeam
 
bool m_iflSAG
 
G4int m_NRphi
 
G4double m_Rmin
 
G4double m_Rmax
 
G4double m_Rphi [5000]
 
G4double m_dR
 

Detailed Description

Definition at line 36 of file LArBarrelGeometry.h.

Constructor & Destructor Documentation

◆ Geometry() [1/2]

LArG4::Barrel::Geometry::Geometry ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 74 of file LArBarrelGeometry.cxx.

74  {
75  declareProperty("DetectorName",m_detectorName);
76  declareProperty("TestBeam", m_testbeam);
77  }
78 
79  // ====================================================================================
80 
82  {
83  // initialize the geometry.
84  // Access source of detector parameters.
85 
87 
88  // number of straight sections (should be 14)
89  m_Nbrt = (int) (parameters->GetValue("LArEMBnoOFAccZigs"));
90  // Number of ZIGs + 1 i.e. 15 = number of folds
91  m_Nbrt1 = m_Nbrt + 1;
92  // phi of first absorber
93  m_gam0 = parameters->GetValue("LArEMBAbsPhiFirst");
94  // radius of curvature of neutral fiber in the folds
95  m_rint_eleFib = parameters->GetValue("LArEMBNeutFiberRadius");
96 
97  m_rc = new double[m_Nbrt1];
98  m_phic = new double[m_Nbrt1];
99  m_delta = new double[m_Nbrt1];
100  m_xc = new double[m_Nbrt1];
101  m_yc = new double[m_Nbrt1];
102 
103  // r,phi positions of the centre of the folds (nominal geometry)
104  for (G4int idat = 0; idat < m_Nbrt1 ; idat++) {
105  m_rc[idat] = (double) parameters->GetValue("LArEMBRadiusAtCurvature",idat);
106  m_phic[idat] = (double) parameters->GetValue("LArEMBPhiAtCurvature",idat);
107  m_delta[idat] = (double) parameters->GetValue("LArEMBDeltaZigAngle",idat);
108  m_xc[idat] = m_rc[idat]*cos(m_phic[idat]);
109  m_yc[idat] = m_rc[idat]*sin(m_phic[idat]);

◆ ~Geometry()

virtual LArG4::Barrel::Geometry::~Geometry ( )
inlinevirtual

Definition at line 43 of file LArBarrelGeometry.h.

43 { };

◆ Geometry() [2/2]

LArG4::Barrel::Geometry::Geometry ( )
protected

Member Function Documentation

◆ CalculateECAMIdentifier()

LArG4Identifier LArG4::Barrel::Geometry::CalculateECAMIdentifier ( const G4Step *  a_step,
const G4int  indEcam,
const bool  inSTAC = true,
int  zside = 1 
) const
private

Definition at line 1065 of file LArBarrelGeometry.cxx.

1070  : midinLocal.phi();
1071  const G4double radius2Zpos = xZpos*xZpos + yZpos*yZpos;
1072  const G4double radiusZpos = sqrt(radius2Zpos);
1073 
1074  CalcData currentCellData;
1075  if (m_testbeam) {
1076  currentCellData.zSide = 1;
1077  }
1078  else {
1079  currentCellData.zSide = zside;
1080  }
1081 
1082  // Check if the hit is in the fiducial range and in the STAC volume
1083  // if yes this is active or inactive material
1084 
1085  if (inSTAC && radiusZpos >=m_rMinAccordion && radiusZpos <= m_rMaxAccordion &&
1086  zZpos <= m_zMaxBarrel && zZpos >= m_zMinBarrel && etaZpos <= m_etaMaxBarrel) {
1087 
1088 #ifdef DEBUGHITS
1089  ATH_MSG_VERBOSE("This hit is in the STAC volume !!!!! ");
1090 #endif
1091 
1092  // DETERMINATION of currentCellData.cellID,
1093  // currentCellData.zSide, currentCellData.sampling,
1094  // currentCellData.phiBin, currentCellData.etaBin,
1095  // m_stackNumID
1096  const bool MapDetail(false);
1097  this->findCell( currentCellData, xZpos, yZpos, zZpos, radiusZpos, etaZpos, phiZpos, MapDetail );
1098 
1099  // adjust phi in the negative half barrel frame
1100 
1101  if( currentCellData.zSide == -1 )
1102  {
1103  if( currentCellData.sampling == 1 && currentCellData.region ==0 )
1104  {
1105  currentCellData.phiBin = 31 - currentCellData.phiBin;
1106  if(currentCellData.phiBin < 0 ) currentCellData.phiBin += 64;
1107  }
1108  if( currentCellData.sampling == 1 && currentCellData.region ==1 )
1109  {
1110  currentCellData.phiBin = 127 - currentCellData.phiBin;
1111  if(currentCellData.phiBin < 0 ) currentCellData.phiBin += 256;
1112  }
1113  if( currentCellData.sampling >= 2 )
1114  {
1115  currentCellData.phiBin = 127 - currentCellData.phiBin;
1116  if(currentCellData.phiBin < 0 ) currentCellData.phiBin += 256;
1117  }
1118  }
1119 
1120  // there are few hundred microns between the 4mm nominal beginning of the active region
1121  // and the real beginning of the first strip at eta=0.025/8
1122  // to avoid inactive energy with strip=0 assign this to strip=1
1123  if (currentCellData.sampling==1 && currentCellData.region==0 && currentCellData.etaBin==0) {
1124  currentCellData.etaBin=1;
1125  }
1126 
1127  result << 4 // LArCalorimeter
1128  << 1 // LArEM
1129  << currentCellData.zSide
1130  << currentCellData.sampling
1131  << currentCellData.region
1132  << currentCellData.etaBin
1133  << currentCellData.phiBin;
1134 
1135 #ifdef DEBUGHITS
1136  ATH_MSG_VERBOSE("Here the identifier for the barrel ACTIVE ----> ");
1137  ATH_MSG_VERBOSE("eta in local frame --> " << etaZpos);
1138  ATH_MSG_VERBOSE("currentCellData.zSide ----> " << currentCellData.zSide);
1139  ATH_MSG_VERBOSE("currentCellData.sampling ----> " << currentCellData.sampling);
1140  ATH_MSG_VERBOSE("currentCellData.region ----> " << currentCellData.region);
1141  ATH_MSG_VERBOSE("currentCellData.etaBin ----> " << currentCellData.etaBin);
1142  ATH_MSG_VERBOSE("currentCellData.phiBin ----> " << currentCellData.phiBin);
1143  ATH_MSG_VERBOSE("And also etafirst ----> " << thisStepPoint->GetPosition().pseudoRapidity());
1144 #endif
1145 
1146  // if (!Geometry::CheckLArIdentifier(currentCellData.sampling,currentCellData.region,currentCellData.etaBin,currentCellData.phiBin)) {
1147  // ATH_MSG_ERROR(" ** Bad LAr identifier " << currentCellData.sampling << " " << currentCellData.region << " "
1148  // << currentCellData.etaBin << " " << currentCellData.phiBin);
1149  // ATH_MSG_ERROR(" x,y,z,eta,phi " << xZpos << " " << yZpos << " " << zZpos
1150  // << " " << radiusZpos << " " << etaZpos << " " << phiZpos);
1151  // }
1152 
1153 
1154  }
1155  // hits in dead material part
1156  else {
1157 
1158  G4int sampling=0;
1159  G4int region=0;
1160  const G4int numDeadPhiBins = 64;
1161  double abs_eta = std::fabs(etaZpos);
1162  const double DM1EtaWidth = 0.1 ;
1163  const double DM1PhiWidth = 2.*M_PI / numDeadPhiBins ;
1164  currentCellData.etaBin = (G4int) ( abs_eta * (1./DM1EtaWidth) ) ;
1165  currentCellData.phiBin = (G4int) (phiZpos/ DM1PhiWidth );
1166  G4int type=1;
1167  // protect against rounding error for phi ~2pi
1168  if (currentCellData.phiBin==numDeadPhiBins) currentCellData.phiBin=currentCellData.phiBin-1;
1169 
1170  // adjust phi for negative half barrel
1171 
1172  if ( currentCellData.zSide == -1 ) {
1173  currentCellData.phiBin = 31 - currentCellData.phiBin;
1174  if (currentCellData.phiBin < 0 ) currentCellData.phiBin +=64 ;
1175  }
1176 
1177  // material in front of the active accordion
1178  if ( radiusZpos < m_rMinAccordion ) {
1179  sampling =1 ;
1180  region = 3 ;
1181  if (currentCellData.etaBin > 14) currentCellData.etaBin=14;
1182 
1183 #ifdef DEBUGHITS
1184  ATH_MSG_VERBOSE("This hit is in the ECAM volume in front of the accordion (DEAD MATERIAL) !!!!! ");
1185 #endif
1186 
1187  } else if (radiusZpos >= m_rMaxAccordion){ // material behind the active accordion
1188  sampling = 2;
1189 
1190  if (abs_eta < 1.0 ) {
1191  region = 0 ;
1192 #ifdef DEBUGHITS
1193  ATH_MSG_VERBOSE("This hit is in the ECAM volume behind accordion (DEAD MATERIAL 0) !!!!! ");
1194 #endif
1195  } else if ( abs_eta >= 1.0 && abs_eta < 1.5) {
1196  region = 2;
1197  currentCellData.etaBin = currentCellData.etaBin - 10; // to have etabin between 0 and 4
1198 #ifdef DEBUGHITS
1199  ATH_MSG_VERBOSE("This hit is in the ECAM volume behind accordion (DEAD MATERIAL 2) !!!!! ");
1200 #endif
1201  } else {
1202  ATH_MSG_ERROR(" LArBarrelGeometry: hit behind accordion at eta>1.5 !!! ");
1203  region = 2;
1204  currentCellData.etaBin = 4;
1205  }
1206 
1207  } else if (zZpos <= m_zMinBarrel) { // inactive matter between two EMB halves
1208  type=2;
1209  region=0;
1210  const G4int phisave=currentCellData.phiBin;
1211  const G4bool MapDetail(false);
1212  this->findCell( currentCellData, xZpos, yZpos, zZpos, radiusZpos, etaZpos, phiZpos, MapDetail );
1213  sampling = currentCellData.sampling; // sampling as in normal definition
1214  currentCellData.etaBin=0;
1215  currentCellData.phiBin=phisave;
1216 
1217  } else if (zZpos >= m_zMaxBarrel - m_zMaxBarrelDMMargin || abs_eta >= 1.40) { // inactive matter between EMB and scintillator including some margin for error
1218  if (abs_eta >1.0 && abs_eta < 1.5) {
1219  sampling=2;
1220  region=2;
1221  currentCellData.etaBin = currentCellData.etaBin - 10; // to have etabin between 0 and 4
1222  } else if (abs_eta < 1.6) {
1223  sampling=1;
1224  region=4;
1225  currentCellData.etaBin=0;
1226  } else {
1227  ATH_MSG_ERROR(" LArBarrelGeometry: hit at eta>1.6 !!! ");
1228  sampling=1;
1229  region=4;
1230  currentCellData.etaBin=0;
1231  }
1232  } else {
1233  if (!m_testbeam) {
1234  const G4double thisStepEnergyDeposit = a_step->GetTotalEnergyDeposit() * a_step->GetTrack()->GetWeight();
1235  std::ostringstream dmLog;
1236  dmLog << "LArBarrelGeometry: cannot find region for DM hit..." << std::endl;
1237  dmLog << "LArBarrelGeometry: cannot find region for DM hit..." << std::endl;
1238  dmLog << "m_zMinBarrel: " << m_zMinBarrel << std::endl;
1239  dmLog << "m_zMaxBarrel: " << m_zMaxBarrel << std::endl;
1240  dmLog << "m_rMinAccordion: " << m_rMinAccordion << std::endl;
1241  dmLog << "m_rMaxAccordion: " << m_rMaxAccordion << std::endl;
1242  dmLog << "r,z,eta,phi " << radiusZpos << " " << zZpos << " " << etaZpos << " " << phiZpos << std::endl;
1243  dmLog << "x,y,z (Atlas) " << p.x() << " " << p.y() << " " << p.z() << std::endl;
1244  dmLog << " inSTAC " << inSTAC << std::endl;
1245  dmLog << " eDeposited " << thisStepEnergyDeposit << std::endl;
1246  const G4VPhysicalVolume* vol = thisStepPoint->GetPhysicalVolume();
1247  const G4String volName = vol->GetName();
1248  dmLog << " volName " << volName << std::endl;
1249  const G4int ndep = g4navigation->GetDepth();
1250  for (G4int ii=0;ii<=ndep;ii++) {
1251  const G4VPhysicalVolume* v1 = g4navigation->GetVolume(ii);
1252  const G4String vname = v1->GetName();
1253  dmLog << "vname " << vname << std::endl;
1254  }
1255  if (thisStepEnergyDeposit > 1.*CLHEP::MeV) {
1256  ATH_MSG_ERROR(dmLog.str());
1257  } else {
1258  ATH_MSG_WARNING(dmLog.str());
1259  }
1260  }
1261  // in test beam case, we can get there for leakage on the side (in phi) of the module
1262  // in this case, we attribute an identifier like inactive material
1263  else
1264  {
1265  G4bool MapDetail=false;
1266  this->findCell( currentCellData, xZpos, yZpos, zZpos, radiusZpos, etaZpos, phiZpos, MapDetail );
1267  // ATH_MSG_ERROR(" Lateral lakage r,eta,phi " << radiusZpos << " " << etaZpos << " "
1268  // << phiZpos << " sampling/region/eta/phi " << currentCellData.sampling << " " <<
1269  // currentCellData.region << " " << currentCellData.etaBin << " " << currentCellData.phiBin);
1270  // protect against small space between z=4m and real beginning of ieta=1 in strips
1271  if (currentCellData.sampling==1 && currentCellData.region==0 && currentCellData.etaBin==0) {
1272  currentCellData.etaBin=1;
1273  // ATH_MSG_ERROR("S1R0 etabin 0 found r,z,phi local " << radiusZpos << " "
1274  // << " " << zZpos << " " << phiZpos);
1275  }
1276  result << 4 // LArCalorimeter
1277  << 1 // LArEM
1278  << currentCellData.zSide
1279  << currentCellData.sampling
1280  << currentCellData.region
1281  << currentCellData.etaBin
1282  << currentCellData.phiBin;
1283  return result;
1284  }
1285  }
1286 
1287  result << 10 // LArCalorimeter
1288  << currentCellData.zSide * 4 // LArBarrel
1289  << type
1290  << sampling
1291  << region
1292  << currentCellData.etaBin
1293  << currentCellData.phiBin;
1294 
1295 #ifdef DEBUGHITS
1296  ATH_MSG_VERBOSE("Here the identifier for the barrel DEAD materials ---->");
1297  ATH_MSG_VERBOSE("Type ----> " << type);
1298  ATH_MSG_VERBOSE("Sampling ----> " << sampling);
1299  ATH_MSG_VERBOSE("Region ----> " << region);
1300  ATH_MSG_VERBOSE("zSide ----> " << currentCellData.zSide*4);
1301  ATH_MSG_VERBOSE("etaBin ----> " << currentCellData.etaBin);
1302  ATH_MSG_VERBOSE("phiBin ----> " << currentCellData.phiBin);
1303 #endif
1304 
1305  // if (!Geometry::CheckDMIdentifier(type,sampling,region,currentCellData.etaBin,currentCellData.phiBin)) {
1306  // ATH_MSG_ERROR(" ** Bad DM identifier " << type << " " << sampling << " " << region << " "
1307  // << currentCellData.etaBin << " " << currentCellData.phiBin);
1308  // ATH_MSG_ERROR("x,y,z,r,eta,phi" << xZpos << " " << yZpos << " " << zZpos <<
1309  // " " << radiusZpos << " " << etaZpos << " " << phiZpos);
1310  // }
1311 
1312  }
1313 
1314  return result;
1315 
1316  }
1317 
1318  bool Geometry::CheckDMIdentifier(int type, int sampling, int region, int eta, int phi) const
1319  {
1320 
1321  if (type <1 || type > 2) return false;
1322  if (type==1) {
1323  if (sampling<1 || sampling>2) return false;
1324  if (sampling==1) {
1325  if (region!=3 && region !=4) return false;
1326  if (phi<0 || phi>63) return false;
1327  if (region==3) {
1328  if (eta<0 || eta>14) return false;
1329  }
1330  if (region==4) {
1331  if (eta !=0) return false;
1332  }
1333  }
1334  if (sampling==2) {
1335  if (region !=0 && region !=2) return false;
1336  if (phi<0 || phi>63) return false;
1337  if (region==0){
1338  if (eta<0 || eta>9) return false;
1339  }
1340  if (region==2) {
1341  if (eta<0 || eta>4) return false;
1342  }
1343  }
1344  }
1345  if (type==2) {
1346  if (sampling<1 || sampling >3) return false;
1347  if (region !=0) return false;
1348  if (eta!=0) return false;

◆ CalculateIdentifier()

LArG4Identifier LArG4::Barrel::Geometry::CalculateIdentifier ( const G4Step *  a_step) const
finaloverridevirtual

Definition at line 985 of file LArBarrelGeometry.cxx.

◆ CheckDMIdentifier()

bool LArG4::Barrel::Geometry::CheckDMIdentifier ( int  type,
int  sampling,
int  region,
int  eta,
int  phi 
) const
private

Definition at line 1350 of file LArBarrelGeometry.cxx.

1356  {
1357  if (sampling<0 || sampling >3) return false;
1358  if (sampling==0) {
1359  if (region!=0) return false;
1360  if (eta<0 || eta>60) return false;
1361  if (phi<0 || phi>63) return false;
1362  }
1363  if (sampling==1) {
1364  if (region<0 || region >1) return false;
1365  if (region==0) {
1366  if (eta<1 || eta>447) return false;
1367  if (phi<0 || phi>63) return false;
1368  }
1369  if (region==1) {
1370  if (eta<0 || eta>2) return false;
1371  if (phi<0 || phi>255) return false;
1372  }
1373  }
1374  if (sampling==2) {
1375  if (region<0 || region >1) return false;
1376  if (region==0) {
1377  if (eta<0 || eta>55) return false;
1378  if (phi<0 || phi>255) return false;
1379  }
1380  if (region==1) {
1381  if (eta!=0) return false;
1382  if (phi<0 || phi>255) return false;
1383  }
1384  }

◆ CheckLArIdentifier()

bool LArG4::Barrel::Geometry::CheckLArIdentifier ( int  sampling,
int  region,
int  eta,
int  phi 
) const
private

Definition at line 1387 of file LArBarrelGeometry.cxx.

◆ Distance_Abs()

double LArG4::Barrel::Geometry::Distance_Abs ( const double &  x,
const double &  y,
const int &  nabs,
const int &  Num_Straight,
const int &  Num_Coude 
) const
private

Definition at line 290 of file LArBarrelGeometry.cxx.

291  { m_coudeabs->XCentCoude(Num_Coude, PhiCell), m_coudeabs->YCentCoude(Num_Coude, PhiCell) };
292  // c_Hit Vector components and its length
293  dx = xhit - Xc[0];
294  dy = yhit - Xc[1];
295  const double dr = sqrt( dx*dx + dy*dy);
296  return (Num_Coude%2 == m_parity) ? (m_rint_eleFib-dr) : (dr - m_rint_eleFib);
297  } // end of Fold Regions
298  } // end of the function Distance_Abs
299 
300 
301  //=============================================================================
302  // Function SampSeg
303  //
304  // eta-sampling segmentation of barrel calorimeter GU, January 2005
305  // input values: eta,radius in half-barrel frame
306  //
307  // return value of function: true=active area, false=inactive area
308  // return arguments: iregion,isampling,ieta
309  // take into account detailed electrode drawing
310  // with readout strips
311  // isamp2,ieta2 do not take into account
312  // readout strips and can be used to access current
313  // maps.
314  //
315  // iregion=0 (eta<1.4) or 1 (eta=1.4-1.475)
316  // for region 0: isampling = 1 (strips), 2 (middle), 3 (back)
317  // for region 1: isampling = 1 or isampling = 2
318  // ieta= eta cell number
319  // region0,samp1: ieta=1->448 (strip 0 does not exist)
320  // region0,samp2: ieta=0->55
321  // region0,samp3: ieta=0->26 (max eta 1.325)
322  // region1,samp1: ieta=0->2 (deta=0.025)
323  // region1,samp2: ieta=0 (only 1 cell)
324 
325  G4int Geometry::SampSeg(G4double eta, G4double radius, G4double z,
326  G4int& iregion, G4int& isampling, G4int& ieta,
327  G4int& isamp2, G4int& ieta2) const
328  {
329  // Helper struct to hold pre-calculated geometry information
330  struct Geo {

◆ Distance_Ele()

double LArG4::Barrel::Geometry::Distance_Ele ( const double &  x,
const double &  y,
const int &  PhiC,
int &  Num_Straight,
const int &  Num_Coude,
double &  xl 
) const
private

Definition at line 216 of file LArBarrelGeometry.cxx.

216  { m_electrode->XCentEle(Num_Straight, PhiCell), m_electrode->YCentEle(Num_Straight, PhiCell) };
217  // m_Hit Vector components
218  double dx = xhit - Xm[0];
219  double dy = yhit - Xm[1];
220 
221  // First compute algebric distance m_hit (2D) the 2D_projection of the
222  // m_Hit Vector on this electrode neutral fiber.
223  const double hit = dx*u[0] + dy*u[1];
224 
225  //
226  // Flat of Fold Region ?
227  //
228  const G4double Half_Elec(m_electrode->HalfLength(Num_Straight,PhiCell));
229 
230  if(std::fabs(hit) < Half_Elec) {
231  // Flat Region
232  xl=hit/Half_Elec;
233  return u[0]*dy - u[1]*dx;
234  }
235  else {
236  // Fold region
237  // c_Hit Vector components and its length
238  dx = xhit - Xc[0];
239  dy = yhit - Xc[1];
240  const double dr = sqrt( dx*dx + dy*dy);
241  if (Num_Coude==Num_Straight) { xl=-1.; }
242  else xl=+1;
243  return (Num_Coude%2 == m_parity) ? (m_rint_eleFib-dr) : (dr - m_rint_eleFib);
244  } // end of Fold Regions
245  } // end of the function Distance_Ele
246 
247 
248  //======================================================================================
249  // Algebric distance to absorber
250  //
251  // inputs: xhit,yhit = x,y positions in local half barrel
252  // PhiCell = absorber number in phi (0 to 1023 for Atlas case)
253  // Num_Straight = number (0 to 13) of the straight section
254  // Num_Coude = number (0 to 14) of closest fold
255  //
256  // output: Function value = algebric distance to electrode
257 
258  double Geometry::Distance_Abs(const double & xhit,
259  const double &yhit, const int &PhiCell, const int &Num_Straight,
260  const int &Num_Coude) const
261  {
262  //
263  // FrameWork is consistent with the one used to PhiCell determination
264  // e.g. it assumes HERE to be the LOCAL one of "stac_phys1",
265  // (mother of ACCordion volumes) from which Z> 0. and Z < 0. half_barrel
266  // parts are then defined.
267  //
268  // One needs POINTERS to Electrode neutral fibers
269  // either for straight parts or for folds
270  //
271  // u unit 2D_Vector along straight part of the electrode neutral fiber
272  const G4double u[2] = { m_absorber->Cosu(Num_Straight, PhiCell), m_absorber->Sinu(Num_Straight, PhiCell) };
273  // Middle m_coordinates of this straight part of the electrode neutral fiber
274  const G4double Xm[2] = { m_absorber->XCentAbs(Num_Straight, PhiCell), m_absorber->YCentAbs(Num_Straight, PhiCell) };
275  // m_Hit Vector components
276  double dx = xhit - Xm[0]; double dy = yhit - Xm[1];
277 

◆ finalize()

StatusCode LArG4::Barrel::Geometry::finalize ( )
finaloverridevirtual

Definition at line 187 of file LArBarrelGeometry.cxx.

187  {
188  //
189  // FrameWork is consistent with the one used to PhiCell determination
190  // e.g. it assumes HERE to be the LOCAL one of "stac_phys1",
191  // (mother of ACCordion volumes) from which Z> 0. and Z < 0. half_barrel
192  // parts are then defined.
193  //
194  // One needs POINTERS to Electrode neutral fibers
195  // either for straight parts or for folds
196  //

◆ findCell()

void LArG4::Barrel::Geometry::findCell ( CalcData currentCellData,
const double &  x,
const double &  y,
const double &  z,
const double &  r,
const double &  eta,
const double &  phi,
const bool  detail 
) const
finaloverridevirtual

Definition at line 643 of file LArBarrelGeometry.cxx.

643  {
644  currentCellData.nfold +=1;
645  }
646  if (currentCellData.nfold <0 || currentCellData.nfold >= m_Nbrt1) {
647  ATH_MSG_ERROR("Invalid fold number " << currentCellData.nfold);
648  return;
649  }
650 
651 
652 #ifdef DEBUGHITS
653  ATH_MSG_VERBOSE(" BarrelGeometry: radius,eta,phi " << aRadius << " " << anEta << " ");
654  ATH_MSG_VERBOSE(" Straight/Fold numbers " << currentCellData.nstraight << " " << currentCellData.nfold);
655 #endif
656 
657  // eta and longitudinal segmentations
658  G4int ireg,isamp,ieta,isamp2,ieta2;
659  currentCellData.cellID = this->SampSeg(anEta,aRadius,zPosition,ireg,isamp,ieta,isamp2,ieta2);
660 
661  currentCellData.etaBin = ieta;
662  currentCellData.sampling = isamp;
663  currentCellData.region = ireg;
664  currentCellData.etaMap = ieta2;
665  currentCellData.sampMap = isamp2;
666 
667  // compute electrode number in phi
668  int phicell = this->PhiGap(aRadius,xPosition,yPosition);
669  if (phicell<0) phicell=0;
670  // for test beam, some protection
671  if (m_NCellTot !=1024) {
672  if (phicell>=m_NCellTot) {
673  if (phicell<512) { phicell=m_NCellTot-1; }
674  else { phicell=0; }
675  currentCellData.cellID=0;
676  }
677  }
678 
679 #ifdef DEBUGHITS
680  ATH_MSG_VERBOSE(" phigap " << phicell);
681 #endif
682 
683  // compute readout cell number
684  int sampling_phi_nGaps=4;
685  if (currentCellData.region==0 && currentCellData.sampling==1) { sampling_phi_nGaps=16; }
686 
687  if (currentCellData.cellID==0) {
688  currentCellData.phiBin = (G4int) ( phicell/sampling_phi_nGaps );
689  currentCellData.distElec=9999.;
690  return;
691  }
692 
693  // compute distance to electrode
694  G4double xl;
695  G4int nstr = currentCellData.nstraight;
696  const G4double distElec = this->Distance_Ele(xPosition,yPosition,phicell,nstr,currentCellData.nfold,xl);
697 
698 #ifdef DEBUGHITS
699  ATH_MSG_VERBOSE(" distElec " << distElec);
700 #endif
701 
702  // if distance is < 2.5mm we are sure to be in the correct gap
703  if (std::fabs(distElec) > 2.5) {
704  // try +-2 electrode in phi to get minimum distance
705  double dElecMin=distElec;
706  double xlmin=xl;
707  int phicellmin=phicell;
708  for (int ii=-2;ii<3;ii++) {
709  if (ii==0) { continue; }
710  int phicellnew = phicell+ii;
711  // for test beam no phi wrapping
712  if (m_NCellTot != 1024 && ( phicellnew<0 || phicellnew >= m_NCellTot)) { continue; }
713  if (phicellnew < 0) { phicellnew += m_NCellTot; }
714  if (phicellnew >= m_NCellTot) { phicellnew -= m_NCellTot; }
715  double xln;
716  int nstr2=currentCellData.nstraight;
717  double dElec = Distance_Ele(xPosition,yPosition,phicellnew,nstr2,currentCellData.nfold,xln);
718  if (std::fabs(dElec)<std::fabs(dElecMin)) {
719  phicellmin=phicellnew;
720  xlmin=xln;
721  dElecMin = dElec;
722  nstr=nstr2;
723  }
724  }
725  currentCellData.phiGap = phicellmin;
726  currentCellData.distElec = dElecMin;
727  currentCellData.xl = xlmin;
728  currentCellData.nstraight = nstr;
729  } // end distance >2.5mm
730  else {
731  currentCellData.phiGap=phicell;
732  currentCellData.distElec=distElec;
733  currentCellData.xl=xl;
734  currentCellData.nstraight=nstr;
735  }
736 
737 #ifdef DEBUGHITS
738  ATH_MSG_VERBOSE(" final phiGap,distElec,xl " << currentCellData.phiGap << " " << currentCellData.distElec << " "
739  << currentCellData.xl);
740 #endif
741 
742  // compute distance to absorber
743 
744  G4int nabs;
745  if (currentCellData.distElec<0) nabs=currentCellData.phiGap;
746  else nabs=currentCellData.phiGap+1;
747  if (nabs >= m_NCellMax) nabs -= m_NCellMax;
748  currentCellData.distAbs = Distance_Abs(xPosition,yPosition,nabs,currentCellData.nstraight,currentCellData.nfold);
749 #ifdef DEBUGHITS
750  ATH_MSG_VERBOSE(" nabs,distAbs " << nabs << " " << currentCellData.distAbs);
751 #endif
752 
753  // in some rare cases near fold, the closest distance could give the wrong gap
754  // in such case, the signs of distAbs and distElec are not opposite as they should
755  if ((currentCellData.distAbs>0. && currentCellData.distElec>0) ||
756  (currentCellData.distAbs<0. && currentCellData.distElec<0) ) {
757  // ATH_MSG_VERBOSE("distElec and distAbs same sign " << currentCellData.distElec << " " << currentCellData.distAbs);
758  // ATH_MSG_VERBOSE(" currentCellData.phiGap " << currentCellData.phiGap);
759  if (std::fabs(currentCellData.distElec)>std::fabs(currentCellData.distAbs)) {
760  if (currentCellData.distAbs>0) { currentCellData.phiGap += 1; }
761  if (currentCellData.distAbs<0) { currentCellData.phiGap -= 1; }
762  if (m_NCellTot != 1024) {
763  if (currentCellData.phiGap <0) { currentCellData.phiGap=0; }
764  if (currentCellData.phiGap >= m_NCellTot) { currentCellData.phiGap = m_NCellTot-1; }
765  }
766  else {
767  if (currentCellData.phiGap < 0) { currentCellData.phiGap += m_NCellTot; }
768  if (currentCellData.phiGap >= m_NCellTot) { currentCellData.phiGap -= m_NCellTot; }
769  }
770  currentCellData.distElec = Distance_Ele(xPosition,yPosition,currentCellData.phiGap,currentCellData.nstraight,currentCellData.nfold,currentCellData.xl);
771  // ATH_MSG_VERBOSE(" new phiGap,distElec " << currentCellData.phiGap << " " << currentCellData.distElec);
772  }
773  }
774 
775  currentCellData.phiBin = (G4int) ( currentCellData.phiGap/sampling_phi_nGaps );
776 
777  if (MapDetail) {
778  // compute x0,y0 coordinates in local electrode frame, using closest fold
779  // as reference
780  const G4double alpha = m_coudeelec->PhiRot(currentCellData.nfold,currentCellData.phiGap);
781  const G4double dx=xPosition-m_coudeelec->XCentCoude(currentCellData.nfold,currentCellData.phiGap);
782  const G4double dy=yPosition-m_coudeelec->YCentCoude(currentCellData.nfold,currentCellData.phiGap);
783  const G4double dx1=dx*cos(alpha)-dy*sin(alpha);
784  const G4double dy1=dx*sin(alpha)+dy*cos(alpha);
785  currentCellData.x0 = dx1 + m_xc[currentCellData.nfold];
786  currentCellData.y0 = dy1 + m_yc[currentCellData.nfold];
787  if (m_parity==1) { currentCellData.y0 = -1*currentCellData.y0; }
788  }
789 
790 
791  } // end of findCell method
792 
793  // =============================================================================
794  // initialize phi0 vs radius of first absorber (for gam=0)
795  void Geometry::GetRphi()
796  {
797  const G4double dl=0.001;
798  const G4double inv_dl = 1. / dl;
799  G4double cenx[15],ceny[15];
800  //G4double xl,xl2;
801  G4double sum1[5000],sumx[5000];
802  //xl=0;
803  //xl2=0.;
804  m_NRphi=5000;
805  m_Rmin=1500.;
806  m_dR=0.10;
807  m_Rmax=0.;
808 
809  const G4double rint= m_rint_eleFib;
810  const G4double inv_rint = 1. / rint;
811  const G4double dt=dl * inv_rint;
812  const G4double inv_dt = 1. / dt;
813 
814  for (G4int i=0;i<m_NRphi;i++) {
815  sum1[i]=0.;
816  sumx[i]=0.;
817  }
818  for (G4int i=0;i<15;i++) {
819  cenx[i]=m_rc[i]*cos(m_phic[i]);
820  ceny[i]=m_rc[i]*sin(m_phic[i]);
821  }
822 
823  for (G4int i=0; i<15; i++) {

◆ GetRphi()

void LArG4::Barrel::Geometry::GetRphi ( )
private

phi vs r of first absorber in nominal geometry

Initialize r-phi reference map (called from constructor)

Definition at line 827 of file LArBarrelGeometry.cxx.

827  {
828  // first fold goes up
829  if (m_parity==0) {
830  phi0=-CLHEP::pi/2.;
831  phi1=-m_delta[0];
832  }
833  // first fold goes down
834  else {
835  phi0=m_delta[0];
836  phi1=CLHEP::pi/2;
837  }
838  }
839  else if (i==14) {
840  if (m_parity==0) {
841  phi0=-CLHEP::pi+m_delta[13];
842  phi1=-CLHEP::pi/2.;
843  }
844  else {
845  phi0=CLHEP::pi/2;
846  phi1=CLHEP::pi - m_delta[13];
847  }
848  }
849  else {
850  if (i%2==(1-m_parity)) {
851  phi0=m_delta[i];
852  phi1=CLHEP::pi-m_delta[i-1];
853  }
854  else {
855  phi0=-CLHEP::pi+m_delta[i-1];
856  phi1=-m_delta[i];
857  }
858  }
859  //xl2+=rint*std::fabs(phi1-phi0);
860  const G4int nstep=int((phi1-phi0)*inv_dt)+1;
861  for (int ii=0;ii<nstep;ii++) {
862  //xl+=dl;
863  const G4double phi=phi0+dt*((G4double)ii);
864  const G4double x=cenx[i]+rint*cos(phi);
865  const G4double y=ceny[i]+rint*sin(phi);
866  const G4double radius=sqrt(x*x+y*y);
867  if (radius>m_Rmax) { m_Rmax=radius; }
868  const G4double phid=atan(y/x);
869  const G4int ir=((int) ((radius-m_Rmin)/m_dR) );
870  if (ir>=0 && ir < m_NRphi) {
871  sum1[ir]+=1.;
872  sumx[ir]+=phid;
873  }
874  }
875 
876  // straight section
877  if (i<14) {
878  const G4double dx=cenx[i+1]-cenx[i];
879  const G4double dy=ceny[i+1]-ceny[i];
880  const G4double along=std::sqrt(dx*dx+dy*dy-4.*rint*rint);
881  const G4double x0=0.5*(cenx[i+1]+cenx[i]);
882  const G4double y0=0.5*(ceny[i+1]+ceny[i]);
883  const G4double phi = (i%2==m_parity) ? CLHEP::pi/2-m_delta[i] : -CLHEP::pi/2.+m_delta[i];
884  const G4double x1=x0-0.5*along*cos(phi);
885  const G4double y1=y0-0.5*along*sin(phi);
886  //xl2+=along;
887  const int nstep=int(along*inv_dl)+1;
888  for (int ii=0;ii<nstep;ii++) {
889  //xl+=dl;
890  const G4double x=x1+dl*((G4double)ii)*cos(phi);
891  const G4double y=y1+dl*((G4double)ii)*sin(phi);
892  const G4double radius=sqrt(x*x+y*y);
893  if (radius>m_Rmax) { m_Rmax=radius; }
894  const G4double phid=atan(y/x);
895  const G4int ir=((int) ((radius-m_Rmin)/m_dR) );
896  if (ir>=0 && ir < m_NRphi) {
897  sum1[ir]+=1.;
898  sumx[ir]+=phid;
899  }
900  }
901  }
902  }
903  // ATH_MSG_VERBOSE("total electrode length " << xl << " " << xl2);
904  // ATH_MSG_VERBOSE("rmax in accordion " << m_Rmax);
905  for (int i=0; i<m_NRphi; i++) {
906  if (sum1[i]>0) {
907  m_Rphi[i]=sumx[i]/sum1[i];
908  // Not used:
909  //G4double radius = m_Rmin + ((G4double(i))+0.5)*m_dR;
910  //ATH_MSG_VERBOSE(" GUTEST r,phi0 " << radius << " " << m_Rphi[i]);
911  }
912  else { m_Rphi[i]=0.; }
913  }
914  }
915 
916  // ======================================================================================
917  // phi of first absorber as function of radius for nominal accordion geometry
918  // (before sagging)
919  G4double Geometry::Phi0(G4double radius) const
920  {
921  // TODO This function could be simplified.
922  G4int ir;
923  if (radius < m_Rmin) { ir=0; }
924  else {
925  if (radius > m_Rmax) radius=m_Rmax-0.0001;
926  ir=((int) ((radius-m_Rmin)/m_dR) );
927  }
928  return m_Rphi[ir];
929  }
930 
931  // ======================================================================================
932  // compute number (0 to 1023) of closest electrode according to nominal
933  // accordion geometry
934  G4int Geometry::PhiGap(const double & radius, const double & xhit, const double &yhit) const
935  {
936  const G4double phi0=Phi0(radius)+m_gam0; // from -pi to pi
937  const G4double phi_hit=atan2(yhit,xhit); // from -pi to pi
938  G4double dphi=phi_hit-phi0;
939  // bring back to 0-2pi
940  if (dphi<0) dphi=dphi+2*M_PI;
941  if (dphi>=2*M_PI) dphi=dphi-2*M_PI;
942  dphi=dphi/(2*M_PI)*1024;
943  const G4int ngap=((int) dphi);
944 #ifdef DEBUGHITS
945  ATH_MSG_VERBOSE(" phi0 " << phi0 << " dphi, ngap " << dphi << " " << ngap);
946 #endif

◆ initialize()

StatusCode LArG4::Barrel::Geometry::initialize ( )
finaloverridevirtual

Definition at line 113 of file LArBarrelGeometry.cxx.

113  { m_parity=1; }
114  //
115  m_rMinAccordion = parameters->GetValue("LArEMBRadiusInnerAccordion");
116  m_rMaxAccordion = parameters->GetValue("LArEMBFiducialRmax");
117  m_etaMaxBarrel = parameters->GetValue("LArEMBMaxEtaAcceptance");
118  m_zMinBarrel = parameters->GetValue("LArEMBfiducialMothZmin");
119  m_zMaxBarrel = parameters->GetValue("LArEMBfiducialMothZmax");
120  m_zMaxBarrelDMMargin = 10.0; // 10 mm margin
121  // === GU 11/06/2003 total number of cells in phi
122  // to distinguish 1 module (testbeam case) from full Atlas
123  m_NCellTot = (int) (parameters->GetValue("LArEMBnoOFPhysPhiCell"));
124  // total number of cells in phi to distinguish 1 module (testbeam case) from full Atlas
125  m_testbeam=false;
126  if (m_NCellTot != 1024) {
127  m_testbeam=true;
128  }
129  m_NCellMax=1024;
130  // ===
131 
132  // Initialize r-phi reference map
133  this->GetRphi();
134 
135  if (m_detectorName.empty()) m_ecamName = "LAr::EMB::ECAM";
136  else m_ecamName = m_detectorName+"::LAr::EMB::ECAM";
137 
138 
139  return StatusCode::SUCCESS;
140  }
141 
142  // ====================================================================================
143 
145  {
146  // get pointers to access G4 geometry
151  }
152 
153  // ====================================================================================
154 
156  {
157  if (m_rc) delete [] m_rc;
158  if (m_phic) delete [] m_phic;
159  if (m_delta) delete [] m_delta;
160  if (m_xc) delete [] m_xc;
161  if (m_yc) delete [] m_yc;
162 
163  return StatusCode::SUCCESS;
164  }
165 
166  //======================================================================================
167  //
168  // Here INTRINSIC Distance_to_electrode determination (G.P.)
169  //
170  // This retuns an ALGEBRICDistEle value, the distance from electrode
171  //neutral fiber TOWARDS the Sub_Step in LAr (measured on a local perpendicular
172  //vector unit oriented upwards i.e. following increasing Phi values).

◆ initializeForSDCreation()

void LArG4::Barrel::Geometry::initializeForSDCreation ( )
finaloverridevirtual

Definition at line 176 of file LArBarrelGeometry.cxx.

◆ Phi0()

G4double LArG4::Barrel::Geometry::Phi0 ( G4double  radius) const
private

Definition at line 951 of file LArBarrelGeometry.cxx.

954  {
955 
956  // The default result is a blank identifier.
958 
959  // Get all the required information from the current step
960  const G4NavigationHistory* g4navigation = a_step->GetPreStepPoint()->GetTouchable()->GetHistory();
961  const G4int ndep = g4navigation->GetDepth();

◆ PhiGap()

G4int LArG4::Barrel::Geometry::PhiGap ( const double &  radius,
const double &  xhit,
const double &  yhit 
) const
private

Definition at line 966 of file LArBarrelGeometry.cxx.

967  {
968  const G4String& vname = g4navigation->GetVolume(ii)->GetName();
969  // FIXME Need to find a way to avoid these string-comparisons
970  if ( indECAM<0 && vname == m_ecamName ) indECAM=ii;
971  if ( !inSTAC && vname.find("STAC") !=std::string::npos) inSTAC=true;
972  if ( vname.find("NegPhysical") != std::string::npos) zside=-1;
973  }
974  if (indECAM>=0)
975  result = this->CalculateECAMIdentifier( a_step , indECAM, inSTAC, zside) ;
976  else
977  ATH_MSG_ERROR("LArBarrel::Geometry::CalculateIdentifier ECAM volume not found in hierarchy");
978 
979  return result;
980  }

◆ SampSeg()

G4int LArG4::Barrel::Geometry::SampSeg ( G4double  eta,
G4double  radius,
G4double  z,
G4int &  iregion,
G4int &  isampling,
G4int &  ieta,
G4int &  isamp2,
G4int &  ieta2 
) const
private

Definition at line 357 of file LArBarrelGeometry.cxx.

400  {
401 
402  // get radius for end of strips
403  istrip=(int) (aeta/deta*8.);
404  if (istrip<0 || istrip >=448) {
405  ATH_MSG_ERROR(" Problem aeta,istrip " << aeta << " " << istrip);
406  return 0;
407  }
408  r12=Rmax1[istrip];
409 
410  // get radius for end of middle
411  imid = (int) (aeta/deta);
412  if (imid <0 || imid >=56) {
413  ATH_MSG_ERROR(" Problem aeta,imid " << aeta << " " << imid);
414  return 0;
415  }
416  r23=Rmax2[imid];
417 
418  iregion=0;
419 
420  // strips
421  if (radius <= r12) {
422  isampling=1;
423  ieta=istrip;
424  if (ieta==0) iactive=0;
425  isamp2=1;
426  ieta2=istrip;
427  }
428 
429  // region between strips and middle => not active, same identifier as strips
430  else if (radius < (r12+Dr_s12)) {
431  isampling=1;
432  ieta=istrip;
433  iactive=0;
434  isamp2=1;
435  ieta2=istrip;
436  }
437 
438  else {
439 
440  // eta<1.325, we can be in the back
441  if (aeta<Eta_max_s3) {
442  // radius<r23 we are in the middle
443  if (radius <= r23) {
444  isampling=2;
445  ieta=imid;
446  isamp2=2;
447  ieta2=imid;
448  }
449  // for radius >r23 we have to take care of the readout strips at high z
450  // and attribute some of the energy to other cells
451  else { // radius>r23
452  if (z>g.zmax1) {
453  isampling=2;
454  ieta=55;
455  }
456  else if (z>g.zmax2) {
457  isampling=2;
458  ieta=54;
459  }
460  else if (z>g.zmax3) {
461  isampling=2;
462  ieta=53;
463  }
464  else if (z>g.zmax4) {
465  isampling=3;
466  ieta=26;
467  }
468  else if (aeta<1.3 && z>g.zmax5) {
469  isampling=2;
470  ieta=52;
471  }
472  else if (aeta<1.3 && z>g.zmax6) {
473  isampling=2;
474  ieta=51;
475  }
476  else if (radius>g.rmax4 && z<g.zmax5 && aeta>1.2) {
477  if (radius>g.rmax1) {
478  isampling=2;
479  ieta=51;
480  }
481  else if(radius>g.rmax2) {
482  isampling=3;
483  ieta=25;
484  }
485  else if (radius>g.rmax3) {
486  if (z<g.zmax7) {
487  isampling=2;
488  ieta=50;
489  }
490  else {
491  isampling=3;
492  ieta=25;
493  }
494  }
495  else {
496  if (aeta<1.25) {
497  isampling=2;
498  ieta=49;
499  }
500  else {
501  isampling=3;
502  ieta=25;
503  }
504  }
505  }
506  // normal back cell
507  else {
508  isampling=3;
509  ieta=imid/2;
510  isamp2=3;
511  ieta2=ieta;
512  }
513  isamp2=3;
514  ieta2=imid/2;
515  } // end radius>r23
516  // put into middle energy deposited along readout strips across the back
517  if (isampling==3 && z<g.zmax4 && (radius<g.rmax4 || aeta<1.2) ) {
518  const double etastr = (imid%2==0) ? 0.025*imid : 0.025*(imid+1);
519  const double delta=radius*(sinh(etastr)-sinh(aeta))/cosh(etastr);
520  double deltastr;
521  if (aeta<0.475) { deltastr=1.5;}
522  else if (aeta<0.80) { deltastr=2.75;}
523  else if (aeta<0.85) { deltastr=1.5;}
524  else if (aeta<1.1) { deltastr=2.75;}
525  else { deltastr=3.25;}
526 
527  if (std::fabs(delta)<deltastr) {
528  isampling=2;
529  ieta=imid;
530  }
531  } // end if sampling==3
532  } // end if eta<1.325
533  else {
534  isampling=2;
535  ieta=imid;
536  if (z>g.zmax1) {
537  ieta=55;
538  }
539  else if (z>g.zmax2 && aeta<1.375) {
540  ieta=54;
541  }
542  isamp2=2;
543  ieta2=imid;
544  } // end eta>1.352
545  } // end radius selection
546  } // end eta1.4
547 
548  // eta between 1.4 and 1.475
549 
550  if (aeta>=Eta_max_s1 && aeta<g.Eta_max) {
551  r12 = Rmax1[447]; // radius for end of sampling 1
552  r23=g.Z_max_acc/sinh(aeta); // radius of end of sampling 2, bounded by high z end
553 
554  const double zmax = g.Z_max_lowr + g.dzdr*(radius-g.R_min_acc);
555 
556  iregion=1;
557  if (radius <=r12) {
558  isampling=1;
559  ieta=int((aeta-Eta_max_s1)/deta);
560  if (z>zmax) { iactive=0; }
561  }
562  else if (radius < (r12+Dr_s12)) {
563  isampling=1;
564  ieta=int((aeta-Eta_max_s1)/deta);
565  iactive=0;
566  }
567  else if (radius <= r23) {
568  isampling=2;
569  ieta=0;
570  if (z>zmax) { iactive=0; }
571  }
572  else {
573  isampling=2;
574  ieta=0;
575  iactive=0;
576  }
577  isamp2=isampling;
578  ieta2=ieta;
579  }
580  // eta above 1.475, not fiducial region, but still returns something
581  // for calibration hits
582  if (aeta>g.Eta_max) {
583  iregion=1;
584  r12 = Rmax1[447];
585  if (radius <=r12) {
586  isampling=1;
587  ieta=2;
588  }
589  else {
590  isampling=2;
591  ieta=0;
592  }
593  isamp2=isampling;
594  ieta2=ieta;
595  iactive=0;
596  }
597 
598  // cross-check of active region
599  if (z>g.Z_max_acc || radius>g.R_max_acc || radius<g.R_min_acc || aeta > g.Eta_max) iactive=0;
600 
601  return iactive;
602  }
603  // =======================================================================
604  // function findCell
605  //
606  // compute cell in EM accordion for hit at position x,y,z,radius,eta,phi
607  // given in LOCAL half barrel coordinate system (Stac Geant volume)
608  // It has already been checked that the hit is in the accordion sensitive volume
609  //
610 
611  void Geometry::findCell(CalcData & currentCellData,
612  const double &xPosition,
613  const double &yPosition,
614  const double &zPosition,
615  const double &aRadius,
616  const double &anEta,
617  const double &/*aPhi*/,
618  const bool MapDetail) const
619  {
620 
621  currentCellData.cellID = 0;
622 
623  if (aRadius < m_rc[0] || aRadius >= m_rc[m_Nbrt1-1]) {
624 #ifdef DEBUGHITS
625  ATH_MSG_VERBOSE(" Outside Accordion " << aRadius << " " << m_rc[0] << " " << m_rc[m_Nbrt1-1]);
626 #endif
627  return; // outside accordion
628  }
629 
630  // set the straight section number
631  currentCellData.nstraight=0;
632  for (int i=1;i<m_Nbrt1;i++) {
633  if (m_rc[i] > aRadius) { break; }
634  currentCellData.nstraight++;

Member Data Documentation

◆ m_absorber

const LArStraightAbsorbers* LArG4::Barrel::Geometry::m_absorber
private

Definition at line 96 of file LArBarrelGeometry.h.

◆ m_coudeabs

const LArCoudeAbsorbers* LArG4::Barrel::Geometry::m_coudeabs
private

Definition at line 94 of file LArBarrelGeometry.h.

◆ m_coudeelec

const LArCoudeElectrodes* LArG4::Barrel::Geometry::m_coudeelec
private

Definition at line 93 of file LArBarrelGeometry.h.

◆ m_delta

double * LArG4::Barrel::Geometry::m_delta
private

Definition at line 86 of file LArBarrelGeometry.h.

◆ m_detectorName

std::string LArG4::Barrel::Geometry::m_detectorName
private

Definition at line 64 of file LArBarrelGeometry.h.

◆ m_dR

G4double LArG4::Barrel::Geometry::m_dR
private

Definition at line 109 of file LArBarrelGeometry.h.

◆ m_ecamName

G4String LArG4::Barrel::Geometry::m_ecamName
private

Definition at line 65 of file LArBarrelGeometry.h.

◆ m_electrode

const LArStraightElectrodes* LArG4::Barrel::Geometry::m_electrode
private

Definition at line 95 of file LArBarrelGeometry.h.

◆ m_etaMaxBarrel

double LArG4::Barrel::Geometry::m_etaMaxBarrel
private

Definition at line 73 of file LArBarrelGeometry.h.

◆ m_gam0

double LArG4::Barrel::Geometry::m_gam0
private

Definition at line 84 of file LArBarrelGeometry.h.

◆ m_iflSAG

bool LArG4::Barrel::Geometry::m_iflSAG
private

Definition at line 102 of file LArBarrelGeometry.h.

◆ m_Nbrt

int LArG4::Barrel::Geometry::m_Nbrt
private

Definition at line 80 of file LArBarrelGeometry.h.

◆ m_Nbrt1

int LArG4::Barrel::Geometry::m_Nbrt1
private

Definition at line 81 of file LArBarrelGeometry.h.

◆ m_NCellMax

int LArG4::Barrel::Geometry::m_NCellMax
private

Definition at line 77 of file LArBarrelGeometry.h.

◆ m_NCellTot

int LArG4::Barrel::Geometry::m_NCellTot
private

Definition at line 76 of file LArBarrelGeometry.h.

◆ m_NRphi

G4int LArG4::Barrel::Geometry::m_NRphi
private

Definition at line 105 of file LArBarrelGeometry.h.

◆ m_parity

int LArG4::Barrel::Geometry::m_parity
private

Definition at line 87 of file LArBarrelGeometry.h.

◆ m_phic

double * LArG4::Barrel::Geometry::m_phic
private

Definition at line 86 of file LArBarrelGeometry.h.

◆ m_rc

double* LArG4::Barrel::Geometry::m_rc
private

Definition at line 86 of file LArBarrelGeometry.h.

◆ m_rint_eleFib

double LArG4::Barrel::Geometry::m_rint_eleFib
private

Definition at line 85 of file LArBarrelGeometry.h.

◆ m_Rmax

G4double LArG4::Barrel::Geometry::m_Rmax
private

Definition at line 107 of file LArBarrelGeometry.h.

◆ m_rMaxAccordion

double LArG4::Barrel::Geometry::m_rMaxAccordion
private

Definition at line 69 of file LArBarrelGeometry.h.

◆ m_Rmin

G4double LArG4::Barrel::Geometry::m_Rmin
private

Definition at line 106 of file LArBarrelGeometry.h.

◆ m_rMinAccordion

double LArG4::Barrel::Geometry::m_rMinAccordion
private

Definition at line 68 of file LArBarrelGeometry.h.

◆ m_Rphi

G4double LArG4::Barrel::Geometry::m_Rphi[5000]
private

Definition at line 108 of file LArBarrelGeometry.h.

◆ m_testbeam

bool LArG4::Barrel::Geometry::m_testbeam
private

Definition at line 100 of file LArBarrelGeometry.h.

◆ m_xc

double * LArG4::Barrel::Geometry::m_xc
private

Definition at line 86 of file LArBarrelGeometry.h.

◆ m_yc

double * LArG4::Barrel::Geometry::m_yc
private

Definition at line 86 of file LArBarrelGeometry.h.

◆ m_zMaxBarrel

double LArG4::Barrel::Geometry::m_zMaxBarrel
private

Definition at line 71 of file LArBarrelGeometry.h.

◆ m_zMaxBarrelDMMargin

double LArG4::Barrel::Geometry::m_zMaxBarrelDMMargin
private

Definition at line 72 of file LArBarrelGeometry.h.

◆ m_zMinBarrel

double LArG4::Barrel::Geometry::m_zMinBarrel
private

Definition at line 70 of file LArBarrelGeometry.h.


The documentation for this class was generated from the following files:
LArG4::Barrel::Geometry::PhiGap
G4int PhiGap(const double &, const double &, const double &) const
Definition: LArBarrelGeometry.cxx:966
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
LArStraightAbsorbers::Sinu
double Sinu(int stackid, int cellid) const
Definition: LArStraightAbsorbers.h:29
LArG4::Barrel::Geometry::m_parity
int m_parity
Definition: LArBarrelGeometry.h:87
LArG4Identifier
Definition: LArG4Identifier.h:121
LArStraightAbsorbers::GetInstance
static const LArStraightAbsorbers * GetInstance(const std::string &strDetector="")
Definition: LArStraightAbsorbers.cxx:11
LArG4::Barrel::Geometry::m_Rmax
G4double m_Rmax
Definition: LArBarrelGeometry.h:107
LArCoudeElectrodes::XCentCoude
double XCentCoude(int stackid, int cellid) const
Definition: LArCoudeElectrodes.h:19
TestSUSYToolsAlg.dl
dl
Definition: TestSUSYToolsAlg.py:81
LArStraightAbsorbers::XCentAbs
double XCentAbs(int stackid, int cellid) const
Definition: LArStraightAbsorbers.h:25
get_generator_info.result
result
Definition: get_generator_info.py:21
LArG4::Barrel::Geometry::m_Rphi
G4double m_Rphi[5000]
Definition: LArBarrelGeometry.h:108
LArStraightAbsorbers::YCentAbs
double YCentAbs(int stackid, int cellid) const
Definition: LArStraightAbsorbers.h:26
LArGeo::VDetectorParameters
Definition: VDetectorParameters.h:29
LArG4::Barrel::Geometry::m_Rmin
G4double m_Rmin
Definition: LArBarrelGeometry.h:106
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LArG4::Barrel::Geometry::initializeForSDCreation
virtual void initializeForSDCreation() override final
Definition: LArBarrelGeometry.cxx:176
LArG4::Barrel::Geometry::m_NCellTot
int m_NCellTot
Definition: LArBarrelGeometry.h:76
LArCoudeAbsorbers::XCentCoude
double XCentCoude(int stackid, int cellid) const
Definition: LArCoudeAbsorbers.h:19
LArG4::Barrel::Geometry::m_zMinBarrel
double m_zMinBarrel
Definition: LArBarrelGeometry.h:70
LArG4::Barrel::Geometry::Phi0
G4double Phi0(G4double) const
Definition: LArBarrelGeometry.cxx:951
LArG4::Barrel::Geometry::m_Nbrt
int m_Nbrt
Definition: LArBarrelGeometry.h:80
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
LArG4::Barrel::Geometry::Distance_Ele
double Distance_Ele(const double &x, const double &y, const int &PhiC, int &Num_Straight, const int &Num_Coude, double &xl) const
Definition: LArBarrelGeometry.cxx:216
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
LArCoudeElectrodes::GetInstance
static const LArCoudeElectrodes * GetInstance(const std::string &strDetector="")
Definition: LArCoudeElectrodes.cxx:9
LArG4::Barrel::Geometry::m_rc
double * m_rc
Definition: LArBarrelGeometry.h:86
LArG4::Barrel::Geometry::m_yc
double * m_yc
Definition: LArBarrelGeometry.h:86
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LArG4::Barrel::Geometry::m_coudeelec
const LArCoudeElectrodes * m_coudeelec
Definition: LArBarrelGeometry.h:93
LArG4::Barrel::Geometry::m_electrode
const LArStraightElectrodes * m_electrode
Definition: LArBarrelGeometry.h:95
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
LArG4::Barrel::Geometry::m_etaMaxBarrel
double m_etaMaxBarrel
Definition: LArBarrelGeometry.h:73
x
#define x
LArG4::Barrel::Geometry::findCell
virtual void findCell(CalcData &currentCellData, const double &x, const double &y, const double &z, const double &r, const double &eta, const double &phi, const bool detail) const override final
Definition: LArBarrelGeometry.cxx:643
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
pi
#define pi
Definition: TileMuonFitter.cxx:65
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
LArG4::Barrel::Geometry::SampSeg
G4int SampSeg(G4double, G4double, G4double, G4int &, G4int &, G4int &, G4int &, G4int &) const
Definition: LArBarrelGeometry.cxx:357
LArCoudeElectrodes::PhiRot
double PhiRot(int stackid, int cellid) const
Definition: LArCoudeElectrodes.h:21
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
LArG4::Barrel::Geometry::CalculateECAMIdentifier
LArG4Identifier CalculateECAMIdentifier(const G4Step *, const G4int indEcam, const bool inSTAC=true, int zside=1) const
Definition: LArBarrelGeometry.cxx:1065
LArG4::Barrel::Geometry::GetRphi
void GetRphi()
phi vs r of first absorber in nominal geometry
Definition: LArBarrelGeometry.cxx:827
LArG4::Barrel::Geometry::m_ecamName
G4String m_ecamName
Definition: LArBarrelGeometry.h:65
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
LArG4::Barrel::Geometry::CheckDMIdentifier
bool CheckDMIdentifier(int type, int sampling, int region, int eta, int phi) const
Definition: LArBarrelGeometry.cxx:1350
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArG4::Barrel::Geometry::finalize
virtual StatusCode finalize() override final
Definition: LArBarrelGeometry.cxx:187
LArStraightElectrodes::XCentEle
double XCentEle(int stackid, int cellid) const
Definition: LArStraightElectrodes.h:26
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
LArG4::Barrel::Geometry::m_rint_eleFib
double m_rint_eleFib
Definition: LArBarrelGeometry.h:85
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloNoise_fillDB.dt
dt
Definition: CaloNoise_fillDB.py:58
LArG4::Barrel::Geometry::Distance_Abs
double Distance_Abs(const double &x, const double &y, const int &nabs, const int &Num_Straight, const int &Num_Coude) const
Definition: LArBarrelGeometry.cxx:290
LArG4::Barrel::Geometry::m_gam0
double m_gam0
Definition: LArBarrelGeometry.h:84
LArG4::Barrel::Geometry::initialize
virtual StatusCode initialize() override final
Definition: LArBarrelGeometry.cxx:113
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
LArG4::Barrel::Geometry::m_absorber
const LArStraightAbsorbers * m_absorber
Definition: LArBarrelGeometry.h:96
LArCoudeElectrodes::YCentCoude
double YCentCoude(int stackid, int cellid) const
Definition: LArCoudeElectrodes.h:20
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
LArG4::Barrel::Geometry::m_Nbrt1
int m_Nbrt1
Definition: LArBarrelGeometry.h:81
MuonR4::SegmentFit::ParamDefs::x0
@ x0
MuonR4::SegmentFit::ParamDefs::y0
@ y0
LArG4::Barrel::Geometry::m_dR
G4double m_dR
Definition: LArBarrelGeometry.h:109
LArCoudeAbsorbers::GetInstance
static const LArCoudeAbsorbers * GetInstance(const std::string &strDetector="")
Definition: LArCoudeAbsorbers.cxx:9
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
LArG4::Barrel::Geometry::m_coudeabs
const LArCoudeAbsorbers * m_coudeabs
Definition: LArBarrelGeometry.h:94
LArG4::Barrel::Geometry::m_phic
double * m_phic
Definition: LArBarrelGeometry.h:86
LArStraightElectrodes::YCentEle
double YCentEle(int stackid, int cellid) const
Definition: LArStraightElectrodes.h:27
ir
int ir
counter of the current depth
Definition: fastadd.cxx:49
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
LArG4::Barrel::Geometry::m_delta
double * m_delta
Definition: LArBarrelGeometry.h:86
LArCoudeAbsorbers::YCentCoude
double YCentCoude(int stackid, int cellid) const
Definition: LArCoudeAbsorbers.h:20
y
#define y
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArG4::Barrel::Geometry::m_zMaxBarrelDMMargin
double m_zMaxBarrelDMMargin
Definition: LArBarrelGeometry.h:72
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
LArStraightAbsorbers::Cosu
double Cosu(int stackid, int cellid) const
Definition: LArStraightAbsorbers.h:28
LArStraightElectrodes::GetInstance
static const LArStraightElectrodes * GetInstance(const std::string &strDetector="")
Definition: LArStraightElectrodes.cxx:12
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
LArG4::Barrel::Geometry::m_NRphi
G4int m_NRphi
Definition: LArBarrelGeometry.h:105
LArG4::Barrel::Geometry::m_xc
double * m_xc
Definition: LArBarrelGeometry.h:86
LArG4::Barrel::Geometry::m_rMaxAccordion
double m_rMaxAccordion
Definition: LArBarrelGeometry.h:69
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
LArGeo::VDetectorParameters::GetInstance
static const VDetectorParameters * GetInstance()
Definition: VDetectorParameters.cxx:29
LArG4::Barrel::Geometry::m_testbeam
bool m_testbeam
Definition: LArBarrelGeometry.h:100
LArG4::Barrel::Geometry::m_NCellMax
int m_NCellMax
Definition: LArBarrelGeometry.h:77
LArG4::Barrel::Geometry::m_detectorName
std::string m_detectorName
Definition: LArBarrelGeometry.h:64
LArG4::Barrel::Geometry::m_zMaxBarrel
double m_zMaxBarrel
Definition: LArBarrelGeometry.h:71
LArG4::Barrel::Geometry::m_rMinAccordion
double m_rMinAccordion
Definition: LArBarrelGeometry.h:68
LArStraightElectrodes::HalfLength
double HalfLength(int stackid, int cellid) const
Definition: LArStraightElectrodes.h:28