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

std::string m_detectorName {"LArMgr"}
 
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}
 
bool m_testbeam {false}
 

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

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

Definition at line 93 of file LArBarrelPresamplerGeometry.cxx.

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 152 of file LArBarrelPresamplerGeometry.cxx.

173  {
174  currentCellData.phiBin = 31 - currentCellData.phiBin;
175  if(currentCellData.phiBin < 0 ) currentCellData.phiBin += 64;
176  }
177 

◆ 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 237 of file LArBarrelPresamplerGeometry.cxx.

251  : ploc2.phi();
252  const G4double eta = ploc2.eta();
253  //G4double z2=fabs(ploc2.z());
254 
263  const G4int numberPhiMod = 32;
264  const G4double dphi = ( 2.*M_PI ) / numberPhiMod;
265  const G4double inv_dphi = 1. / dphi;
266  const G4double PSModuleRmean = 1420 ;
267  const G4double phicheck = phi - int(phi * inv_dphi) * dphi - (dphi /2.);
268  const G4double Rcheck = PSModuleRmean / cos(phicheck);
269  CalcData currentCellData;
270  if (radius > Rcheck) {
271  currentCellData.region = 3;
272  } else {
273  currentCellData.region = 2;
274  }
275 
276  const G4double detaDM = 0.1 ;
277  const G4double dphiDM = ( 2 * M_PI ) / 64. ;
278 
279  currentCellData.phiBin = G4int( phi * (1. / dphiDM) );
280  currentCellData.etaBin = G4int( eta * (1. / detaDM) );
281 
282  if( zSide == -1 )
283  {
284  currentCellData.phiBin = 31 - currentCellData.phiBin;
285  if(currentCellData.phiBin < 0 ) currentCellData.phiBin += 64;
286  }
287 
288  // 07-Jul-2005 WGS: Handle an extremely rare rounding problem.
289  if ( currentCellData.phiBin == 64 ) currentCellData.phiBin = 0;
290 
292  LArG4Identifier PS_DM_ID = LArG4Identifier();
293  PS_DM_ID << 10 // ATLAS
294  << zSide*4 // LArEM
295  << 1
296  << 1
297  << currentCellData.region
298  << currentCellData.etaBin
299  << currentCellData.phiBin;
300 
301 #ifdef DEBUGHITS
302  ATH_MSG_VERBOSE("Here the identifier for the presampler DEAD materials ---->");
303  ATH_MSG_VERBOSE("m_zSide ----> " << zSide*4);
304  ATH_MSG_VERBOSE("region ----> " << currentCellData.region);
305  ATH_MSG_VERBOSE("etaBin ----> " << currentCellData.etaBin);
306  ATH_MSG_VERBOSE("phiBin ----> " << currentCellData.phiBin);
307 #endif
308 
309  return PS_DM_ID ;
310  }
311 
338  bool Geometry::findCell(CalcData & currentCellData, G4double xloc,G4double yloc,G4double zloc) const
339  {
340 
341  currentCellData.sampling = 0;
342  currentCellData.region = 0;
343 
345  G4double phi = atan2(yloc,xloc);
346  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 186 of file LArBarrelPresamplerGeometry.cxx.

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

◆ 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 374 of file LArBarrelPresamplerGeometry.cxx.

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

◆ 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 98 of file LArBarrelPresamplerGeometry.cxx.

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

Member Data Documentation

◆ m_cat_th

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

Definition at line 62 of file LArBarrelPresamplerGeometry.h.

◆ m_detectorName

std::string LArG4::BarrelPresampler::Geometry::m_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 59 of file LArBarrelPresamplerGeometry.h.

◆ m_first_cathod

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

Definition at line 64 of file LArBarrelPresamplerGeometry.h.

◆ m_halfThickLAr

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

Definition at line 74 of file LArBarrelPresamplerGeometry.h.

◆ m_ncell_module

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

Definition at line 72 of file LArBarrelPresamplerGeometry.h.

◆ m_ngap_cell

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

Definition at line 68 of file LArBarrelPresamplerGeometry.h.

◆ m_pitch

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

Definition at line 70 of file LArBarrelPresamplerGeometry.h.

◆ m_testbeam

bool LArG4::BarrelPresampler::Geometry::m_testbeam {false}
private

Definition at line 76 of file LArBarrelPresamplerGeometry.h.

◆ m_tilt

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

Definition at line 66 of file LArBarrelPresamplerGeometry.h.

◆ m_zminPS

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

Definition at line 60 of file LArBarrelPresamplerGeometry.h.

◆ m_zpres

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

Definition at line 61 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:74
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
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
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:374
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_detectorName
std::string m_detectorName
Definition: LArBarrelPresamplerGeometry.h:54
LArG4::BarrelPresampler::Geometry::m_tilt
G4double m_tilt[8]
Definition: LArBarrelPresamplerGeometry.h:66
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
lumiFormat.i
int i
Definition: lumiFormat.py:85
TRT_PAI_physicsConstants::r0
const double r0
electron radius{cm}
Definition: TRT_PAI_physicsConstants.h:20
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:70
LArG4::BarrelPresampler::Geometry::m_ncell_module
G4int m_ncell_module[8]
Definition: LArBarrelPresamplerGeometry.h:72
LArG4::BarrelPresampler::Geometry::m_ngap_cell
G4int m_ngap_cell[8]
Definition: LArBarrelPresamplerGeometry.h:68
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
LArG4::BarrelPresampler::Geometry::m_testbeam
bool m_testbeam
Definition: LArBarrelPresamplerGeometry.h:76
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
merge.status
status
Definition: merge.py:17
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
LArG4::BarrelPresampler::Geometry::m_first_cathod
G4double m_first_cathod[8]
Definition: LArBarrelPresamplerGeometry.h:64