1 |
loizides |
1.1 |
// $Id: runSimpleExample.C,v 1.5 2008/06/09 00:06:36 bendavid 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/TreeMod/interface/HLTExampleMod.h"
|
9 |
|
|
#endif
|
10 |
|
|
|
11 |
|
|
//--------------------------------------------------------------------------------------------------
|
12 |
|
|
void runHLTExample(const char *trigger="HLT_Jet80", const char *files = "mit-full_000.root")
|
13 |
|
|
{
|
14 |
|
|
using namespace mithep;
|
15 |
|
|
gDebugMask = Debug::kAnalysis;
|
16 |
|
|
gDebugLevel = 1;
|
17 |
|
|
|
18 |
|
|
HLTMod *hltmod = new HLTMod;
|
19 |
|
|
hltmod->AddTrigger(trigger);
|
20 |
|
|
hltmod->SetTrigObjsName("myhltobjs");
|
21 |
|
|
|
22 |
|
|
HLTExampleMod *hltexmod = new HLTExampleMod;
|
23 |
|
|
hltexmod->SetTrigObjsName("myhltobjs");
|
24 |
|
|
hltmod->Add(hltexmod);
|
25 |
|
|
|
26 |
|
|
// set up analysis
|
27 |
|
|
Analysis *ana = new Analysis;
|
28 |
|
|
ana->SetSuperModule(hltmod);
|
29 |
|
|
ana->AddFile(files);
|
30 |
|
|
if (gROOT->IsBatch())
|
31 |
|
|
ana->SetOutputName("mit-hlt-hist.root");
|
32 |
|
|
|
33 |
|
|
// run the analysis after successful initialisation
|
34 |
|
|
ana->Run(!gROOT->IsBatch());
|
35 |
|
|
|
36 |
|
|
cout << "HLTMod: Accepted " << hltmod->GetNAccepted()
|
37 |
|
|
<< " of " << hltmod->GetNEvents() << " events" << endl;
|
38 |
|
|
}
|