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 ()=default
 
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

Gaudi::Property< std::string > m_detectorName {this, "DetectorName", "LArMgr"}
 
Gaudi::Property< bool > m_testbeam {this, "TestBeam", false}
 
G4String m_ecamName
 
double m_rMinAccordion {0.}
 
double m_rMaxAccordion {0.}
 
double m_zMinBarrel {0.}
 
double m_zMaxBarrel {0.}
 
double m_zMaxBarrelDMMargin {0.}
 
double m_etaMaxBarrel {0.}
 
int m_NCellTot {0}
 
int m_NCellMax {0}
 
int m_Nbrt {0}
 
int m_Nbrt1 {0}
 
double m_gam0 {0.}
 
double m_rint_eleFib {0.}
 
double * m_rc {nullptr}
 
double * m_phic {nullptr}
 
double * m_xc {nullptr}
 
double * m_yc {nullptr}
 
double * m_delta {nullptr}
 
int m_parity {0}
 
const LArCoudeElectrodesm_coudeelec {nullptr}
 
const LArCoudeAbsorbersm_coudeabs {nullptr}
 
const LArStraightElectrodesm_electrode {nullptr}
 
const LArStraightAbsorbersm_absorber {nullptr}
 
bool m_iflSAG {false}
 
G4int m_NRphi {0}
 
G4double m_Rmin {0.}
 
G4double m_Rmax {0.}
 
G4double m_Rphi [5000] = {0}
 
G4double m_dR {0.}
 

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.

81  { m_parity=1; }

◆ ~Geometry()

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

◆ 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 1033 of file LArBarrelGeometry.cxx.

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

◆ CalculateIdentifier()

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

Definition at line 953 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 1318 of file LArBarrelGeometry.cxx.

