ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.16
Committed: Wed Dec 10 14:20:26 2008 UTC (16 years, 4 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.15: +2 -2 lines
Log Message:
Cosmetics.

File Contents

# User Rev Content
1 loizides 1.2 //--------------------------------------------------------------------------------------------------
2 loizides 1.16 // $Id: Analysis.h,v 1.15 2008/12/09 10:13:00 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 paus 1.13 // c) Add files using a catalog using Analysis::AddDataset
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 loizides 1.15 void AddSuperModule(TAModule *mod);
47 paus 1.9 Bool_t AddDataset(const Dataset *dataset);
48 loizides 1.1 Bool_t AddFile(const char *pname);
49 loizides 1.5 Bool_t AddFiles(const char *pname, Int_t nmax=-1);
50 paus 1.9 void AddLoader(TAMVirtualLoader *l);
51     void AddPackage(const char *name);
52 loizides 1.1 void AddPackages(TList *list);
53 loizides 1.15 const char *GetAnaOutputName() const { return fAnaOutput; }
54     const TList *GetOutput() const { return fOutput; }
55     Bool_t GetUseProof() const { return fUseProof; }
56 loizides 1.1 Bool_t Init();
57 loizides 1.15 Bool_t IsInit() const { return fState==kInit; }
58     Bool_t IsRun() const { return fState==kRun; }
59     Bool_t IsTerminated() const { return fState==kTerminate; }
60 loizides 1.1 void Run();
61 loizides 1.4 Bool_t Run(Bool_t browse);
62 loizides 1.15 void SetProcessNEvents(Long64_t n) { fDoNEvents = n; }
63     void SetCompressionLevel(Int_t level) { fCompLevel = level; }
64     void SetConfigName(const char* name) { fConfig = name; }
65     void SetAutoBranchLoad(Bool_t b) { fDoProxy = b; }
66     void SetKeepHierarchy(Bool_t b) { fHierarchy = b; }
67     void SetMasterName(const char* name) { fMaster = name; }
68     void SetOutputName(const char *name) { fAnaOutput = name; }
69     void SetSuperModule(TAModule *mod);
70     void SetTreeName(const char *name) { fTreeName = name; }
71     void SetUseHLT(Bool_t hlt) { fUseHLT = hlt; }
72     void SetUseProof(Bool_t up) { fUseProof = up; }
73 loizides 1.1 void Terminate();
74    
75     protected:
76     enum EState { kPristine, //after constructor
77     kInit, //after init
78     kRun, //after run
79     kTerminate //after terminate
80     };
81    
82 loizides 1.3 Bool_t fUseProof; //=true if PROOF is to be used (def=0)
83 loizides 1.11 Bool_t fUseHLT; //=true if HLT module is to be used (def=1)
84 loizides 1.12 Bool_t fHierarchy; //=true if module hierachy to be stored (def=1)
85     Bool_t fDoProxy; //=true if branch autoload is used (def=1)
86 loizides 1.1 EState fState; //status of analysis
87     Int_t fNFriends; //number of friend trees
88     TList *fList; //list of lists of path names
89     TList *fOutput; //output as obtained from TAM (not owned)
90     TList *fPackages; //list of package names for PROOF upload
91     TList *fLoaders; //list of loaders
92 loizides 1.15 TList *fSuperMods; //top level TAM module(s) (not owned)
93 loizides 1.1 TAMSelector *fSelector; //selector for non-PROOF usage
94     TChain *fChain; //trees or friend trees for non-PROOF usage
95     TDSet *fSet; //set of trees or friend trees for PROOF usage
96     TList *fDeleteList; //list of objects to be deleted on Terminate()
97     TString fTreeName; //name of trees or friend trees
98     TString fAnaOutput; //path name of output file
99     TString fMaster; //hostname of PROOF master
100     TString fConfig; //config file name for PROOF
101 loizides 1.3 Int_t fCompLevel; //compression level for output file (def=2)
102 loizides 1.1 TProof *fProof; //pointer to the PROOF session
103 paus 1.9 Long64_t fDoNEvents; //events to process (def=TChain::kBigNumber)
104 loizides 1.1
105     void AddFile(const char *pname, Int_t eventlist);
106     void AddFile(const TObject *oname, Int_t eventlist);
107     void AddList(TList *list, Int_t eventlist);
108     Bool_t IsValidName(const char */*name*/) { return kTRUE; }
109     Bool_t InitProof();
110     Bool_t UploadPackages(TList *packages);
111    
112 loizides 1.16 ClassDef(Analysis, 0) // Top-level analysis class
113 loizides 1.1 };
114 loizides 1.5 }
115     #endif