/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/TofRec/TofRec-00-04-46/src/TofCount.cxx

Go to the documentation of this file.
00001 #include "TofRec/TofTrack.h"
00002 #include "TofRec/TofCount.h"
00003 #include <iostream>
00004 #include <iomanip>
00005 
00006 TofCount::TofCount() {
00007   extTrkNum = 0;
00008   barrelTrk = 0;
00009   endcapTrk = 0;
00010   inner1  = 0;
00011   outer1  = 0;
00012   double1 = 0;
00013   east1   = 0;
00014   west1   = 0;
00015   nohit1  = 0;
00016   unchanged1 = 0;
00017   changed1   = 0;
00018   inner2  = 0;
00019   outer2  = 0;
00020   double2 = 0;
00021   east2   = 0;
00022   west2   = 0;
00023   nohit2  = 0;
00024   unchanged2 = 0;
00025   changed2   = 0;
00026   inner3  = 0;
00027   outer3  = 0;
00028   double3 = 0;
00029   east3   = 0;
00030   west3   = 0;
00031   nohit3  = 0;
00032   unchanged3 = 0;
00033   changed3   = 0;
00034   inner4  = 0;
00035   outer4  = 0;
00036   double4 = 0;
00037   east4   = 0;
00038   west4   = 0;
00039   nohit4  = 0;
00040   unchanged4 = 0;
00041   changed4   = 0;
00042 
00043   for( unsigned int i=0; i<nParBhabha; i++ ) {
00044     nbb[i] = 0;
00045   }
00046 
00047   return;
00048 }
00049 
00050 
00051 void TofCount::init() {
00052   extTrkNum = 0;
00053   barrelTrk = 0;
00054   endcapTrk = 0;
00055   inner1  = 0;
00056   outer1  = 0;
00057   double1 = 0;
00058   east1   = 0;
00059   west1   = 0;
00060   nohit1  = 0;
00061   unchanged1 = 0;
00062   changed1   = 0;
00063   inner2  = 0;
00064   outer2  = 0;
00065   double2 = 0;
00066   east2   = 0;
00067   west2   = 0;
00068   nohit2  = 0;
00069   unchanged2 = 0;
00070   changed2   = 0;
00071   inner3  = 0;
00072   outer3  = 0;
00073   double3 = 0;
00074   east3   = 0;
00075   west3   = 0;
00076   nohit3  = 0;
00077   unchanged3 = 0;
00078   changed3   = 0;
00079   inner4  = 0;
00080   outer4  = 0;
00081   double4 = 0;
00082   east4   = 0;
00083   west4   = 0;
00084   nohit4  = 0;
00085   unchanged4 = 0;
00086   changed4   = 0;
00087 
00088   return;
00089 }
00090 
00091 
00092 void TofCount::setExtTrackNum( unsigned int ntrk ) {
00093   extTrkNum = extTrkNum + ntrk;
00094   return;
00095 }
00096 
00097 
00098 void TofCount::setTrack1( TofTrack*& tof ) {
00099   if( tof->hitCase() == InnerLayer )       inner1++;
00100   else if( tof->hitCase() == OuterLayer )  outer1++;
00101   else if( tof->hitCase() == DoubleLayer ) double1++;
00102   else if( tof->hitCase() == EastEndcap )  east1++;
00103   else if( tof->hitCase() == WestEndcap )  west1++;
00104   else if( tof->hitCase() == EastEndcapMRPC )  east1++;
00105   else if( tof->hitCase() == WestEndcapMRPC )  west1++;
00106   else                                     nohit1++;
00107   return;
00108 }
00109 
00110 
00111 void TofCount::setTrack1Col( std::vector<TofTrack*>*& tofTrackVec ) {
00112   TofTrackVec::iterator iter_tof = tofTrackVec->begin();
00113   for( ; iter_tof!=tofTrackVec->end(); iter_tof++ ) {
00114     setTrack1( *iter_tof );
00115   }
00116   return;
00117 }
00118 
00119 
00120 void TofCount::setTrack2( TofTrack*& tof ) {
00121   if( tof->hitCase() == InnerLayer )       inner2++;
00122   else if( tof->hitCase() == OuterLayer )  outer2++;
00123   else if( tof->hitCase() == DoubleLayer ) double2++;
00124   else if( tof->hitCase() == EastEndcap )  east2++;
00125   else if( tof->hitCase() == WestEndcap )  west2++;
00126   else if( tof->hitCase() == EastEndcapMRPC )  east2++;
00127   else if( tof->hitCase() == WestEndcapMRPC )  west2++;
00128   else                                     nohit2++;
00129   //  if( tof->changed() ) changed2++;
00130   //  else                 unchanged2++;
00131   return;
00132 }
00133 
00134 
00135 void TofCount::setTrack3( TofTrack*& tof ) {
00136   if( tof->hitCase() == InnerLayer )       inner3++;
00137   else if( tof->hitCase() == OuterLayer )  outer3++;
00138   else if( tof->hitCase() == DoubleLayer ) double3++;
00139   else if( tof->hitCase() == EastEndcap )  east3++;
00140   else if( tof->hitCase() == WestEndcap )  west3++;
00141   else if( tof->hitCase() == EastEndcapMRPC )  east3++;
00142   else if( tof->hitCase() == WestEndcapMRPC )  west3++;
00143   else                                     nohit3++;
00144   //  if( tof->changed() ) changed3++;
00145   //  else                 unchanged3++;
00146   return;
00147 }
00148 
00149 
00150 void TofCount::setTrack4( TofTrack*& tof ) {
00151   if( tof->hitCase() == InnerLayer )       inner4++;
00152   else if( tof->hitCase() == OuterLayer )  outer4++;
00153   else if( tof->hitCase() == DoubleLayer ) double4++;
00154   else if( tof->hitCase() == EastEndcap )  east4++;
00155   else if( tof->hitCase() == WestEndcap )  west4++;
00156   else if( tof->hitCase() == EastEndcapMRPC )  east4++;
00157   else if( tof->hitCase() == WestEndcapMRPC )  west4++;
00158   else                                     nohit4++;
00159   //  if( tof->changed() ) changed4++;
00160   //  else                 unchanged4++;
00161   return;
00162 }
00163 
00164 /*
00165 void TofCount::final() {
00166    std::cout<<"############################# TofRec Summary #####################################" << std::endl;
00167    std::cout<<" ===> The Extend tracks in total:  " << extTrkNum <<std::endl;
00168    std::cout<<"     ===> The valid Extend tracks in total:  "<< (inner4+outer4+double4+east4+west4) <<std::endl;
00169    std::cout<<"          ===> The TofRec barrel tracks in total:  " << (inner4+outer4+double4) <<std::endl;
00170    std::cout<<"              ===> The Inner Layer hit only in total:   " << inner1 << "   " << inner2 << "   " << inner3 << "   " << inner4 << std::endl;
00171    std::cout<<"              ===> The Outer Layer hit only in total:   " << outer1 << "   " << outer2 << "   " << outer3 << "   " << outer4 << std::endl;
00172    std::cout<<"              ===> The Double Layer hit in total:       " << double1 << "   " << double2 << "   " << double3 << "   " << double4 << std::endl;
00173    std::cout<<"          ===> The TofRec endcap tracks in total:  " << (east4+west4) <<std::endl;
00174    std::cout<<"              ===> The TofRec East endcap tracks in total: " << east1 << "   " << east2 << "   " << east3 << "   " << east4 << std::endl;
00175    std::cout<<"              ===> The TofRec West endcap tracks in total: " << west1 << "   " << west2 << "   " << west3 << "   " << west4 << std::endl;
00176    std::cout<<"     ===> The invalid Extend tracks in total:  "<< nohit1 << "   " << nohit2 << "   " << nohit3 << "   " << nohit4 <<std::endl;
00177    std::cout<<"#############################  End Summary #######################################" <<std::endl;
00178 
00179 }
00180 */
00181 
00182 void TofCount::final() {
00183    std::cout<<"############################# TofRec Summary #####################################" << std::endl;
00184    std::cout<<" ===> Number of Extrapolated tracks:  " << extTrkNum <<std::endl;
00185    std::cout<<"   ===> Number of valid Extraploated tracks:  " << (inner1+outer1+double1+east1+west1) << "  Barrel: " << (inner1+outer1+double1) << "  Endcap: " << (east1+west1) << std::endl;
00186    std::cout<<"     ===> TofRec: number of barrel tracks:  " << (inner3+outer3+double3) << "  Efficiency:  " << setprecision(4) << (inner3+outer3+double3)*100.0/((inner1+outer1+double1)*1.0) << "%" << std::endl;
00187    std::cout<<"       ===> Inner Layer hit only in total:   " << inner1 << " \t" << inner2 << " \t" << inner3 << " \t" << inner4 << std::endl;
00188    std::cout<<"       ===> Outer Layer hit only in total:   " << outer1 << "\t" << outer2 << " \t" << outer3 << " \t" << outer4 << std::endl;
00189    std::cout<<"       ===> Double Layer hit in total:       " << double1 << " \t" << double2 << " \t" << double3 << " \t" << double4 << std::endl;
00190    std::cout<<"     ===> TofRec: number of endcap tracks:  " << (east3+west3) << "  Efficiency:  " << setprecision(4) << (east3+west3)*100.0/((east1+west1)*1.0) << "%" << std::endl;
00191    std::cout<<"       ===> East endcap tracks in total: " << east1 << " \t" << east2 << " \t" << east3 << " \t" << east4 << std::endl;
00192    std::cout<<"       ===> West endcap tracks in total: " << west1 << " \t" << west2 << " \t" << west3 << " \t" << west4 << std::endl;
00193    std::cout<<"     ===> The invalid Extend tracks in total:  "<< nohit1 << " \t" << nohit2 << " \t" << nohit3 << " \t" << nohit4 <<std::endl;
00194    std::cout<<"#############################  End Summary #######################################" <<std::endl;
00195 
00196 }
00197 
00198 
00199 void TofCount::initBhabha() {
00200  for( unsigned int i=0; i<nParBhabha; i++ ) {
00201    nbb[i] = 0;
00202  }
00203  return;
00204 }
00205 
00206 
00207 void TofCount::addNumber(unsigned int i) {
00208   if( i<nParBhabha ) {
00209     nbb[i]++;
00210   }
00211   return;
00212 }
00213 
00214 
00215 void TofCount::finalBhabha( std::string calibData ) {
00216   std::cout<<"$$$$$$$ Summary of Bhabha Selection Criteria $$$$$$$$$$$$$$$$$$$$$"<<std::endl;
00217   std::cout <<"0 Total umber of events:  "<<nbb[0]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[0])*100.0/double(nbb[0])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[0])*100.0/double(nbb[0])<<"%"<<std::endl;
00218   std::cout <<"1 Event Start Time:       "<<nbb[1]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[1])*100.0/double(nbb[0])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[1])*100.0/double(nbb[0])<<"%"<<std::endl;
00219   std::cout <<"2 N_ext_track = 2:        "<<nbb[2]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[2])*100.0/double(nbb[1])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[2])*100.0/double(nbb[0])<<"%"<<std::endl;
00220   std::cout <<"3 N_mdc_track = 2:        "<<nbb[3]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[3])*100.0/double(nbb[2])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[3])*100.0/double(nbb[0])<<"%"<<std::endl;
00221   std::cout <<"4 EMC reconstructed:      "<<nbb[4]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[4])*100.0/double(nbb[3])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[4])*100.0/double(nbb[0])<<"%"<<std::endl;
00222   std::cout <<"5 N_shower >= 2:          "<<nbb[5]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[5])*100.0/double(nbb[4])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[5])*100.0/double(nbb[0])<<"%"<<std::endl;
00223   std::cout <<"6 Total charge = 0:       "<<nbb[6]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[6])*100.0/double(nbb[5])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[6])*100.0/double(nbb[0])<<"%"<<std::endl;
00224   std::cout <<"7 Back to back:           "<<nbb[7]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[7])*100.0/double(nbb[6])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[7])*100.0/double(nbb[0])<<"%"<<std::endl;
00225   std::cout <<"8 Kalman Filter:          "<<nbb[8]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[8])*100.0/double(nbb[7])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[8])*100.0/double(nbb[0])<<"%"<<std::endl;
00226   std::cout <<"9 Distance of ext-shower: "<<nbb[9]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[9])*100.0/double(nbb[8])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[9])*100.0/double(nbb[0])<<"%"<<std::endl;
00227   std::cout <<"10 Vertex cut of 1st trk: "<<nbb[10]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[10])*100.0/double(nbb[9])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[10])*100.0/double(nbb[0])<<"%"<<std::endl;
00228   std::cout <<"11 Vertex cut of 2nd trk: "<<nbb[11]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[11])*100.0/double(nbb[10])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[11])*100.0/double(nbb[0])<<"%"<<std::endl;
00229   std::cout <<"12 Delta phi:             "<<nbb[12]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[12])*100.0/double(nbb[11])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[12])*100.0/double(nbb[0])<<"%"<<std::endl;
00230   std::cout <<"13 Energy of Shower:      "<<nbb[13]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[13])*100.0/double(nbb[12])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[13])*100.0/double(nbb[0])<<"%"<<std::endl;
00231   if( calibData=="Bhabha" ) {
00232     std::cout <<"14 Energy of others:      "<<nbb[14]<<"\t"<<"Ratio1: "<<setprecision(4)<<double(nbb[14])*100.0/double(nbb[13])<<"%"<<"\t"<<"Ratio2: "<<setprecision(4)<<double(nbb[14])*100.0/double(nbb[0])<<"%"<<std::endl;
00233   }
00234   else if( calibData=="Dimu") {
00235   }
00236   std::cout<<"$$$$$$$ End of Summary $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<std::endl;
00237   return;
00238 }

Generated on Tue Nov 29 23:14:10 2016 for BOSS_7.0.2 by  doxygen 1.4.7