1324  {
1325  if (sampling<0 || sampling >3) return false;
1326  if (sampling==0) {
1327  if (region!=0) return false;
1328  if (eta<0 || eta>60) return false;
1329  if (phi<0 || phi>63) return false;
1330  }
1331  if (sampling==1) {
1332  if (region<0 || region >1) return false;
1333  if (region==0) {
1334  if (eta<1 || eta>447) return false;
1335  if (phi<0 || phi>63) return false;
1336  }
1337  if (region==1) {
1338  if (eta<0 || eta>2) return false;
1339  if (phi<0 || phi>255) return false;
1340  }
1341  }
1342  if (sampling==2) {
1343  if (region<0 || region >1) return false;
1344  if (region==0) {
1345  if (eta<0 || eta>55) return false;
1346  if (phi<0 || phi>255) return false;
1347  }
1348  if (region==1) {
1349  if (eta!=0) return false;
1350  if (phi<0 || phi>255) return false;
1351  }
1352  }

◆ CheckLArIdentifier()

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

Definition at line 1355 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 258 of file LArBarrelGeometry.cxx.

259  { m_coudeabs->XCentCoude(Num_Coude, PhiCell), m_coudeabs->YCentCoude(Num_Coude, PhiCell) };
260  // c_Hit Vector components and its length
261  dx = xhit - Xc[0];
262  dy = yhit - Xc[1];
263  const double dr = sqrt( dx*dx + dy*dy);
264  return (Num_Coude%2 == m_parity) ? (m_rint_eleFib-dr) : (dr - m_rint_eleFib);
265  } // end of Fold Regions
266  } // end of the function Distance_Abs
267 
268 
269  //=============================================================================
270  // Function SampSeg
271  //
272  // eta-sampling segmentation of barrel calorimeter GU, January 2005
273  // input values: eta,radius in half-barrel frame
274  //
275  // return value of function: true=active area, false=inactive area
276  // return arguments: iregion,isampling,ieta
277  // take into account detailed electrode drawing
278  // with readout strips
279  // isamp2,ieta2 do not take into account
280  // readout strips and can be used to access current
281  // maps.
282  //
283  // iregion=0 (eta<1.4) or 1 (eta=1.4-1.475)
284  // for region 0: isampling = 1 (strips), 2 (middle), 3 (back)
285  // for region 1: isampling = 1 or isampling = 2
286  // ieta= eta cell number
287  // region0,samp1: ieta=1->448 (strip 0 does not exist)
288  // region0,samp2: ieta=0->55
289  // region0,samp3: ieta=0->26 (max eta 1.325)
290  // region1,samp1: ieta=0->2 (deta=0.025)
291  // region1,samp2: ieta=0 (only 1 cell)
292 
293  G4int Geometry::SampSeg(G4double eta, G4double radius, G4double z,
294  G4int& iregion, G4int& isampling, G4int& ieta,
295  G4int& isamp2, G4int& ieta2) const
296  {
297  // Helper struct to hold pre-calculated geometry information
298  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 184 of file LArBarrelGeometry.cxx.

184  { m_electrode->XCentEle(Num_Straight, PhiCell), m_electrode->YCentEle(Num_Straight, PhiCell) };
185  // m_Hit Vector components
186  double dx = xhit - Xm[0];
187  double dy = yhit - Xm[1];
188 
189  // First compute algebric distance m_hit (2D) the 2D_projection of the
190  // m_Hit Vector on this electrode neutral fiber.
191  const double hit = dx*u[0] + dy*u[1];
192 
193  //
194  // Flat of Fold Region ?
195  //
196  const G4double Half_Elec(m_electrode->HalfLength(Num_Straight,PhiCell));
197 
198  if(std::fabs(hit) < Half_Elec) {
199  // Flat Region
200  xl=hit/Half_Elec;
201  return u[0]*dy - u[1]*dx;
202  }
203  else {
204  // Fold region
205  // c_Hit Vector components and its length
206  dx = xhit - Xc[0];
207  dy = yhit - Xc[1];
208  const double dr = sqrt( dx*dx + dy*dy);
209  if (Num_Coude==Num_Straight) { xl=-1.; }
210  else xl=+1;
211  return (Num_Coude%2 == m_parity) ? (m_rint_eleFib-dr) : (dr - m_rint_eleFib);
212  } // end of Fold Regions
213  } // end of the function Distance_Ele
214 
215 
216  //======================================================================================
217  // Algebric distance to absorber
218  //
219  // inputs: xhit,yhit = x,y positions in local half barrel
220  // PhiCell = absorber number in phi (0 to 1023 for Atlas case)
221  // Num_Straight = number (0 to 13) of the straight section
222  // Num_Coude = number (0 to 14) of closest fold
223  //
224  // output: Function value = algebric distance to electrode
225 
226  double Geometry::Distance_Abs(const double & xhit,
227  const double &yhit, const int &PhiCell, const int &Num_Straight,
228  const int &Num_Coude) const
229  {
230  //
231  // FrameWork is consistent with the one used to PhiCell determination
232  // e.g. it assumes HERE to be the LOCAL one of "stac_phys1",
233  // (mother of ACCordion volumes) from which Z> 0. and Z < 0. half_barrel
234  // parts are then defined.
235  //
236  // One needs POINTERS to Electrode neutral fibers
237  // either for straight parts or for folds
238  //
239  // u unit 2D_Vector along straight part of the electrode neutral fiber
240  const G4double u[2] = { m_absorber->Cosu(Num_Straight, PhiCell), m_absorber->Sinu(Num_Straight, PhiCell) };
241  // Middle m_coordinates of this straight part of the electrode neutral fiber
242  const G4double Xm[2] = { m_absorber->XCentAbs(Num_Straight, PhiCell), m_absorber->YCentAbs(Num_Straight, PhiCell) };
243  // m_Hit Vector components
244  double dx = xhit - Xm[0]; double dy = yhit - Xm[1];
245 

◆ finalize()

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

Definition at line 155 of file LArBarrelGeometry.cxx.

155  {
156  //
157  // FrameWork is consistent with the one used to PhiCell determination
158  // e.g. it assumes HERE to be the LOCAL one of "stac_phys1",
159  // (mother of ACCordion volumes) from which Z> 0. and Z < 0. half_barrel
160  // parts are then defined.
161  //
162  // One needs POINTERS to Electrode neutral fibers
163  // either for straight parts or for folds
164  //

◆ 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 611 of file LArBarrelGeometry.cxx.

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

795  {
796  // first fold goes up
797  if (m_parity==0) {
798  phi0=-CLHEP::pi/2.;
799  phi1=-m_delta[0];
800  }
801  // first fold goes down
802  else {
803  phi0=m_delta[0];
804  phi1=CLHEP::pi/2;
805  }
806  }
807  else if (i==14) {
808  if (m_parity==0) {
809  phi0=-CLHEP::pi+m_delta[13];
810  phi1=-CLHEP::pi/2.;
811  }
812  else {
813  phi0=CLHEP::pi/2;
814  phi1=CLHEP::pi - m_delta[13];
815  }
816  }
817  else {
818  if (i%2==(1-m_parity)) {
819  phi0=m_delta[i];
820  phi1=CLHEP::pi-m_delta[i-1];
821  }
822  else {
823  phi0=-CLHEP::pi+m_delta[i-1];
824  phi1=-m_delta[i];
825  }
826  }
827  //xl2+=rint*std::fabs(phi1-phi0);
828  const G4int nstep=int((phi1-phi0)*inv_dt)+1;
829  for (int ii=0;ii<nstep;ii++) {
830  //xl+=dl;
831  const G4double phi=phi0+dt*((G4double)ii);
832  const G4double x=cenx[i]+rint*cos(phi);
833  const G4double y=ceny[i]+rint*sin(phi);
834  const G4double radius=sqrt(x*x+y*y);
835  if (radius>m_Rmax) { m_Rmax=radius; }
836  const G4double phid=atan(y/x);
837  const G4int ir=((int) ((radius-m_Rmin)/m_dR) );
838  if (ir>=0 && ir < m_NRphi) {
839  sum1[ir]+=1.;
840  sumx[ir]+=phid;
841  }
842  }
843 
844  // straight section
845  if (i<14) {
846  const G4double dx=cenx[i+1]-cenx[i];
847  const G4double dy=ceny[i+1]-ceny[i];
848  const G4double along=std::sqrt(dx*dx+dy*dy-4.*rint*rint);
849  const G4double x0=0.5*(cenx[i+1]+cenx[i]);
850  const G4double y0=0.5*(ceny[i+1]+ceny[i]);
851  const G4double phi = (i%2==m_parity) ? CLHEP::pi/2-m_delta[i] : -CLHEP::pi/2.+m_delta[i];
852  const G4double x1=x0-0.5*along*cos(phi);
853  const G4double y1=y0-0.5*along*sin(phi);
854  //xl2+=along;
855  const int nstep=int(along*inv_dl)+1;
856  for (int ii=0;ii<nstep;ii++) {
857  //xl+=dl;
858  const G4double x=x1+dl*((G4double)ii)*cos(phi);
859  const G4double y=y1+dl*((G4double)ii)*sin(phi);
860  const G4double radius=sqrt(x*x+y*y);
861  if (radius>m_Rmax) { m_Rmax=radius; }
862  const G4double phid=atan(y/x);
863  const G4int ir=((int) ((radius-m_Rmin)/m_dR) );
864  if (ir>=0 && ir < m_NRphi) {
865  sum1[ir]+=1.;
866  sumx[ir]+=phid;
867  }
868  }
869  }
870  }
871  // ATH_MSG_VERBOSE("total electrode length " << xl << " " << xl2);
872  // ATH_MSG_VERBOSE("rmax in accordion " << m_Rmax);
873  for (int i=0; i<m_NRphi; i++) {
874  if (sum1[i]>0) {
875  m_Rphi[i]=sumx[i]/sum1[i];
876  // Not used:
877  //G4double radius = m_Rmin + ((G4double(i))+0.5)*m_dR;
878  //ATH_MSG_VERBOSE(" GUTEST r,phi0 " << radius << " " << m_Rphi[i]);
879  }
880  else { m_Rphi[i]=0.; }
881  }
882  }
883 
884  // ======================================================================================
885  // phi of first absorber as function of radius for nominal accordion geometry
886  // (before sagging)
887  G4double Geometry::Phi0(G4double radius) const
888  {
889  // TODO This function could be simplified.
890  G4int ir;
891  if (radius < m_Rmin) { ir=0; }
892  else {
893  if (radius > m_Rmax) radius=m_Rmax-0.0001;
894  ir=((int) ((radius-m_Rmin)/m_dR) );
895  }
896  return m_Rphi[ir];
897  }
898 
899  // ======================================================================================
900  // compute number (0 to 1023) of closest electrode according to nominal
901  // accordion geometry
902  G4int Geometry::PhiGap(const double & radius, const double & xhit, const double &yhit) const
903  {
904  const G4double phi0=Phi0(radius)+m_gam0; // from -pi to pi
905  const G4double phi_hit=atan2(yhit,xhit); // from -pi to pi
906  G4double dphi=phi_hit-phi0;
907  // bring back to 0-2pi
908  if (dphi<0) dphi=dphi+2*M_PI;
909  if (dphi>=2*M_PI) dphi=dphi-2*M_PI;
910  dphi=dphi/(2*M_PI)*1024;
911  const G4int ngap=((int) dphi);
912 #ifdef DEBUGHITS
913  ATH_MSG_VERBOSE(" phi0 " << phi0 << " dphi, ngap " << dphi << " " << ngap);
914 #endif

◆ initialize()

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

Definition at line 81 of file LArBarrelGeometry.cxx.

81  { m_parity=1; }
82  //
83  m_rMinAccordion = parameters->GetValue("LArEMBRadiusInnerAccordion");
84  m_rMaxAccordion = parameters->GetValue("LArEMBFiducialRmax");
85  m_etaMaxBarrel = parameters->GetValue("LArEMBMaxEtaAcceptance");
86  m_zMinBarrel = parameters->GetValue("LArEMBfiducialMothZmin");
87  m_zMaxBarrel = parameters->GetValue("LArEMBfiducialMothZmax");
88  m_zMaxBarrelDMMargin = 10.0; // 10 mm margin
89  // === GU 11/06/2003 total number of cells in phi
90  // to distinguish 1 module (testbeam case) from full Atlas
91  m_NCellTot = (int) (parameters->GetValue("LArEMBnoOFPhysPhiCell"));
92  // total number of cells in phi to distinguish 1 module (testbeam case) from full Atlas
93  m_testbeam=false;
94  if (m_NCellTot != 1024) {
95  m_testbeam=true;
96  }
97  m_NCellMax=1024;
98  // ===
99 
100  // Initialize r-phi reference map
101  this->GetRphi();
102 
103  if (m_detectorName.empty()) m_ecamName = "LAr::EMB::ECAM";
104  else m_ecamName = m_detectorName+"::LAr::EMB::ECAM";
105 
106 
107  return StatusCode::SUCCESS;
108  }
109 
110  // ====================================================================================
111 
113  {
114  // get pointers to access G4 geometry
119  }
120 
121  // ====================================================================================
122 
124  {
125  if (m_rc) delete [] m_rc;
126  if (m_phic) delete [] m_phic;
127  if (m_delta) delete [] m_delta;
128  if (m_xc) delete [] m_xc;
129  if (m_yc) delete [] m_yc;
130 
131  return StatusCode::SUCCESS;
132  }
133 
134  //======================================================================================
135  //
136  // Here INTRINSIC Distance_to_electrode determination (G.P.)
137  //
138  // This retuns an ALGEBRICDistEle value, the distance from electrode
139  //neutral fiber TOWARDS the Sub_Step in LAr (measured on a local perpendicular
140  //vector unit oriented upwards i.e. following increasing Phi values).

