ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/macros/examples/runHLTExample.C
Revision: 1.6
Committed: Mon Jan 4 16:01:24 2010 UTC (15 years, 4 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012h
Changes since 1.5: +2 -2 lines
Log Message:
Fix

File Contents

# User Rev Content
1 loizides 1.6 // $Id: runHLTExample.C,v 1.5 2009/09/29 19:18:22 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 loizides 1.3 #include "MitAna/PhysicsMod/interface/HLTExampleMod.h"
9 loizides 1.1 #endif
10    
11     //--------------------------------------------------------------------------------------------------
12 loizides 1.5 void runHLTExample(const char *trigger="HLT_Jet80",
13     const char *files = "mit-full_000.root",
14 loizides 1.6 Int_t nEvs = 0)
15 loizides 1.1 {
16     using namespace mithep;
17     gDebugMask = Debug::kAnalysis;
18     gDebugLevel = 1;
19    
20     HLTMod *hltmod = new HLTMod;
21 loizides 1.2 hltmod->SetPrintTable(kTRUE);
22 loizides 1.1 hltmod->AddTrigger(trigger);
23     hltmod->SetTrigObjsName("myhltobjs");
24    
25     HLTExampleMod *hltexmod = new HLTExampleMod;
26     hltexmod->SetTrigObjsName("myhltobjs");
27     hltmod->Add(hltexmod);
28    
29     // set up analysis
30     Analysis *ana = new Analysis;
31 loizides 1.4 if (0) {
32     hltmod->SetBitsName("HLTBits_E29");
33     ana->SetHLTTreeName("HLT_E29");
34     ana->SetHLTObjsName("HLTObjects_E29");
35     }
36 loizides 1.5 if (nEvs)
37     ana->SetProcessNEvents(nEvs);
38 loizides 1.1 ana->SetSuperModule(hltmod);
39     ana->AddFile(files);
40     if (gROOT->IsBatch())
41     ana->SetOutputName("mit-hlt-hist.root");
42    
43     // run the analysis after successful initialisation
44     ana->Run(!gROOT->IsBatch());
45    
46     cout << "HLTMod: Accepted " << hltmod->GetNAccepted()
47     << " of " << hltmod->GetNEvents() << " events" << endl;
48     }