BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcBhabhaEvent.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3//
4// Description:
5// Class EmcBhabhaEvent
6//
7// Environment:
8// Software developed for the BESIII Detector at the BEPCII.
9//
10// Author List:
11// ChunXiu Liu IHEP
12//
13//------------------------------------------------------------------------
14//-----------------------
15// This Class's Header --
16//-----------------------
17
19#include "CLHEP/Vector/ThreeVector.h"
20#include "CLHEP/Vector/LorentzVector.h"
21#include "CLHEP/Vector/TwoVector.h"
22using CLHEP::Hep3Vector;
23using CLHEP::Hep2Vector;
24using CLHEP::HepLorentzVector;
25//---------------
26// C Headers --
27//---------------
28#include <cassert>
29//---------------
30// C++ Headers --
31//---------------
32#include <fstream>
33//-------------------------------
34// Collaborating Class Headers --
35//-------------------------------
36
37//static elements
38bool EmcBhabhaEvent::m_initialized = true;
39int EmcBhabhaEvent::m_selectedMDCType = -1;
40int EmcBhabhaEvent::m_selectedEmcType = -1;
41//double EmcBhabhaEvent::m_eBeamEnergy = 1.548;
42//double EmcBhabhaEvent::m_pBeamEnergy = 1.548;
43
44//----------------
45// Constructors --
46//----------------
48{
49 m_positron = new EmcBhabha();
50 assert( 0 != m_positron );
51 m_electron = new EmcBhabha();
52 assert( 0 != m_electron );
53 /*
54 if (m_bhaEvList.empty()) {
55
56 m_bhaEvList.push_back(*m_positron);
57 m_bhaEvList.push_back(*m_electron);
58
59 }
60 else {
61 if (m_bhaEvList.size() != 2) {
62 cout<<"error " << "ERROR EmcBhabhaEvent: Length of event list != 2 !"
63 << endl
64 << " EmcBhabhaEvent: Length = "
65 << m_bhaEvList.size()
66 << endl;
67 }
68 }
69 */
70 initData();
71}
72
73//--------------
74// Destructor --
75//--------------
77
78 delete m_positron;
79 delete m_electron;
80
81}
82
83//Modifiers
84void
86{
87 m_initialized = true;
88}
89
90void
92{
93}
94
95//Accessor
96void
98
99 if ( positron()->found() )
100 {
101 cout << "Positron: " << endl;
102 positron()->print( );
103 }
104 else
105 {
106 cout<<"routine "<< "No positron found ! " << endl;
107 }
108
109 if ( electron()->found() )
110 {
111 cout << "Electron: " << endl;
112 electron()->print( );
113 }
114 else
115 {
116 cout<<"routine "<< "No electron found ! " << endl;
117 }
118}
119
120
121/*
122double
123EmcBhabhaEvent::getDepExpShowerEnergy(unsigned int thetaIndex,
124 unsigned int phiIndex,
125 double ePeakEne) const {
126
127 if ( ! m_initialized )
128 {
129 cout<<"error "<< " EmcBhabhaEvent not initialized ! " << endl
130 << " Is EmcLoadBhabhaData included in the path ? "
131 << endl;
132 return 0;
133 }
134
135 //the deposited energy
136 double depoEne = 0.;
137
138 EmcStructure* theEmcStruc=new EmcStructure();
139
140
141 if (theEmcStruc->isOutofAccep(thetaIndex, phiIndex ))
142 {
143 cout<<"warning "<< "EmcBhabhaEvent: Theta " << thetaIndex
144 << " or phi " << phiIndex
145 << " out of the calorimeter acceptance !"
146 << "Return 0 !"
147 << endl;
148 delete theEmcStruc;
149 return 0;
150
151 }
152 else
153 {
154 depoEne =ePeakEne;
155
156
157 delete theEmcStruc;
158 return depoEne;
159
160 }
161
162}
163
164*/
165
166double
168 unsigned int phiIndex,
169 double ePeak,
170 double beamEnergy) const {
171
172 if ( ! m_initialized )
173 {
174 cout<<"error "<< " EmcBhabhaEvent not initialized ! " << endl
175 << " Is EmcLoadBhabhaData included in the path ? "
176 << endl;
177 return 0;
178 }
179
180 //the deposited energy
181 double depoEne = 0.;
182
183 EmcStructure* theEmcStruc=new EmcStructure();
184
185
186 if (theEmcStruc->isOutofAccep(thetaIndex, phiIndex ))
187 {
188 cout<<"warning "<< "EmcBhabhaEvent: Theta " << thetaIndex
189 << " or phi " << phiIndex
190 << " out of the calorimeter acceptance !"
191 << "Return 0 !"
192 << endl;
193 delete theEmcStruc;
194 return 0;
195
196 }
197 else
198 {
199 depoEne =ePeak*beamEnergy;
200
201
202 delete theEmcStruc;
203 return depoEne;
204
205 }
206
207}
208
209
210double
212 double phi,
213 unsigned int thetaIndex,
214 unsigned int phiIndex,
215 double ePeak,
216 double beamEnergy) const {
217
218 if ( ! m_initialized )
219 {
220 cout<<"error "<< " EmcBhabhaEvent not initialized ! " << endl
221 << " Is EmcLoadBhabhaData included in the path ? "
222 << endl;
223 return 0;
224 }
225
226 //the deposited energy
227 double depoEne = 0.;
228
229 EmcStructure* theEmcStruc=new EmcStructure();
230
231
232 if (theEmcStruc->isOutofAccep(thetaIndex, phiIndex ))
233 {
234 cout<<"warning "<< "EmcBhabhaEvent: Theta " << thetaIndex
235 << " or phi " << phiIndex
236 << " out of the calorimeter acceptance !"
237 << "Return 0 !"
238 << endl;
239 delete theEmcStruc;
240 return 0;
241
242 }
243 else
244 {
245
246 HepLorentzVector ptrk;
247 ptrk.setPx(beamEnergy*sin(theta)*cos(phi));
248 ptrk.setPy(beamEnergy*sin(theta)*sin(phi));
249 ptrk.setPz(beamEnergy*cos(theta));
250 ptrk.setE(beamEnergy);
251
252 ptrk=ptrk.boost(0.011,0,0); //boost from cms to lab
253 //double the_lab = ptrk.theta();
254 //double phi_lab = ptrk.phi();
255 double depoEne_lab =ePeak*ptrk.e();
256 delete theEmcStruc;
257 return depoEne_lab;
258
259 }
260
261}
262
263double
265 unsigned int phiIndex,
266 double eSigma) const {
267
268 if ( ! m_initialized )
269 {
270 cout<<"error "<< " EmcBhabhaEvent not initialized ! " << endl
271 << " Is EmcLoadBhabhaData included in the path ? "
272 << endl;
273 return 0;
274 }
275
276 double sig=0.;
277 EmcStructure* theEmcStruc=new EmcStructure();
278
279 if (theEmcStruc->isOutofAccep(thetaIndex, phiIndex ))
280 {
281 cout<<"warning "<< "EmcBhabhaEvent: Theta " << thetaIndex
282 << " or phi " << phiIndex
283 << " out of the calorimeter acceptance !"
284 << "Return 0 !"
285 << endl;
286
287 delete theEmcStruc;
288 return 0;
289
290 }
291 else
292 {
293 sig=eSigma;
294 delete theEmcStruc;
295 return sig;
296
297 }
298
299}
300
301double
303{
304 return 1.0;
305}
306
307double
309{
310 return 0.0;
311}
312
313Hep3Vector
315{
316 Hep3Vector theShowerVector(1,1,1);
317 theShowerVector.setTheta(theShower.theta());
318 theShowerVector.setPhi(theShower.phi());
319 theShowerVector.setMag(theShower.energy());
320
321 return theShowerVector;
322}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
EmcBhabha * positron() const
double getDepoMCShowerEnergy(unsigned int thetaIndex, unsigned int phiIndex, double ePeak, double beamEnergy) const
double getErrorDepoMCShowerEnergy(unsigned int thetaIndex, unsigned int phiIndex, double eSigma) const
double enLeakageTheta(double theta)
EmcBhabha * electron() const
double getDepoMCShowerEnergy_lab(double theta, double phi, unsigned int thetaIndex, unsigned int phiIndex, double ePeak, double beamEnergy) const
Hep3Vector showerVector(EmcShower theShower)
double enLeakageThetaErr(double theta)
void print()
Definition: EmcBhabha.cxx:95
const double & theta() const
Definition: EmcShower.h:39
const double & energy() const
Definition: EmcShower.h:38
const double & phi() const
Definition: EmcShower.h:40
bool isOutofAccep(unsigned int thetaIndex, unsigned int phiIndex) const
float ptrk