ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/macros/examples/runSimpleExample.C
Revision: 1.6
Committed: Sun Sep 28 02:42:49 2008 UTC (16 years, 7 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006, Mit_005, Mit_004
Changes since 1.5: +8 -7 lines
Log Message:
Adapt to SimpleExampleMod.

File Contents

# Content
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/SimpleExampleMod.h"
8
9 #endif
10
11 //--------------------------------------------------------------------------------------------------
12 void runSimpleExample(const char *files = "mit-gen_000.root")
13 {
14 using namespace mithep;
15 gDebugMask = Debug::kAnalysis;
16 gDebugLevel = 1;
17
18 SimpleExampleMod *smod = new SimpleExampleMod;
19
20 // set up analysis
21 Analysis *ana = new Analysis;
22 ana->SetSuperModule(smod);
23 ana->AddFile(files);
24 if (gROOT->IsBatch())
25 ana->SetOutputName("mit-example-hist.root");
26
27 // run the analysis after successful initialisation
28 ana->Run(!gROOT->IsBatch());
29 }