CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
HOTriggerPrimitiveDigi Class Reference

#include <HOTriggerPrimitiveDigi.h>

Public Types

typedef HcalDetId key_type
 For the sorted collection. More...
 

Public Member Functions

int bits () const
 get the single-bit data More...
 
bool data (int whichbit=HO_TP_SAMPLES_MAX) const
 
 HOTriggerPrimitiveDigi ()
 
 HOTriggerPrimitiveDigi (int ieta, int iphi, int nsamples, int whichSampleTriggered, int databits)
 
 HOTriggerPrimitiveDigi (uint32_t data)
 
const HcalDetId id () const
 
int ieta () const
 get the signed ieta value More...
 
int ieta_abs () const
 get the absolute value of ieta More...
 
int ieta_sign () const
 get the sign of ieta (int: +/- 1) More...
 
int iphi () const
 get the iphi value More...
 
int nsamples () const
 get the number of samples used to compute the TP More...
 
uint32_t operator() ()
 for streaming More...
 
uint32_t raw () const
 get the raw (packed) Triger Primitive More...
 
int raw_ieta () const
 get the raw ieta value More...
 
int whichSampleTriggered () const
 get the number of the triggering sample More...
 

Static Public Attributes

static const int HO_TP_SAMPLES_MAX = 10
 

Private Attributes

uint32_t theHO_TP
 

Detailed Description

Definition at line 15 of file HOTriggerPrimitiveDigi.h.

Member Typedef Documentation

◆ key_type

For the sorted collection.

Definition at line 17 of file HOTriggerPrimitiveDigi.h.

Constructor & Destructor Documentation

◆ HOTriggerPrimitiveDigi() [1/3]

HOTriggerPrimitiveDigi::HOTriggerPrimitiveDigi ( )
inline

Definition at line 19 of file HOTriggerPrimitiveDigi.h.

19 { theHO_TP = 0; }

References theHO_TP.

◆ HOTriggerPrimitiveDigi() [2/3]

HOTriggerPrimitiveDigi::HOTriggerPrimitiveDigi ( uint32_t  data)
inline

Definition at line 20 of file HOTriggerPrimitiveDigi.h.

20 { theHO_TP = data; }

References data(), and theHO_TP.

◆ HOTriggerPrimitiveDigi() [3/3]

HOTriggerPrimitiveDigi::HOTriggerPrimitiveDigi ( int  ieta,
int  iphi,
int  nsamples,
int  whichSampleTriggered,
int  databits 
)

Definition at line 4 of file HOTriggerPrimitiveDigi.cc.

5  {
6  if ((nsamples < 0) || (nsamples > HO_TP_SAMPLES_MAX))
7  printf("HOTRiggerPrimitiveDigi: nsamples out of range.");
9  printf("HOTriggerPrimitiveDigi: specified Triggering Sample out of range");
10  if ((databits >> nsamples) != 0x0000)
11  printf("HOTRiggerPrimitiveDigi: Specified extra bits out of nsamples range.");
12  int samples = nsamples;
13  if (samples < 0)
14  samples = 0;
17 
18  theHO_TP = (abs(ieta) & 0xf) | ((ieta < 0) ? (0x10) : (0x00)) | ((iphi & 0x7F) << 5) | ((samples & 0xF) << 12) |
19  (((whichSampleTriggered)&0xF) << 16) | ((databits & 0x3FF) << 20);
20 }

References funct::abs(), HO_TP_SAMPLES_MAX, ieta(), iphi(), nsamples(), EgammaValidation_cff::samples, theHO_TP, and whichSampleTriggered().

Member Function Documentation

◆ bits()

int HOTriggerPrimitiveDigi::bits ( ) const
inline

get the single-bit data

Definition at line 42 of file HOTriggerPrimitiveDigi.h.

42 { return (theHO_TP >> 20) & 0x03FF; }

References theHO_TP.

◆ data()

bool HOTriggerPrimitiveDigi::data ( int  whichbit = HO_TP_SAMPLES_MAX) const

get one bit from the single-bit data. required to be called with a legal value.

Definition at line 23 of file HOTriggerPrimitiveDigi.cc.

23  {
24  if ((whichbit < 0) || (whichbit > nsamples())) {
25  printf("HOTPDigi: Sample bit requested out of range.");
26  return false;
27  }
28  return ((theHO_TP >> (20 + whichbit)) & 0x0001);
29 }

References nsamples(), and theHO_TP.

Referenced by HOTriggerPrimitiveDigi(), and operator<<().

◆ id()

const HcalDetId HOTriggerPrimitiveDigi::id ( ) const
inline

Definition at line 23 of file HOTriggerPrimitiveDigi.h.

23 { return HcalDetId(HcalOuter, ieta(), iphi(), 4); }

References HcalOuter, ieta(), and iphi().

◆ ieta()

int HOTriggerPrimitiveDigi::ieta ( ) const
inline

get the signed ieta value