◆ initializeForSDCreation()

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

Definition at line 144 of file LArBarrelGeometry.cxx.

◆ Phi0()

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

Definition at line 919 of file LArBarrelGeometry.cxx.

922  {
923 
924  // The default result is a blank identifier.
926 
927  // Get all the required information from the current step
928  const G4NavigationHistory* g4navigation = a_step->GetPreStepPoint()->GetTouchable()->GetHistory();
929  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 934 of file LArBarrelGeometry.cxx.

935  {
936  const G4String& vname = g4navigation->GetVolume(ii)->GetName();
937  // FIXME Need to find a way to avoid these string-comparisons
938  if ( indECAM<0 && vname == m_ecamName ) indECAM=ii;
939  if ( !inSTAC && vname.find("STAC") !=std::string::npos) inSTAC=true;
940  if ( vname.find("NegPhysical") != std::string::npos) zside=-1;
941  }
942  if (indECAM>=0)
943  result = this->CalculateECAMIdentifier( a_step , indECAM, inSTAC, zside) ;
944  else
945  ATH_MSG_ERROR("LArBarrel::Geometry::CalculateIdentifier ECAM volume not found in hierarchy");
946 
947  return result;
948  }

◆ 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 325 of file LArBarrelGeometry.cxx.

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

Member Data Documentation

