ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.26
Committed: Fri Jun 19 07:39:01 2009 UTC (15 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.25: +3 -1 lines
Log Message:
Allow to set scale of printouts.

File Contents

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