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

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.6 // $Id: Selector.h,v 1.5 2008/09/10 03:33:28 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.3 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 loizides 1.2
32     protected:
33 loizides 1.6 Bool_t BeginRun();
34 loizides 1.3 Bool_t ConsistentRunNum() const;
35 loizides 1.6 Bool_t EndRun();
36     Bool_t Notify();
37     void SlaveBegin(TTree* tree);
38 loizides 1.3 void UpdateRunInfo();
39     void UpdateRunInfoTree();
40    
41     Bool_t fDoRunInfo; //=true then get RunInfo (def=1)
42 loizides 1.6 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 loizides 1.2
54 loizides 1.1 ClassDef(Selector,1)
55     };
56 loizides 1.4 }
57 loizides 1.2
58     //--------------------------------------------------------------------------------------------------
59 loizides 1.4 inline Bool_t mithep::Selector::ConsistentRunNum() const
60     {
61     return (ValidRunNum() && fCurRunNum==fEventHeader->RunNum());
62     }
63 loizides 1.2
64     //--------------------------------------------------------------------------------------------------
65 loizides 1.4 inline Bool_t mithep::Selector::ValidRunInfo() const
66     {
67     return (fRunInfo && fCurRunNum==fRunInfo->RunNum());
68 loizides 1.1 }
69     #endif