◆ m_absorber

const LArStraightAbsorbers* LArG4::Barrel::Geometry::m_absorber {nullptr}
private

Definition at line 102 of file LArBarrelGeometry.h.

◆ m_coudeabs

const LArCoudeAbsorbers* LArG4::Barrel::Geometry::m_coudeabs {nullptr}
private

Definition at line 100 of file LArBarrelGeometry.h.

◆ m_coudeelec

const LArCoudeElectrodes* LArG4::Barrel::Geometry::m_coudeelec {nullptr}
private

Definition at line 99 of file LArBarrelGeometry.h.

◆ m_delta

double* LArG4::Barrel::Geometry::m_delta {nullptr}
private

Definition at line 95 of file LArBarrelGeometry.h.

◆ m_detectorName

Gaudi::Property<std::string> LArG4::Barrel::Geometry::m_detectorName {this, "DetectorName", "LArMgr"}
private

Definition at line 64 of file LArBarrelGeometry.h.

◆ m_dR

G4double LArG4::Barrel::Geometry::m_dR {0.}
private

Definition at line 111 of file LArBarrelGeometry.h.

◆ m_ecamName

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

Definition at line 69 of file LArBarrelGeometry.h.

◆ m_electrode

const LArStraightElectrodes* LArG4::Barrel::Geometry::m_electrode {nullptr}
private

