ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.3
Committed: Tue Jun 3 09:58:32 2008 UTC (16 years, 11 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.2: +11 -11 lines
Log Message:
Updated class docu and set meaningful default params.

File Contents

# User Rev Content
1 loizides 1.3 // $Id: Analysis.h,v 1.2 2008/06/01 18:43:25 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     Analysis(Bool_t up=kFALSE);
46     ~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     void SetOutputName(const char *name) { fAnaOutput = name; }
61     void SetCompressionLevel(Int_t level) { fCompLevel = level; }
62     void SetConfigName(const char* name) { fConfig = name; }
63     void SetKeepHierachy(Bool_t b) { fHierachy = b; }
64     void SetMasterName(const char* name) { fMaster = name; }
65     void SetSuperModule(TAModule *mod) { fSuperMod = mod; }
66     void SetTreeName(const char *name) { fTreeName = name; }
67     void SetUseProof(Bool_t up) { fUseProof = up; }
68     void Terminate();
69    
70     protected:
71     enum EState { kPristine, //after constructor
72     kInit, //after init
73     kRun, //after run
74     kTerminate //after terminate
75     };
76    
77 loizides 1.3 Bool_t fUseProof; //=true if PROOF is to be used (def=0)
78     Bool_t fHierachy; //=true if module hierachy to be stored (def=1)
79 loizides 1.1 EState fState; //status of analysis
80     Int_t fNFriends; //number of friend trees
81     TList *fList; //list of lists of path names
82     TList *fOutput; //output as obtained from TAM (not owned)
83     TList *fPackages; //list of package names for PROOF upload
84     TList *fLoaders; //list of loaders
85     TAModule *fSuperMod; //top level TAM module (not owned)
86     TAMSelector *fSelector; //selector for non-PROOF usage
87     TChain *fChain; //trees or friend trees for non-PROOF usage
88     TDSet *fSet; //set of trees or friend trees for PROOF usage
89     TList *fDeleteList; //list of objects to be deleted on Terminate()
90     TString fTreeName; //name of trees or friend trees
91     TString fAnaOutput; //path name of output file
92     TString fMaster; //hostname of PROOF master
93     TString fConfig; //config file name for PROOF
94 loizides 1.3 Int_t fCompLevel; //compression level for output file (def=2)
95 loizides 1.1 TProof *fProof; //pointer to the PROOF session
96    
97     void AddFile(const char *pname, Int_t eventlist);
98     void AddFile(const TObject *oname, Int_t eventlist);
99     void AddList(TList *list, Int_t eventlist);
100     Bool_t IsValidName(const char */*name*/) { return kTRUE; }
101     Bool_t InitProof();
102     Bool_t UploadPackages(TList *packages);
103    
104     ClassDef(Analysis,0) // Top-level analysis class
105     };
106    
107     } /*namespace mithep*/
108    
109     #endif /*HIROOT_Analysis*/