ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.17
Committed: Thu Dec 11 15:29:09 2008 UTC (16 years, 4 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.16: +17 -9 lines
Log Message:
Added the possibility to specify filesets/files from environment. Read header file description if interested.

File Contents

# User Rev Content
1 loizides 1.2 //--------------------------------------------------------------------------------------------------
2 loizides 1.17 // $Id: Analysis.h,v 1.16 2008/12/10 14:20:26 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.17 // d) Use of environment variables (only will be attempted if none of a-c is provided)
15     // MIT_CATALOG (=/home/mitprod/catalog)
16     // MIT_BOOK (=mit/filler/006)
17     // MIT_DATASET (=s8-ttbar-id9)
18     // MIT_FILESETS (=0000;0001;0002)
19     // or
20     // MIT_FILES (=file1;file2;file3)
21 loizides 1.1 //
22 loizides 1.3 // See $CMSSW_BASE/src/MitAna/macros/examples/runSimpleExample.C
23     // for an example of how to use this class.
24 loizides 1.1 //
25 loizides 1.3 // Authors: C.Loizides
26 loizides 1.2 //--------------------------------------------------------------------------------------------------
27 loizides 1.1
28 loizides 1.10 #ifndef MITANA_DATAUTIL_ANALYSIS_H
29     #define MITANA_DATAUTIL_ANALYSIS_H
30 loizides 1.7
31     #include <TObject.h>
32     #include <TString.h>
33    
34     class TList;
35     class TChain;
36     class TDSet;
37     class TString;
38     class TAModule;
39     class TAMSelector;
40     class TAMVirtualLoader;
41     class TObjArray;
42     class TProof;
43    
44 loizides 1.1 namespace mithep
45     {
46 paus 1.9 class Dataset;
47 loizides 1.1 class Analysis : public TObject
48     {
49     public:
50 loizides 1.4 Analysis(Bool_t useproof=kFALSE);
51 loizides 1.1 ~Analysis();
52    
53 paus 1.9 Bool_t AddDataset(const Dataset *dataset);
54 loizides 1.1 Bool_t AddFile(const char *pname);
55 loizides 1.5 Bool_t AddFiles(const char *pname, Int_t nmax=-1);
56 paus 1.9 void AddLoader(TAMVirtualLoader *l);
57     void AddPackage(const char *name);
58 loizides 1.1 void AddPackages(TList *list);
59 loizides 1.17 void AddSuperModule(TAModule *mod);
60 loizides 1.15 const char *GetAnaOutputName() const { return fAnaOutput; }
61     const TList *GetOutput() const { return fOutput; }
62     Bool_t GetUseProof() const { return fUseProof; }
63 loizides 1.1 Bool_t Init();
64 loizides 1.15 Bool_t IsInit() const { return fState==kInit; }
65     Bool_t IsRun() const { return fState==kRun; }
66     Bool_t IsTerminated() const { return fState==kTerminate; }
67 loizides 1.1 void Run();
68 loizides 1.4 Bool_t Run(Bool_t browse);
69 loizides 1.15 void SetProcessNEvents(Long64_t n) { fDoNEvents = n; }
70     void SetCompressionLevel(Int_t level) { fCompLevel = level; }
71     void SetConfigName(const char* name) { fConfig = name; }
72     void SetAutoBranchLoad(Bool_t b) { fDoProxy = b; }
73     void SetKeepHierarchy(Bool_t b) { fHierarchy = b; }
74     void SetMasterName(const char* name) { fMaster = name; }
75     void SetOutputName(const char *name) { fAnaOutput = name; }
76     void SetSuperModule(TAModule *mod);
77     void SetTreeName(const char *name) { fTreeName = name; }
78     void SetUseHLT(Bool_t hlt) { fUseHLT = hlt; }
79     void SetUseProof(Bool_t up) { fUseProof = up; }
80 loizides 1.1 void Terminate();
81    
82     protected:
83 loizides 1.17 void AddFile(const char *pname, Int_t eventlist);
84     void AddFile(const TObject *oname, Int_t eventlist);
85     void AddList(TList *list, Int_t eventlist);
86     void FileInputFromEnv();
87     Bool_t IsValidName(const char */*name*/) { return kTRUE; }
88     Bool_t InitProof();
89     Bool_t UploadPackages(TList *packages);
90    
91 loizides 1.1 enum EState { kPristine, //after constructor
92     kInit, //after init
93     kRun, //after run
94     kTerminate //after terminate
95     };
96    
97 loizides 1.3 Bool_t fUseProof; //=true if PROOF is to be used (def=0)
98 loizides 1.11 Bool_t fUseHLT; //=true if HLT module is to be used (def=1)
99 loizides 1.12 Bool_t fHierarchy; //=true if module hierachy to be stored (def=1)
100     Bool_t fDoProxy; //=true if branch autoload is used (def=1)
101 loizides 1.1 EState fState; //status of analysis
102     Int_t fNFriends; //number of friend trees
103     TList *fList; //list of lists of path names
104     TList *fOutput; //output as obtained from TAM (not owned)
105     TList *fPackages; //list of package names for PROOF upload
106     TList *fLoaders; //list of loaders
107 loizides 1.15 TList *fSuperMods; //top level TAM module(s) (not owned)
108 loizides 1.1 TAMSelector *fSelector; //selector for non-PROOF usage
109     TChain *fChain; //trees or friend trees for non-PROOF usage
110     TDSet *fSet; //set of trees or friend trees for PROOF usage
111     TList *fDeleteList; //list of objects to be deleted on Terminate()
112     TString fTreeName; //name of trees or friend trees
113     TString fAnaOutput; //path name of output file
114     TString fMaster; //hostname of PROOF master
115     TString fConfig; //config file name for PROOF
116 loizides 1.3 Int_t fCompLevel; //compression level for output file (def=2)
117 loizides 1.1 TProof *fProof; //pointer to the PROOF session
118 paus 1.9 Long64_t fDoNEvents; //events to process (def=TChain::kBigNumber)
119 loizides 1.1
120 loizides 1.16 ClassDef(Analysis, 0) // Top-level analysis class
121 loizides 1.1 };
122 loizides 1.5 }
123     #endif