ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/Selector.h
Revision: 1.2
Committed: Tue Jun 24 14:08:39 2008 UTC (16 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.1: +39 -11 lines
Log Message:
Deal with run info information

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.2 // $Id: Selector.h,v 1.1 2008/06/23 10:54:03 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     // Modules can ask the selector to provide the run information. (This needs to be implemented.)
7 loizides 1.1 //
8     // Authors: C.Loizides
9     //--------------------------------------------------------------------------------------------------
10    
11     #ifndef TREEMOD_SELECTOR_H
12     #define TREEMOD_SELECTOR_H
13    
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.2 Bool_t BeginRun();
28     Bool_t EndRun();
29     Bool_t Notify();
30     void SlaveBegin(TTree* tree);
31     Bool_t ValidRunInfo() const;
32     Bool_t ValidRunNum() const { return fCurRunNum!=UInt_t(-1); }
33    
34     protected:
35     Bool_t ConsistentRunNum() const;
36     void UpdateRunInfo();
37     void UpdateRunInfoTree();
38    
39     Bool_t fDoRunInfo; //=true then get RunInfo (def=1)
40     TTree *fRunTree; //run info tree in current file
41     EventHeader *fEventHeader; //event header for current event
42     RunInfo *fRunInfo; //run information for current run
43     TTree *fLATree; //look-ahead tree in current file
44     LAHeader *fLAHeader; //event header for next event
45     UInt_t fCurRunNum; //current run number
46    
47 loizides 1.1 ClassDef(Selector,1)
48     };
49 loizides 1.2
50     //--------------------------------------------------------------------------------------------------
51     inline Bool_t Selector::ConsistentRunNum() const
52     {
53     return (ValidRunNum() && fCurRunNum==fEventHeader->RunNum());
54     }
55    
56     //--------------------------------------------------------------------------------------------------
57     inline Bool_t Selector::ValidRunInfo() const
58     {
59     return (fRunInfo && fCurRunNum==fRunInfo->RunNum());
60     }
61 loizides 1.1 }
62     #endif