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

# User Rev Content
1 bendavid 1.7 // $Id: runHLTExample.C,v 1.6 2010/01/04 16:01:24 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 bendavid 1.7 void runHLTExample(const char *trigger="HLT_MinBiasBSC_OR",
13 loizides 1.5 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 bendavid 1.7 hltmod->SetBitsName("HLTBits");
33     ana->SetHLTTreeName("HLT");
34     ana->SetHLTObjsName("HLTObjects");
35 loizides 1.4 }
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     }