/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Emc/EmcCalib/EmcBhaCalib/EmcBhaCalib-00-00-34/src/EmcBhabhaEvent.cxx

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //
00004 // Description:
00005 //      Class EmcBhabhaEvent
00006 //           
00007 // Environment:
00008 //      Software developed for the BESIII Detector at the BEPCII.
00009 //
00010 // Author List:
00011 //      ChunXiu Liu          IHEP
00012 //
00013 //------------------------------------------------------------------------
00014 //-----------------------
00015 // This Class's Header --
00016 //-----------------------
00017 
00018 #include "EmcBhaCalib/EmcBhabhaEvent.h"
00019 #include "CLHEP/Vector/ThreeVector.h"
00020 #include "CLHEP/Vector/LorentzVector.h"
00021 #include "CLHEP/Vector/TwoVector.h"
00022 using CLHEP::Hep3Vector;
00023 using CLHEP::Hep2Vector;
00024 using CLHEP::HepLorentzVector;
00025 //---------------
00026 // C Headers --
00027 //---------------
00028 #include <cassert>
00029 //---------------
00030 // C++ Headers --
00031 //---------------
00032 #include <fstream>
00033 //-------------------------------
00034 // Collaborating Class Headers --
00035 //-------------------------------
00036 
00037 //static elements
00038 bool EmcBhabhaEvent::m_initialized = true;
00039 int EmcBhabhaEvent::m_selectedMDCType = -1;
00040 int EmcBhabhaEvent::m_selectedEmcType = -1;
00041 //double EmcBhabhaEvent::m_eBeamEnergy = 1.548;
00042 //double EmcBhabhaEvent::m_pBeamEnergy = 1.548;
00043 
00044 //----------------
00045 // Constructors --
00046 //----------------
00047 EmcBhabhaEvent::EmcBhabhaEvent()
00048 {   
00049   m_positron = new EmcBhabha();    
00050   assert( 0 !=  m_positron );
00051   m_electron = new EmcBhabha();
00052   assert( 0 != m_electron );
00053   /*
00054    if (m_bhaEvList.empty()) {
00055  
00056     m_bhaEvList.push_back(*m_positron);
00057     m_bhaEvList.push_back(*m_electron);
00058   
00059   }
00060   else {
00061     if (m_bhaEvList.size() != 2) {
00062       cout<<"error " << "ERROR EmcBhabhaEvent: Length of event list != 2 !" 
00063                     << endl
00064                     << "      EmcBhabhaEvent: Length = " 
00065                     << m_bhaEvList.size() 
00066                     << endl;
00067     }
00068   }
00069   */
00070   initData();
00071 }
00072 
00073 //--------------
00074 // Destructor --
00075 //--------------
00076 EmcBhabhaEvent::~EmcBhabhaEvent() {
00077 
00078   delete m_positron;
00079   delete m_electron;
00080 
00081 }
00082 
00083 //Modifiers
00084 void
00085 EmcBhabhaEvent::initData() 
00086 {
00087   m_initialized = true;  
00088 }
00089 
00090 void
00091 EmcBhabhaEvent::deleteData() 
00092 {
00093 }  
00094 
00095 //Accessor
00096 void
00097 EmcBhabhaEvent::print() {
00098 
00099   if ( positron()->found() ) 
00100     {
00101       cout << "Positron: " << endl;
00102       positron()->print( );
00103     }
00104   else 
00105     {
00106       cout<<"routine "<< "No positron found ! " << endl;
00107     }
00108 
00109   if ( electron()->found() ) 
00110     {
00111       cout << "Electron: " << endl;
00112       electron()->print( );
00113     }
00114   else 
00115     {
00116       cout<<"routine "<< "No electron found ! " << endl;
00117     }
00118 }
00119 
00120 
00121 /*
00122 double 
00123 EmcBhabhaEvent::getDepExpShowerEnergy(unsigned int thetaIndex,
00124                                       unsigned int phiIndex,
00125                                       double ePeakEne) const {
00126 
00127   if ( ! m_initialized ) 
00128     {
00129       cout<<"error "<< " EmcBhabhaEvent not initialized ! " << endl
00130           << " Is EmcLoadBhabhaData included in the path ? "
00131           << endl;
00132       return 0;
00133     }
00134   
00135   //the deposited energy
00136   double depoEne  = 0.;
00137 
00138   EmcStructure* theEmcStruc=new EmcStructure();
00139 
00140 
00141   if (theEmcStruc->isOutofAccep(thetaIndex, phiIndex ))
00142     {   
00143       cout<<"warning "<< "EmcBhabhaEvent: Theta " << thetaIndex
00144           << " or phi " << phiIndex
00145           << " out of the calorimeter acceptance !"
00146           << "Return 0 !"
00147           << endl; 
00148       delete theEmcStruc;
00149       return 0;
00150 
00151     }   
00152   else 
00153     {
00154        depoEne  =ePeakEne;
00155       
00156 
00157       delete theEmcStruc;
00158       return depoEne;
00159 
00160     }
00161   
00162 }
00163 
00164 */
00165 
00166 double 
00167 EmcBhabhaEvent::getDepoMCShowerEnergy(unsigned int thetaIndex,
00168                                       unsigned int phiIndex,
00169                                       double ePeak,
00170                                       double beamEnergy) const {
00171 
00172   if ( ! m_initialized ) 
00173     {
00174       cout<<"error "<< " EmcBhabhaEvent not initialized ! " << endl
00175           << " Is EmcLoadBhabhaData included in the path ? "
00176           << endl;
00177       return 0;
00178     }
00179   
00180   //the deposited energy
00181   double depoEne  = 0.;
00182 
00183   EmcStructure* theEmcStruc=new EmcStructure();
00184 
00185 
00186   if (theEmcStruc->isOutofAccep(thetaIndex, phiIndex ))
00187     {   
00188       cout<<"warning "<< "EmcBhabhaEvent: Theta " << thetaIndex
00189           << " or phi " << phiIndex
00190           << " out of the calorimeter acceptance !"
00191           << "Return 0 !"
00192           << endl; 
00193       delete theEmcStruc;
00194       return 0;
00195 
00196     }   
00197   else 
00198     {
00199       depoEne  =ePeak*beamEnergy;
00200       
00201   
00202       delete theEmcStruc;
00203       return depoEne;
00204 
00205     }
00206   
00207 }
00208 
00209 
00210 double 
00211 EmcBhabhaEvent::getDepoMCShowerEnergy_lab(double theta,
00212                                           double phi,
00213                                           unsigned int thetaIndex,
00214                                           unsigned int phiIndex,
00215                                           double ePeak,
00216                                           double beamEnergy) const {
00217 
00218   if ( ! m_initialized ) 
00219     {
00220       cout<<"error "<< " EmcBhabhaEvent not initialized ! " << endl
00221           << " Is EmcLoadBhabhaData included in the path ? "
00222           << endl;
00223       return 0;
00224     }
00225   
00226   //the deposited energy
00227   double depoEne  = 0.;
00228 
00229   EmcStructure* theEmcStruc=new EmcStructure();
00230 
00231 
00232   if (theEmcStruc->isOutofAccep(thetaIndex, phiIndex ))
00233     {   
00234       cout<<"warning "<< "EmcBhabhaEvent: Theta " << thetaIndex
00235           << " or phi " << phiIndex
00236           << " out of the calorimeter acceptance !"
00237           << "Return 0 !"
00238           << endl; 
00239       delete theEmcStruc;
00240       return 0;
00241 
00242     }   
00243   else 
00244     {
00245        
00246       HepLorentzVector ptrk;
00247       ptrk.setPx(beamEnergy*sin(theta)*cos(phi));
00248       ptrk.setPy(beamEnergy*sin(theta)*sin(phi));
00249       ptrk.setPz(beamEnergy*cos(theta));
00250       ptrk.setE(beamEnergy);
00251       
00252       ptrk=ptrk.boost(0.011,0,0); //boost from cms to lab
00253       //double the_lab = ptrk.theta();
00254       //double phi_lab = ptrk.phi();
00255       double depoEne_lab  =ePeak*ptrk.e();
00256       delete theEmcStruc;
00257       return depoEne_lab;
00258 
00259     }
00260   
00261 }
00262 
00263 double 
00264 EmcBhabhaEvent::getErrorDepoMCShowerEnergy(unsigned int thetaIndex,
00265                                            unsigned int phiIndex,
00266                                            double eSigma) const {
00267 
00268   if ( ! m_initialized ) 
00269     {
00270       cout<<"error "<< " EmcBhabhaEvent not initialized ! " << endl
00271           << " Is EmcLoadBhabhaData included in the path ? "
00272           << endl;
00273       return 0;
00274     } 
00275 
00276   double sig=0.; 
00277   EmcStructure* theEmcStruc=new EmcStructure();
00278 
00279   if (theEmcStruc->isOutofAccep(thetaIndex, phiIndex ))
00280     {   
00281       cout<<"warning "<< "EmcBhabhaEvent: Theta " << thetaIndex
00282           << " or phi " << phiIndex
00283           << " out of the calorimeter acceptance !"
00284           << "Return 0 !"
00285           << endl; 
00286 
00287       delete theEmcStruc;
00288       return 0;
00289 
00290     } 
00291   else 
00292     {
00293       sig=eSigma;
00294       delete theEmcStruc;
00295       return sig; 
00296    
00297     }
00298 
00299 }
00300 
00301 double 
00302 EmcBhabhaEvent::enLeakageTheta(double theta)
00303 {
00304   return  1.0;
00305 }
00306 
00307 double 
00308 EmcBhabhaEvent::enLeakageThetaErr(double theta)
00309 {
00310   return 0.0;
00311 }
00312 
00313 Hep3Vector
00314 EmcBhabhaEvent::showerVector( EmcShower theShower)
00315 {
00316   Hep3Vector theShowerVector(1,1,1);
00317   theShowerVector.setTheta(theShower.theta());
00318   theShowerVector.setPhi(theShower.phi());
00319   theShowerVector.setMag(theShower.energy());
00320   
00321   return theShowerVector;
00322 }

Generated on Tue Nov 29 22:58:15 2016 for BOSS_7.0.2 by  doxygen 1.4.7