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

#include <LArBarrelPresamplerGeometry.h>

Inheritance diagram for LArG4::BarrelPresampler::Geometry:
Collaboration diagram for LArG4::BarrelPresampler::Geometry:

Public Member Functions

 Geometry (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~Geometry ()=default
 
virtual StatusCode initialize () override final
 initialize geometry parameters this should at some stage be taken from a database... More...
 
virtual LArG4Identifier CalculateIdentifier (const G4Step *) const override final
 The following method computes the identifiers in the Presampler volume: More...
 
virtual bool findCell (CalcData &currentCellData, G4double xloc, G4double yloc, G4double zloc) const override final
 =============================================================================== bool findCell(xloc,yloc,zloc) const More...
 

Private Member Functions

LArG4Identifier CalculatePSActiveIdentifier (const G4Step *, const G4int indPS) const
 calculate identifier from a G4 step in the PS active region This function should always return a valid identifier which can be used for calibration hit even if the hit is not really in the "fiducial" active part More...
 
LArG4Identifier CalculatePS_DMIdentifier (const G4Step *, const G4int indPS) const
 
G4int determineZSide (const double zCoord) const
 

Private Attributes

Gaudi::Property< std::string > m_detectorName {this, "DetectorName", "LArMgr"}
 
Gaudi::Property< bool > m_testbeam {this, "TestBeam", false}
 
G4double m_end_module [8] {}
 
G4double m_zminPS {3.00*Athena::Units::mm}
 
G4double m_zpres {1549.*Athena::Units::mm}
 
G4double m_cat_th {}
 
G4double m_first_cathod [8] {}
 
G4double m_tilt [8] {}
 
G4int m_ngap_cell [8] {}
 
G4double m_pitch [8] {}
 
G4int m_ncell_module [8] {}
 
G4double m_halfThickLAr {0.5*13.*Athena::Units::mm}
 

Detailed Description

Definition at line 27 of file LArBarrelPresamplerGeometry.h.

Constructor & Destructor Documentation

◆ Geometry()

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

Definition at line 85 of file LArBarrelPresamplerGeometry.cxx.

◆ ~Geometry()

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

Member Function Documentation

◆ CalculateIdentifier()

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

The following method computes the identifiers in the Presampler volume:

1) Navigate through the volumes hierarchy

2) Calculate identifier using the CalculatePSActiveIdentifier method if the hit is in the Module volume and CalculatePS_DMIdentifier if the hit is in some dead region

Get all the required information from the current step

Now navigate through the volumes hierarchy

Definition at line 147 of file LArBarrelPresamplerGeometry.cxx.

168  {
169  currentCellData.phiBin = 31 - currentCellData.phiBin;
170  if(currentCellData.phiBin < 0 ) currentCellData.phiBin += 64;
171  }
172 

◆ CalculatePS_DMIdentifier()

LArG4Identifier LArG4::BarrelPresampler::Geometry::CalculatePS_DMIdentifier ( const G4Step *  a_step,
const G4int  indPS 
) const
private

to get coordinates in local half barrel frame, independently of overall presampler position/rotation

shift z such that z=0 is eta=0 in Atlas standard frame

eta,phi in "local" half barrel coordinates

check if the hit is in front of the active layer of the presampler in order to distinguish between regin 2 and 3: WARNING the method is temporary!

PSModuleRmean = 1420 is the distance between the middle of the active layer (LAr) of the PS modules and the interaction point

Fill identifier.

Definition at line 232 of file LArBarrelPresamplerGeometry.cxx.

