anadst.cxx

Go to the documentation of this file.
00001 #include <TFile.h>
00002 #include <TH2F.h>
00003 #include "DSTAnalysis/NuMI/NuMIRunQAna.h"
00004 #include "DSTAnalysis/NuMI/NuMIBeamAna.h"
00005 #include "DSTAnalysis/NuMI/NuMITgtAna.h"
00006 #include "MIPPEventSummary/MIPPEventSummary.h"
00007 #include "MIPPEventSummary/MIPPTrackSummary.h"
00008 
00009 static int firstRun = 14497;
00010 static int lastRun  = 15250;
00011 
00012 static NuMIRunQAna* fNuMIRunQAna = 0;
00013 static NuMIBeamAna* fNuMIBeamAna = 0;
00014 static NuMITgtAna*  fNuMITgtAna  = 0;
00015 
00016 // ROOT histograms
00017 static TFile* gsHistoFile = 0;
00018 
00019 extern "C" 
00020 {
00021   void InitDST(const char* fname) 
00022   {
00023     gsHistoFile = new TFile(fname,"RECREATE");
00024     gsHistoFile->cd();
00025     
00026     fNuMIRunQAna = new NuMIRunQAna();
00027     fNuMIBeamAna = new NuMIBeamAna();
00028     fNuMITgtAna  = new NuMITgtAna();
00029  }
00030 
00031   //....................................................................
00032 
00033   void EndDST() { gsHistoFile->Write(); }
00034 
00035   //....................................................................
00036 
00037   bool AnaDST(const MIPPEventSummary* dst) 
00038   {
00039     // Select only NuMI target data
00040     //    if (dst->tgta!=1201) return false;
00041 
00042     // Fill histograms related to run quality
00043     bool goodrun = fNuMIRunQAna->Ana(dst);
00044     if (goodrun==false) return false;
00045 
00046     // Look at the beam track quality
00047     bool goodbeam = fNuMIBeamAna->Ana(dst);
00048     if (goodbeam==false) return false;
00049     
00050     // Now fill analysis histograms
00051     bool goodevent = fNuMITgtAna->Ana(dst);
00052     if (goodevent==false) return false;
00053 
00054     return true;
00055   }
00056 
00057 }
00058 ////////////////////////////////////////////////////////////////////////

Generated on Mon Nov 23 08:01:43 2009 for MIPP(E907) by  doxygen 1.4.7