/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/DQA/DQADtagAlg/DQADtagAlg-00-00-13/DQADtagAlg/util/DQAPi0Info.h

Go to the documentation of this file.
00001 #ifndef CLASS_DQAPi0INFO_H
00002 #define CLASS_DQAPI0INFO_H
00003 
00004 //#include "GaudiKernel/ObjectVector.h"
00005 //#include "GaudiKernel/AlgFactory.h"
00006 //#include "GaudiKernel/Algorithm.h"
00007 //#include "GaudiKernel/NTuple.h"
00008 //#include "GaudiKernel/IDataProviderSvc.h"
00009 
00010 #include "EvtRecEvent/EvtRecTrack.h"
00011 //#include "EvtRecEvent/EvtRecDTag.h"
00012 
00013 #include "CLHEP/Vector/LorentzVector.h"
00014 
00015 #include <iostream>
00016 
00017 using namespace std;
00018 class DQAPi0Info{
00019 public: 
00020 DQAPi0Info();
00021 ~DQAPi0Info();
00022 
00023 void setchild(int n, EvtRecTrack* shower)
00024 {
00025   if (n==0)
00026   m_shower0 = shower;
00027   else if (n==1)
00028   m_shower1 = shower;
00029 }
00030 void setchilds(EvtRecTrack* shower0, EvtRecTrack* shower1)
00031 {
00032   m_shower0 = shower0;
00033   m_shower1 = shower1;
00034 }
00035 EvtRecTrack* getchild(int n)
00036 {
00037   if (n==0)
00038         return m_shower0;
00039   else if (n==1)
00040         return m_shower1;
00041 }
00042 double m()
00043 {
00044   return m_mpi0;
00045 }
00046 HepLorentzVector p4()
00047 {
00048   return m_p4;
00049 }
00050 void setEnergyThreshold(double energyThreshold_b, double energyThreshold_e)
00051 {
00052   m_energyThreshold_b = energyThreshold_b;
00053   m_energyThreshold_e = energyThreshold_e;
00054 }
00055 void setCosTheta(double costheta_b, double costheta_e1, double costheta_e2)
00056 {
00057         m_costheta_b = costheta_b;
00058         m_costheta_e1 = costheta_e1;
00059         m_costheta_e2 = costheta_e2;
00060 }
00061 bool calculate()
00062 {
00063   if (m_shower0 == 0 || m_shower1 == 0 ) return false;
00064   RecEmcShower* photon1= m_shower0->emcShower();
00065   RecEmcShower* photon2= m_shower1->emcShower();
00066   double eraw1 = photon1->energy();
00067   double phiemc1 = photon1->phi(); 
00068   double theta1 = photon1->theta();
00069   double eraw2 = photon2->energy();
00070   double phiemc2 = photon2->phi(); 
00071   double theta2 = photon2->theta();
00072   double costheta1 = fabs(cos(theta1));
00073   double costheta2 = fabs(cos(theta2));
00074   if (!((costheta1 < m_costheta_b && eraw1 > m_energyThreshold_b ) || 
00075   (costheta1 > m_costheta_e1 && costheta1 < m_costheta_e2 && eraw1 > m_energyThreshold_e )))
00076   return false;
00077   if (!((costheta2 < m_costheta_b && eraw2 > m_energyThreshold_b ) ||
00078   (costheta2 > m_costheta_e1 && costheta2 < m_costheta_e2 && eraw2 > m_energyThreshold_e )))
00079   return false;
00080 
00081   HepLorentzVector pemc1;
00082   pemc1.setPx(eraw1*sin(theta1)*cos(phiemc1));
00083   pemc1.setPy(eraw1*sin(theta1)*sin(phiemc1));
00084   pemc1.setPz(eraw1*cos(theta1));
00085   pemc1.setE(eraw1);
00086 
00087   HepLorentzVector pemc2;
00088   pemc2.setPx(eraw2*sin(theta2)*cos(phiemc2));
00089   pemc2.setPy(eraw2*sin(theta2)*sin(phiemc2));
00090   pemc2.setPz(eraw2*cos(theta2));
00091   pemc2.setE(eraw2);
00092 
00093   HepLorentzVector ppi0=pemc1+pemc2;
00094   m_p4 = ppi0;
00095   m_mpi0 = ppi0.m();
00096   return true;
00097 }
00098 private:
00099 EvtRecTrack*    m_shower0;
00100 EvtRecTrack*    m_shower1;
00101 HepLorentzVector m_p4;
00102 double m_mpi0;
00103 double m_energyThreshold_b;
00104 double m_energyThreshold_e;
00105 double m_costheta_b;
00106 double m_costheta_e1;
00107 double m_costheta_e2;
00108 };
00109 #endif

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