00001 #ifndef CalibEventSelect_H 00002 #define CalibEventSelect_H 00003 #include <cstring> 00004 00005 #include "GaudiKernel/AlgFactory.h" 00006 #include "GaudiKernel/Algorithm.h" 00007 #include "GaudiKernel/NTuple.h" 00008 #include "EvtRecEvent/EvtRecTrack.h" 00009 00010 00011 #include "AIDA/IAxis.h" 00012 #include "AIDA/IHistogram1D.h" 00013 #include "AIDA/IHistogramFactory.h" 00014 using AIDA::IHistogram1D; 00015 00016 00017 class CalibEventSelect : public Algorithm { 00018 00019 public: 00020 CalibEventSelect(const std::string& name, ISvcLocator* pSvcLocator); 00021 StatusCode initialize(); 00022 StatusCode execute(); 00023 StatusCode finalize(); 00024 00025 bool WhetherSector(double ph,double ph1,double ph2); 00026 void readbeamEfromDb(int runNo, double & beamE); 00027 00028 private: 00029 00030 int m_BarrelOrEndcap; 00031 bool m_output; 00032 bool m_display; 00033 00034 int m_run; 00035 double m_ecm; 00036 static int idmax[43]; 00037 00038 //histograms 00039 00040 IHistogram1D* h_nGood; 00041 IHistogram1D* h_nCharge; 00042 IHistogram1D* h_pmaxobeam; 00043 IHistogram1D* h_eopmax; 00044 IHistogram1D* h_eopsec; 00045 IHistogram1D* h_deltap; 00046 IHistogram1D* h_esumoecm; 00047 IHistogram1D* h_egmax; 00048 IHistogram1D* h_deltaphi; 00049 IHistogram1D* h_Pt; 00050 00051 // Tag this event 00052 00053 bool m_isRadBhabha; 00054 bool m_isGGEE; 00055 bool m_isGG4Pi; 00056 bool m_isRadBhabhaT; 00057 bool m_isRhoPi; 00058 bool m_isKstarK; 00059 bool m_isPPPiPi; 00060 bool m_isRecoJpsi; 00061 bool m_isBhabha; 00062 bool m_isDimu; 00063 bool m_isCosmic; 00064 bool m_isGenProton; 00065 bool m_isPsipRhoPi; 00066 bool m_isPsipKstarK; 00067 bool m_isPsipPPPiPi; 00068 bool m_isPsippCand; 00069 00070 00071 00072 // Whether select event 00073 bool m_printmonitor; 00074 bool m_selectRadBhabha; 00075 bool m_selectGGEE; 00076 bool m_selectGG4Pi; 00077 bool m_selectRadBhabhaT; 00078 bool m_selectRhoPi; 00079 bool m_selectKstarK; 00080 bool m_selectPPPiPi; 00081 bool m_selectRecoJpsi; 00082 bool m_selectBhabha; 00083 bool m_selectDimu; 00084 bool m_selectCosmic; 00085 bool m_selectGenProton; 00086 bool m_selectPsipRhoPi; 00087 bool m_selectPsipKstarK; 00088 bool m_selectPsipPPPiPi; 00089 bool m_selectPsippCand; 00090 00091 00092 bool m_writeDst; 00093 bool m_writeRec; 00094 00095 // Declare r0, z0 cut for charged tracks 00096 double m_vr0cut; 00097 double m_vz0cut; 00098 double m_pt0HighCut; 00099 double m_pt0LowCut; 00100 00101 // Declare energy, dphi, dthe cuts for fake gamma's 00102 double m_energyThreshold; 00103 double m_gammaPhiCut; 00104 double m_gammaThetaCut; 00105 00106 // Select creteria for each event 00107 00108 00110 long int m_events; 00111 int m_radbhabha_scale; 00112 int m_bhabha_scale; 00113 int m_dimu_scale; 00114 int m_cosmic_scale; 00115 int m_proton_scale; 00116 00117 double m_cosmic_lowp; 00118 00121 long int m_radBhabhaNumber; 00122 long int m_GGEENumber; 00123 long int m_GG4PiNumber; 00124 long int m_radBhabhaTNumber; 00125 long int m_rhoPiNumber; 00126 long int m_kstarKNumber; 00127 long int m_ppPiPiNumber; 00128 long int m_recoJpsiNumber; 00129 long int m_bhabhaNumber; 00130 long int m_dimuNumber; 00131 long int m_cosmicNumber; 00132 long int m_genProtonNumber; 00133 long int m_psipRhoPiNumber; 00134 long int m_psipKstarKNumber; 00135 long int m_psipPPPiPiNumber; 00136 long int m_psippCandNumber; 00137 00138 Algorithm* m_subalg1; //write dst 00139 Algorithm* m_subalg2; //write rec 00140 Algorithm* m_subalg3; //write rad bhabha 00141 Algorithm* m_subalg4; //write gg to ee events 00142 Algorithm* m_subalg5; //write gg to 4pi events 00143 Algorithm* m_subalg6; //write rad bhabha with tight selection critera 00144 Algorithm* m_subalg7; //write rhopi events 00145 Algorithm* m_subalg8; //write KK* events 00146 Algorithm* m_subalg9; //write pppipi events 00147 Algorithm* m_subalg10; //write recoil jpsi (4,2 track) events 00148 Algorithm* m_subalg11; //write bhabha events 00149 Algorithm* m_subalg12; //write dimu events 00150 Algorithm* m_subalg13; //write cosmic events 00151 Algorithm* m_subalg14; //write generic proton events 00152 Algorithm* m_subalg15; //write recoil rhopi events 00153 Algorithm* m_subalg16; //write recoil kstark events 00154 Algorithm* m_subalg17; //write recoil pppipi events 00155 Algorithm* m_subalg18; //write psi'' candidates 00156 00157 00158 // define Ntuples here 00159 00160 NTuple::Tuple* m_tuple0; //Trk2Sh2 00161 NTuple::Item<double> m_esum; 00162 NTuple::Item<double> m_eemc; 00163 NTuple::Item<double> m_etot; 00164 NTuple::Item<double> m_nGood; 00165 NTuple::Item<double> m_nCharge; 00166 NTuple::Item<double> m_nGam; 00167 NTuple::Item<double> m_ptot; 00168 NTuple::Item<double> m_pp; 00169 NTuple::Item<double> m_pm; 00170 NTuple::Item<long> m_runnb; 00171 NTuple::Item<long> m_evtnb; 00172 NTuple::Item<double> m_maxE; 00173 NTuple::Item<double> m_secE; 00174 NTuple::Item<double> m_dThe; 00175 NTuple::Item<double> m_dPhi; 00176 NTuple::Item<long> m_mdcHit1; 00177 NTuple::Item<long> m_mdcHit2; 00178 00179 NTuple::Tuple* m_tuple1; // charged track vertex 00180 NTuple::Item<double> m_vx0; 00181 NTuple::Item<double> m_vy0; 00182 NTuple::Item<double> m_vz0; 00183 NTuple::Item<double> m_vr0; 00184 NTuple::Item<double> m_theta0; 00185 NTuple::Item<double> m_p0; 00186 NTuple::Item<double> m_pt0; 00187 00188 NTuple::Tuple* m_tuple2; // photon 00189 NTuple::Item<double> m_dthe; 00190 NTuple::Item<double> m_dphi; 00191 NTuple::Item<double> m_dang; 00192 NTuple::Item<double> m_eraw; 00193 }; 00194 00195 #endif