ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/macros/examples/runHLTExample.C
Revision: 1.2
Committed: Thu Oct 23 17:03:06 2008 UTC (16 years, 6 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006
Changes since 1.1: +2 -1 lines
Log Message:
Added print table.

File Contents

# User Rev Content
1 loizides 1.2 // $Id: runHLTExample.C,v 1.1 2008/09/28 02:43:15 loizides Exp $
2 loizides 1.1
3     #if !defined(__CINT__) || defined(__MAKECINT__)
4     #include <TROOT.h>
5     #include "MitAna/DataUtil/interface/Debug.h"
6     #include "MitAna/TreeMod/interface/Analysis.h"
7     #include "MitAna/TreeMod/interface/HLTMod.h"
8     #include "MitAna/TreeMod/interface/HLTExampleMod.h"
9     #endif
10    
11     //--------------------------------------------------------------------------------------------------
12     void runHLTExample(const char *trigger="HLT_Jet80", const char *files = "mit-full_000.root")
13     {
14     using namespace mithep;
15     gDebugMask = Debug::kAnalysis;
16     gDebugLevel = 1;
17    
18     HLTMod *hltmod = new HLTMod;
19 loizides 1.2 hltmod->SetPrintTable(kTRUE);
20 loizides 1.1 hltmod->AddTrigger(trigger);
21     hltmod->SetTrigObjsName("myhltobjs");
22    
23     HLTExampleMod *hltexmod = new HLTExampleMod;
24     hltexmod->SetTrigObjsName("myhltobjs");
25     hltmod->Add(hltexmod);
26    
27     // set up analysis
28     Analysis *ana = new Analysis;
29     ana->SetSuperModule(hltmod);
30     ana->AddFile(files);
31     if (gROOT->IsBatch())
32     ana->SetOutputName("mit-hlt-hist.root");
33    
34     // run the analysis after successful initialisation
35     ana->Run(!gROOT->IsBatch());
36    
37     cout << "HLTMod: Accepted " << hltmod->GetNAccepted()
38     << " of " << hltmod->GetNEvents() << " events" << endl;
39     }