ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.13
Committed: Wed Nov 12 23:31:29 2008 UTC (16 years, 5 months ago) by paus
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006
Changes since 1.12: +2 -2 lines
Log Message:
Updated header documentation.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: Analysis.h,v 1.12 2008/10/06 17:01:20 loizides Exp $
3 //
4 // Analysis
5 //
6 // 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 //
10 // The class can operate in following modes:
11 // a) Add single files to be analyzed using Analysis::AddFile
12 // b) Use a text file to point to files to be analyzed using Analysis::AddFiles
13 // c) Add files using a catalog using Analysis::AddDataset
14 //
15 // See $CMSSW_BASE/src/MitAna/macros/examples/runSimpleExample.C
16 // for an example of how to use this class.
17 //
18 // Authors: C.Loizides
19 //--------------------------------------------------------------------------------------------------
20
21 #ifndef MITANA_DATAUTIL_ANALYSIS_H
22 #define MITANA_DATAUTIL_ANALYSIS_H
23
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 namespace mithep
38 {
39 class Dataset;
40 class Analysis : public TObject
41 {
42 public:
43 Analysis(Bool_t useproof=kFALSE);
44 ~Analysis();
45
46 Bool_t AddDataset(const Dataset *dataset);
47 Bool_t AddFile(const char *pname);
48 Bool_t AddFiles(const char *pname, Int_t nmax=-1);
49 void AddLoader(TAMVirtualLoader *l);
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 Bool_t Run(Bool_t browse);
61 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 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 Bool_t fUseProof; //=true if PROOF is to be used (def=0)
82 Bool_t fUseHLT; //=true if HLT module is to be used (def=1)
83 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 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 Int_t fCompLevel; //compression level for output file (def=2)
101 TProof *fProof; //pointer to the PROOF session
102 Long64_t fDoNEvents; //events to process (def=TChain::kBigNumber)
103
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 ClassDef(Analysis,0) // Top-level analysis class
112 };
113 }
114 #endif