ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Selector.h
Revision: 1.13
Committed: Mon Jun 15 15:00:17 2009 UTC (15 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_010, Mit_009c, Mit_009b
Changes since 1.12: +1 -2 lines
Log Message:
Added proper fwd defs plus split up complilation of MitAna/DataTree LinkDefs.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.13 // $Id: Selector.h,v 1.12 2009/06/11 08:59:32 loizides Exp $
3 loizides 1.1 //
4 loizides 1.2 // Our selector class for modular processing of a tree (or chain). In addition to the generic
5     // TAMSelector it determines the begin and end of a run and does the necessary bookkeeping.
6 loizides 1.6 // Modules can ask the selector to provide the run information.
7 loizides 1.1 //
8     // Authors: C.Loizides
9     //--------------------------------------------------------------------------------------------------
10    
11 loizides 1.5 #ifndef MITANA_TREEMOD_SELECTOR_H
12     #define MITANA_TREEMOD_SELECTOR_H
13 loizides 1.1
14     #include "MitAna/TAM/interface/TAModule.h"
15     #include "MitAna/TAM/interface/TAMSelector.h"
16 loizides 1.2 #include "MitAna/DataTree/interface/EventHeader.h"
17     #include "MitAna/DataTree/interface/LAHeader.h"
18     #include "MitAna/DataTree/interface/RunInfo.h"
19 loizides 1.1
20     namespace mithep {
21 loizides 1.8 class OutputMod;
22    
23 loizides 1.1 class Selector : public TAMSelector
24     {
25     public:
26     Selector();
27     ~Selector();
28 loizides 1.8
29 loizides 1.12 void AddToTrash(TObject *obj) { fTrash.AddLast(obj); }
30     const char *GetAllEvtTreeName() const { return fAllEvtTreeName; }
31     const char *GetAllEvtHdrBrn() const { return fAllEvtHdrBrn; }
32     const THashTable &GetBranchTable() const { return fBranchTable; }
33     const char *GetEvtHdrName() const { return fEvtHdrName; }
34     const EventHeader *GetEventHeader() const { return fEventHeader; }
35     const char *GetLATreeName() const { return fLATreeName; }
36     const char *GetLAHdrName() const { return fLAHdrName; }
37     const char *GetRunTreeName() const { return fRunTreeName; }
38     const char *GetRunInfoName() const { return fRunInfoName; }
39     const RunInfo *GetRunInfo() const { return fRunInfo; }
40 loizides 1.3 Bool_t ValidRunInfo() const;
41     Bool_t ValidRunNum() const { return fCurRunNum!=UInt_t(-1); }
42 loizides 1.2
43     protected:
44 loizides 1.6 Bool_t BeginRun();
45 loizides 1.3 Bool_t ConsistentRunNum() const;
46 loizides 1.6 Bool_t EndRun();
47     Bool_t Notify();
48 loizides 1.12 Bool_t Process(Long64_t entry);
49 loizides 1.6 void SlaveBegin(TTree* tree);
50 loizides 1.3 void UpdateRunInfo();
51     void UpdateRunInfoTree();
52    
53     Bool_t fDoRunInfo; //=true then get RunInfo (def=1)
54 loizides 1.6 TString fEvtHdrName; //name of event header branch
55     TString fRunTreeName; //name of run info tree
56     TString fRunInfoName; //name of run info branch
57 loizides 1.8 TString fAllEvtHdrBrn; //name of all-event header branch
58 loizides 1.6 TString fLATreeName; //name of look-ahead tree
59     TString fLAHdrName; //name of look-ahead event header branch
60 loizides 1.8 TString fAllEvtTreeName; //name of all-event tree
61 loizides 1.6 TTree *fRunTree; //!run info tree in current file
62     EventHeader *fEventHeader; //!event header for current event
63     RunInfo *fRunInfo; //!run information for current run
64     TTree *fLATree; //!look-ahead tree in current file
65     LAHeader *fLAHeader; //!event header for next event
66     UInt_t fCurRunNum; //!current run number
67 loizides 1.12 TList fOutputMods; //!pointer(s) to output modules
68     TObjArray fTrash; //!pointers to trashed objects
69    
70 loizides 1.9 private:
71     void SearchOutputMods(const TAModule *mod);
72 loizides 1.8
73     friend class OutputMod;
74 loizides 1.2
75 loizides 1.10 ClassDef(Selector, 1) // Customized selector class
76 loizides 1.1 };
77 loizides 1.4 }
78 loizides 1.2
79     //--------------------------------------------------------------------------------------------------
80 loizides 1.4 inline Bool_t mithep::Selector::ConsistentRunNum() const
81     {
82     return (ValidRunNum() && fCurRunNum==fEventHeader->RunNum());
83     }
84 loizides 1.2
85     //--------------------------------------------------------------------------------------------------
86 loizides 1.4 inline Bool_t mithep::Selector::ValidRunInfo() const
87     {
88     return (fRunInfo && fCurRunNum==fRunInfo->RunNum());
89 loizides 1.1 }
90     #endif