00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013
00014
00015
00016 #include <cstdio>
00017 #include <cstdlib>
00018 #include <iostream>
00019 #include <fstream>
00020
00021 #include "SFHMarana/SFHMarEvent.h"
00022 #include "SFHMarana/MaranaEventLoop.h"
00023 #include "jbltools/sfh/FloatFun.h"
00024 #include "jbltools/sfh/h1examples/JPsiFuns.h"
00025 #include "jbltools/sfh/h1/H1ModsJPsis.h"
00026
00027
00028 TROOT the_root("EXEMPLE","Exemple analysis");
00029
00030
00031 using namespace std;
00032
00033 int main(int argc, char *argv[])
00034 {
00035
00036 if (argc <2) {
00037 cout << "Usage:" <<endl;
00038 cout << "JpsiMods input_parameters " <<endl;
00039 exit(1);
00040 }
00041
00042
00043 TRunHisto run(argv[1]);
00044
00045
00046 SFHMarEvent event(&run);
00047
00048 new JpsiElasticCut (mods_JPsis);
00049 new JpsiTTCut (mods_JPsis);
00050 new JpsiNoCosmicCut (mods_JPsis);
00051 new Jpsi2MuCut (mods_JPsis);
00052 new Jpsi2IronMuCut (mods_JPsis);
00053
00054
00055 Char_t OutputTextFile[200];
00056
00057
00058
00059 MaranaEventLoop evtLoop(run,"JpsiHistos","JpsiEvents.txt");
00060
00061
00062 printf("Nb events before hat selection: %d \n",gH1Tree->GetEntries());
00063 H1Tree::Instance()->SelectHat("NumJPsi>0");
00064 printf("Nb events after hat selection: %d \n",gH1Tree->GetEntries());
00065
00066
00067 cout << "\n>>> start loop \n"<<endl;
00068
00069 event.find_ElePho=kTRUE;
00070 event.PtMinEle=0;
00071 event.ThetaMinEle=5;
00072 event.ThetaMaxEle=175;
00073
00074 event.find_Muon=kTRUE;
00075 event.PtMinMu=2;
00076 event.ThetaMinMu=10;
00077 event.ThetaMaxMu=160;
00078 event.DTrTrMinMu=0.5;
00079
00080
00081 event.find_Jet=kFALSE;
00082 event.find_NP=kFALSE;
00083
00084
00085
00086 while (event.Next(run)) {
00087 if (event.num%5000==0)cout << "--> process event "<< event.num<<endl;
00088
00089 if (!(event.MCFlag)) {
00090 static H1ShortPtr RunQuality("RunQ");
00091 if (*RunQuality==3&&!event.IsData2003()) {
00092 printf("Poor Quality run rejected \n");
00093 continue;
00094 }
00095 }
00096
00097 if(!event.IsHV()||event.IsCosmic()) continue;
00098
00099 if((fabs(event.Vertex[2])>35)||event.Vertex[2]==0) continue;
00100
00101
00102 if(event.IsTimingOk() == kFALSE) continue;
00103
00104
00105
00106 evtLoop.Fill();
00107 }
00108
00109
00110
00111 cout << "\n>>>>>>>> End of events loop : " << event.num << " Events <<<<<<<<<" << endl;
00112
00113 return 0;
00114
00115 }
00116
00117
00118
00119
00120
00121