BOSS 8.0.0
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
18#include "EmcBhabhaEvent.h"
19#include "CLHEP/Vector/LorentzVector.h"
20#include "CLHEP/Vector/ThreeVector.h"
21#include "CLHEP/Vector/TwoVector.h"
22using CLHEP::Hep2Vector;
23using CLHEP::Hep3Vector;
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 m_positron = new EmcBhabha();
49 assert( 0 != m_positron );
50 m_electron = new EmcBhabha();
51 assert( 0 != m_electron );
52 /*
53 if (m_bhaEvList.empty()) {
54
55 m_bhaEvList.push_back(*m_positron);
56 m_bhaEvList.push_back(*m_electron);
57
58 }
59 else {
60 if (m_bhaEvList.size() != 2) {
61 cout<<"error " << "ERROR EmcBhabhaEvent: Length of event list != 2 !"
62 << endl
63 << " EmcBhabhaEvent: Length = "
64 << m_bhaEvList.size()
65 << endl;
66 }
67 }
68 */
69 initData();
70}
71
72//--------------
73// Destructor --
74//--------------
76
77 delete m_positron;
78 delete m_electron;
79}
80
81// Modifiers
82void EmcBhabhaEvent::initData() { m_initialized = true; }
83
85
86// Accessor
88
89 if ( positron()->found() )
90 {
91 cout << "Positron: " << endl;
92 positron()->print();
93 }
94 else
95 {
96 cout << "routine "
97 << "No positron found ! " << endl;
98 }
99
100 if ( electron()->found() )
101 {
102 cout << "Electron: " << endl;
103 electron()->print();
104 }
105 else
106 {
107 cout << "routine "
108 << "No electron found ! " << endl;
109 }
110}
111
112/*
113double
114EmcBhabhaEvent::getDepExpShowerEnergy(unsigned int thetaIndex,
115 unsigned int phiIndex,
116 double ePeakEne) const {
117
118 if ( ! m_initialized )
119 {
120 cout<<"error "<< " EmcBhabhaEvent not initialized ! " << endl
121 << " Is EmcLoadBhabhaData included in the path ? "
122 << endl;
123 return 0;
124 }
125
126 //the deposited energy
127 double depoEne = 0.;
128
129 EmcStructure* theEmcStruc=new EmcStructure();
130
131
132 if (theEmcStruc->isOutofAccep(thetaIndex, phiIndex ))
133 {
134 cout<<"warning "<< "EmcBhabhaEvent: Theta " << thetaIndex
135 << " or phi " << phiIndex
136 << " out of the calorimeter acceptance !"
137 << "Return 0 !"
138 << endl;
139 delete theEmcStruc;
140 return 0;
141
142 }
143 else
144 {
145 depoEne =ePeakEne;
146
147
148 delete theEmcStruc;
149 return depoEne;
150
151 }
152
153}
154
155*/
156
157double EmcBhabhaEvent::getDepoMCShowerEnergy( unsigned int thetaIndex, unsigned int phiIndex,
158 double ePeak, double beamEnergy ) const {
159
160 if ( !m_initialized )
161 {
162 cout << "error "
163 << " EmcBhabhaEvent not initialized ! " << endl
164 << " Is EmcLoadBhabhaData included in the path ? " << endl;
165 return 0;
166 }
167
168 // the deposited energy
169 double depoEne = 0.;
170
171 EmcStructure* theEmcStruc = new EmcStructure();
172
173 if ( theEmcStruc->isOutofAccep( thetaIndex, phiIndex ) )
174 {
175 cout << "warning "
176 << "EmcBhabhaEvent: Theta " << thetaIndex << " or phi " << phiIndex
177 << " out of the calorimeter acceptance !"
178 << "Return 0 !" << endl;
179 delete theEmcStruc;
180 return 0;
181 }
182 else
183 {
184 depoEne = ePeak * beamEnergy;
185
186 delete theEmcStruc;
187 return depoEne;
188 }
189}
190
191double EmcBhabhaEvent::getDepoMCShowerEnergy_lab( double theta, double phi,
192 unsigned int thetaIndex,
193 unsigned int phiIndex, double ePeak,
194 double beamEnergy ) const {
195
196 if ( !m_initialized )
197 {
198 cout << "error "
199 << " EmcBhabhaEvent not initialized ! " << endl
200 << " Is EmcLoadBhabhaData included in the path ? " << endl;
201 return 0;
202 }
203
204 // the deposited energy
205 double depoEne = 0.;
206
207 EmcStructure* theEmcStruc = new EmcStructure();
208
209 if ( theEmcStruc->isOutofAccep( thetaIndex, phiIndex ) )
210 {
211 cout << "warning "
212 << "EmcBhabhaEvent: Theta " << thetaIndex << " or phi " << phiIndex
213 << " out of the calorimeter acceptance !"
214 << "Return 0 !" << endl;
215 delete theEmcStruc;
216 return 0;
217 }
218 else
219 {
220
221 HepLorentzVector ptrk;
222 ptrk.setPx( beamEnergy * sin( theta ) * cos( phi ) );
223 ptrk.setPy( beamEnergy * sin( theta ) * sin( phi ) );
224 ptrk.setPz( beamEnergy * cos( theta ) );
225 ptrk.setE( beamEnergy );
226
227 ptrk = ptrk.boost( 0.011, 0, 0 ); // boost from cms to lab
228 // double the_lab = ptrk.theta();
229 // double phi_lab = ptrk.phi();
230 double depoEne_lab = ePeak * ptrk.e();
231 delete theEmcStruc;
232 return depoEne_lab;
233 }
234}
235
236double EmcBhabhaEvent::getErrorDepoMCShowerEnergy( unsigned int thetaIndex,
237 unsigned int phiIndex,
238 double eSigma ) const {
239
240 if ( !m_initialized )
241 {
242 cout << "error "
243 << " EmcBhabhaEvent not initialized ! " << endl
244 << " Is EmcLoadBhabhaData included in the path ? " << endl;
245 return 0;
246 }
247
248 double sig = 0.;
249 EmcStructure* theEmcStruc = new EmcStructure();
250
251 if ( theEmcStruc->isOutofAccep( thetaIndex, phiIndex ) )
252 {
253 cout << "warning "
254 << "EmcBhabhaEvent: Theta " << thetaIndex << " or phi " << phiIndex
255 << " out of the calorimeter acceptance !"
256 << "Return 0 !" << endl;
257
258 delete theEmcStruc;
259 return 0;
260 }
261 else
262 {
263 sig = eSigma;
264 delete theEmcStruc;
265 return sig;
266 }
267}
268
269double EmcBhabhaEvent::enLeakageTheta( double theta ) { return 1.0; }
270
271double EmcBhabhaEvent::enLeakageThetaErr( double theta ) { return 0.0; }
272
274 Hep3Vector theShowerVector( 1, 1, 1 );
275 theShowerVector.setTheta( theShower.theta() );
276 theShowerVector.setPhi( theShower.phi() );
277 theShowerVector.setMag( theShower.energy() );
278
279 return theShowerVector;
280}
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:87
const double & theta() const
Definition EmcShower.h:37
const double & energy() const
Definition EmcShower.h:36
const double & phi() const
Definition EmcShower.h:38
bool isOutofAccep(unsigned int thetaIndex, unsigned int phiIndex) const