1 |
loizides |
1.1 |
// $Id: THIAnalysis.h 4604 2007-11-01 15:21:50Z loizides $
|
2 |
|
|
|
3 |
|
|
#ifndef DATAUTIL_ANALYSIS_H
|
4 |
|
|
#define DATAUTIL_ANALYSIS_H
|
5 |
|
|
|
6 |
|
|
//////////////////////////////////////////////////////////////////////////
|
7 |
|
|
//
|
8 |
|
|
// Analysis
|
9 |
|
|
//
|
10 |
|
|
// This is the top-level analysis class used to hide the (little)
|
11 |
|
|
// differences between TAM standalone and TAM with PROOF.
|
12 |
|
|
// In addition it provides an almost transparent interface
|
13 |
|
|
// in the case you want to do mixing of different events.
|
14 |
|
|
//
|
15 |
|
|
// The class can operate in two distinct modes:
|
16 |
|
|
// a) Non-mixing (use AddFile())
|
17 |
|
|
// b) Mixing (use MixFiles())
|
18 |
|
|
//
|
19 |
|
|
// See macros/ana/runAna.C and macros/ana/runAnaMixer.C
|
20 |
|
|
// for its usage.
|
21 |
|
|
//
|
22 |
|
|
// Authors: M.Ballintijn
|
23 |
|
|
// C.Loizides
|
24 |
|
|
//
|
25 |
|
|
//////////////////////////////////////////////////////////////////////////
|
26 |
|
|
|
27 |
|
|
#include <TObject.h>
|
28 |
|
|
#include <TString.h>
|
29 |
|
|
|
30 |
|
|
class TList;
|
31 |
|
|
class TChain;
|
32 |
|
|
class TDSet;
|
33 |
|
|
class TString;
|
34 |
|
|
class TAModule;
|
35 |
|
|
class TAMSelector;
|
36 |
|
|
class TAMVirtualLoader;
|
37 |
|
|
class TObjArray;
|
38 |
|
|
class TProof;
|
39 |
|
|
|
40 |
|
|
namespace mithep
|
41 |
|
|
{
|
42 |
|
|
class Analysis : public TObject
|
43 |
|
|
{
|
44 |
|
|
public:
|
45 |
|
|
Analysis(Bool_t up=kFALSE);
|
46 |
|
|
~Analysis();
|
47 |
|
|
|
48 |
|
|
void AddLoader(TAMVirtualLoader *l);
|
49 |
|
|
Bool_t AddFile(const char *pname);
|
50 |
|
|
void AddPackage(const char* name);
|
51 |
|
|
void AddPackages(TList *list);
|
52 |
|
|
const char *GetAnaOutputName() const { return fAnaOutput;}
|
53 |
|
|
const TList *GetOutput() const { return fOutput; }
|
54 |
|
|
Bool_t GetUseProof() const { return fUseProof; }
|
55 |
|
|
Bool_t Init();
|
56 |
|
|
Bool_t IsInit() const { return fState==kInit; }
|
57 |
|
|
Bool_t IsRun() const { return fState==kRun; }
|
58 |
|
|
Bool_t IsTerminated() const { return fState==kTerminate; }
|
59 |
|
|
void Run();
|
60 |
|
|
void SetOutputName(const char *name) { fAnaOutput = name; }
|
61 |
|
|
void SetCompressionLevel(Int_t level) { fCompLevel = level; }
|
62 |
|
|
void SetConfigName(const char* name) { fConfig = name; }
|
63 |
|
|
void SetKeepHierachy(Bool_t b) { fHierachy = b; }
|
64 |
|
|
void SetMasterName(const char* name) { fMaster = name; }
|
65 |
|
|
void SetSuperModule(TAModule *mod) { fSuperMod = mod; }
|
66 |
|
|
void SetTreeName(const char *name) { fTreeName = name; }
|
67 |
|
|
void SetUseProof(Bool_t up) { fUseProof = up; }
|
68 |
|
|
void Terminate();
|
69 |
|
|
|
70 |
|
|
protected:
|
71 |
|
|
enum EState { kPristine, //after constructor
|
72 |
|
|
kInit, //after init
|
73 |
|
|
kRun, //after run
|
74 |
|
|
kTerminate //after terminate
|
75 |
|
|
};
|
76 |
|
|
|
77 |
|
|
Bool_t fUseProof; //=true if PROOF is to be used
|
78 |
|
|
Bool_t fHierachy; //=true if module hierachy to be stored
|
79 |
|
|
EState fState; //status of analysis
|
80 |
|
|
Int_t fNFriends; //number of friend trees
|
81 |
|
|
TList *fList; //list of lists of path names
|
82 |
|
|
TList *fOutput; //output as obtained from TAM (not owned)
|
83 |
|
|
TList *fPackages; //list of package names for PROOF upload
|
84 |
|
|
TList *fLoaders; //list of loaders
|
85 |
|
|
TAModule *fSuperMod; //top level TAM module (not owned)
|
86 |
|
|
TAMSelector *fSelector; //selector for non-PROOF usage
|
87 |
|
|
TChain *fChain; //trees or friend trees for non-PROOF usage
|
88 |
|
|
TDSet *fSet; //set of trees or friend trees for PROOF usage
|
89 |
|
|
TList *fDeleteList; //list of objects to be deleted on Terminate()
|
90 |
|
|
TString fTreeName; //name of trees or friend trees
|
91 |
|
|
TString fAnaOutput; //path name of output file
|
92 |
|
|
TString fMaster; //hostname of PROOF master
|
93 |
|
|
TString fConfig; //config file name for PROOF
|
94 |
|
|
Int_t fCompLevel; //compression level for output file
|
95 |
|
|
TProof *fProof; //pointer to the PROOF session
|
96 |
|
|
|
97 |
|
|
void AddFile(const char *pname, Int_t eventlist);
|
98 |
|
|
void AddFile(const TObject *oname, Int_t eventlist);
|
99 |
|
|
void AddList(TList *list, Int_t eventlist);
|
100 |
|
|
Bool_t IsValidName(const char */*name*/) { return kTRUE; }
|
101 |
|
|
Bool_t InitProof();
|
102 |
|
|
Bool_t UploadPackages(TList *packages);
|
103 |
|
|
|
104 |
|
|
ClassDef(Analysis,0) // Top-level analysis class
|
105 |
|
|
};
|
106 |
|
|
|
107 |
|
|
} /*namespace mithep*/
|
108 |
|
|
|
109 |
|
|
#endif /*HIROOT_Analysis*/
|