ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/EventHeader.h
Revision: 1.15
Committed: Thu Mar 19 16:10:46 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_009c, Mit_009b, Mit_009a, Mit_009, Mit_008
Changes since 1.14: +2 -2 lines
Log Message:
Cosmetics.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.15 // $Id: EventHeader.h,v 1.14 2009/03/15 11:16:36 loizides Exp $
3 loizides 1.1 //
4     // EventHeader
5     //
6 loizides 1.14 // Class to hold event specific information. If Skimmed() returns value > 0 then the event
7 loizides 1.9 // content has been removed from events tree, and only meta information for book keeping
8     // purposes have been kept. This is used in conjunction with skimming.
9 loizides 1.1 //
10     // Authors: C.Loizides
11     //--------------------------------------------------------------------------------------------------
12    
13 loizides 1.11 #ifndef MITANA_DATATREE_EVENTHEADER_H
14     #define MITANA_DATATREE_EVENTHEADER_H
15 loizides 1.2
16     #include "MitAna/DataTree/interface/Types.h"
17 loizides 1.8 #include "MitAna/DataTree/interface/DataBase.h"
18 loizides 1.2
19 loizides 1.1 namespace mithep
20     {
21 loizides 1.8 class EventHeader : public DataBase
22 loizides 1.1 {
23     public:
24 loizides 1.14 EventHeader() : fRunNum(0), fEvtNum(0), fLumiSec(0), fRunEntry(-1),
25     fWeight(1), fSkimmed(0), fIsMC(kTRUE) {}
26 loizides 1.5 EventHeader(UInt_t run, UInt_t evt, UInt_t lumi) :
27 loizides 1.14 fRunNum(run), fEvtNum(evt), fLumiSec(lumi), fRunEntry(-1),
28     fWeight(1), fSkimmed(0), fIsMC(kTRUE) {}
29 loizides 1.1
30 loizides 1.10 UInt_t EvtNum() const { return fEvtNum; }
31 loizides 1.15 Bool_t IsMC() const { return fIsMC; }
32 loizides 1.10 UInt_t LumiSec() const { return fLumiSec; }
33     EObjType ObjType() const { return kEventHeader; }
34     Int_t RunEntry() const { return fRunEntry; }
35     UInt_t RunNum() const { return fRunNum; }
36 loizides 1.14 UChar_t Skimmed() const { return fSkimmed; }
37     Double_t Weight() const { return fWeight; }
38 loizides 1.10 void SetEvtNum(UInt_t i) { fEvtNum=i; }
39 loizides 1.14 void SetIsMC(Bool_t b) { fIsMC=b; }
40 loizides 1.10 void SetLumiSec(UInt_t i) { fLumiSec=i; }
41     void SetRunEntry(Int_t i) { fRunEntry=i; }
42     void SetRunNum(UInt_t i) { fRunNum=i; }
43 loizides 1.14 void SetSkimmed(UChar_t s) { fSkimmed = s; }
44     void SetWeight(Double_t w) { fWeight=w; }
45     Bool_t operator!=(const EventHeader &other) const;
46     Bool_t operator==(const EventHeader &other) const;
47    
48 loizides 1.1 protected:
49 loizides 1.6 UInt_t fRunNum; //run number
50     UInt_t fEvtNum; //event number
51     UInt_t fLumiSec; //luminosity block number
52     Int_t fRunEntry; //entry for run block
53 loizides 1.14 Double32_t fWeight; //event weight
54 loizides 1.13 UChar_t fSkimmed; //level of skimming (0 == non-skimmed)
55 loizides 1.14 Bool_t fIsMC; //==true for MC data
56 loizides 1.9
57 loizides 1.12 ClassDef(EventHeader, 1) // Event header class
58 loizides 1.1 };
59     }
60 loizides 1.14
61     //--------------------------------------------------------------------------------------------------
62     inline Bool_t mithep::EventHeader::operator!=(const mithep::EventHeader &other) const
63     {
64     // Unequal operator.
65    
66     if (fEvtNum != other.EvtNum())
67     return kTRUE;
68     if (fLumiSec != other.LumiSec())
69     return kTRUE;
70     if (fRunNum != other.RunNum())
71     return kTRUE;
72     if(fIsMC != other.IsMC())
73     return kTRUE;
74    
75     return kFALSE;
76     }
77    
78     //--------------------------------------------------------------------------------------------------
79     inline Bool_t mithep::EventHeader::operator==(const mithep::EventHeader &other) const
80     {
81     // Equal operator.
82    
83     if (fEvtNum != other.EvtNum())
84     return kFALSE;
85     if (fLumiSec != other.LumiSec())
86     return kFALSE;
87     if (fRunNum != other.RunNum())
88     return kFALSE;
89     if(fIsMC != other.IsMC())
90     return kFALSE;
91    
92     return kTRUE;
93     }
94 loizides 1.1 #endif