00001
00002
00003
00004 #ifndef FROOT_TFndPreanHistos
00005 #define FROOT_TFndPreanHistos
00006
00007 #include <Riostream.h>
00008 #include "TROOT.h"
00009 #include "TSystem.h"
00010 #include "TApplication.h"
00011
00012 #include "TString.h"
00013 #include "TThread.h"
00014
00015 #include "TFile.h"
00016 #include "TTree.h"
00017 #include "TCanvas.h"
00018 #include "TStyle.h"
00019 #include "TH2.h"
00020 #include "TH3F.h"
00021
00022 #include "TFndGraphs.h"
00023 #include "TFndPrean.h"
00024
00025 class TFndPreanHistos: public TFndPrean{
00026
00027 public:
00028 enum E_FndPreanShowNCanv
00029 {
00030 PreanShow_N_BhaCanv = 2,
00031 PreanShow_N_HypCanv = 3,
00032 };
00033
00034 Int_t TrkTypes() { return 7; }
00035 Int_t TrkType(Int_t id,TString &str){
00036 switch(id){
00037 case 0: str = "ANY"; return -1;
00038 case 1: str = "FWD-LONG"; return 11110;
00039 case 2: str = "FWD-SHORT"; return 1110;
00040 case 3: str = "BCK-XLONG"; return 11112;
00041 case 4: str = "BCK-LONG"; return 1112;
00042 case 5: str = "BCK-SHORT"; return 112;
00043 case 6: str = "BCK-XSHORT"; return 12;
00044 default: return 0;
00045 }
00046 return 0;
00047 }
00048
00049
00050 UInt_t GetSelMuPath(Int_t pathnum){
00051 switch(pathnum){
00052
00053
00054
00055
00056
00057
00058
00059
00060 case 1: return 0x44100;
00061 case 2: return 0x33200;
00062 case 3: return 0x22300;
00063 case 4: return 0x11500;
00064 case 5: return 0x88600;
00065 case 6: return 0x77700;
00066 case 7: return 0x66900;
00067 case 8: return 0x55A00;
00068 default:
00069 Error("MuPathName","pathnum \"%d\" not available (possible BUG!)",pathnum);
00070 TerminateFroot();
00071 }
00072
00073 }
00074
00075
00076 TString MuPathNameTitle(Int_t pathnum,Bool_t is_name){
00077 switch(pathnum){
00078 case 1: return (is_name) ? "t1_1-4-4" : "t1: 1,4,4";
00079 case 2: return (is_name) ? "t2_2-3-3" : "t2: 2,3,3";
00080 case 3: return (is_name) ? "t3_3-2-2" : "t3: 3,2,2";
00081 case 4: return (is_name) ? "t4_5-1-1" : "t4: 5,1,1";
00082 case 5: return (is_name) ? "t5_6-8-8" : "t5: 6,8,8";
00083 case 6: return (is_name) ? "t6_7-7-7" : "t6: 7,7,7";
00084 case 7: return (is_name) ? "t7_9-6-6" : "t7: 9,6,6";
00085 case 8: return (is_name) ? "t8_A-5-5" : "t8: 10,5,5";
00086 default:
00087 Error("MuPathName","pathnum \"%d\" not available (possible BUG!)",pathnum);
00088 TerminateFroot();
00089 }
00090 }
00091
00092 protected:
00093
00094 Bool_t fGesHistosInitialized;
00095 Bool_t fBhabhaHistosInitialized;
00096 Bool_t fHypeHistosInitialized;
00097 Bool_t fStatGraphsInitialized;
00098
00099 Int_t fKstopMarkCol[E_Kaon_Stop_Other+1];
00100
00101
00102 TCanvas *fBhabhaCanvas[PreanShow_N_BhaCanv];
00103 TCanvas *fHypeCanvas[PreanShow_N_HypCanv];
00104
00105
00106 protected:
00107
00108
00109 TH1F *fH_GesTrigBit;
00110
00111
00112 TH2F *fH_BhaMom_2D;
00113
00114 TH1F *fH_InvMass_EpluEmin;
00115 TH1F *fH_InvMass_PIpluPImin;
00116
00117 TH3F *fH_BhaVert_XYZ;
00118 TH2F *fH_BhaVert_XY;
00119 TH2F *fH_BhaVert_XZ;
00120
00121 TH1F *fH_BhaTracksAngle;
00122 TH1F *fH_BhaTotalMomentum;
00123
00124
00125 TH2F *fH_BhaParticleTOF_2D;
00126 TH1F *fH_BhaTofi_TimeDiff;
00127 TH2F *fH_BhaTofi_Time_2D;
00128 TH1F *fH_BhaTofo_TimeDiff;
00129
00130
00131
00132
00133 TH1F *fH_Hyp_PattRecErr;
00134
00135 TH2F *fH_HypKmin_stop_XY[E_Kaon_Stop_Other+1];
00136 TH2F *fH_HypKplu_stop_XY[E_Kaon_Stop_Other+1];
00137
00138 TH1F *fH_Hyp_Kmin_StopCode;
00139 TH1F *fH_Hyp_Kplu_StopCode;
00140
00141 TH1F *fH_Hyp_Kmin_StopTgt;
00142 TH1F *fH_Hyp_Kplu_StopTgt;
00143 TH2F *fH_Hyp_K_StopTgt_2D;
00144
00145 TH1F *fH_Hyp_Kmin_StopVol;
00146 TH1F *fH_Hyp_Kplu_StopVol;
00147 TH2F *fH_Hyp_K_StopVol_2D;
00148
00149 TH3F *fH_Hyp_PhiDecPos_XYZ;
00150 TH2F *fH_Hyp_PhiDecPos_XY;
00151 TH2F *fH_Hyp_PhiDecPos_XZ;
00152 TH1F *fH_PhiDecPos_X;
00153 TH1F *fH_PhiDecPos_Y;
00154 TH1F *fH_PhiDecPos_Z;
00155
00156 TH1F *fH_HypTrk_KpluPosAll;
00157 TH1F *fH_HypTrk_KpluPosPthAll;
00158
00159 TH1F *fH_HypTrk_KpluPosTgt[8];
00160 TH1F *fH_HypTrk_KpluPosPth[8];
00161
00162
00163 TH1F *fH_Hyp_KTofi_TimeDiff;
00164 TH2F *fH_Hyp_KTofi_Time_2D;
00165 TH1F *fH_Hyp_MuTof;
00166 TH1F *fH_Hyp_MuTofCorr;
00167
00168 Int_t fCount_EventTotal;
00169
00170
00171 Int_t fCount_EventPerRun;
00172 Int_t fCount_KminPerRun;
00173 Int_t fCount_KpluPerRun;
00174 Int_t fCount_Stat_Time[E_Scal_Inhib_End];
00175 Int_t fCount_Stat_BhaNum[E_Scal_Inhib_End];
00176 Int_t fCount_Stat_HypNum[E_Scal_Inhib_End];
00177
00178
00179
00180
00181 Int_t fEval_NumOfStoppedKplu[8];
00182 Int_t fEval_NumOfStoppedKplu_All;
00183
00184 Int_t fEval_NumOf_Mu_plu[8];
00185 Int_t fEval_NumOf_Mu_plu_All;
00186
00187 Int_t fEval_NumOf_Mu_plu_Pth[8];
00188 Int_t fEval_NumOf_Mu_plu_Pth_All;
00189
00190 Float_t fEval_RecEff[8];
00191 Float_t fEval_RecEff_All;
00192 Float_t fEval_RecEff_Pth[8];
00193 Float_t fEval_RecEff_Pth_All;
00194
00195
00196 Int_t fEval_NumOfStoppedKmin[8];
00197 Int_t fEval_NumOfStoppedKmin_All;
00198
00199
00200
00201 TFndGraph *fGR_Stat_Evs;
00202
00203 TFndGraph *fGR_Stat_BhaNum[E_Scal_Inhib_End];
00204 TFndGraph *fGR_Stat_HypNum[E_Scal_Inhib_End];
00205 TFndGraph *fGR_Stat_AvgLum[E_Scal_Inhib_End];
00206 TFndGraph *fGR_Stat_IntLum[E_Scal_Inhib_End];
00207 TFndGraph *fGR_Stat_IntLum_Tot[E_Scal_Inhib_End];
00208
00209 TFndGraph *fGR_Stat_KminStop_Num;
00210 TFndGraph *fGR_Stat_KpluStop_Num;
00211
00212 TFndGraph *fGR_Stat_MuPluAll_Num;
00213 TFndGraph *fGR_Stat_MuPluAll_Mom;
00214
00215 TFndGraph *fGR_Stat_BhaRec_Num;
00216 TFndGraph *fGR_Stat_BhaRec_ECMee;
00217 TFndGraph *fGR_Stat_BhaRec_Kshort_Num;
00218 TFndGraph *fGR_Stat_BhaRec_Kshort_InvMass;
00219 TFndGraph *fGR_Stat_BhaRec_Ratio;
00220
00221
00222 TH1F *fHTmp_MuPluAll;
00223 TH1F *fHTmp_BhaInvMass;
00224 TH1F *fHTmp_PionsInvMass;
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236 Bool_t fCut_Fitted;
00237 Int_t fCut_TrkType;
00238
00239 private:
00240 void InitStatGraphs();
00241 void DeleteStatGraphs();
00242
00243 void InitGesHistos();
00244 void InitBhabhaHistos();
00245 void InitHypeHistos();
00246
00247 void ResetGesHistos();
00248 void ResetBhabhaHistos();
00249 void ResetHypeHistos();
00250
00251 void WriteGesHistos();
00252 void WriteBhabhaHistos();
00253 void WriteHypeHistos();
00254 void WriteStatGraphs();
00255
00256 void LoadGesHistos(TFile *fin);
00257 void LoadBhabhaHistos(TFile *fin);
00258 void LoadHypeHistos(TFile *fin);
00259 void LoadStatHistos(TFile *fin);
00260
00261 void FillGesHistos();
00262 void FillBhabhaHistos();
00263 void FillHypeHistos();
00264 void FillScalVariables();
00265
00266 void EvalGesHistos();
00267 void EvalBhabhaHistos();
00268 void EvalHypeHistos();
00269 void EvalStatGraphs(const Int_t &cur_run);
00270
00271 void AddSingleHistoFromFile(TH1 *hori,TFile *fin){
00272 if(!hori || !fin){
00273 Error("AddSingleHistoFromFile","At least one NULL argument!");
00274 return;
00275 }
00276 hori->Add( (TH1*) (fin->Get( hori->GetName() ) ) );
00277 }
00278
00279 void LoadSingleGraphFromFile(TFndGraph *pori,TFile *fin){
00280 if(!pori || !fin){
00281 Error("LoadSingleGraphFromFile","At least one NULL argument!");
00282 return;
00283 }
00284
00285 TFndGraph *grfil = (TFndGraph *) ( fin->Get( pori->GetName() ) );
00286 Double_t px = 0;
00287 Double_t py = 0;
00288 Double_t ex = 0;
00289 Double_t ey = 0;
00290 for(Int_t p=0;p<grfil->GetN();p++){
00291 grfil->GetPoint(p,px,py);
00292 ex = grfil->GetErrorX(p);
00293 ey = grfil->GetErrorY(p);
00294 pori->AddPoint(px,py,ex,ey);
00295 }
00296 grfil = 0;
00297 }
00298
00299 public:
00300 TFndPreanHistos();
00301 ~TFndPreanHistos();
00302
00303 void InitHistos()
00304 {
00305
00306
00307 InitGesHistos();
00308 InitBhabhaHistos();
00309 InitHypeHistos();
00310 InitStatGraphs();
00311 }
00312
00313 void ResetHistos()
00314 {
00315 ResetGesHistos();
00316 ResetBhabhaHistos();
00317 ResetHypeHistos();
00318 }
00319
00320 void ResetStatGraphs(const Bool_t &recreate);
00321
00322
00323 void FillHistos()
00324 {
00325 FillGesHistos();
00326 FillBhabhaHistos();
00327 FillHypeHistos();
00328 FillScalVariables();
00329 }
00330
00331
00332 void EvalHistos()
00333 {
00334 EvalGesHistos();
00335 EvalBhabhaHistos();
00336 EvalHypeHistos();
00337 }
00338
00339 void WriteHistosToFile(const TString &fnam);
00340 void LoadHistosFromFile(const TString &fnam);
00341
00342
00343 friend class TFndPreanGUI;
00344
00345 ClassDef(TFndPreanHistos,1)
00346 };
00347
00348
00349 #endif // FROOT_TFndPreanHistos