BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcSelBhaEvent.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// Environment:
3// This software was developed for the BESIII collaboration. If you
4// use all or part of it, please give an appropriate acknowledgement.
5//
6// Copyright Information:
7// Copyright (C) 2005 IHEP
8//
9//------------------------------------------------------------------------
10
11#ifndef EMCSELBHAEVENT_H
12#define EMCSELBHAEVENT_H
13
14//-------------
15// C Headers --
16//-------------
17#include <ctime>
18
19#include <cstring>
20#include<list>
21
22#include "GaudiKernel/Algorithm.h"
23#include "GaudiKernel/Property.h"
24
25//Ntuple
26#include "GaudiKernel/NTuple.h"
34//#include "EmcBhaCalib/ReadBeamInfFromDb.h"
35
38
42
43using namespace std;
44
45class IScanEnergySvc;
46class IEmcRecGeoSvc;
47class IBeamEnergySvc;
48// ---------------------
49// -- Class Interface --
50// ---------------------
51//
52// package EmcSelBhaEvent - Select Bhabha events(MCdata) for Emc-digi Calibration
53//
54// @author Chunxiu Liu (originator/contributor etc.);
55//
56
57class EmcSelBhaEvent:public Algorithm {
58
59 public:
60
61 //selected type
63
64 EmcSelBhaEvent(const std::string& name, ISvcLocator* pSvcLocator);
65
66
67 //--------------
68 // Destructor
69 //--------------
71
72 StatusCode initialize();
73 StatusCode execute();
74 StatusCode finalize();
75
76 //-----------------
77 bool passed() { return m_passed;}
78 void setPassed( bool passed) { m_passed = passed;}
79
80 int selectedType() const
81 {
82 return m_selectedType;
83 }
84
85 int selectedTrkID1() const
86 {
87 return m_selectedTrkID1;
88 }
89
90 int selectedTrkID2() const
91 {
92 return m_selectedTrkID2;
93 }
94
95 //-----------------
96 // matrix to convert theta,phi <-> index
97 int index(int theta, int phi) const {
98 int val = ((m_index)[theta][phi]);
99 return (val); }
100
101 // init Emc geometry (convertion matrix theta,phi <-> index)
102 void initGeom();
103
104 //--------------
105 StatusCode SelectBhabha();
106
107 StatusCode SelectFillBhabha();
108
109 void FillBhabha();
110
111 //collect Bhabha event and fill matrix and vector of system of linear equations
112 void CollectBhabha();
113
114 //output matrix and vector to files
115 void OutputMV();
116
117 double findPhiDiff( double phi1, double phi2);
118
119
120 //read correction function f(theta) itheta=0:55
121 void readCorFun();
122
123 //read Esigma function sigma(theta) itheta=0:55
124 void readEsigma();
125
126 // energy deposition function 56(0:55) for shower selection of Bhabha calibration
127 void readDepEneFun();
128
129 // energy resolution function 56(0:55) for shower selection of Bhabha calibration
130 void readSigmaExp();
131
132 void readRawPeakIxtal();
133
134 void readDataAndMCIxtal(); //about the electronics saturation for the very high beam energy
135
136 double Angle2ClosestShower( int ShowerID );
137
138 private :
139
140 // Declare r0, z0 cut for charged tracks
141 double m_vr0cut;
142 double m_vz0cut;
143
144 double m_lowEnergyShowerCut;
145 double m_highEnergyShowerCut;
146 double m_matchThetaCut ;
147 double m_matchPhiCut ;
148
149 double m_highMomentumCut;
150 double m_EoPMaxCut;
151 double m_EoPMinCut;
152 double m_minAngShEnergyCut;
153 double m_minAngCut;
154 double m_acolliCut;
155 double m_eNormCut;
156 double m_pNormCut;
157 double m_oneProngMomentumCut;
158
159/**selected event type */
160 int m_selectedType;
161 int m_selectedTrkID1;
162 int m_selectedTrkID2;
163
164 int m_Nothing;
165 int m_oneProngsSelected;
166 int m_twoProngsMatchedSelected;
167 int m_twoProngsOneMatchedSelected;
168
169 // calculate the expected energy of a Bhabha depending on theta
170 double expectedEnergy( long int ixtal ); //not been used now
171
172 //Correction funtion 56(0:55) parameter
173 double m_corFun[56];
174
175 //Esigma 56(0:55) as function of Itheta
176 double m_eSigma[56];
177
178 // energy deposition function 56(0:55) for shower selection of Bhabha calibration
179 double m_eDepEne[56];
180
181 double m_eRawMean[6240];
182 double m_eRawRMS[6240];
183
184 double m_eRawPeak[6240];
185 double m_eMcPeak[6240];
186
187 double m_eMeanData[6240];
188 double m_eMeanMC[6240];
189 double m_eRmsData[6240];
190 double m_eRmsMC[6240];
191
192 double m_eDepMean[6240];
193 double m_eDepPeak[6240];
194 double m_eDepSigma[6240];
195 //energy resolution
196 double m_eSigmaExp[56];
197 //cut off digis further away from the maxima digi
198 // of a shower in theta and phi
199
200 int m_digiRangeCut; //be not used now for MCdata
201
202 //low energy shower cut
203 double m_ShEneThreshCut;
204
205 // high energy shower cut
206 double m_ShEneLeptonCut;
207
208 // cut on minimum number of crystals of a shower in the event
209 int m_minNrXtalsShowerCut; //be not used now for MCdata
210
211 // cut on maximum number of crystals of a shower in the event
212 int m_maxNrXtalsShowerCut; //be not used now for MCdata
213
214 // cut on minimum difference of the two showers in phi
215 double m_phiDiffMinCut; //be not used now for MCdata
216
217 // cut on maximum difference of the two showers in phi
218 double m_phiDiffMaxCut; //be not used now for MCdata
219
220 // cut on number of showers above low energy threshold less this
221 int m_nrShThreshCut; //be not used now for MCdata
222
223 // cut on ratio measured to expected energy of the event
224 //double m_eNormCut; //be not used now for MCdata
225
226 // cut on minimum difference of the two showers in theta
227 double m_thetaDiffCut; //be not used now for MCdata
228
229 double m_LATCut; //be not used now for MCdata
230
231 // no shower closer than this angle
232 //double m_minAngCut; //be not used now for MCdata
233
234 //number of events passed
235 long int m_events;
236
237 //number of events selected
238 long int m_taken;
239
240 //number of events with OneProng
241
242 long int m_OneProng;
243 //number of events with TwoProngMatched
244 long int m_TwoProngMatched;
245 //number of events with TwoProngOneMatched
246 long int m_TwoProngOneMatched;
247
248 //number of events rejected
249 long int m_rejected;
250
251 //number of showers accepted
252 long m_showersAccepted;
253
254 // int m_oneProngsSelelected; //be not used now for MCdata
255 //int m_twoProngsSelected; //be not used now for MCdata
256
257
258 list<EmcShower> m_showerList;
259
260 //-------------
261 // fill Matrix of system of linear equations
262 void fillMatrix();
263
264 //write the matrix and vector also to file ?
265 bool m_writeMVToFile;
266 //file name extensions
267 std::string m_fileExt;
268
269 //file directory
270 std::string m_fileDir;
271
272 //input file directory
273 std::string m_inputFileDir;
274
275 //Selection method with "Ithe" and "Ixtal"
276 std::string m_selMethod;
277
278 //calibration data: matrix M, vector R and other stuff
279 EmcBhaCalibData* myCalibData;
280 //the Bhabha event that is filled with the two showers
281 EmcBhabhaEvent* myBhaEvt;
282
283 int m_nXtals;
284
285 //SigmaCut : selecting Bhabha events for digi-calibration
286 double m_sigmaCut;
287 //beam energy GeV
288 double m_beamEnergy;
289 double m_dbeam;
290
291 bool m_ReadBeamEFromDB;
292 bool m_useBeamDetectorEnergy;
293
294 bool m_elecSaturation;
295 IBeamEnergySvc *m_BeamEnergySvc;
296 // ReadBeamInfFromDb m_readDb;
297 int m_irun;
298
299 //message output in the tool classes
300 int m_MsgFlag;
301 int m_Num; //for MC file
302 int m_fileNum; //for datafile
303 // matrix to convert theta,phi <-> index
304 int **m_index;
305 int m_measure[6240];
306 bool m_passed;
307 double m_inputConst[6240];
308 int m_event;
309 int m_run;
310 IEmcRecGeoSvc* m_iGeoSvc;
311
312 //IEmcCalibConstSvc* m_emcCalibConstSvc;
313
314};
315
316
317#endif // EMCSELBHAEVENT_H
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
Double_t phi2
Double_t phi1
#define private
int selectedTrkID2() const
double findPhiDiff(double phi1, double phi2)
int selectedTrkID1() const
StatusCode SelectBhabha()
StatusCode execute()
void setPassed(bool passed)
int selectedType() const
int index(int theta, int phi) const
double Angle2ClosestShower(int ShowerID)
StatusCode initialize()
StatusCode SelectFillBhabha()
StatusCode finalize()