ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/EventHeader.h
Revision: 1.16
Committed: Mon Jul 6 13:37:39 2009 UTC (15 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.15: +37 -23 lines
Log Message:
Added timestamp, bx, orbitnumber, etc.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.16 // $Id: EventHeader.h,v 1.15 2009/03/19 16:10:46 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.16 EventHeader();
25     EventHeader(UInt_t run, UInt_t evt, UInt_t lumi);
26    
27     Int_t BunchCrossing() const { return fBunchCrossing; }
28     Int_t ExpType() const { return fExpType; }
29     UInt_t EvtNum() const { return fEvtNum; }
30     Bool_t IsMC() const { return fIsMC; }
31     UInt_t LumiSec() const { return fLumiSec; }
32     EObjType ObjType() const { return kEventHeader; }
33     Int_t OrbitNumber() const { return fOrbitNumber; }
34     Int_t RunEntry() const { return fRunEntry; }
35     UInt_t RunNum() const { return fRunNum; }
36     UChar_t Skimmed() const { return fSkimmed; }
37     Int_t StoreNumber() const { return fStoreNumber; }
38     ULong64_t TimeStamp() const { return fTimeStamp; }
39     Double_t Weight() const { return fWeight; }
40     void SetBunchCrossing(Int_t b) { fBunchCrossing = b; }
41     void SetEvtNum(UInt_t i) { fEvtNum = i; }
42     void SetExpType(Int_t e) { fExpType = e; }
43     void SetIsMC(Bool_t b) { fIsMC = b; }
44     void SetLumiSec(UInt_t i) { fLumiSec = i; }
45     void SetOrbitNumber(Int_t o) { fOrbitNumber = o; }
46     void SetRunEntry(Int_t i) { fRunEntry = i; }
47     void SetRunNum(UInt_t i) { fRunNum = i; }
48     void SetSkimmed(UChar_t s) { fSkimmed = s; }
49     void SetStoreNumber(Int_t s) { fStoreNumber = s; }
50     void SetTimeStamp(ULong64_t t) { fTimeStamp = t; }
51     void SetWeight(Double_t w) { fWeight = w; }
52    
53 loizides 1.14 Bool_t operator!=(const EventHeader &other) const;
54     Bool_t operator==(const EventHeader &other) const;
55    
56 loizides 1.1 protected:
57 loizides 1.16
58     ULong64_t fTimeStamp; //time stamp of event (h32 -> sec, l32 -> musec)
59     Int_t fBunchCrossing; //bunch crossing
60     Int_t fOrbitNumber; //orbit number
61     Int_t fStoreNumber; //store number
62 loizides 1.6 UInt_t fRunNum; //run number
63     UInt_t fEvtNum; //event number
64     UInt_t fLumiSec; //luminosity block number
65     Int_t fRunEntry; //entry for run block
66 loizides 1.14 Double32_t fWeight; //event weight
67 loizides 1.16 UChar_t fExpType; //experiment type (as assigned in EventAuxiliary)
68 loizides 1.13 UChar_t fSkimmed; //level of skimming (0 == non-skimmed)
69 loizides 1.14 Bool_t fIsMC; //==true for MC data
70 loizides 1.9
71 loizides 1.16 ClassDef(EventHeader, 2) // Event header class
72 loizides 1.1 };
73     }
74 loizides 1.14
75     //--------------------------------------------------------------------------------------------------
76     inline Bool_t mithep::EventHeader::operator!=(const mithep::EventHeader &other) const
77     {
78     // Unequal operator.
79    
80     if (fEvtNum != other.EvtNum())
81     return kTRUE;
82     if (fLumiSec != other.LumiSec())
83     return kTRUE;
84     if (fRunNum != other.RunNum())
85     return kTRUE;
86     if(fIsMC != other.IsMC())
87     return kTRUE;
88    
89     return kFALSE;
90     }
91    
92     //--------------------------------------------------------------------------------------------------
93     inline Bool_t mithep::EventHeader::operator==(const mithep::EventHeader &other) const
94     {
95     // Equal operator.
96    
97     if (fEvtNum != other.EvtNum())
98     return kFALSE;
99     if (fLumiSec != other.LumiSec())
100     return kFALSE;
101     if (fRunNum != other.RunNum())
102     return kFALSE;
103     if(fIsMC != other.IsMC())
104     return kFALSE;
105    
106     return kTRUE;
107     }
108 loizides 1.1 #endif