246  : ploc2.phi();
247  const G4double eta = ploc2.eta();
248  //G4double z2=fabs(ploc2.z());
249 
258  const G4int numberPhiMod = 32;
259  const G4double dphi = ( 2.*M_PI ) / numberPhiMod;
260  const G4double inv_dphi = 1. / dphi;
261  const G4double PSModuleRmean = 1420 ;
262  const G4double phicheck = phi - int(phi * inv_dphi) * dphi - (dphi /2.);
263  const G4double Rcheck = PSModuleRmean / cos(phicheck);
264  CalcData currentCellData;
265  if (radius > Rcheck) {
266  currentCellData.region = 3;
267  } else {
268  currentCellData.region = 2;
269  }
270 
271  const G4double detaDM = 0.1 ;
272  const G4double dphiDM = ( 2 * M_PI ) / 64. ;
273 
274  currentCellData.phiBin = G4int( phi * (1. / dphiDM) );
275  currentCellData.etaBin = G4int( eta * (1. / detaDM) );
276 
277  if( zSide == -1 )
278  {
279  currentCellData.phiBin = 31 - currentCellData.phiBin;
280  if(currentCellData.phiBin < 0 ) currentCellData.phiBin += 64;
281  }
282 
283  // 07-Jul-2005 WGS: Handle an extremely rare rounding problem.
284  if ( currentCellData.phiBin == 64 ) currentCellData.phiBin = 0;
285 
287  LArG4Identifier PS_DM_ID = LArG4Identifier();
288  PS_DM_ID << 10 // ATLAS
289  << zSide*4 // LArEM
290  << 1
291  << 1
292  << currentCellData.region
293  << currentCellData.etaBin
294  << currentCellData.phiBin;
295 
296 #ifdef DEBUGHITS
297  ATH_MSG_VERBOSE("Here the identifier for the presampler DEAD materials ---->");
298  ATH_MSG_VERBOSE("m_zSide ----> " << zSide*4);
299  ATH_MSG_VERBOSE("region ----> " << currentCellData.region);
300  ATH_MSG_VERBOSE("etaBin ----> " << currentCellData.etaBin);
301  ATH_MSG_VERBOSE("phiBin ----> " << currentCellData.phiBin);
302 #endif
303 
304  return PS_DM_ID ;
305  }
306 
333  bool Geometry::findCell(CalcData & currentCellData, G4double xloc,G4double yloc,G4double zloc) const
334  {
335 
336  currentCellData.sampling = 0;
337  currentCellData.region = 0;
338 
340  G4double phi = atan2(yloc,xloc);
341  if ( phi < 0. ) phi += 2.*M_PI;

◆ CalculatePSActiveIdentifier()

LArG4Identifier LArG4::BarrelPresampler::Geometry::CalculatePSActiveIdentifier ( const G4Step *  a_step,
const G4int  indPS 
) const
private

calculate identifier from a G4 step in the PS active region This function should always return a valid identifier which can be used for calibration hit even if the hit is not really in the "fiducial" active part

following code for an Y-axis rotation to define the side C half-barrel

Append the cell ID to the (empty) identifier.

Definition at line 181 of file LArBarrelPresamplerGeometry.cxx.

197  {
198 
199  /******************************************************************************
200  CaloDM_ID identifier:
201 
202  detector_system/subdet/type/sampling/region/eta/phi
203  detector system = 10 -> Calorimeters
204  subdet = +/-4 -> LAr dead materials
205  type = 1 -> dead materials outside accordion and active presampler layers
206  sampling = 1 -> dead materials in front and in active LAr calorimeters
207  (starting from front warm cryostat walls)
208  regions: = 0 barrel warm wall and solenoid in front of the barrel presampler, 0 < |eta| < 1.5
209  = 1 barrel cryostat cold wall in front of the barrel presampler, 0 < |eta| < 1.5
210  = 2 all materials in front of the barrel presampler at radius larger than cold wall
211  outer radius, 0 < |eta| < 1.5
212  = 3 all materials from the active layer of the barrel presampler to the active layer
213  of accordion, 0 < |eta| < 1.5
214 
215  ---> Granularity : deta 0.1 granularity within region
216  dphi pi/32 ~ 0.1 granularity within region
217 
218  ***********************************************************************************/
219 
220  const G4ThreeVector p = (a_step->GetPostStepPoint()->GetPosition() + a_step->GetPreStepPoint()->GetPosition()) * 0.5;
221 
222 #ifdef DEBUGHITS
223  ATH_MSG_VERBOSE("Position of the step in the ATLAS frame (x,y,z) --> " << p.x() << " " << p.y() << " " << p.z());
224  ATH_MSG_VERBOSE("Eta and Phi in the atlas frame --> " << p.eta() << " " << p.phi());
225 #endif
226 

◆ determineZSide()

G4int LArG4::BarrelPresampler::Geometry::determineZSide ( const double  zCoord) const
inlineprivate

Definition at line 45 of file LArBarrelPresamplerGeometry.h.

45  {
46  // in TB case, only 1 side,
47  // in Atlas case, use overall z to decide side
48  if (m_testbeam) { return 1; }
49  if (zCoord > 0.) { return 1; }
50  return -1;
51  }

◆ findCell()

bool LArG4::BarrelPresampler::Geometry::findCell ( CalcData currentCellData,
G4double  xloc,
G4double  yloc,
G4double  zloc 
) const
finaloverridevirtual

=============================================================================== bool findCell(xloc,yloc,zloc) const

From local PS coordinates (half barrel tube mother volume) compute etaBin,phiBin,sampling,region as well as gap number, distance to closest electrode and projection along electrode axis

Takes into account for complexity of eta segmentation

Return true if where are really within the 13mm LAr gap Return false for the few steps which are in the safety region at the edges of module Assume that hit is in the "active" LAr

note that here phiBin is computed for the + half barrel some care has to be taken to convert to the - half barrel, taking into account the rotation

findCell always fills valid currentCellData.region, currentCellData.sampling, currentCellData.etaBin, currentCellData.phiBin it returns true if the hit is in the normal 13mm Ar gap, within a real module it returns false otherwise

eta,phi in "local" Atlas like half barrel coordinates

According to the memo, phi is divided into 64 regions [0..63].

Convert phi into integer bins.

if inside LAr but outside a module, returns some etaBin value for the DM identifier, but function return false to veto this step in the normal calculator

find in which module in z the hit is

compute signed distance from middle of active layer along layer height axis

compute z distance from first cathode of module to step, taking into account the m_tilt angle of the cathode

compute gap number

compute cell number in eta

z of the centre of the anode of the gap

compute step position in electrode reference frame currentCellData.distElec => signed distance to electrode currentCellData.xElec => projection along electrode axis

Definition at line 369 of file LArBarrelPresamplerGeometry.cxx.

372  {
373  G4cerr << "LArBarrelPresampler: invalid module/hit " << currentCellData.module << " " << z2 << G4endl;
374  if (currentCellData.module<0) currentCellData.etaBin=0;
375  if (currentCellData.module>7) currentCellData.etaBin=60;
376  return false;
377  }
378 
380  const G4int isect=G4int(phi*m_nsectors/(2.*M_PI));
381  const G4double phi0= ((double)isect+0.5)*2.*M_PI/((double) m_nsectors);
382  static const G4double r0=1420.4*CLHEP::mm; // FIXME should be recomputed from database
383  currentCellData.dist=(xloc*cos(phi0)+yloc*sin(phi0)-r0);
384 
385 #ifdef DEBUGHITS
386  ATH_MSG_VERBOSE("sector number, dist along height " << isect << " " << currentCellData.dist);
387  ATH_MSG_VERBOSE("z2,module number,m_first_cathod " << z2 << " " << currentCellData.module << " "
388  << m_first_cathod[currentCellData.module]);
389 #endif
390 
393  G4double deltaz=z2-(m_first_cathod[currentCellData.module]+currentCellData.dist*tan(m_tilt[currentCellData.module]));
394  if (deltaz<0 ) {
395  if (currentCellData.module>0) {
396  currentCellData.module=currentCellData.module-1;
397  deltaz=z2-(m_first_cathod[currentCellData.module]+currentCellData.dist*tan(m_tilt[currentCellData.module]));
398  }
399  else deltaz=0;
400  }
401 
403  currentCellData.gap = ((int)(deltaz/m_pitch[currentCellData.module]));
404 
405 #ifdef DEBUGHITS
406  ATH_MSG_VERBOSE("deltaz from first cathode,gap number " << deltaz << " " << currentCellData.gap);
407 #endif
408 
410  currentCellData.etaBin= currentCellData.gap/m_ngap_cell[currentCellData.module];
411 #ifdef DEBUGHITS
412  ATH_MSG_VERBOSE("etaBin inside module " << currentCellData.etaBin);
413 #endif
414  if (currentCellData.etaBin >= m_ncell_module[currentCellData.module]) currentCellData.etaBin=m_ncell_module[currentCellData.module]-1;
415 
416  for (int i=0;i<currentCellData.module;i++) currentCellData.etaBin=currentCellData.etaBin+m_ncell_module[i];
417 #ifdef DEBUGHITS
418  ATH_MSG_VERBOSE(" final etaBin " << currentCellData.etaBin);
419 #endif
420 
421  if (currentCellData.etaBin < 0 || currentCellData.etaBin > 60) {
422  ATH_MSG_WARNING("LArBarrelPresamplerGeometry::findCell etaBin outside range " << currentCellData.etaBin);
423  }
424 
426  const G4double zmiddle=m_first_cathod[currentCellData.module]+((double)(currentCellData.gap+0.5))*m_pitch[currentCellData.module];
427 
431  currentCellData.xElec=currentCellData.dist*cos(m_tilt[currentCellData.module])+(z2-zmiddle)*sin(m_tilt[currentCellData.module]);
432  currentCellData.distElec=(z2-zmiddle)*cos(m_tilt[currentCellData.module]) - currentCellData.dist*sin(m_tilt[currentCellData.module]);
433 #ifdef DEBUGHITS
434  ATH_MSG_VERBOSE("zmiddle,xloc,yloc " << zmiddle << " " << currentCellData.distElec << " " << currentCellData.xElec);
435 #endif
436 
437  bool status=true;
438  if (fabs(currentCellData.dist)>m_halfThickLAr) {
439 #ifdef DEBUGHITS
440  ATH_MSG_VERBOSE("Outside normal LAr 13mm gap "),
441 #endif
442  status=false;
443  }
444 
445  return status;
446  }
447 
448  }
450 }

