ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.4
Committed: Thu Jun 5 09:46:40 2008 UTC (16 years, 11 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.3: +3 -2 lines
Log Message:
Added Run(bool) so that macros are simplied. Coding conventions.

File Contents

# User Rev Content
1 loizides 1.4 // $Id: Analysis.h,v 1.3 2008/06/03 09:58:32 loizides Exp $
2 loizides 1.1
3     #ifndef DATAUTIL_ANALYSIS_H
4     #define DATAUTIL_ANALYSIS_H
5    
6 loizides 1.2 #include <TObject.h>
7     #include <TString.h>
8    
9     class TList;
10     class TChain;
11     class TDSet;
12     class TString;
13     class TAModule;
14     class TAMSelector;
15     class TAMVirtualLoader;
16     class TObjArray;
17     class TProof;
18    
19     //--------------------------------------------------------------------------------------------------
20 loizides 1.1 //
21     // Analysis
22     //
23     // This is the top-level analysis class used to hide the (little)
24     // differences between TAM standalone and TAM with PROOF.
25     // In addition it provides an almost transparent interface
26     // in the case you want to do mixing of different events.
27     //
28 loizides 1.3 // The class can operate in following modes:
29     // a) Add single files to be analyzed using Analysis::AddFile
30     // b) Use a text file to point to files to be analyzed using Analysis::AddFiles (to be done)
31     // c) Add files using a catalogue (to be done)
32 loizides 1.1 //
33 loizides 1.3 // See $CMSSW_BASE/src/MitAna/macros/examples/runSimpleExample.C
34     // for an example of how to use this class.
35 loizides 1.1 //
36 loizides 1.3 // Authors: C.Loizides
37 loizides 1.1 //
38 loizides 1.2 //--------------------------------------------------------------------------------------------------
39 loizides 1.1
40     namespace mithep
41     {
42     class Analysis : public TObject
43     {
44     public:
45 loizides 1.4 Analysis(Bool_t useproof=kFALSE);
46 loizides 1.1 ~Analysis();
47    
48     void AddLoader(TAMVirtualLoader *l);
49     Bool_t AddFile(const char *pname);
50     void AddPackage(const char* name);
51     void AddPackages(TList *list);
52     const char *GetAnaOutputName() const { return fAnaOutput;}
53     const TList *GetOutput() const { return fOutput; }
54     Bool_t GetUseProof() const { return fUseProof; }
55     Bool_t Init();
56     Bool_t IsInit() const { return fState==kInit; }
57     Bool_t IsRun() const { return fState==kRun; }
58     Bool_t IsTerminated() const { return fState==kTerminate; }
59     void Run();
60 loizides 1.4 Bool_t Run(Bool_t browse);
61 loizides 1.1 void SetOutputName(const char *name) { fAnaOutput = name; }
62     void SetCompressionLevel(Int_t level) { fCompLevel = level; }
63     void SetConfigName(const char* name) { fConfig = name; }
64     void SetKeepHierachy(Bool_t b) { fHierachy = b; }
65     void SetMasterName(const char* name) { fMaster = name; }
66     void SetSuperModule(TAModule *mod) { fSuperMod = mod; }
67     void SetTreeName(const char *name) { fTreeName = name; }
68     void SetUseProof(Bool_t up) { fUseProof = up; }
69     void Terminate();
70    
71     protected:
72     enum EState { kPristine, //after constructor
73     kInit, //after init
74     kRun, //after run
75     kTerminate //after terminate
76     };
77    
78 loizides 1.3 Bool_t fUseProof; //=true if PROOF is to be used (def=0)
79     Bool_t fHierachy; //=true if module hierachy to be stored (def=1)
80 loizides 1.1 EState fState; //status of analysis
81     Int_t fNFriends; //number of friend trees
82     TList *fList; //list of lists of path names
83     TList *fOutput; //output as obtained from TAM (not owned)
84     TList *fPackages; //list of package names for PROOF upload
85     TList *fLoaders; //list of loaders
86     TAModule *fSuperMod; //top level TAM module (not owned)
87     TAMSelector *fSelector; //selector for non-PROOF usage
88     TChain *fChain; //trees or friend trees for non-PROOF usage
89     TDSet *fSet; //set of trees or friend trees for PROOF usage
90     TList *fDeleteList; //list of objects to be deleted on Terminate()
91     TString fTreeName; //name of trees or friend trees
92     TString fAnaOutput; //path name of output file
93     TString fMaster; //hostname of PROOF master
94     TString fConfig; //config file name for PROOF
95 loizides 1.3 Int_t fCompLevel; //compression level for output file (def=2)
96 loizides 1.1 TProof *fProof; //pointer to the PROOF session
97    
98     void AddFile(const char *pname, Int_t eventlist);
99     void AddFile(const TObject *oname, Int_t eventlist);
100     void AddList(TList *list, Int_t eventlist);
101     Bool_t IsValidName(const char */*name*/) { return kTRUE; }
102     Bool_t InitProof();
103     Bool_t UploadPackages(TList *packages);
104    
105     ClassDef(Analysis,0) // Top-level analysis class
106     };
107    
108     } /*namespace mithep*/
109    
110     #endif /*HIROOT_Analysis*/