Definition at line 101 of file LArBarrelGeometry.h.

◆ m_etaMaxBarrel

double LArG4::Barrel::Geometry::m_etaMaxBarrel {0.}
private

Definition at line 77 of file LArBarrelGeometry.h.

◆ m_gam0

double LArG4::Barrel::Geometry::m_gam0 {0.}
private

Definition at line 88 of file LArBarrelGeometry.h.

◆ m_iflSAG

bool LArG4::Barrel::Geometry::m_iflSAG {false}
private

Definition at line 104 of file LArBarrelGeometry.h.

◆ m_Nbrt

int LArG4::Barrel::Geometry::m_Nbrt {0}
private

Definition at line 84 of file LArBarrelGeometry.h.

◆ m_Nbrt1

int LArG4::Barrel::Geometry::m_Nbrt1 {0}
private

Definition at line 85 of file LArBarrelGeometry.h.

◆ m_NCellMax

int LArG4::Barrel::Geometry::m_NCellMax {0}
private

Definition at line 81 of file LArBarrelGeometry.h.

◆ m_NCellTot

int LArG4::Barrel::Geometry::m_NCellTot {0}
private

Definition at line 80 of file LArBarrelGeometry.h.

◆ m_NRphi

G4int LArG4::Barrel::Geometry::m_NRphi {0}
private

Definition at line 107 of file LArBarrelGeometry.h.

◆ m_parity

int LArG4::Barrel::Geometry::m_parity {0}
private

Definition at line 96 of file LArBarrelGeometry.h.

◆ m_phic

double* LArG4::Barrel::Geometry::m_phic {nullptr}
private

Definition at line 92 of file LArBarrelGeometry.h.

