CbmRoot
CbmMvdStationPar.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmMvdStationPar source file -----
3 // ----- Created 28/10/14 by P.Sitzmann -----
4 // -------------------------------------------------------------------------
5 
6 #include "CbmMvdStationPar.h"
7 
8 #include "FairLogger.h"
9 
10 #include <iostream>
11 #include <math.h>
12 
13 using std::cout;
14 using std::endl;
15 
16 
17 // ----- Default constructor -------------------------------------------
19  : TNamed()
20  , fStationCount()
21  , fZPositions()
22  , fThicknesses()
23  , fHeights()
24  , fWidths()
25  , fXResolutions()
26  , fYResolutions()
27  , fRadiationLength()
28  , fBeamHeights()
29  , fBeamWidths() {}
30 // -------------------------------------------------------------------------
31 
32 // ----- Destructor ----------------------------------------------------
34 // -------------------------------------------------------------------------
35 
36 // ----- Public method Print -------------------------------------------
37 void CbmMvdStationPar::Print(Option_t* /*opt*/) const {
38 
39  LOG(info) << "MvdStationPar: Initialized parameter file with "
40  << fZPositions.size() << " stations";
41 
42  LOG(debug) << "Z Postion station 0: " << GetZPosition(0);
43  LOG(debug) << "Z Postion station 1: " << GetZPosition(1);
44  LOG(debug) << "Z Postion station 2: " << GetZPosition(2);
45  LOG(debug) << "Z Postion station 3: " << GetZPosition(3);
46 
47  LOG(debug) << "Thickness station 0: " << GetThickness(0);
48  LOG(debug) << "Thickness station 1: " << GetThickness(1);
49  LOG(debug) << "Thickness station 2: " << GetThickness(2);
50  LOG(debug) << "Thickness station 3: " << GetThickness(3);
51 
52  LOG(debug) << "Width station 0: " << GetWidth(0);
53  LOG(debug) << "Width station 1: " << GetWidth(1);
54  LOG(debug) << "Width station 2: " << GetWidth(2);
55  LOG(debug) << "Width station 3: " << GetWidth(3);
56 
57  LOG(debug) << "Height station 0: " << GetHeight(0);
58  LOG(debug) << "Height station 1: " << GetHeight(1);
59  LOG(debug) << "Height station 2: " << GetHeight(2);
60  LOG(debug) << "Height station 3: " << GetHeight(3);
61 }
62 // -------------------------------------------------------------------------
63 
64 // -------------------------------------------------------------------------
66  for (Int_t i = 0; i < fStationCount; i++) {
67  fZPositions[i] = 0.;
68  fThicknesses[i] = 0.;
69  fHeights[i] = 0.;
70  fWidths[i] = 0.;
71  fXResolutions[i] = 0.;
72  fYResolutions[i] = 0.;
73  fRadiationLength[i] = 0.;
74  fBeamHeights[i] = 0.;
75  fBeamWidths[i] = 0.;
76  }
77  return 1;
78 }
79 // -------------------------------------------------------------------------
80 
81 // -------------------------------------------------------------------------
82 Double_t CbmMvdStationPar::GetZPosition(Int_t stationNumber) const {
83  if (stationNumber <= fStationCount) {
84  return fZPositions.at(stationNumber);
85  } else {
86  cout << "Station number out of Range " << endl;
87  }
88  return 0.;
89 }
90 // -------------------------------------------------------------------------
91 
92 // -------------------------------------------------------------------------
93 Double_t CbmMvdStationPar::GetThickness(Int_t stationNumber) const {
94  if (stationNumber <= fStationCount) {
95  return fThicknesses.at(stationNumber);
96  } else {
97  cout << "Station number out of Range " << endl;
98  }
99  return 0.;
100 }
101 
102 // -------------------------------------------------------------------------
103 
104 // -------------------------------------------------------------------------
105 Double_t CbmMvdStationPar::GetHeight(Int_t stationNumber) const {
106  if (stationNumber <= fStationCount) {
107  return fHeights.at(stationNumber);
108  } else {
109  cout << "Station number out of Range " << endl;
110  }
111  return 0.;
112 }
113 
114 // -------------------------------------------------------------------------
115 
116 // -------------------------------------------------------------------------
117 Double_t CbmMvdStationPar::GetWidth(Int_t stationNumber) const {
118  if (stationNumber <= fStationCount) {
119  return fWidths.at(stationNumber);
120 
121  } else {
122  cout << "Station number out of Range " << endl;
123  }
124  return 0.;
125 }
126 
127 // -------------------------------------------------------------------------
128 
129 // -------------------------------------------------------------------------
130 Double_t CbmMvdStationPar::GetXRes(Int_t stationNumber) const {
131  if (stationNumber <= fStationCount) {
132  return fXResolutions.at(stationNumber);
133  } else {
134  cout << "Station number out of Range " << endl;
135  }
136  return 0.;
137 }
138 
139 // -------------------------------------------------------------------------
140 
141 // -------------------------------------------------------------------------
142 Double_t CbmMvdStationPar::GetYRes(Int_t stationNumber) const {
143  if (stationNumber <= fStationCount) {
144  return fYResolutions.at(stationNumber);
145  } else {
146  cout << "Station number out of Range " << endl;
147  }
148  return 0.;
149 }
150 
151 // -------------------------------------------------------------------------
152 
153 // -------------------------------------------------------------------------
154 Double_t CbmMvdStationPar::GetRadLength(Int_t stationNumber) const {
155  if (stationNumber <= fStationCount) {
156  return fRadiationLength.at(stationNumber);
157  } else {
158  cout << "Station number out of Range " << endl;
159  }
160  return 0.;
161 }
162 
163 // -------------------------------------------------------------------------
164 
165 // -------------------------------------------------------------------------
166 Double_t CbmMvdStationPar::GetBeamHeight(Int_t stationNumber) const {
167  if (stationNumber <= fStationCount) {
168  return fBeamHeights.at(stationNumber);
169  } else {
170  cout << "Station number out of Range " << endl;
171  }
172  return 0.;
173 }
174 
175 // -------------------------------------------------------------------------
176 
177 // -------------------------------------------------------------------------
178 Double_t CbmMvdStationPar::GetBeamWidth(Int_t stationNumber) const {
179  if (stationNumber <= fStationCount) {
180  return fBeamWidths.at(stationNumber);
181  } else {
182  cout << "Station number out of Range " << endl;
183  }
184  return 0.;
185 }
186 
187 // -------------------------------------------------------------------------
188 
189 
190 // -------------------------------------------------------------------------
191 void CbmMvdStationPar::SetZPosition(Int_t stationNumber, Double_t z) {
192  if (fZPositions[stationNumber] != 0) {
193  fZPositions[stationNumber] =
194  Int_t(((fZPositions[stationNumber] + z) / 2) + 0.5);
195  } else {
196  fZPositions[stationNumber] = z;
197  }
198 }
199 // -------------------------------------------------------------------------
200 
201 // -------------------------------------------------------------------------
202 void CbmMvdStationPar::SetThickness(Int_t stationNumber, Double_t thickness) {
203  Float_t Sensorthickness = fabs(thickness - fZPositions[stationNumber]);
204  if (Sensorthickness > fThicknesses[stationNumber])
205  fThicknesses[stationNumber] = Sensorthickness;
206 }
207 // -------------------------------------------------------------------------
208 
209 // -------------------------------------------------------------------------
210 void CbmMvdStationPar::SetHeight(Int_t stationNumber, Double_t height) {
211  if (fHeights[stationNumber] < height) { fHeights[stationNumber] = height; }
212 }
213 // -------------------------------------------------------------------------
214 
215 // -------------------------------------------------------------------------
216 void CbmMvdStationPar::SetWidth(Int_t stationNumber, Double_t width) {
217  if (fWidths[stationNumber] < width) { fWidths[stationNumber] = width; }
218 }
219 // -------------------------------------------------------------------------
220 
221 // -------------------------------------------------------------------------
222 void CbmMvdStationPar::SetXRes(Int_t stationNumber, Double_t xres) {
223  fXResolutions[stationNumber] = xres;
224 }
225 // -------------------------------------------------------------------------
226 
227 // -------------------------------------------------------------------------
228 void CbmMvdStationPar::SetYRes(Int_t stationNumber, Double_t yres) {
229  fYResolutions[stationNumber] = yres;
230 }
231 // -------------------------------------------------------------------------
232 
233 // -------------------------------------------------------------------------
234 void CbmMvdStationPar::SetRadLength(Int_t stationNumber, Double_t length) {
235  fRadiationLength[stationNumber] = length;
236 }
237 // -------------------------------------------------------------------------
238 
239 // -------------------------------------------------------------------------
240 void CbmMvdStationPar::SetBeamHeight(Int_t stationNumber, Double_t beamheight) {
241  if (fBeamHeights[stationNumber] != 0) {
242  if (fBeamHeights[stationNumber] > beamheight) {
243  fBeamHeights[stationNumber] = beamheight;
244  }
245  } else {
246  fBeamHeights[stationNumber] = beamheight;
247  }
248 }
249 // -------------------------------------------------------------------------
250 
251 // -------------------------------------------------------------------------
252 void CbmMvdStationPar::SetBeamWidth(Int_t stationNumber, Double_t beamwidth) {
253  if (fBeamWidths[stationNumber] != 0) {
254  if (fBeamWidths[stationNumber] > beamwidth) {
255  fBeamWidths[stationNumber] = beamwidth;
256  }
257  } else {
258  fBeamWidths[stationNumber] = beamwidth;
259  }
260 }
261 // -------------------------------------------------------------------------
262 
263 
CbmMvdStationPar::fWidths
std::map< Int_t, Double_t > fWidths
Definition: CbmMvdStationPar.h:69
CbmMvdStationPar::SetRadLength
void SetRadLength(Int_t stationNumber, Double_t length)
Definition: CbmMvdStationPar.cxx:234
CbmMvdStationPar::GetZPosition
Double_t GetZPosition(Int_t stationNumber) const
Definition: CbmMvdStationPar.cxx:82
CbmMvdStationPar::fXResolutions
std::map< Int_t, Double_t > fXResolutions
Definition: CbmMvdStationPar.h:70
CbmMvdStationPar::GetXRes
Double_t GetXRes(Int_t stationNumber) const
Definition: CbmMvdStationPar.cxx:130
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmMvdStationPar::Init
Bool_t Init()
Definition: CbmMvdStationPar.cxx:65
CbmMvdStationPar::SetHeight
void SetHeight(Int_t stationNumber, Double_t height)
Definition: CbmMvdStationPar.cxx:210
CbmMvdStationPar::GetWidth
Double_t GetWidth(Int_t stationNumber) const
Definition: CbmMvdStationPar.cxx:117
CbmMvdStationPar::SetBeamWidth
void SetBeamWidth(Int_t stationNumber, Double_t beamwidth)
Definition: CbmMvdStationPar.cxx:252
CbmMvdStationPar::SetXRes
void SetXRes(Int_t stationNumber, Double_t xres)
Definition: CbmMvdStationPar.cxx:222
CbmMvdStationPar::SetYRes
void SetYRes(Int_t stationNumber, Double_t yres)
Definition: CbmMvdStationPar.cxx:228
CbmMvdStationPar::CbmMvdStationPar
CbmMvdStationPar()
Definition: CbmMvdStationPar.cxx:18
CbmMvdStationPar::fRadiationLength
std::map< Int_t, Double_t > fRadiationLength
Definition: CbmMvdStationPar.h:72
CbmMvdStationPar::SetZPosition
void SetZPosition(Int_t stationNumber, Double_t z)
Definition: CbmMvdStationPar.cxx:191
CbmMvdStationPar::GetThickness
Double_t GetThickness(Int_t stationNumber) const
Definition: CbmMvdStationPar.cxx:93
CbmMvdStationPar::fThicknesses
std::map< Int_t, Double_t > fThicknesses
Definition: CbmMvdStationPar.h:67
CbmMvdStationPar::GetBeamWidth
Double_t GetBeamWidth(Int_t stationNumber) const
Definition: CbmMvdStationPar.cxx:178
CbmMvdStationPar::GetYRes
Double_t GetYRes(Int_t stationNumber) const
Definition: CbmMvdStationPar.cxx:142
CbmMvdStationPar::SetThickness
void SetThickness(Int_t stationNumber, Double_t thickness)
Definition: CbmMvdStationPar.cxx:202
CbmMvdStationPar.h
CbmMvdStationPar::fYResolutions
std::map< Int_t, Double_t > fYResolutions
Definition: CbmMvdStationPar.h:71
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMvdStationPar::fHeights
std::map< Int_t, Double_t > fHeights
Definition: CbmMvdStationPar.h:68
CbmMvdStationPar::SetWidth
void SetWidth(Int_t stationNumber, Double_t width)
Definition: CbmMvdStationPar.cxx:216
CbmMvdStationPar::fBeamWidths
std::map< Int_t, Double_t > fBeamWidths
Definition: CbmMvdStationPar.h:74
CbmMvdStationPar::fStationCount
Int_t fStationCount
Definition: CbmMvdStationPar.h:64
CbmMvdStationPar::Print
void Print(Option_t *opt="") const
Definition: CbmMvdStationPar.cxx:37
CbmMvdStationPar::~CbmMvdStationPar
virtual ~CbmMvdStationPar()
Definition: CbmMvdStationPar.cxx:33
CbmMvdStationPar::GetHeight
Double_t GetHeight(Int_t stationNumber) const
Definition: CbmMvdStationPar.cxx:105
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:60
CbmMvdStationPar::SetBeamHeight
void SetBeamHeight(Int_t stationNumber, Double_t beamheight)
Definition: CbmMvdStationPar.cxx:240
CbmMvdStationPar
Definition: CbmMvdStationPar.h:22
CbmMvdStationPar::GetRadLength
Double_t GetRadLength(Int_t stationNumber) const
Definition: CbmMvdStationPar.cxx:154
CbmMvdStationPar::fBeamHeights
std::map< Int_t, Double_t > fBeamHeights
Definition: CbmMvdStationPar.h:73
CbmMvdStationPar::GetBeamHeight
Double_t GetBeamHeight(Int_t stationNumber) const
Definition: CbmMvdStationPar.cxx:166
CbmMvdStationPar::fZPositions
std::map< Int_t, Int_t > fZPositions
Definition: CbmMvdStationPar.h:66