◆ initialize()

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

initialize geometry parameters this should at some stage be taken from a database...

compute positions of end of modules and of first cathode in a module in nominal Atlas coordinates

Definition at line 93 of file LArBarrelPresamplerGeometry.cxx.

112  {
113  const static G4String fullPSName = (m_detectorName.empty()) ? "LAr::Barrel::Presampler" : G4String(m_detectorName+"::LAr::Barrel::Presampler");
114  const static G4String fullCryoName = (m_detectorName.empty()) ? "LAr::TBBarrel::Cryostat::LAr" : G4String(m_detectorName+"::LAr::TBBarrel::Cryostat::LAr");
115  const static G4String fullModuleName = (m_detectorName.empty()) ? "LAr::Barrel::Presampler::Module" : G4String(m_detectorName+"::LAr::Barrel::Presampler::Module");
116 
118  const G4NavigationHistory* g4navigation = a_step->GetPreStepPoint()->GetTouchable()->GetHistory();
119  const G4int ndep = g4navigation->GetDepth();
120  bool iactive(false);
121  G4int idep(-999);
122 
124  for (G4int ii=0;ii<=ndep;ii++) {
125  // FIXME Need to find a way to avoid these string-comparisons
126  const G4String& vname = g4navigation->GetVolume(ii)->GetName();
127  if (idep<0 && vname==fullPSName) idep=ii; // half barrel
128  else if (!iactive && vname==fullModuleName) iactive=true;
129  }
130 
131  if (idep < 0) std::abort();
132 
133  if ( iactive ) {

Member Data Documentation

◆ m_cat_th

G4double LArG4::BarrelPresampler::Geometry::m_cat_th {}
private

Definition at line 65 of file LArBarrelPresamplerGeometry.h.

◆ m_detectorName

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

Definition at line 54 of file LArBarrelPresamplerGeometry.h.

◆ m_end_module

G4double LArG4::BarrelPresampler::Geometry::m_end_module[8] {}
private

Definition at line 62 of file LArBarrelPresamplerGeometry.h.

◆ m_first_cathod

G4double LArG4::BarrelPresampler::Geometry::m_first_cathod[8] {}
private

Definition at line 67 of file LArBarrelPresamplerGeometry.h.

◆ m_halfThickLAr

G4double LArG4::BarrelPresampler::Geometry::m_halfThickLAr {0.5*13.*Athena::Units::mm}
private

Definition at line 77 of file LArBarrelPresamplerGeometry.h.

◆ m_ncell_module

G4int LArG4::BarrelPresampler::Geometry::m_ncell_module[8] {}
private

Definition at line 75 of file LArBarrelPresamplerGeometry.h.

◆ m_ngap_cell

G4int LArG4::BarrelPresampler::Geometry::m_ngap_cell[8] {}
private

Definition at line 71 of file LArBarrelPresamplerGeometry.h.

◆ m_pitch

G4double LArG4::BarrelPresampler::Geometry::m_pitch[8] {}
private

Definition at line 73 of file LArBarrelPresamplerGeometry.h.

◆ m_testbeam

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

Definition at line 56 of file LArBarrelPresamplerGeometry.h.

◆ m_tilt

G4double LArG4::BarrelPresampler::Geometry::m_tilt[8] {}
private

Definition at line 69 of file LArBarrelPresamplerGeometry.h.

◆ m_zminPS

G4double LArG4::BarrelPresampler::Geometry::m_zminPS {3.00*Athena::Units::mm}
private

Definition at line 63 of file LArBarrelPresamplerGeometry.h.

◆ m_zpres

G4double LArG4::BarrelPresampler::Geometry::m_zpres {1549.*Athena::Units::mm}
private

Definition at line 64 of file LArBarrelPresamplerGeometry.h.


The documentation for this class was generated from the following files:
LArG4::BarrelPresampler::Geometry::m_halfThickLAr
G4double m_halfThickLAr
Definition: LArBarrelPresamplerGeometry.h:77
RoiUtil::phicheck
double phicheck(double phi)
basic range checkers
Definition: RoiUtil.cxx:123
test_pyathena.eta
eta
Definition: test_pyathena.py:10
LArG4Identifier
Definition: LArG4Identifier.h:121
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LArG4::BarrelPresampler::Geometry::findCell
virtual bool findCell(CalcData &currentCellData, G4double xloc, G4double yloc, G4double zloc) const override final
=============================================================================== bool findCell(xloc,...
Definition: LArBarrelPresamplerGeometry.cxx:369
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
m_nsectors
G4int m_nsectors
GU add phi min and phi span of overall volume.
Definition: PresParameterDef.h:60
LArG4::BarrelPresampler::Geometry::m_tilt
G4double m_tilt[8]
Definition: LArBarrelPresamplerGeometry.h:69
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
lumiFormat.i
int i
Definition: lumiFormat.py:85
TRT_PAI_physicsConstants::r0
const double r0
electron radius{cm}
Definition: TRT_PAI_physicsConstants.h:22
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
LArG4::BarrelPresampler::Geometry::m_pitch
G4double m_pitch[8]
Definition: LArBarrelPresamplerGeometry.h:73
LArG4::BarrelPresampler::Geometry::m_detectorName
Gaudi::Property< std::string > m_detectorName
Definition: LArBarrelPresamplerGeometry.h:54
LArG4::BarrelPresampler::Geometry::m_ncell_module
G4int m_ncell_module[8]
Definition: LArBarrelPresamplerGeometry.h:75
LArG4::BarrelPresampler::Geometry::m_ngap_cell
G4int m_ngap_cell[8]
Definition: LArBarrelPresamplerGeometry.h:71
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArG4::BarrelPresampler::Geometry::m_testbeam
Gaudi::Property< bool > m_testbeam
Definition: LArBarrelPresamplerGeometry.h:56
merge.status
status
Definition: merge.py:16
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
LArG4::BarrelPresampler::Geometry::m_first_cathod
G4double m_first_cathod[8]
Definition: LArBarrelPresamplerGeometry.h:67