Revision: | 1.14 |
Committed: | Tue Aug 11 15:24:39 2009 UTC (15 years, 8 months ago) by loizides |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, HEAD |
Branch point for: | Mit_025c_branch |
Changes since 1.13: | +23 -15 lines |
Log Message: | Support different HLT menus |
# | Content |
---|---|
1 | //-------------------------------------------------------------------------------------------------- |
2 | // $Id: Selector.h,v 1.13 2009/06/15 15:00:17 loizides Exp $ |
3 | // |
4 | // 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 | // Modules can ask the selector to provide the run information. |
7 | // |
8 | // Authors: C.Loizides |
9 | //-------------------------------------------------------------------------------------------------- |
10 | |
11 | #ifndef MITANA_TREEMOD_SELECTOR_H |
12 | #define MITANA_TREEMOD_SELECTOR_H |
13 | |
14 | #include "MitAna/TAM/interface/TAModule.h" |
15 | #include "MitAna/TAM/interface/TAMSelector.h" |
16 | #include "MitAna/DataTree/interface/EventHeader.h" |
17 | #include "MitAna/DataTree/interface/LAHeader.h" |
18 | #include "MitAna/DataTree/interface/RunInfo.h" |
19 | |
20 | namespace mithep { |
21 | class OutputMod; |
22 | |
23 | class Selector : public TAMSelector |
24 | { |
25 | public: |
26 | Selector(); |
27 | ~Selector(); |
28 | |
29 | 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 | Bool_t ValidRunInfo() const; |
41 | Bool_t ValidRunNum() const { return fCurRunNum!=UInt_t(-1); } |
42 | void SetAllEvtHdrBrn(const char *n) { fAllEvtHdrBrn = n; } |
43 | void SetAllEvtTreeName(const char *n) { fAllEvtTreeName = n; } |
44 | void SetDoRunInfo(Bool_t b) { fDoRunInfo = b; } |
45 | void SetEvtHdrName(const char *n) { fEvtHdrName = n; } |
46 | void SetLAHdrName(const char *n) { fLAHdrName = n; } |
47 | void SetLATreeName(const char *n) { fLATreeName = n; } |
48 | void SetRunInfoName(const char *n) { fRunInfoName = n; } |
49 | void SetRunTreeName(const char *n) { fRunTreeName = n; } |
50 | |
51 | protected: |
52 | Bool_t BeginRun(); |
53 | Bool_t ConsistentRunNum() const; |
54 | Bool_t EndRun(); |
55 | Bool_t Notify(); |
56 | Bool_t Process(Long64_t entry); |
57 | void SlaveBegin(TTree* tree); |
58 | void UpdateRunInfo(); |
59 | void UpdateRunInfoTree(); |
60 | |
61 | Bool_t fDoRunInfo; //=true then get RunInfo (def=1) |
62 | TString fEvtHdrName; //name of event header branch |
63 | TString fRunTreeName; //name of run info tree |
64 | TString fRunInfoName; //name of run info branch |
65 | TString fAllEvtHdrBrn; //name of all-event header branch |
66 | TString fLATreeName; //name of look-ahead tree |
67 | TString fLAHdrName; //name of look-ahead event header branch |
68 | TString fAllEvtTreeName; //name of all-event tree |
69 | TTree *fRunTree; //!run info tree in current file |
70 | EventHeader *fEventHeader; //!event header for current event |
71 | RunInfo *fRunInfo; //!run information for current run |
72 | TTree *fLATree; //!look-ahead tree in current file |
73 | LAHeader *fLAHeader; //!event header for next event |
74 | UInt_t fCurRunNum; //!current run number |
75 | TList fOutputMods; //!pointer(s) to output modules |
76 | TObjArray fTrash; //!pointers to trashed objects |
77 | |
78 | private: |
79 | void SearchOutputMods(const TAModule *mod); |
80 | |
81 | friend class OutputMod; |
82 | |
83 | ClassDef(Selector, 1) // Customized selector class |
84 | }; |
85 | } |
86 | |
87 | //-------------------------------------------------------------------------------------------------- |
88 | inline Bool_t mithep::Selector::ConsistentRunNum() const |
89 | { |
90 | return (ValidRunNum() && fCurRunNum==fEventHeader->RunNum()); |
91 | } |
92 | |
93 | //-------------------------------------------------------------------------------------------------- |
94 | inline Bool_t mithep::Selector::ValidRunInfo() const |
95 | { |
96 | return (fRunInfo && fCurRunNum==fRunInfo->RunNum()); |
97 | } |
98 | #endif |