ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.9
Committed: Mon Jul 7 16:41:53 2008 UTC (16 years, 10 months ago) by paus
Content type: text/plain
Branch: MAIN
CVS Tags: MITHEP_2_0_x
Changes since 1.8: +9 -8 lines
Log Message:
Implement simple Ascii file driven catalog. Easily extensible, though.

File Contents

# User Rev Content
1 loizides 1.2 //--------------------------------------------------------------------------------------------------
2 paus 1.9 // $Id: Analysis.h,v 1.8 2008/06/24 14:07:21 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 loizides 1.3 // c) Add files using a catalogue (to be done)
14 loizides 1.1 //
15 loizides 1.3 // See $CMSSW_BASE/src/MitAna/macros/examples/runSimpleExample.C
16     // for an example of how to use this class.
17 loizides 1.1 //
18 loizides 1.3 // Authors: C.Loizides
19 loizides 1.2 //--------------------------------------------------------------------------------------------------
20 loizides 1.1
21 loizides 1.7 #ifndef DATAUTIL_ANALYSIS_H
22     #define DATAUTIL_ANALYSIS_H
23    
24     #include <TObject.h>
25     #include <TString.h>
26    
27     class TList;
28     class TChain;
29     class TDSet;
30     class TString;
31     class TAModule;
32     class TAMSelector;
33     class TAMVirtualLoader;
34     class TObjArray;
35     class TProof;
36    
37 loizides 1.1 namespace mithep
38     {
39 paus 1.9 class Dataset;
40 loizides 1.1 class Analysis : public TObject
41     {
42     public:
43 loizides 1.4 Analysis(Bool_t useproof=kFALSE);
44 loizides 1.1 ~Analysis();
45    
46 paus 1.9 Bool_t AddDataset(const Dataset *dataset);
47 loizides 1.1 Bool_t AddFile(const char *pname);
48 loizides 1.5 Bool_t AddFiles(const char *pname, Int_t nmax=-1);
49 paus 1.9 void AddLoader(TAMVirtualLoader *l);
50     void AddPackage(const char *name);
51 loizides 1.1 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 paus 1.9 Long64_t fDoNEvents; //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 loizides 1.8 ClassDef(Analysis,0) // Top-level analysis class
108 loizides 1.1 };
109 loizides 1.5 }
110     #endif