ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.23
Committed: Wed Mar 11 10:07:40 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.22: +3 -2 lines
Log Message:
First attempt to get skimmed info.

File Contents

# User Rev Content
1 loizides 1.2 //--------------------------------------------------------------------------------------------------
2 loizides 1.23 // $Id: Analysis.h,v 1.22 2009/03/02 13:26:45 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 loizides 1.18 // MIT_CATALOG (eg. export MIT_CATALOG=/home/mitprod/catalog)
16     // MIT_BOOK (eg. export MIT_BOOK=mit/filler/006)
17     // MIT_DATASET (eg. export MIT_DATASET=s8-ttbar-id9)
18     // MIT_FILESETS (eg. export MIT_FILESETS=0000;0001;0002)
19 loizides 1.17 // or
20 loizides 1.18 // MIT_FILES (eg. export 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.21 void SetProcessNEvents(Long64_t n) { fDoNEvents = n; }
70     void SetCacheSize(Int_t cache) { fCacheSize = cache; }
71     void SetCompressionLevel(Int_t level) { fCompLevel = level; }
72     void SetConfigName(const char* name) { fConfig = name; }
73     void SetDoObjTabClean(Bool_t b) { fDoObjTabClean = b; }
74 loizides 1.22 void SetDoProxy(Bool_t b) { fDoProxy = b; }
75 loizides 1.21 void SetKeepHierarchy(Bool_t b) { fHierarchy = b; }
76     void SetMasterName(const char* name) { fMaster = name; }
77     void SetOutputName(const char *name) { fAnaOutput = name; }
78 loizides 1.15 void SetSuperModule(TAModule *mod);
79 loizides 1.21 void SetTreeName(const char *name) { fTreeName = name; }
80     void SetUseHLT(Bool_t hlt) { fUseHLT = hlt; }
81     void SetUseProof(Bool_t up) { fUseProof = up; }
82 loizides 1.1 void Terminate();
83    
84     protected:
85 loizides 1.17 void AddFile(const char *pname, Int_t eventlist);
86     void AddFile(const TObject *oname, Int_t eventlist);
87     void AddList(TList *list, Int_t eventlist);
88     void FileInputFromEnv();
89     Bool_t IsValidName(const char */*name*/) { return kTRUE; }
90     Bool_t InitProof();
91 loizides 1.23 void EventLoop();
92 loizides 1.17 Bool_t UploadPackages(TList *packages);
93    
94 loizides 1.1 enum EState { kPristine, //after constructor
95     kInit, //after init
96     kRun, //after run
97     kTerminate //after terminate
98     };
99    
100 loizides 1.3 Bool_t fUseProof; //=true if PROOF is to be used (def=0)
101 loizides 1.11 Bool_t fUseHLT; //=true if HLT module is to be used (def=1)
102 loizides 1.12 Bool_t fHierarchy; //=true if module hierachy to be stored (def=1)
103 loizides 1.21 Bool_t fDoProxy; //=true if TRef branch autoload is used (def=0)
104     Bool_t fDoObjTabClean; //=true if object table cleaning is used (def=1)
105 loizides 1.1 EState fState; //status of analysis
106     Int_t fNFriends; //number of friend trees
107     TList *fList; //list of lists of path names
108     TList *fOutput; //output as obtained from TAM (not owned)
109     TList *fPackages; //list of package names for PROOF upload
110     TList *fLoaders; //list of loaders
111 loizides 1.15 TList *fSuperMods; //top level TAM module(s) (not owned)
112 loizides 1.1 TAMSelector *fSelector; //selector for non-PROOF usage
113     TChain *fChain; //trees or friend trees for non-PROOF usage
114     TDSet *fSet; //set of trees or friend trees for PROOF usage
115     TList *fDeleteList; //list of objects to be deleted on Terminate()
116     TString fTreeName; //name of trees or friend trees
117     TString fAnaOutput; //path name of output file
118     TString fMaster; //hostname of PROOF master
119     TString fConfig; //config file name for PROOF
120 loizides 1.23 Int_t fCompLevel; //compression level for output file (def=7)
121 loizides 1.1 TProof *fProof; //pointer to the PROOF session
122 paus 1.9 Long64_t fDoNEvents; //events to process (def=TChain::kBigNumber)
123 bendavid 1.19 Int_t fCacheSize; //size of read cache for events tree
124 loizides 1.1
125 loizides 1.16 ClassDef(Analysis, 0) // Top-level analysis class
126 loizides 1.1 };
127 loizides 1.5 }
128     #endif