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 "SFHMarana/Funs.h"
00024 #include "Marana/TMarEvent.h"
00025 #include "Marana/TTools.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 << "TestSFHMarana input_parameters " <<endl;
00039 exit(1);
00040 }
00041
00042
00043 cout << "Creating TRunHisto" <<endl;
00044 TRunHisto run(argv[1]);
00045
00046
00047 cout << "Creating SFHMarEvent" <<endl;
00048 SFHMarEvent event(&run);
00049
00050
00051 Char_t OutputTextFile[200];
00052
00053
00054
00055 cout << "Creating MaranaEventLoop" <<endl;
00056 MaranaEventLoop evtLoop(run,"TestHistos","TestEvents.txt");
00057
00058
00059 printf("Nb events before hat selection: %d \n",gH1Tree->GetEntries());
00060
00061 printf("Nb events after hat selection: %d \n",gH1Tree->GetEntries());
00062
00063
00064 cout << "\n>>> start loop \n"<<endl;
00065
00066 event.find_ElePho=kTRUE;
00067 event.PtMinEle=0;
00068 event.ThetaMinEle=5;
00069 event.ThetaMaxEle=175;
00070
00071 event.find_Muon=kTRUE;
00072 event.PtMinMu=2;
00073 event.ThetaMinMu=10;
00074 event.ThetaMaxMu=160;
00075 event.DTrTrMinMu=0.5;
00076
00077 event.find_Jet=kTRUE;
00078 event.PtMinJet=7.;
00079 event.ThetaMinJet=7;
00080 event.ThetaMaxJet=145;
00081 event.RMinJet=0.1;
00082 event.EmFracJet=0.95;
00083
00084
00085
00086 event.find_NP=kFALSE;
00087
00088 FloatFun& ffNSelJets = *new NSelJetsFun(event.jet, "NSelJets");
00089 FloatFun& ffPtSelJet1 = *new PtSelJet1Fun(event.jet, "PtSelJet1");
00090 FloatFun& ffThSelJet1 = *new ThSelJet1Fun(event.jet, "ThSelJet1");
00091
00092
00093
00094 while (event.Next(run)) {
00095
00096 if (event.num%1000==0) cout << "--> process event " << event.num
00097 << ", NSelJets = " << ffNSelJets()
00098 << ", PtSelJet1 = " << ffPtSelJet1()
00099 << ", ThSelJet1 = " << ffThSelJet1() << endl;
00100
00101 if (!(event.MCFlag)) {
00102 static H1ShortPtr RunQuality("RunQ");
00103 if (*RunQuality==3&&!event.IsData2003()) {
00104 printf("Poor Quality run rejected \n");
00105 continue;
00106 }
00107 }
00108
00109 if(!event.IsHV()||event.IsCosmic()) continue;
00110
00111 if((fabs(event.Vertex[2])>35)||event.Vertex[2]==0) continue;
00112
00113
00114 if(event.IsTimingOk() == kFALSE) continue;
00115
00116
00117
00118 evtLoop.Fill();
00119 }
00120
00121
00122
00123 cout << "\n>>>>>>>> End of events loop : " << event.num << " Events <<<<<<<<<" << endl;
00124
00125 return 0;
00126
00127 }
00128
00129
00130
00131
00132
00133