ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Selector.h
Revision: 1.6
Committed: Sun Sep 28 02:37:30 2008 UTC (16 years, 7 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006, Mit_005, Mit_004
Changes since 1.5: +17 -12 lines
Log Message:
Cleanup related to names.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: Selector.h,v 1.5 2008/09/10 03:33:28 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 Selector : public TAMSelector
22 {
23 public:
24 Selector();
25 ~Selector();
26
27 const EventHeader *GetEventHeader() const { return fEventHeader; }
28 const RunInfo *GetRunInfo() const { return fRunInfo; }
29 Bool_t ValidRunInfo() const;
30 Bool_t ValidRunNum() const { return fCurRunNum!=UInt_t(-1); }
31
32 protected:
33 Bool_t BeginRun();
34 Bool_t ConsistentRunNum() const;
35 Bool_t EndRun();
36 Bool_t Notify();
37 void SlaveBegin(TTree* tree);
38 void UpdateRunInfo();
39 void UpdateRunInfoTree();
40
41 Bool_t fDoRunInfo; //=true then get RunInfo (def=1)
42 TString fEvtHdrName; //name of event header branch
43 TString fRunTreeName; //name of run info tree
44 TString fRunInfoName; //name of run info branch
45 TString fLATreeName; //name of look-ahead tree
46 TString fLAHdrName; //name of look-ahead event header branch
47 TTree *fRunTree; //!run info tree in current file
48 EventHeader *fEventHeader; //!event header for current event
49 RunInfo *fRunInfo; //!run information for current run
50 TTree *fLATree; //!look-ahead tree in current file
51 LAHeader *fLAHeader; //!event header for next event
52 UInt_t fCurRunNum; //!current run number
53
54 ClassDef(Selector,1)
55 };
56 }
57
58 //--------------------------------------------------------------------------------------------------
59 inline Bool_t mithep::Selector::ConsistentRunNum() const
60 {
61 return (ValidRunNum() && fCurRunNum==fEventHeader->RunNum());
62 }
63
64 //--------------------------------------------------------------------------------------------------
65 inline Bool_t mithep::Selector::ValidRunInfo() const
66 {
67 return (fRunInfo && fCurRunNum==fRunInfo->RunNum());
68 }
69 #endif