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