1 |
loizides |
1.8 |
// $Id: runSimpleExample.C,v 1.7 2008/11/25 14:00:25 loizides Exp $
|
2 |
loizides |
1.1 |
|
3 |
|
|
#if !defined(__CINT__) || defined(__MAKECINT__)
|
4 |
loizides |
1.3 |
#include <TROOT.h>
|
5 |
loizides |
1.1 |
#include "MitAna/DataUtil/interface/Debug.h"
|
6 |
|
|
#include "MitAna/TreeMod/interface/Analysis.h"
|
7 |
loizides |
1.8 |
#include "MitAna/PhysicsMod/interface/SimpleExampleMod.h"
|
8 |
loizides |
1.1 |
#endif
|
9 |
|
|
|
10 |
paus |
1.2 |
//--------------------------------------------------------------------------------------------------
|
11 |
bendavid |
1.5 |
void runSimpleExample(const char *files = "mit-gen_000.root")
|
12 |
loizides |
1.1 |
{
|
13 |
|
|
using namespace mithep;
|
14 |
paus |
1.2 |
gDebugMask = Debug::kAnalysis;
|
15 |
|
|
gDebugLevel = 1;
|
16 |
loizides |
1.1 |
|
17 |
loizides |
1.6 |
SimpleExampleMod *smod = new SimpleExampleMod;
|
18 |
loizides |
1.1 |
|
19 |
paus |
1.2 |
// set up analysis
|
20 |
loizides |
1.1 |
Analysis *ana = new Analysis;
|
21 |
loizides |
1.6 |
ana->SetSuperModule(smod);
|
22 |
loizides |
1.1 |
ana->AddFile(files);
|
23 |
loizides |
1.6 |
if (gROOT->IsBatch())
|
24 |
|
|
ana->SetOutputName("mit-example-hist.root");
|
25 |
|
|
|
26 |
paus |
1.2 |
// run the analysis after successful initialisation
|
27 |
loizides |
1.3 |
ana->Run(!gROOT->IsBatch());
|
28 |
loizides |
1.1 |
}
|