ATLAS Offline Software
TBCaloCoordinate.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ***************************************************************************
6 // Liquid Argon H8 Combined TestBeam Geometry
7 // -----------------------------------------
8 //
9 // 30.9.2004 Creation of the class by claire.bourdarios@cern.ch
10 //
11 // ***************************************************************************
12 
13 #ifndef TBCALOGEOMETRY_TBCALOCOORDINATE_H
14 #define TBCALOGEOMETRY_TBCALOCOORDINATE_H
15 
18 
19 class CaloPhiRange;
20 class ITBCaloPosTool;
21 class IMessageSvc;
22 class TBDetDescrManager;
23 
24 //done in the interface : #include "CLHEP/Geometry/Transform3D.h"
25 
26 //<<<<<< INCLUDES >>>>>>
27 
67 class TBCaloCoordinate : public AthAlgTool, virtual public ICaloCoordinateTool
68 {
69 public:
70 
71  // Constructors:
72 
73  TBCaloCoordinate(const std::string& type,
74  const std::string& name,
75  const IInterface* parent);
76 
78  static const InterfaceID& interfaceID( ) ;
81 
82  // Methods for general use:
83 
84  // 1) basic translation between the 2 cartesian coordinate systems:
85 
86  void ctb_to_local( Amg::Vector3D& pt_ctb,
87  Amg::Vector3D& pt_local);
88  void local_to_ctb( Amg::Vector3D& pt_local,
89  Amg::Vector3D& pt_ctb);
90 
91  void ctb_to_local( double& x_ctb, double& y_ctb, double& z_ctb,
92  double& x_local, double& y_local, double& z_local);
93  void local_to_ctb( double& x_local, double& y_local, double& z_local,
94  double& x_ctb, double& y_ctb, double& z_ctb);
95 
96  // 2) the most common use-case :
97  // the H8 beam goes along the x axis -> that are the local
98  // eta and phi seen by the calorimeter ?
99 
100  double beam_local_eta();
101  double beam_local_phi();
102 
103 
104  // Methods of less general interest : ( see ICaloCoordinate.h for comments )
105 
106  // real table reading :
107  virtual void read_table_position();
108 
109  // hand-coded value :
110  virtual void read_fake_table_position();
111 
114 
115  void print_transform(Amg::Transform3D& htrans);
116 
117 private:
118  // Avoid coverity warnings
121 
122  // these methods are used by read_table_position to get numbers :
123 
124  bool read_data_position(); // for H8 data
125  bool read_MC_position(); // for H8 MC where numbers are in POOL
126  void read_user_position(); // for H8 MC where numbers are not avail
127  void read_neutral_position(); // for Atlas
128 
129  // these are the famous key numbers :
130 
131  // 1) position of the table axis (oral tradition)
134  // 2) distance between the table axis and projective point (oral tradition)
137  // 3) angle of rotation : default is set in jobOpt (property)
138  // + will be overwritten if DB/Pool is used
139  // + will be ignored "if atlas"
140  double m_table_eta;
141 
142  // Another layer on top, "in case" the user wants to add an
143  // extra HepTransform on top of these known moovements :
150 
151  // these will be read in the DB :
153  double m_table_z;
155  // this is calculated from the DB info :
158 
159  // these properties define what we are reading (see jobOpt)
160  int m_DBRead;
162 
163  // keep the 2 steps separated : table rotation, then translation
164  //HepGeom::Rotate3D* m_table_rotate;
166  //HepGeom::Translate3D* m_table_shift;
168 
169  // the user defined one on top :
170 
175 
176  // the final transform from local to ctb :
179 
180  // Run number
182 
183  // to limit the printout
185 
189 };
190 
191 
192 #endif // TBCALOGEOMETRY_TBCALOCOORDINATE_H
TBCaloCoordinate::m_table_theta
double m_table_theta
Definition: TBCaloCoordinate.h:152
TBCaloCoordinate::m_table_axis_data
double m_table_axis_data
Definition: TBCaloCoordinate.h:132
TBCaloCoordinate::m_table_axis_MC
double m_table_axis_MC
Definition: TBCaloCoordinate.h:133
TBCaloCoordinate::local_to_ctb
void local_to_ctb(Amg::Vector3D &pt_local, Amg::Vector3D &pt_ctb)
General use method: basic translation between the 2 cartesian coordinate systems:
TBCaloCoordinate::m_table_delta
double m_table_delta
Definition: TBCaloCoordinate.h:154
CaloPhiRange
This class defines the phi convention for Calorimeters.
Definition: CaloPhiRange.h:28
TBCaloCoordinate::m_table_calc_theta
double m_table_calc_theta
Definition: TBCaloCoordinate.h:156
TBCaloCoordinate::m_calo_y_shift
double m_calo_y_shift
Definition: TBCaloCoordinate.h:148
TBCaloCoordinate::TBCaloCoordinate
TBCaloCoordinate(const TBCaloCoordinate &)
TBCaloCoordinate::transform_ctb_to_calo
Amg::Transform3D * transform_ctb_to_calo()
method accessing the transformations
Definition: TBCaloCoordinate.cxx:256
TBCaloCoordinate::m_rotz_extra_calo_to_ctb
Amg::Transform3D m_rotz_extra_calo_to_ctb
Definition: TBCaloCoordinate.h:171
TBCaloCoordinate::m_table_z
double m_table_z
Definition: TBCaloCoordinate.h:153
TBCaloCoordinate::m_transform_ctb_to_calo
Amg::Transform3D * m_transform_ctb_to_calo
Definition: TBCaloCoordinate.h:178
TBCaloCoordinate::interfaceID
static const InterfaceID & interfaceID()
Definition: TBCaloCoordinate.cxx:44
TBCaloCoordinate::TBCaloCoordinate
TBCaloCoordinate(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TBCaloCoordinate.cxx:47
TBCaloCoordinate::m_calo_x_shift
double m_calo_x_shift
Definition: TBCaloCoordinate.h:147
TBCaloCoordinate::~TBCaloCoordinate
~TBCaloCoordinate()
Definition: TBCaloCoordinate.cxx:130
TBCaloCoordinate::read_table_position
virtual void read_table_position()
clients who want the real position must call this
Definition: TBCaloCoordinate.cxx:217
TBCaloCoordinate::m_transform_calo_to_ctb
Amg::Transform3D * m_transform_calo_to_ctb
Definition: TBCaloCoordinate.h:177
TBCaloCoordinate::m_calo_theta_shift
double m_calo_theta_shift
Definition: TBCaloCoordinate.h:145
TBCaloCoordinate::m_table_rotate
Amg::RotationMatrix3D * m_table_rotate
Definition: TBCaloCoordinate.h:165
TBCaloCoordinate::m_translxyz_extra_calo_to_ctb
Amg::Transform3D m_translxyz_extra_calo_to_ctb
Definition: TBCaloCoordinate.h:174
TBCaloCoordinate::m_postool
ITBCaloPosTool * m_postool
Definition: TBCaloCoordinate.h:186
TBCaloCoordinate::m_calo_psi_shift
double m_calo_psi_shift
Definition: TBCaloCoordinate.h:146
TBCaloCoordinate::beam_local_phi
double beam_local_phi()
the most common use-case : the H8 beam goes along the x axis -> that are the local calorimeters eta a...
Definition: TBCaloCoordinate.cxx:208
TBCaloCoordinate::m_calo_phi_shift
double m_calo_phi_shift
Definition: TBCaloCoordinate.h:144
TBCaloCoordinate::read_fake_table_position
virtual void read_fake_table_position()
clients who want to avoid the DB-decoding, and force a fixed eta must call this :
Definition: TBCaloCoordinate.cxx:238
TBCaloCoordinate::m_table_eta
double m_table_eta
Definition: TBCaloCoordinate.h:140
TBCaloCoordinate::m_roty_extra_calo_to_ctb
Amg::Transform3D m_roty_extra_calo_to_ctb
Definition: TBCaloCoordinate.h:172
TBCaloCoordinate::m_runNumber
long m_runNumber
Definition: TBCaloCoordinate.h:181
TBCaloCoordinate::print_transform
void print_transform(Amg::Transform3D &htrans)
printout method
Definition: TBCaloCoordinate.cxx:262
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TBCaloCoordinate::m_table_calc_x
double m_table_calc_x
Definition: TBCaloCoordinate.h:157
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
AthAlgTool.h
TBCaloCoordinate::m_firstevt
int m_firstevt
Definition: TBCaloCoordinate.h:184
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TBCaloCoordinate::transform_calo_to_ctb
Amg::Transform3D * transform_calo_to_ctb()
method accessing the transformations
Definition: TBCaloCoordinate.cxx:250
ITBCaloPosTool
Definition: ITBCaloPosTool.h:25
TBCaloCoordinate::read_user_position
void read_user_position()
Definition: TBCaloCoordinate.cxx:436
ICaloCoordinateTool
This (clean) interface is implemented in the (rather dirty) ICaloCoordinateTool class,...
Definition: ICaloCoordinateTool.h:65
TBCaloCoordinate::m_table_proj_data
double m_table_proj_data
Definition: TBCaloCoordinate.h:135
TBCaloCoordinate::m_DBRead
int m_DBRead
Definition: TBCaloCoordinate.h:160
TBCaloCoordinate::operator=
TBCaloCoordinate & operator=(const TBCaloCoordinate &)
ICaloCoordinateTool.h
ICaloCoordinateTool interface declaration 30.9.2004 Creation of the class TBCalocoordinate by claire....
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TBCaloCoordinate::finalize
StatusCode finalize()
Definition: TBCaloCoordinate.cxx:140
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TBCaloCoordinate::m_calo_z_shift
double m_calo_z_shift
Definition: TBCaloCoordinate.h:149
TBCaloCoordinate::ctb_to_local
void ctb_to_local(Amg::Vector3D &pt_ctb, Amg::Vector3D &pt_local)
General use method: basic translation between the 2 cartesian coordinate systems:
TBCaloCoordinate::read_neutral_position
void read_neutral_position()
Definition: TBCaloCoordinate.cxx:507
TBDetDescrManager
Definition: TBDetDescrManager.h:21
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
TBCaloCoordinate::m_rotx_extra_calo_to_ctb
Amg::Transform3D m_rotx_extra_calo_to_ctb
Definition: TBCaloCoordinate.h:173
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
TBCaloCoordinate::beam_local_eta
double beam_local_eta()
the most common use-case : the H8 beam goes along the x axis -> that are the local calorimeters eta a...
Definition: TBCaloCoordinate.cxx:201
TBCaloCoordinate
This class implements the CaloDetDescr/ICaloCoordinateTool and handles the translation between :
Definition: TBCaloCoordinate.h:68
TBCaloCoordinate::initialize
StatusCode initialize()
Definition: TBCaloCoordinate.cxx:104
TBCaloCoordinate::m_PoolRead
int m_PoolRead
Definition: TBCaloCoordinate.h:161
TBCaloCoordinate::read_MC_position
bool read_MC_position()
Definition: TBCaloCoordinate.cxx:386
AthAlgTool
Definition: AthAlgTool.h:26
TBCaloCoordinate::read_data_position
bool read_data_position()
Definition: TBCaloCoordinate.cxx:284
TBCaloCoordinate::m_table_shift
Amg::Translation3D * m_table_shift
Definition: TBCaloCoordinate.h:167
TBCaloCoordinate::m_table_proj_MC
double m_table_proj_MC
Definition: TBCaloCoordinate.h:136
TBCaloCoordinate::m_range
CaloPhiRange * m_range
Definition: TBCaloCoordinate.h:188
TBCaloCoordinate::m_MCmgr
const TBDetDescrManager * m_MCmgr
Definition: TBCaloCoordinate.h:187