ATLAS Offline Software
LArBarrelGeometry.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // LArBarrelGeometry.hh
6 
7 #ifndef LARG4BARREL_LARBARRELGEOMETRY_H
8 #define LARG4BARREL_LARBARRELGEOMETRY_H
9 
10 #include "ILArBarrelGeometry.h"
12 
15 #include "G4ThreeVector.hh"
16 #include "G4StepPoint.hh"
17 #include "G4Step.hh"
18 #include "G4LogicalVolume.hh"
19 #include "G4LogicalVolumeStore.hh"
20 #include "G4TouchableHistory.hh"
21 
22 #include <string>
23 
24 // Forward declarations.
25 class LArG4Identifier;
26 class G4Step;
27 class LArCoudeElectrodes;
28 class LArCoudeAbsorbers;
31 
32 namespace LArG4 {
33 
34  namespace Barrel {
35 
36  class Geometry: public extends<AthService, ILArBarrelGeometry> {
37 
38  public:
39 
40  //constructor
41  Geometry(const std::string& name, ISvcLocator * pSvcLocator);
42 
43  virtual ~Geometry() = default;
44 
45  virtual StatusCode initialize() override final;
46  virtual StatusCode finalize() override final;
47 
48  virtual void initializeForSDCreation() override final;
49 
50  // Full identifier computation from a G4 step
51  virtual LArG4Identifier CalculateIdentifier( const G4Step* ) const override final;
52 
53  // Given a point compute all quantities (cell number, distance to electrode, etc...)
54  virtual void findCell( CalcData & currentCellData, const double & x, const double & y, const double & z,
55  const double & r, const double & eta, const double & phi, const bool detail) const override final;
56 
57  private:
58 
59  LArG4Identifier CalculateECAMIdentifier( const G4Step* , const G4int indEcam, const bool inSTAC=true,int zside=1) const;
60  bool CheckLArIdentifier(int sampling,int region, int eta,int phi) const;
61  bool CheckDMIdentifier(int type, int sampling, int region, int eta, int phi) const;
62 
63  // detector name, for translated geometry
64  Gaudi::Property<std::string> m_detectorName{this, "DetectorName", "LArMgr"};
65  // to handle small difference (mostly phi wrapping and +-z symmetry)
66  // between atlas and test beam
67  Gaudi::Property<bool> m_testbeam{this, "TestBeam", false};
68 
69  G4String m_ecamName;
70 
71  // global EMBarrel dimensions
72  double m_rMinAccordion{0.};
73  double m_rMaxAccordion{0.};
74  double m_zMinBarrel{0.};
75  double m_zMaxBarrel{0.};
77  double m_etaMaxBarrel{0.};
78 
79  // GU 11/06/2003 total number of cells in phi
80  int m_NCellTot{0}; // either 64 or 1024 for TestBeam or Atlas
81  int m_NCellMax{0}; // 1024
82 
83  // Accordion parameters
84  int m_Nbrt{0}; // number of straight sections (=14)
85  int m_Nbrt1{0}; // number of folds (=15)
86 
87  // Accordion parameters, refering to the neutral fibre
88  double m_gam0{0.}; //phi position for the first absorber neutral fiber
89  double m_rint_eleFib{0.}; //2.78
90 
91  double *m_rc{nullptr};
92  double *m_phic{nullptr};
93  double *m_xc{nullptr};
94  double *m_yc{nullptr};
95  double *m_delta{nullptr};
96  int m_parity{0};
97 
98  // to access G4 geometry
100  const LArCoudeAbsorbers* m_coudeabs{nullptr};
103 
104  bool m_iflSAG{false};
105 
106  // intermediate values for phi cell computation
107  G4int m_NRphi{0};
108  G4double m_Rmin{0.};
109  G4double m_Rmax{0.};
110  G4double m_Rphi[5000] = {0};
111  G4double m_dR{0.};
112 
113  // function to compute distance to electrode
114  double Distance_Ele(const double &x, const double &y,
115  const int &PhiC, int &Num_Straight, const int &Num_Coude,
116  double &xl) const;
117  // function to compute distance to absorber
118  double Distance_Abs(const double &x, const double &y,
119  const int &nabs, const int &Num_Straight, const int &Num_Coude) const;
120 
121  // longitudinal and eta segmentation of electrodes
122  G4int SampSeg(G4double,G4double,G4double,G4int&,G4int&,G4int&,G4int&,G4int&) const;
123 
125 
127  void GetRphi();
129  G4double Phi0(G4double) const;
131  G4int PhiGap(const double &, const double &, const double &) const;
132 
133  protected:
134 
136 
137 
138  } ;
139 
140  } //end of Barrel namespace
141 
142 } // end of LArG4 namespace
143 
144 #endif // LARG4BARREL_LARBARRELGEOMETRY_H
LArG4::Barrel::Geometry::PhiGap
G4int PhiGap(const double &, const double &, const double &) const
Definition: LArBarrelGeometry.cxx:934
beamspotman.r
def r
Definition: beamspotman.py:672
LArG4::Barrel::Geometry::m_parity
int m_parity
Definition: LArBarrelGeometry.h:96
LArG4Identifier
Definition: LArG4Identifier.h:121
LArG4::Barrel::Geometry::m_Rmax
G4double m_Rmax
Definition: LArBarrelGeometry.h:109
LArG4::Barrel::Geometry::m_Rphi
G4double m_Rphi[5000]
Definition: LArBarrelGeometry.h:110
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
LArG4::Barrel::Geometry::m_zMinBarrel
double m_zMinBarrel
Definition: LArBarrelGeometry.h:74
LArG4::Barrel::Geometry::Phi0
G4double Phi0(G4double) const
Definition: LArBarrelGeometry.cxx:919
LArG4::Barrel::Geometry::m_Nbrt
int m_Nbrt
Definition: LArBarrelGeometry.h:84
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
LArG4::Barrel::Geometry::m_rc
double * m_rc
Definition: LArBarrelGeometry.h:91
LArVG4DetectorParameters.h
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
detail
Definition: extract_histogram_tag.cxx:14
LArG4::Barrel::CalcData
Definition: ILArBarrelGeometry.h:26
LArG4::Barrel::Geometry::Geometry
Geometry()
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
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
Property
Support class for PropertyMgr.
Definition: Property.h:23
LArG4
Definition: LArWheelCalculatorEnums.h:8
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
LArG4::Barrel::Geometry::SampSeg
G4int SampSeg(G4double, G4double, G4double, G4int &, G4int &, G4int &, G4int &, G4int &) const
Definition: LArBarrelGeometry.cxx:325
DetType::Barrel
@ Barrel
Definition: DetType.h:14
LArG4::Barrel::Geometry
Definition: LArBarrelGeometry.h:36
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
LArStraightAbsorbers
Definition: LArStraightAbsorbers.h:11
LArG4::Barrel::Geometry::CheckDMIdentifier
bool CheckDMIdentifier(int type, int sampling, int region, int eta, int phi) const
Definition: LArBarrelGeometry.cxx:1318
LArG4::Barrel::Geometry::CalculateIdentifier
virtual LArG4Identifier CalculateIdentifier(const G4Step *) const override final
Definition: LArBarrelGeometry.cxx:953
LArStraightElectrodes
Definition: LArStraightElectrodes.h:11
LArG4::Barrel::Geometry::finalize
virtual StatusCode finalize() override final
Definition: LArBarrelGeometry.cxx:155
z
#define z
LArG4::Barrel::Geometry::m_rint_eleFib
double m_rint_eleFib
Definition: LArBarrelGeometry.h:89
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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
LArG4::Barrel::Geometry::initialize
virtual StatusCode initialize() override final
Definition: LArBarrelGeometry.cxx:81
LArG4::Barrel::Geometry::m_absorber
const LArStraightAbsorbers * m_absorber
Definition: LArBarrelGeometry.h:102
LArG4Identifier.h
LArG4::Barrel::Geometry::m_Nbrt1
int m_Nbrt1
Definition: LArBarrelGeometry.h:85
LArCoudeElectrodes
Definition: LArCoudeElectrodes.h:10
LArG4::Barrel::Geometry::~Geometry
virtual ~Geometry()=default
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
LArG4::Barrel::Geometry::m_dR
G4double m_dR
Definition: LArBarrelGeometry.h:111
LArG4::Barrel::Geometry::m_yc
double * m_yc
Definition: LArBarrelGeometry.h:94
LArG4::Barrel::Geometry::m_coudeabs
const LArCoudeAbsorbers * m_coudeabs
Definition: LArBarrelGeometry.h:100
LArCoudeAbsorbers
Definition: LArCoudeAbsorbers.h:10
LArG4::Barrel::Geometry::CheckLArIdentifier
bool CheckLArIdentifier(int sampling, int region, int eta, int phi) const
Definition: LArBarrelGeometry.cxx:1355
LArG4::Barrel::Geometry::m_detectorName
Gaudi::Property< std::string > m_detectorName
Definition: LArBarrelGeometry.h:64
y
#define y
LArG4::Barrel::Geometry::m_delta
double * m_delta
Definition: LArBarrelGeometry.h:95
LArG4::Barrel::Geometry::m_zMaxBarrelDMMargin
double m_zMaxBarrelDMMargin
Definition: LArBarrelGeometry.h:76
LArG4::Barrel::Geometry::m_xc
double * m_xc
Definition: LArBarrelGeometry.h:93
LArG4::Barrel::Geometry::m_iflSAG
bool m_iflSAG
Definition: LArBarrelGeometry.h:104
Gaudi
=============================================================================
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:273
AthService.h
private
#define private
Definition: xAODTruthCnvAlg.h:20
LArG4::Barrel::Geometry::m_NRphi
G4int m_NRphi
Definition: LArBarrelGeometry.h:107
LArG4::Barrel::Geometry::m_rMaxAccordion
double m_rMaxAccordion
Definition: LArBarrelGeometry.h:73
ILArBarrelGeometry.h
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