Belle II Software  release-08-01-10
ARICHBtestGeometryPar.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <framework/logging/Logger.h>
10 
11 #include <arich/geometry/ARICHBtestGeometryPar.h>
12 
13 #include <boost/format.hpp>
14 #include <boost/foreach.hpp>
15 
16 using namespace std;
17 using namespace boost;
18 
19 namespace Belle2 {
25  ARICHBtestGeometryPar* ARICHBtestGeometryPar::p_B4ARICHBtestGeometryParDB = 0;
26 
27  ARICHBtestGeometryPar* ARICHBtestGeometryPar::Instance()
28  {
29  if (!p_B4ARICHBtestGeometryParDB) {
30  p_B4ARICHBtestGeometryParDB = new ARICHBtestGeometryPar();
31  }
32  return p_B4ARICHBtestGeometryParDB;
33  }
34 
35  ARICHBtestGeometryPar::ARICHBtestGeometryPar():
36  m_mwpc(new ARICHTracking),
37  m_trackingShift(TVector3()),
38  m_rotationCenter(TVector3()),
39  m_frameRotation(TRotation()),
40  m_averageAgel(0),
41  m_nPads(0),
42  m_init(0),
43  m_simple(0)
44  {
45  clear();
46  }
47 
48 
50  m_trackingShift(arichPar.m_trackingShift),
51  m_rotationCenter(arichPar.m_rotationCenter),
52  m_frameRotation(arichPar.m_frameRotation),
53  m_hapdmap(arichPar.m_hapdmap),
54  m_hapdeid(arichPar.m_hapdeid)
55  {
56  m_averageAgel = arichPar.m_averageAgel;
57  m_nPads = arichPar.m_nPads;
58  m_init = arichPar.m_init;
59  m_simple = arichPar.m_simple;
60  m_mwpc = new ARICHTracking();
61  *m_mwpc = *arichPar.m_mwpc;
63  }
64 
66  {
67  }
68 
69 
71  {
72  m_mwpc = m;
73  }
74 
75 
77  {
78  return m_mwpc;
79  }
80 
81  std::pair<double, double> ARICHBtestGeometryPar::GetHapdChannelPosition(int id)
82  {
83  return m_hapdmap[id];
84  }
85 
86  std::pair<int, int> ARICHBtestGeometryPar::GetHapdElectronicMap(int id)
87  {
88  return m_hapdeid[id];
89  }
90 
92  {
93  m_hapdmap.push_back(std::make_pair(x, y));
94  return m_hapdmap.size();
95  }
96 
98  {
99  m_hapdeid.push_back(std::make_pair(x, y));
100  return m_hapdeid.size();
101  }
102 
104  {
105  m_trackingShift = v;
106  B2INFO("ARICHBtestGeometryPar::setTrackingShift=" << m_trackingShift.X() << "," << m_trackingShift.Y() << "," <<
107  m_trackingShift.Z());
108 
109  }
110 
111 
113  {
114  return m_trackingShift;
115  }
116 
118  {
119  m_rotationCenter = v;
120  B2INFO("ARICHBtestGeometryPar::setRotationCenter=" << m_rotationCenter.X() << "," << m_rotationCenter.Y() << "," <<
121  m_rotationCenter.Z());
122 
123  }
124 
126  {
127  return m_rotationCenter;
128  }
129 
131  {
132  m_frameRotation = TRotation();
133  m_frameRotation.RotateY(v);
134  B2INFO("ARICHBtestGeometryPar::setFrameRotation=" << v);
135 
136  }
137 
139  {
140  return m_frameRotation;
141  }
142 
144  {
145  m_averageAgel = v;
146  }
147 
149  {
150  return m_averageAgel;
151  }
152 
153 
154 
156  {
157  m_init = false;
158  m_simple = false;
159  m_trackingShift = TVector3();
160  m_frameRotation = TRotation();
161  m_rotationCenter = TVector3();
162  }
163 
164  void ARICHBtestGeometryPar::setOffset(const TVector3& v)
165  {
166  m_offset = v;
167  B2INFO("ARICHBtestGeometryPar::setOffset=" << m_offset.X() << "," << m_offset.Y() << "," << m_offset.Z());
168 
169  }
170 
172  {
173  return m_offset;
174  }
175 
176 
178  {
179 
180  }
181 
183 } // namespace Belle2
The Class for ARICH Beamtest Geometry Parameters.
ARICHTracking * m_mwpc
Pointer to the tracking chambers.
TVector3 m_rotationCenter
rotation center of the Aerogel RICH frame
std::vector< std::pair< int, int > > m_hapdeid
mapping of the electronic channel to the HAPD module nr and the channel number
bool m_simple
True if parametrization initialized with simple geometry (beamtest)
TRotation m_frameRotation
rotation matrix of the Aerogel RICH frame
bool m_init
True if parametrization is already initialized.
int m_nPads
Number of detector module pads.
TVector3 m_trackingShift
Tracking shift.
std::vector< std::pair< double, double > > m_hapdmap
the position of the HAPD channels
bool m_averageAgel
flag for the reconstruction by using the average aerogel refractive index
Beamtest ARICH Geometry Tracking Class.
void setRotationCenter(const TVector3 &)
Set the rotation center of the Aerogel RICH frame.
TVector3 getRotationCenter()
Get the rotation center of the Aerogel RICH frame.
int AddHapdElectronicMapPair(int, int)
Set the mapping of the electronic channel to the HAPD module nr and the channel number.
TVector3 getOffset()
Get the setup global offset.
std::pair< double, double > GetHapdChannelPosition(int)
Get the position of the HAPD channel.
std::pair< int, int > GetHapdElectronicMap(int)
Get the mapping of the electronic channel to the HAPD module nr and the channel number.
void setTrackingShift(const TVector3 &)
Set the tracking shift.
bool getAverageAgel()
Get the flag for the reconstruction by using the average aerogel refractive index.
void setFrameRotation(double)
Set the rotation angle of the Aerogel RICH frame.
void setMwpc(ARICHTracking *m_mwpc)
Set the pointer of the tracking MWPCs.
void Print(void) const
Print some debug information.
TRotation getFrameRotation()
Get the rotation matrix of the Aerogel RICH frame.
static ARICHBtestGeometryPar * p_B4ARICHBtestGeometryParDB
Pointer that saves the instance of this class.
virtual ~ARICHBtestGeometryPar()
Destructor.
void setOffset(const TVector3 &)
Set of the setup global offset.
void setAverageAgel(bool)
Set the flag for the reconstruction by using the average aerogel refractive index.
int AddHapdChannelPositionPair(double, double)
Set the position of the HAPD channel.
ARICHTracking * getMwpc()
Get the pointer of the tracking MWPCs.
TVector3 getTrackingShift()
Get the tracking shift.
Abstract base class for different kinds of events.