ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.8
Committed: Tue Jun 24 14:07:21 2008 UTC (16 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.7: +2 -3 lines
Log Message:
Cosmetics.

File Contents

# User Rev Content
1 loizides 1.2 //--------------------------------------------------------------------------------------------------
2 loizides 1.8 // $Id: Analysis.h,v 1.7 2008/06/18 19:08:14 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.2 //--------------------------------------------------------------------------------------------------
21 loizides 1.1
22 loizides 1.7 #ifndef DATAUTIL_ANALYSIS_H
23     #define DATAUTIL_ANALYSIS_H
24    
25     #include <TObject.h>
26     #include <TString.h>
27    
28     class TList;
29     class TChain;
30     class TDSet;
31     class TString;
32     class TAModule;
33     class TAMSelector;
34     class TAMVirtualLoader;
35     class TObjArray;
36     class TProof;
37    
38 loizides 1.1 namespace mithep
39     {
40     class Analysis : public TObject
41     {
42     public:
43 loizides 1.4 Analysis(Bool_t useproof=kFALSE);
44 loizides 1.1 ~Analysis();
45    
46     void AddLoader(TAMVirtualLoader *l);
47     Bool_t AddFile(const char *pname);
48 loizides 1.5 Bool_t AddFiles(const char *pname, Int_t nmax=-1);
49 loizides 1.1 void AddPackage(const char* name);
50     void AddPackages(TList *list);
51     const char *GetAnaOutputName() const { return fAnaOutput;}
52     const TList *GetOutput() const { return fOutput; }
53     Bool_t GetUseProof() const { return fUseProof; }
54     Bool_t Init();
55     Bool_t IsInit() const { return fState==kInit; }
56     Bool_t IsRun() const { return fState==kRun; }
57     Bool_t IsTerminated() const { return fState==kTerminate; }
58     void Run();
59 loizides 1.4 Bool_t Run(Bool_t browse);
60 loizides 1.6 void SetProcessNevents(Long64_t n) { fDoNEvents = n; }
61 loizides 1.1 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 loizides 1.5 void SetOutputName(const char *name) { fAnaOutput = name; }
66 loizides 1.1 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 loizides 1.6 Long64_t fDoNEvents; //number of events to process (def=TChain::kBigNumber)
98 loizides 1.1
99     void AddFile(const char *pname, Int_t eventlist);
100     void AddFile(const TObject *oname, Int_t eventlist);
101     void AddList(TList *list, Int_t eventlist);
102     Bool_t IsValidName(const char */*name*/) { return kTRUE; }
103     Bool_t InitProof();
104     Bool_t UploadPackages(TList *packages);
105    
106 loizides 1.8 ClassDef(Analysis,0) // Top-level analysis class
107 loizides 1.1 };
108 loizides 1.5 }
109     #endif