ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/macros/examples/runHLTExample.C
Revision: 1.7
Committed: Tue Mar 30 12:10:08 2010 UTC (15 years, 1 month ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_020d, TMit_020d, Mit_020c, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c
Changes since 1.6: +5 -5 lines
Log Message:
Update hlt example

File Contents

# Content
1 // $Id: runHLTExample.C,v 1.6 2010/01/04 16:01:24 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_MinBiasBSC_OR",
13 const char *files = "mit-full_000.root",
14 Int_t nEvs = 0)
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");
33 ana->SetHLTTreeName("HLT");
34 ana->SetHLTObjsName("HLTObjects");
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 }