1 |
loizides |
1.2 |
//--------------------------------------------------------------------------------------------------
|
2 |
loizides |
1.12 |
// $Id: Analysis.h,v 1.11 2008/09/28 02:36:23 loizides Exp $
|
3 |
loizides |
1.1 |
//
|
4 |
|
|
// Analysis
|
5 |
|
|
//
|
6 |
paus |
1.9 |
// This is the top-level analysis class used to hide the (little) differences between TAM standalone
|
7 |
|
|
// and TAM with PROOF. In addition it provides an almost transparent interface in the case you want
|
8 |
|
|
// to do mixing of different events.
|
9 |
loizides |
1.1 |
//
|
10 |
loizides |
1.3 |
// The class can operate in following modes:
|
11 |
|
|
// a) Add single files to be analyzed using Analysis::AddFile
|
12 |
loizides |
1.5 |
// b) Use a text file to point to files to be analyzed using Analysis::AddFiles
|
13 |
loizides |
1.3 |
// c) Add files using a catalogue (to be done)
|
14 |
loizides |
1.1 |
//
|
15 |
loizides |
1.3 |
// See $CMSSW_BASE/src/MitAna/macros/examples/runSimpleExample.C
|
16 |
|
|
// for an example of how to use this class.
|
17 |
loizides |
1.1 |
//
|
18 |
loizides |
1.3 |
// Authors: C.Loizides
|
19 |
loizides |
1.2 |
//--------------------------------------------------------------------------------------------------
|
20 |
loizides |
1.1 |
|
21 |
loizides |
1.10 |
#ifndef MITANA_DATAUTIL_ANALYSIS_H
|
22 |
|
|
#define MITANA_DATAUTIL_ANALYSIS_H
|
23 |
loizides |
1.7 |
|
24 |
|
|
#include <TObject.h>
|
25 |
|
|
#include <TString.h>
|
26 |
|
|
|
27 |
|
|
class TList;
|
28 |
|
|
class TChain;
|
29 |
|
|
class TDSet;
|
30 |
|
|
class TString;
|
31 |
|
|
class TAModule;
|
32 |
|
|
class TAMSelector;
|
33 |
|
|
class TAMVirtualLoader;
|
34 |
|
|
class TObjArray;
|
35 |
|
|
class TProof;
|
36 |
|
|
|
37 |
loizides |
1.1 |
namespace mithep
|
38 |
|
|
{
|
39 |
paus |
1.9 |
class Dataset;
|
40 |
loizides |
1.1 |
class Analysis : public TObject
|
41 |
|
|
{
|
42 |
|
|
public:
|
43 |
loizides |
1.4 |
Analysis(Bool_t useproof=kFALSE);
|
44 |
loizides |
1.1 |
~Analysis();
|
45 |
|
|
|
46 |
paus |
1.9 |
Bool_t AddDataset(const Dataset *dataset);
|
47 |
loizides |
1.1 |
Bool_t AddFile(const char *pname);
|
48 |
loizides |
1.5 |
Bool_t AddFiles(const char *pname, Int_t nmax=-1);
|
49 |
paus |
1.9 |
void AddLoader(TAMVirtualLoader *l);
|
50 |
|
|
void AddPackage(const char *name);
|
51 |
loizides |
1.1 |
void AddPackages(TList *list);
|
52 |
|
|
const char *GetAnaOutputName() const { return fAnaOutput;}
|
53 |
loizides |
1.12 |
const TList *GetOutput() const { return fOutput; }
|
54 |
loizides |
1.1 |
Bool_t GetUseProof() const { return fUseProof; }
|
55 |
|
|
Bool_t Init();
|
56 |
loizides |
1.12 |
Bool_t IsInit() const { return fState==kInit; }
|
57 |
|
|
Bool_t IsRun() const { return fState==kRun; }
|
58 |
loizides |
1.1 |
Bool_t IsTerminated() const { return fState==kTerminate; }
|
59 |
|
|
void Run();
|
60 |
loizides |
1.4 |
Bool_t Run(Bool_t browse);
|
61 |
loizides |
1.12 |
void SetProcessNevents(Long64_t n) { fDoNEvents = n; }
|
62 |
|
|
void SetCompressionLevel(Int_t level) { fCompLevel = level; }
|
63 |
|
|
void SetConfigName(const char* name) { fConfig = name; }
|
64 |
|
|
void SetAutoBranchLoad(Bool_t b) { fDoProxy = b; }
|
65 |
|
|
void SetKeepHierarchy(Bool_t b) { fHierarchy = b; }
|
66 |
|
|
void SetMasterName(const char* name) { fMaster = name; }
|
67 |
|
|
void SetOutputName(const char *name) { fAnaOutput = name; }
|
68 |
|
|
void SetSuperModule(TAModule *mod) { fSuperMod = mod; }
|
69 |
|
|
void SetTreeName(const char *name) { fTreeName = name; }
|
70 |
|
|
void SetUseHLT(Bool_t hlt) { fUseHLT = hlt; }
|
71 |
|
|
void SetUseProof(Bool_t up) { fUseProof = up; }
|
72 |
loizides |
1.1 |
void Terminate();
|
73 |
|
|
|
74 |
|
|
protected:
|
75 |
|
|
enum EState { kPristine, //after constructor
|
76 |
|
|
kInit, //after init
|
77 |
|
|
kRun, //after run
|
78 |
|
|
kTerminate //after terminate
|
79 |
|
|
};
|
80 |
|
|
|
81 |
loizides |
1.3 |
Bool_t fUseProof; //=true if PROOF is to be used (def=0)
|
82 |
loizides |
1.11 |
Bool_t fUseHLT; //=true if HLT module is to be used (def=1)
|
83 |
loizides |
1.12 |
Bool_t fHierarchy; //=true if module hierachy to be stored (def=1)
|
84 |
|
|
Bool_t fDoProxy; //=true if branch autoload is used (def=1)
|
85 |
loizides |
1.1 |
EState fState; //status of analysis
|
86 |
|
|
Int_t fNFriends; //number of friend trees
|
87 |
|
|
TList *fList; //list of lists of path names
|
88 |
|
|
TList *fOutput; //output as obtained from TAM (not owned)
|
89 |
|
|
TList *fPackages; //list of package names for PROOF upload
|
90 |
|
|
TList *fLoaders; //list of loaders
|
91 |
|
|
TAModule *fSuperMod; //top level TAM module (not owned)
|
92 |
|
|
TAMSelector *fSelector; //selector for non-PROOF usage
|
93 |
|
|
TChain *fChain; //trees or friend trees for non-PROOF usage
|
94 |
|
|
TDSet *fSet; //set of trees or friend trees for PROOF usage
|
95 |
|
|
TList *fDeleteList; //list of objects to be deleted on Terminate()
|
96 |
|
|
TString fTreeName; //name of trees or friend trees
|
97 |
|
|
TString fAnaOutput; //path name of output file
|
98 |
|
|
TString fMaster; //hostname of PROOF master
|
99 |
|
|
TString fConfig; //config file name for PROOF
|
100 |
loizides |
1.3 |
Int_t fCompLevel; //compression level for output file (def=2)
|
101 |
loizides |
1.1 |
TProof *fProof; //pointer to the PROOF session
|
102 |
paus |
1.9 |
Long64_t fDoNEvents; //events to process (def=TChain::kBigNumber)
|
103 |
loizides |
1.1 |
|
104 |
|
|
void AddFile(const char *pname, Int_t eventlist);
|
105 |
|
|
void AddFile(const TObject *oname, Int_t eventlist);
|
106 |
|
|
void AddList(TList *list, Int_t eventlist);
|
107 |
|
|
Bool_t IsValidName(const char */*name*/) { return kTRUE; }
|
108 |
|
|
Bool_t InitProof();
|
109 |
|
|
Bool_t UploadPackages(TList *packages);
|
110 |
|
|
|
111 |
loizides |
1.8 |
ClassDef(Analysis,0) // Top-level analysis class
|
112 |
loizides |
1.1 |
};
|
113 |
loizides |
1.5 |
}
|
114 |
|
|
#endif
|