◆ m_rc

double* LArG4::Barrel::Geometry::m_rc {nullptr}
private

Definition at line 91 of file LArBarrelGeometry.h.

◆ m_rint_eleFib

double LArG4::Barrel::Geometry::m_rint_eleFib {0.}
private

Definition at line 89 of file LArBarrelGeometry.h.

◆ m_Rmax

G4double LArG4::Barrel::Geometry::m_Rmax {0.}
private

Definition at line 109 of file LArBarrelGeometry.h.

◆ m_rMaxAccordion

double LArG4::Barrel::Geometry::m_rMaxAccordion {0.}
private

Definition at line 73 of file LArBarrelGeometry.h.

◆ m_Rmin

G4double LArG4::Barrel::Geometry::m_Rmin {0.}
private

Definition at line 108 of file LArBarrelGeometry.h.

◆ m_rMinAccordion

double LArG4::Barrel::Geometry::m_rMinAccordion {0.}
private

Definition at line 72 of file LArBarrelGeometry.h.

◆ m_Rphi

G4double LArG4::Barrel::Geometry::m_Rphi[5000] = {0}
private

Definition at line 110 of file LArBarrelGeometry.h.

◆ m_testbeam

Gaudi::Property<bool> LArG4::Barrel::Geometry::m_testbeam {this, "TestBeam", false}
private

Definition at line 67 of file LArBarrelGeometry.h.

◆ m_xc

double* LArG4::Barrel::Geometry::m_xc {nullptr}
private

Definition at line 93 of file LArBarrelGeometry.h.

◆ m_yc

double* LArG4::Barrel::Geometry::m_yc {nullptr}
private

Definition at line 94 of file LArBarrelGeometry.h.

◆ m_zMaxBarrel

double LArG4::Barrel::Geometry::m_zMaxBarrel {0.}
private

Definition at line 75 of file LArBarrelGeometry.h.

◆ m_zMaxBarrelDMMargin

double LArG4::Barrel::Geometry::m_zMaxBarrelDMMargin {0.}
private

Definition at line 76 of file LArBarrelGeometry.h.

◆ m_zMinBarrel

double LArG4::Barrel::Geometry::m_zMinBarrel {0.}
private

