1 |
loizides |
1.1 |
// $Id: runAna.C 4148 2007-06-21 12:22:37Z loizides $
|
2 |
|
|
|
3 |
|
|
#if !defined(__CINT__) || defined(__MAKECINT__)
|
4 |
|
|
#include "MitAna/DataUtil/interface/Debug.h"
|
5 |
|
|
#include "MitAna/TreeMod/interface/ParticleExampleMod.h"
|
6 |
|
|
#include "MitAna/TreeMod/interface/Analysis.h"
|
7 |
|
|
#endif
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
//________________________________________________________________________
|
11 |
|
|
void runSimpleExample(const char *files, const char *tname="MitTree")
|
12 |
|
|
{
|
13 |
|
|
using namespace mithep;
|
14 |
|
|
gDebugMask = Debug::kAnalysis;
|
15 |
|
|
gDebugLevel = 1;
|
16 |
|
|
|
17 |
|
|
ParticleExampleMod *mod = new ParticleExampleMod;
|
18 |
|
|
//mod->
|
19 |
|
|
|
20 |
|
|
// set up top-level analysis class
|
21 |
|
|
Analysis *ana = new Analysis;
|
22 |
|
|
ana->SetTreeName(tname);
|
23 |
|
|
ana->SetSuperModule(mod);
|
24 |
|
|
ana->AddFile(files);
|
25 |
|
|
ana->SetOutputName("ana_testoutput.root");
|
26 |
|
|
|
27 |
|
|
if(ana->Init()) {
|
28 |
|
|
ana->Run();
|
29 |
|
|
ana->Terminate();
|
30 |
|
|
} else {
|
31 |
|
|
::Error("runAna", "Could not initialize analysis.");
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
delete ana;
|
35 |
|
|
delete mod;
|
36 |
|
|
}
|