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 |
}
|