CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Static Private Attributes
EncodedEventId Class Reference

#include <EncodedEventId.h>

Inheritance diagram for EncodedEventId:
EncodedTruthId

Public Member Functions

int bunchCrossing () const
 get the detector field from this detid More...
 
 EncodedEventId ()
 Create an empty or null id (also for persistence) More...
 
 EncodedEventId (uint32_t id)
 Create an id from a raw number. More...
 
 EncodedEventId (int bunchX, int event)
 Create an id, filling the bunch crossing and event infomrations. More...
 
int event () const
 get the contents of the subdetector field (should be protected?) More...
 
int operator!= (const EncodedEventId &id) const
 inequality More...
 
uint32_t operator() () const
 
int operator< (const EncodedEventId &id) const
 comparison More...
 
int operator== (const EncodedEventId &id) const
 equality More...
 
uint32_t rawId () const
 get the raw id More...
 

Protected Attributes

uint32_t id_
 

Static Private Attributes

static const unsigned int bunchNegMask_ = 0x80000000
 
static const unsigned int bunchXMask_ = 0x10
 
static const unsigned int bunchXStartBit_ = 16
 
static const unsigned int eventMask_ = 0x10
 
static const unsigned int eventStartBit_ = 0
 

Detailed Description

Definition at line 11 of file EncodedEventId.h.

Constructor & Destructor Documentation

◆ EncodedEventId() [1/3]

EncodedEventId::EncodedEventId ( )

Create an empty or null id (also for persistence)

Definition at line 3 of file EncodedEventId.cc.

3 : id_(0) {}

◆ EncodedEventId() [2/3]

EncodedEventId::EncodedEventId ( uint32_t  id)
explicit

Create an id from a raw number.

Definition at line 4 of file EncodedEventId.cc.

4 : id_(id) {}

◆ EncodedEventId() [3/3]

EncodedEventId::EncodedEventId ( int  bunchX,
int  event 
)
inline

Create an id, filling the bunch crossing and event infomrations.

Definition at line 18 of file EncodedEventId.h.

References funct::abs(), bunchNegMask_, bunchXStartBit_, event(), and id_.

18  {
19  id_ = std::abs(bunchX) << bunchXStartBit_ | event;
20  if (bunchX < 0)
21  id_ = id_ | bunchNegMask_;
22  }
int event() const
get the contents of the subdetector field (should be protected?)
static const unsigned int bunchXStartBit_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const unsigned int bunchNegMask_

Member Function Documentation

◆ bunchCrossing()

int EncodedEventId::bunchCrossing ( ) const
inline

◆ event()

int EncodedEventId::event ( ) const
inline

◆ operator!=()

int EncodedEventId::operator!= ( const EncodedEventId id) const
inline

inequality

Definition at line 37 of file EncodedEventId.h.

References id_.

37 { return id_ != id.id_; }

◆ operator()()

uint32_t EncodedEventId::operator() ( ) const
inline

Definition at line 31 of file EncodedEventId.h.

References id_.

31 { return id_; }

◆ operator<()

int EncodedEventId::operator< ( const EncodedEventId id) const
inline

comparison

Definition at line 39 of file EncodedEventId.h.

References id_.

39 { return id_ < id.id_; }

◆ operator==()

int EncodedEventId::operator== ( const EncodedEventId id) const
inline

equality

Definition at line 35 of file EncodedEventId.h.

References id_.

Referenced by EncodedTruthId::operator==().

35 { return id_ == id.id_; }

◆ rawId()

uint32_t EncodedEventId::rawId ( ) const
inline

Member Data Documentation

◆ bunchNegMask_

const unsigned int EncodedEventId::bunchNegMask_ = 0x80000000
staticprivate

Definition at line 45 of file EncodedEventId.h.

Referenced by bunchCrossing(), and EncodedEventId().

◆ bunchXMask_

const unsigned int EncodedEventId::bunchXMask_ = 0x10
staticprivate

Definition at line 44 of file EncodedEventId.h.

◆ bunchXStartBit_

const unsigned int EncodedEventId::bunchXStartBit_ = 16
staticprivate

Definition at line 42 of file EncodedEventId.h.

Referenced by bunchCrossing(), and EncodedEventId().

◆ eventMask_

const unsigned int EncodedEventId::eventMask_ = 0x10
staticprivate

Definition at line 46 of file EncodedEventId.h.

◆ eventStartBit_

const unsigned int EncodedEventId::eventStartBit_ = 0
staticprivate

Definition at line 43 of file EncodedEventId.h.

◆ id_

uint32_t EncodedEventId::id_
protected