Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

TestSFHMarana.C

Go to the documentation of this file.
00001 
00002 // TestSFHMarana.C
00003 //
00004 // Author     : J. List
00005 // Created    : 31/05/2005
00006 // Last update: $Date: 2005/07/28 09:14:27 $
00007 //          by: $Author: boehmej $
00008 // 
00009 // Comment    : 
00010 //      This is a test executable for the SFHMarana package.
00011 //      It is based of ExempleAnalysis from MarExemple by E.Sauvan
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 // ----- Init ROOT environment ---------------- 
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 //...declare the run manager
00043   cout << "Creating TRunHisto" <<endl;
00044   TRunHisto run(argv[1]);
00045 
00046 //...declare the  event --> use "local" SFHMarEvent (derived from TMarEvent)
00047   cout << "Creating SFHMarEvent" <<endl;
00048   SFHMarEvent event(&run);
00049  
00050 //...declare histogram classes 
00051   Char_t OutputTextFile[200];
00052 
00053 //--- create object which manages histogram booking & filling 
00054 //    (derived from THisto derived from THistoManager)
00055   cout << "Creating MaranaEventLoop" <<endl;
00056   MaranaEventLoop evtLoop(run,"TestHistos","TestEvents.txt");
00057 
00058 //---- hat selection (if needed to online preselect the sample) ...
00059   printf("Nb events before hat selection: %d \n",gH1Tree->GetEntries());
00060 //H1Tree::Instance()->SelectHat("(NumEmParts>0&&NumMuons>0)||NumMuons>=2");
00061   printf("Nb events after hat selection: %d \n",gH1Tree->GetEntries());
00062 
00063 //...loop over events  
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;    // parameters from 1999 LQ paper
00078   event.PtMinJet=7.;
00079   event.ThetaMinJet=7;  
00080   event.ThetaMaxJet=145;
00081   event.RMinJet=0.1;      // default in TMarEvent
00082   event.EmFracJet=0.95;   // max!
00083  
00084     
00085 //--- disable other thight finders
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 //---- Here start the main loop on events
00094   while (event.Next(run)) { 
00095     //if (event.num%5000==0)cout << "--> process event "<< event.num<<endl; 
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)) { //--- checks for data quality runs
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;       //--- HV, cosmic base cut
00110 
00111     if((fabs(event.Vertex[2])>35)||event.Vertex[2]==0) continue;        //--- HV, cosmic base cut
00112 
00113 //---- Check Timing
00114     if(event.IsTimingOk() == kFALSE) continue;
00115     
00116 
00117 //---- Filling of histograms
00118     evtLoop.Fill();        // trigger self-filling process 
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 

Generated on Thu Jul 28 11:48:52 2005 for SFHMarana by doxygen 1.3.2