Definition at line 34 of file HOTriggerPrimitiveDigi.h.

34 { return ieta_abs() * ieta_sign(); }

References ieta_abs(), and ieta_sign().

Referenced by HOTriggerPrimitiveDigi(), id(), and operator<<().

◆ ieta_abs()

int HOTriggerPrimitiveDigi::ieta_abs ( ) const
inline

get the absolute value of ieta

Definition at line 32 of file HOTriggerPrimitiveDigi.h.

32 { return (theHO_TP & 0x000F); }

References theHO_TP.

Referenced by ieta().

◆ ieta_sign()

int HOTriggerPrimitiveDigi::ieta_sign ( ) const
inline

get the sign of ieta (int: +/- 1)

Definition at line 30 of file HOTriggerPrimitiveDigi.h.

30 { return ((theHO_TP & 0x10) ? (-1) : (1)); }

References theHO_TP.

Referenced by ieta().

◆ iphi()

int HOTriggerPrimitiveDigi::iphi ( ) const
inline

get the iphi value

Definition at line 36 of file HOTriggerPrimitiveDigi.h.

36 { return (theHO_TP >> 5) & 0x007F; }

References theHO_TP.

Referenced by HOTriggerPrimitiveDigi(), id(), and operator<<().

◆ nsamples()

int HOTriggerPrimitiveDigi::nsamples ( ) const
inline

get the number of samples used to compute the TP

Definition at line 38 of file HOTriggerPrimitiveDigi.h.

38 { return (theHO_TP >> 12) & 0x000F; }

References theHO_TP.

Referenced by data(), HOTriggerPrimitiveDigi(), and operator<<().

◆ operator()()

uint32_t HOTriggerPrimitiveDigi::operator() ( )
inline

for streaming

Definition at line 51 of file HOTriggerPrimitiveDigi.h.

51 { return theHO_TP; }

References theHO_TP.

◆ raw()

uint32_t HOTriggerPrimitiveDigi::raw ( ) const
inline

get the raw (packed) Triger Primitive

Definition at line 26 of file HOTriggerPrimitiveDigi.h.

26 { return theHO_TP; }

References theHO_TP.

◆ raw_ieta()

int HOTriggerPrimitiveDigi::raw_ieta ( ) const
inline

get the raw ieta value

Definition at line 28 of file HOTriggerPrimitiveDigi.h.

28 { return theHO_TP & 0x1F; }

References theHO_TP.

◆ whichSampleTriggered()

int HOTriggerPrimitiveDigi::whichSampleTriggered ( ) const
inline

get the number of the triggering sample

Definition at line 40 of file HOTriggerPrimitiveDigi.h.

40 { return (theHO_TP >> 16) & 0x000F; }

References theHO_TP.

Referenced by HOTriggerPrimitiveDigi(), and operator<<().

Member Data Documentation

◆ HO_TP_SAMPLES_MAX

const int HOTriggerPrimitiveDigi::HO_TP_SAMPLES_MAX = 10
static

Definition at line 44 of file HOTriggerPrimitiveDigi.h.

Referenced by HOTriggerPrimitiveDigi().

◆ theHO_TP

uint32_t HOTriggerPrimitiveDigi::theHO_TP
private
HOTriggerPrimitiveDigi::theHO_TP
uint32_t theHO_TP
Definition: HOTriggerPrimitiveDigi.h:54
HOTriggerPrimitiveDigi::nsamples
int nsamples() const
get the number of samples used to compute the TP
Definition: HOTriggerPrimitiveDigi.h:38
EgammaValidation_cff.samples
samples
Definition: EgammaValidation_cff.py:19
HOTriggerPrimitiveDigi::ieta_sign
int ieta_sign() const
get the sign of ieta (int: +/- 1)
Definition: HOTriggerPrimitiveDigi.h:30
HcalOuter
Definition: HcalAssistant.h:35
HOTriggerPrimitiveDigi::ieta
int ieta() const
get the signed ieta value
Definition: HOTriggerPrimitiveDigi.h:34
HcalDetId
Definition: HcalDetId.h:12
HOTriggerPrimitiveDigi::ieta_abs
int ieta_abs() const
get the absolute value of ieta
Definition: HOTriggerPrimitiveDigi.h:32
HOTriggerPrimitiveDigi::whichSampleTriggered
int whichSampleTriggered() const
get the number of the triggering sample
Definition: HOTriggerPrimitiveDigi.h:40
HOTriggerPrimitiveDigi::HO_TP_SAMPLES_MAX
static const int HO_TP_SAMPLES_MAX
Definition: HOTriggerPrimitiveDigi.h:44
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HOTriggerPrimitiveDigi::iphi
int iphi() const
get the iphi value
Definition: HOTriggerPrimitiveDigi.h:36
HOTriggerPrimitiveDigi::data
bool data(int whichbit=HO_TP_SAMPLES_MAX) const
Definition: HOTriggerPrimitiveDigi.cc:23