ATLAS Offline Software
LArBarrelGeometry.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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() { };
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  std::string m_detectorName;
65  G4String m_ecamName;
66 
67  // global EMBarrel dimensions
70  double m_zMinBarrel;
71  double m_zMaxBarrel;
74 
75  // GU 11/06/2003 total number of cells in phi
76  int m_NCellTot; // either 64 or 1024 for TestBeam or Atlas
77  int m_NCellMax; // 1024
78 
79  // Accordion parameters
80  int m_Nbrt; // number of straight sections (=14)
81  int m_Nbrt1; // number of folds (=15)
82 
83  // Accordion parameters, refering to the neutral fibre
84  double m_gam0 ; //phi position for the first absorber neutral fiber
85  double m_rint_eleFib ; //2.78
86  double *m_rc, *m_phic, *m_xc, *m_yc, *m_delta;// double m_rc[15] ; // R and
87  int m_parity;
88  //double m_phic[15] ; // phi positions of center of fold for first absorber
89  // double m_xc[15]; // corresponding x,y values
90  // double m_yc[15];
91  //double m_delta[15]; // zig-zag angles
92  // to access G4 geometry
97 
98  // to handle small difference (mostly phi wrapping and +-z symmetry)
99  // between atlas and test beam
101 
102  bool m_iflSAG;
103 
104  // intermediate values for phi cell computation
105  G4int m_NRphi;
106  G4double m_Rmin;
107  G4double m_Rmax;
108  G4double m_Rphi[5000];
109  G4double m_dR;
110 
111  // function to compute distance to electrode
112  double Distance_Ele(const double &x, const double &y,
113  const int &PhiC, int &Num_Straight, const int &Num_Coude,
114  double &xl) const;
115  // function to compute distance to absorber
116  double Distance_Abs(const double &x, const double &y,
117  const int &nabs, const int &Num_Straight, const int &Num_Coude) const;
118 
119  // longitudinal and eta segmentation of electrodes
120  G4int SampSeg(G4double,G4double,G4double,G4int&,G4int&,G4int&,G4int&,G4int&) const;
121 
123 
125  void GetRphi();
127  G4double Phi0(G4double) const;
129  G4int PhiGap(const double &, const double &, const double &) const;
130 
131  protected:
132 
134 
135 
136  } ;
137 
138  } //end of Barrel namespace
139 
140 } // end of LArG4 namespace
141 
142 #endif // LARG4BARREL_LARBARRELGEOMETRY_H
LArG4::Barrel::Geometry::PhiGap
G4int PhiGap(const double &, const double &, const double &) const
Definition: LArBarrelGeometry.cxx:966
beamspotman.r
def r
Definition: beamspotman.py:676
LArG4::Barrel::Geometry::m_parity
int m_parity
Definition: LArBarrelGeometry.h:87
LArG4Identifier
Definition: LArG4Identifier.h:121
LArG4::Barrel::Geometry::m_Rmax
G4double m_Rmax
Definition: LArBarrelGeometry.h:107
LArG4::Barrel::Geometry::m_Rphi
G4double m_Rphi[5000]
Definition: LArBarrelGeometry.h:108
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
LArG4::Barrel::Geometry::m_Rmin
G4double m_Rmin
Definition: LArBarrelGeometry.h:106
LArG4::Barrel::Geometry::initializeForSDCreation
virtual void initializeForSDCreation() override final
Definition: LArBarrelGeometry.cxx:176
LArG4::Barrel::Geometry::m_NCellTot
int m_NCellTot
Definition: LArBarrelGeometry.h:76
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
LArG4::Barrel::Geometry::m_zMinBarrel
double m_zMinBarrel
Definition: LArBarrelGeometry.h:70
LArG4::Barrel::Geometry::Phi0
G4double Phi0(G4double) const
Definition: LArBarrelGeometry.cxx:951
LArG4::Barrel::Geometry::m_Nbrt
int m_Nbrt
Definition: LArBarrelGeometry.h:80
LArG4::Barrel::Geometry::Distance_Ele
double Distance_Ele(const double &x, const double &y, const int &PhiC, int &Num_Straight, const int &Num_Coude, double &xl) const
Definition: LArBarrelGeometry.cxx:216
LArG4::Barrel::Geometry::m_rc
double * m_rc
Definition: LArBarrelGeometry.h:86
LArG4::Barrel::Geometry::m_yc
double * m_yc
Definition: LArBarrelGeometry.h:86
LArVG4DetectorParameters.h
LArG4::Barrel::Geometry::m_coudeelec
const LArCoudeElectrodes * m_coudeelec
Definition: LArBarrelGeometry.h:93
LArG4::Barrel::Geometry::m_electrode
const LArStraightElectrodes * m_electrode
Definition: LArBarrelGeometry.h:95
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:562
LArG4::Barrel::Geometry::m_etaMaxBarrel
double m_etaMaxBarrel
Definition: LArBarrelGeometry.h:73
x
#define x
LArG4::Barrel::Geometry::findCell
virtual void findCell(CalcData &currentCellData, const double &x, const double &y, const double &z, const double &r, const double &eta, const double &phi, const bool detail) const override final
Definition: LArBarrelGeometry.cxx:643
LArG4
Definition: LArWheelCalculatorEnums.h:8
protected
#define protected
Definition: DetDescrConditionsDict_dict_fixes.cxx:14
LArG4::Barrel::Geometry::SampSeg
G4int SampSeg(G4double, G4double, G4double, G4int &, G4int &, G4int &, G4int &, G4int &) const
Definition: LArBarrelGeometry.cxx:357
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:1065
LArG4::Barrel::Geometry::GetRphi
void GetRphi()
phi vs r of first absorber in nominal geometry
Definition: LArBarrelGeometry.cxx:827
LArG4::Barrel::Geometry::m_ecamName
G4String m_ecamName
Definition: LArBarrelGeometry.h:65
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:1350
LArG4::Barrel::Geometry::CalculateIdentifier
virtual LArG4Identifier CalculateIdentifier(const G4Step *) const override final
Definition: LArBarrelGeometry.cxx:985
LArStraightElectrodes
Definition: LArStraightElectrodes.h:11
LArG4::Barrel::Geometry::finalize
virtual StatusCode finalize() override final
Definition: LArBarrelGeometry.cxx:187
z
#define z
LArG4::Barrel::Geometry::m_rint_eleFib
double m_rint_eleFib
Definition: LArBarrelGeometry.h:85
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:290
LArG4::Barrel::Geometry::m_gam0
double m_gam0
Definition: LArBarrelGeometry.h:84
LArG4::Barrel::Geometry::initialize
virtual StatusCode initialize() override final
Definition: LArBarrelGeometry.cxx:113
LArG4::Barrel::Geometry::m_absorber
const LArStraightAbsorbers * m_absorber
Definition: LArBarrelGeometry.h:96
LArG4Identifier.h
LArG4::Barrel::Geometry::m_Nbrt1
int m_Nbrt1
Definition: LArBarrelGeometry.h:81
LArG4::Barrel::Geometry::~Geometry
virtual ~Geometry()
Definition: LArBarrelGeometry.h:43
LArCoudeElectrodes
Definition: LArCoudeElectrodes.h:10
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArG4::Barrel::Geometry::m_dR
G4double m_dR
Definition: LArBarrelGeometry.h:109
LArG4::Barrel::Geometry::m_coudeabs
const LArCoudeAbsorbers * m_coudeabs
Definition: LArBarrelGeometry.h:94
LArCoudeAbsorbers
Definition: LArCoudeAbsorbers.h:10
LArG4::Barrel::Geometry::m_phic
double * m_phic
Definition: LArBarrelGeometry.h:86
LArG4::Barrel::Geometry::CheckLArIdentifier
bool CheckLArIdentifier(int sampling, int region, int eta, int phi) const
Definition: LArBarrelGeometry.cxx:1387
LArG4::Barrel::Geometry::m_delta
double * m_delta
Definition: LArBarrelGeometry.h:86
y
#define y
LArG4::Barrel::Geometry::m_zMaxBarrelDMMargin
double m_zMaxBarrelDMMargin
Definition: LArBarrelGeometry.h:72
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArG4::Barrel::Geometry::m_iflSAG
bool m_iflSAG
Definition: LArBarrelGeometry.h:102
AthService.h
LArG4::Barrel::Geometry::m_NRphi
G4int m_NRphi
Definition: LArBarrelGeometry.h:105
LArG4::Barrel::Geometry::m_xc
double * m_xc
Definition: LArBarrelGeometry.h:86
LArG4::Barrel::Geometry::m_rMaxAccordion
double m_rMaxAccordion
Definition: LArBarrelGeometry.h:69
ILArBarrelGeometry.h
LArG4::Barrel::Geometry::m_testbeam
bool m_testbeam
Definition: LArBarrelGeometry.h:100
LArG4::Barrel::Geometry::m_NCellMax
int m_NCellMax
Definition: LArBarrelGeometry.h:77
LArG4::Barrel::Geometry::m_detectorName
std::string m_detectorName
Definition: LArBarrelGeometry.h:64
LArG4::Barrel::Geometry::m_zMaxBarrel
double m_zMaxBarrel
Definition: LArBarrelGeometry.h:71
LArG4::Barrel::Geometry::m_rMinAccordion
double m_rMinAccordion
Definition: LArBarrelGeometry.h:68