ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.7
Committed: Wed Jun 18 19:08:14 2008 UTC (16 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.6: +17 -18 lines
Log Message:
Coding conventions.

File Contents

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