Definition at line 74 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:934
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:215
LArStraightAbsorbers::Sinu
double Sinu(int stackid, int cellid) const
Definition: LArStraightAbsorbers.h:29
LArG4::Barrel::Geometry::m_parity
int m_parity
Definition: LArBarrelGeometry.h:96
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:109
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
add-xsec-uncert-quadrature-N.alpha
alpha
Definition: add-xsec-uncert-quadrature-N.py:110
get_generator_info.result
result
Definition: get_generator_info.py:21
LArG4::Barrel::Geometry::m_Rphi
G4double m_Rphi[5000]
Definition: LArBarrelGeometry.h:110
LArStraightAbsorbers::YCentAbs
double YCentAbs(int stackid, int cellid) const
Definition: LArStraightAbsorbers.h:26
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
LArG4::Barrel::Geometry::m_Rmin
G4double m_Rmin
Definition: LArBarrelGeometry.h:108
LArG4::Barrel::Geometry::initializeForSDCreation
virtual void initializeForSDCreation() override final
Definition: LArBarrelGeometry.cxx:144
LArG4::Barrel::Geometry::m_NCellTot
int m_NCellTot
Definition: LArBarrelGeometry.h:80
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
LArG4::Barrel::Geometry::m_phic
double * m_phic
Definition: LArBarrelGeometry.h:92
LArCoudeAbsorbers::XCentCoude
double XCentCoude(int stackid, int cellid) const
Definition: LArCoudeAbsorbers.h:19
LArG4::Barrel::Geometry::m_zMinBarrel
double m_zMinBarrel
Definition: LArBarrelGeometry.h:74
LArG4::Barrel::Geometry::Phi0
G4double Phi0(G4double) const
Definition: LArBarrelGeometry.cxx:919
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:184
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:91
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LArG4::Barrel::Geometry::m_coudeelec
const LArCoudeElectrodes * m_coudeelec
Definition: LArBarrelGeometry.h:99
LArG4::Barrel::Geometry::m_electrode
const LArStraightElectrodes * m_electrode
Definition: LArBarrelGeometry.h:101
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:111
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:77
LArG4::Barrel::Geometry::m_testbeam
Gaudi::Property< bool > m_testbeam
Definition: LArBarrelGeometry.h:67
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:611
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
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:325
python.SystemOfUnits.MeV
float MeV
Definition: SystemOfUnits.py:172
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:1033
LArG4::Barrel::Geometry::GetRphi
void GetRphi()
phi vs r of first absorber in nominal geometry
Definition: LArBarrelGeometry.cxx:795
LArG4::Barrel::Geometry::m_ecamName
G4String m_ecamName
Definition: LArBarrelGeometry.h:69
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
LArG4::Barrel::Geometry::CheckDMIdentifier
bool CheckDMIdentifier(int type, int sampling, int region, int eta, int phi) const
Definition: LArBarrelGeometry.cxx:1318
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArG4::Barrel::Geometry::finalize
virtual StatusCode finalize() override final
Definition: LArBarrelGeometry.cxx:155
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:89
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:56
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:258
LArG4::Barrel::Geometry::m_gam0
double m_gam0
Definition: LArBarrelGeometry.h:88
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
LArG4::Barrel::Geometry::m_absorber
const LArStraightAbsorbers * m_absorber
Definition: LArBarrelGeometry.h:102
LArCoudeElectrodes::YCentCoude
double YCentCoude(int stackid, int cellid) const
Definition: LArCoudeElectrodes.h:20
LArG4::Barrel::Geometry::m_Nbrt1
int m_Nbrt1
Definition: LArBarrelGeometry.h:85
MuonR4::SegmentFit::ParamDefs::x0
@ x0
MuonR4::SegmentFit::ParamDefs::y0
@ y0
LArG4::Barrel::Geometry::m_dR
G4double m_dR
Definition: LArBarrelGeometry.h:111
LArCoudeAbsorbers::GetInstance
static const LArCoudeAbsorbers * GetInstance(const std::string &strDetector="")
Definition: LArCoudeAbsorbers.cxx:9
LArG4::Barrel::Geometry::m_yc
double * m_yc
Definition: LArBarrelGeometry.h:94
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
LArG4::Barrel::Geometry::m_coudeabs
const LArCoudeAbsorbers * m_coudeabs
Definition: LArBarrelGeometry.h:100
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_detectorName
Gaudi::Property< std::string > m_detectorName
Definition: LArBarrelGeometry.h:64
LArCoudeAbsorbers::YCentCoude
double YCentCoude(int stackid, int cellid) const
Definition: LArCoudeAbsorbers.h:20
y
#define y
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
LArG4::Barrel::Geometry::m_delta
double * m_delta
Definition: LArBarrelGeometry.h:95
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArG4::Barrel::Geometry::m_zMaxBarrelDMMargin
double m_zMaxBarrelDMMargin
Definition: LArBarrelGeometry.h:76
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
LArStraightAbsorbers::Cosu
double Cosu(int stackid, int cellid) const
Definition: LArStraightAbsorbers.h:28
LArG4::Barrel::Geometry::m_xc
double * m_xc
Definition: LArBarrelGeometry.h:93
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:107
LArG4::Barrel::Geometry::m_rMaxAccordion
double m_rMaxAccordion
Definition: LArBarrelGeometry.h:73
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
LArG4::Barrel::Geometry::m_NCellMax
int m_NCellMax
Definition: LArBarrelGeometry.h:81
LArG4::Barrel::Geometry::m_zMaxBarrel
double m_zMaxBarrel
Definition: LArBarrelGeometry.h:75
LArG4::Barrel::Geometry::m_rMinAccordion
double m_rMinAccordion
Definition: LArBarrelGeometry.h:72
LArStraightElectrodes::HalfLength
double HalfLength(int stackid, int cellid) const
Definition: LArStraightElectrodes.h:28