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

JpsiMods.C

Go to the documentation of this file.
00001 
00002 // JpsiMods.C
00003 //
00004 // Author     : J. List
00005 // Created    : 31/05/2005
00006 // Last update: $Date: 2005/06/03 12:32:22 $
00007 //          by: $Author: boehmej $
00008 // 
00009 // Comment    : 
00010 //      This implements the H1OO jpsimods example
00011 //      in SFHMarana
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 // ----- 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 << "JpsiMods input_parameters " <<endl;
00039     exit(1);
00040   }
00041 
00042 //...declare the run manager
00043   TRunHisto run(argv[1]);
00044 
00045 //...declare the  event --> use "local" SFHMarEvent (derived from TMarEvent)
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 //...declare histogram classes 
00055   Char_t OutputTextFile[200];
00056 
00057 //--- create object which manages histogram booking & filling 
00058 //    (derived from THisto derived from THistoManager)
00059   MaranaEventLoop evtLoop(run,"JpsiHistos","JpsiEvents.txt");
00060 
00061 //---- hat selection (if needed to online preselect the sample) ...
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 //...loop over events  
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 //--- disable other thight finders
00081   event.find_Jet=kFALSE;
00082   event.find_NP=kFALSE;
00083   
00084     
00085 //---- Here start the main loop on events
00086   while (event.Next(run)) { 
00087     if (event.num%5000==0)cout << "--> process event "<< event.num<<endl; 
00088 
00089     if (!(event.MCFlag)) { //--- checks for data quality runs
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;       //--- HV, cosmic base cut
00098 
00099     if((fabs(event.Vertex[2])>35)||event.Vertex[2]==0) continue;        //--- HV, cosmic base cut
00100 
00101 //---- Check Timing
00102     if(event.IsTimingOk() == kFALSE) continue;
00103 
00104 
00105 //---- Filling of histograms
00106     evtLoop.Fill();        // trigger self-filling process 
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 

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