ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Analysis.h
Revision: 1.11
Committed: Sun Sep 28 02:36:23 2008 UTC (16 years, 7 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_004
Changes since 1.10: +3 -1 lines
Log Message:
Use HLTFwkMod

File Contents

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