ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Selector.h
Revision: 1.7
Committed: Mon Dec 1 17:40:01 2008 UTC (16 years, 5 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.6: +2 -1 lines
Log Message:
Return branchtable

File Contents

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