ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.28
Committed: Tue Aug 11 15:24:39 2009 UTC (15 years, 8 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, HEAD
Branch point for: Mit_025c_branch
Changes since 1.27: +44 -17 lines
Log Message:
Support different HLT menus

File Contents

# User Rev Content
1 loizides 1.2 //--------------------------------------------------------------------------------------------------
2 loizides 1.28 // $Id: Analysis.h,v 1.27 2009/07/13 20:05:31 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.28 const char *GetAllEvtTreeName() const { return fAllEvtTreeName; }
61     const char *GetAllEvtHdrBrn() const { return fAllEvtHdrBrn; }
62 loizides 1.15 const char *GetAnaOutputName() const { return fAnaOutput; }
63 loizides 1.28 const char *GetEvtHdrName() const { return fEvtHdrName; }
64     const char *GetHLTObjsName() const { return fHLTObjsName; }
65     const char *GetHLTTreeName() const { return fHLTTreeName; }
66     const char *GetLATreeName() const { return fLATreeName; }
67     const char *GetLAHdrName() const { return fLAHdrName; }
68     const char *GetRunTreeName() const { return fRunTreeName; }
69     const char *GetRunInfoName() const { return fRunInfoName; }
70 loizides 1.15 const TList *GetOutput() const { return fOutput; }
71     Bool_t GetUseProof() const { return fUseProof; }
72 loizides 1.1 Bool_t Init();
73 loizides 1.15 Bool_t IsInit() const { return fState==kInit; }
74     Bool_t IsRun() const { return fState==kRun; }
75     Bool_t IsTerminated() const { return fState==kTerminate; }
76 loizides 1.1 void Run();
77 loizides 1.4 Bool_t Run(Bool_t browse);
78 loizides 1.28 void SetAllEvtHdrBrn(const char *n) { fAllEvtHdrBrn = n; }
79     void SetAllEvtTreeName(const char *n) { fAllEvtTreeName = n; }
80     void SetCacheSize(Int_t cache) { fCacheSize = cache; }
81     void SetCompressionLevel(Int_t level) { fCompLevel = level; }
82     void SetConfigName(const char* name) { fConfig = name; }
83     void SetDoObjTabClean(Bool_t b) { fDoObjTabClean = b; }
84     void SetDoParallel(Bool_t b) { fParallel = b; }
85     void SetDoProxy(Bool_t b) { fDoProxy = b; }
86     void SetEvtHdrName(const char *n) { fEvtHdrName = n; }
87     void SetHLTObjsName(const char *n) { fHLTObjsName = n; }
88     void SetHLTTreeName(const char *n) { fHLTTreeName = n; }
89     void SetKeepHierarchy(Bool_t b) { fHierarchy = b; }
90     void SetLAHdrName(const char *n) { fLAHdrName = n; }
91     void SetLATreeName(const char *n) { fLATreeName = n; }
92     void SetMasterName(const char* name) { fMaster = name; }
93     void SetOutputName(const char *name) { fAnaOutput = name; }
94     void SetPrintScale(UInt_t n) { fPrintScale = n; }
95     void SetProcessNEvents(Long64_t n) { fDoNEvents = n; }
96     void SetRunInfoName(const char *n) { fRunInfoName = n; }
97     void SetRunTreeName(const char *n) { fRunTreeName = n; }
98     void SetSkipFirstNEvents(Long64_t n) { fSkipNEvents = n; }
99 loizides 1.15 void SetSuperModule(TAModule *mod);
100 loizides 1.28 void SetTreeName(const char *name) { fTreeName = name; }
101     void SetUseHLT(Bool_t hlt) { fUseHLT = hlt; }
102     void SetUseProof(Bool_t up) { fUseProof = up; }
103 loizides 1.1 void Terminate();
104    
105     protected:
106 loizides 1.17 void AddFile(const char *pname, Int_t eventlist);
107     void AddFile(const TObject *oname, Int_t eventlist);
108     void AddList(TList *list, Int_t eventlist);
109     void FileInputFromEnv();
110     Bool_t IsValidName(const char */*name*/) { return kTRUE; }
111     Bool_t InitProof();
112     Bool_t UploadPackages(TList *packages);
113    
114 loizides 1.24 enum EState {
115     kPristine, //after constructor
116     kInit, //after init
117     kRun, //after run
118     kTerminate //after terminate
119     };
120 loizides 1.1
121 loizides 1.3 Bool_t fUseProof; //=true if PROOF is to be used (def=0)
122 loizides 1.11 Bool_t fUseHLT; //=true if HLT module is to be used (def=1)
123 loizides 1.12 Bool_t fHierarchy; //=true if module hierachy to be stored (def=1)
124 loizides 1.21 Bool_t fDoProxy; //=true if TRef branch autoload is used (def=0)
125     Bool_t fDoObjTabClean; //=true if object table cleaning is used (def=1)
126 loizides 1.27 Bool_t fParallel; //=true if parellel tree unzipping is used (def=0)
127 loizides 1.1 EState fState; //status of analysis
128     Int_t fNFriends; //number of friend trees
129     TList *fList; //list of lists of path names
130     TList *fOutput; //output as obtained from TAM (not owned)
131     TList *fPackages; //list of package names for PROOF upload
132     TList *fLoaders; //list of loaders
133 loizides 1.15 TList *fSuperMods; //top level TAM module(s) (not owned)
134 loizides 1.1 TAMSelector *fSelector; //selector for non-PROOF usage
135     TChain *fChain; //trees or friend trees for non-PROOF usage
136     TDSet *fSet; //set of trees or friend trees for PROOF usage
137     TList *fDeleteList; //list of objects to be deleted on Terminate()
138     TString fAnaOutput; //path name of output file
139     TString fMaster; //hostname of PROOF master
140     TString fConfig; //config file name for PROOF
141 loizides 1.23 Int_t fCompLevel; //compression level for output file (def=7)
142 loizides 1.1 TProof *fProof; //pointer to the PROOF session
143 paus 1.9 Long64_t fDoNEvents; //events to process (def=TChain::kBigNumber)
144 loizides 1.25 Long64_t fSkipNEvents; //number of events to skip from beginning (def=0)
145 loizides 1.26 UInt_t fPrintScale; //scale for evt number/timings printouts (def=100)
146 bendavid 1.19 Int_t fCacheSize; //size of read cache for events tree
147 loizides 1.28 TString fTreeName; //name of trees or friend trees
148     TString fEvtHdrName; //name of event header branch
149     TString fRunTreeName; //name of run info tree
150     TString fRunInfoName; //name of run info branch
151     TString fAllEvtHdrBrn; //name of all-event header branch
152     TString fLATreeName; //name of look-ahead tree
153     TString fLAHdrName; //name of look-ahead event header branch
154     TString fHLTTreeName; //name of HLT tree
155     TString fAllEvtTreeName; //name of all-event tree
156     TString fHLTObjsName; //trigger objects branch name
157 loizides 1.1
158 loizides 1.16 ClassDef(Analysis, 0) // Top-level analysis class
159 loizides 1.1 };
160 loizides 1.5 }
161     #endif