ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/macros/examples/runHLTExample.C
Revision: 1.5
Committed: Tue Sep 29 19:18:22 2009 UTC (15 years, 7 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a
Changes since 1.4: +6 -3 lines
Log Message:
Extend example

File Contents

# Content
1 // $Id: runHLTExample.C,v 1.4 2009/08/11 15:27:08 loizides Exp $
2
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/PhysicsMod/interface/HLTExampleMod.h"
9 #endif
10
11 //--------------------------------------------------------------------------------------------------
12 void runHLTExample(const char *trigger="HLT_Jet80",
13 const char *files = "mit-full_000.root",
14 Int_t nEvs = -1)
15 {
16 using namespace mithep;
17 gDebugMask = Debug::kAnalysis;
18 gDebugLevel = 1;
19
20 HLTMod *hltmod = new HLTMod;
21 hltmod->SetPrintTable(kTRUE);
22 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 if (0) {
32 hltmod->SetBitsName("HLTBits_E29");
33 ana->SetHLTTreeName("HLT_E29");
34 ana->SetHLTObjsName("HLTObjects_E29");
35 }
36 if (nEvs)
37 ana->SetProcessNEvents(nEvs);
38 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 }