CMS 3D CMS Logo

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

#include <FTLRecHit.h>

Public Types

enum  Flags { kGood = 0, kKilled, kUnknown }
 
typedef DetId key_type
 

Public Member Functions

bool checkFlag (int flag) const
 check if the flag is true More...
 
bool checkFlags (const std::vector< int > &flagsvec) const
 check if one of the flags in a set is true More...
 
int column () const
 
const DetIddetid () const
 
float energy () const
 get the id More...
 
 FTLRecHit ()
 
 FTLRecHit (const DetId &id, uint8_t row, uint8_t column, float energy, float time, float timeError, float position, float positionError, uint32_t flagBits=0)
 
 FTLRecHit (const DetId &id, float energy, float time, float timeError, float position, float positionError, uint32_t flagBits=0)
 
const DetIdid () const
 
bool isTimeErrorValid () const
 
bool isTimeValid () const
 
const MTDDetId mtdId () const
 
float position () const
 
float positionError () const
 
int row () const
 
void setEnergy (float energy)
 
void setFlag (int flag)
 set the flags (from Flags or ESFlags) More...
 
void setPosition (float position)
 
void setPositionError (float poserr)
 
void setTime (float time)
 
void setTimeError (float err)
 
float time () const
 
float timeError () const
 
void unsetFlag (int flag)
 

Private Attributes

uint8_t column_
 
float energy_
 
unsigned char flagBits_
 store rechit condition (see Flags enum) in a bit-wise way More...
 
DetId id_
 
float position_
 position is the distance from the center of the bar to hit More...
 
float positionError_
 
uint8_t row_
 
float time_
 
float timeError_
 

Detailed Description

based on EcalRecHit

Author
Lindsey Gray

Definition at line 15 of file FTLRecHit.h.

Member Typedef Documentation

◆ key_type

Definition at line 17 of file FTLRecHit.h.

Member Enumeration Documentation

◆ Flags

Enumerator
kGood 
kKilled 
kUnknown 

Definition at line 20 of file FTLRecHit.h.

20  {
21  kGood = 0, // channel ok, the energy and time measurement are reliable
22  kKilled, // MC only flag: the channel is killed in the real detector
23  kUnknown // to ease the interface with functions returning flags.
24  };

Constructor & Destructor Documentation

◆ FTLRecHit() [1/3]

FTLRecHit::FTLRecHit ( )

bit structure of CaloRecHit::flags_ used in FTLRecHit:

| 32 | 31...25 | 24...12 | 11...5 | 4...1 | | | | | | | | | | +–> reco flags ( 4 bits) | | | +–> chi2 for in time events ( 7 bits) | | +–> energy for out-of-time events (13 bits) | +–> chi2 for out-of-time events ( 7 bits) +–> spare ( 1 bit )

Definition at line 11 of file FTLRecHit.cc.

12  : FTLRecHit(DetId(), 0, 0, -1.f, -1.f, -1.f, -1.f, -1.f, std::numeric_limits<unsigned char>::max()) {}
double f[11][100]
Definition: DetId.h:17

◆ FTLRecHit() [2/3]

FTLRecHit::FTLRecHit ( const DetId id,
uint8_t  row,
uint8_t  column,
float  energy,
float  time,
float  timeError,
float  position,
float  positionError,
uint32_t  flagBits = 0 
)

Definition at line 14 of file FTLRecHit.cc.

23  : id_(id),
24  energy_(energy),
25  time_(time),
29  row_(row),
30  column_(column),
31  flagBits_(flagBits) {}
float positionError_
Definition: FTLRecHit.h:102
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:107
uint8_t column_
Definition: FTLRecHit.h:104
float time_
Definition: FTLRecHit.h:98
float positionError() const
Definition: FTLRecHit.h:82
float timeError() const
Definition: FTLRecHit.h:79
int column() const
Definition: FTLRecHit.h:68
float timeError_
Definition: FTLRecHit.h:99
float energy_
Definition: FTLRecHit.h:97
float time() const
Definition: FTLRecHit.h:70
DetId id_
Definition: FTLRecHit.h:96
int row() const
Definition: FTLRecHit.h:67
uint8_t row_
Definition: FTLRecHit.h:103
float energy() const
get the id
Definition: FTLRecHit.h:59
float position() const
Definition: FTLRecHit.h:73
float position_
position is the distance from the center of the bar to hit
Definition: FTLRecHit.h:101

◆ FTLRecHit() [3/3]

FTLRecHit::FTLRecHit ( const DetId id,
float  energy,
float  time,
float  timeError,
float  position,
float  positionError,
uint32_t  flagBits = 0 
)

Definition at line 33 of file FTLRecHit.cc.

35  : FTLRecHit(id, 0, 0, energy, time, timeError, position, positionError, flagBits) {}
float positionError() const
Definition: FTLRecHit.h:82
float timeError() const
Definition: FTLRecHit.h:79
float time() const
Definition: FTLRecHit.h:70
float energy() const
get the id
Definition: FTLRecHit.h:59
float position() const
Definition: FTLRecHit.h:73

Member Function Documentation

◆ checkFlag()

bool FTLRecHit::checkFlag ( int  flag) const
inline

check if the flag is true

Definition at line 90 of file FTLRecHit.h.

References RemoveAddSevLevel::flag, and flagBits_.

Referenced by checkFlags().

90 { return flagBits_ & (0x1 << flag); }
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:107

◆ checkFlags()

bool FTLRecHit::checkFlags ( const std::vector< int > &  flagsvec) const

check if one of the flags in a set is true

Definition at line 54 of file FTLRecHit.cc.

References checkFlag().

54  {
55  for (std::vector<int>::const_iterator flagPtr = flagsvec.begin(); flagPtr != flagsvec.end();
56  ++flagPtr) { // check if one of the flags is up
57  if (checkFlag(*flagPtr))
58  return true;
59  }
60  return false;
61 }
bool checkFlag(int flag) const
check if the flag is true
Definition: FTLRecHit.h:90

◆ column()

int FTLRecHit::column ( ) const
inline

Definition at line 68 of file FTLRecHit.h.

References column_.

68 { return column_; }
uint8_t column_
Definition: FTLRecHit.h:104

◆ detid()

const DetId& FTLRecHit::detid ( ) const
inline

Definition at line 63 of file FTLRecHit.h.

References id().

63 { return id(); }
const DetId & id() const
Definition: FTLRecHit.h:62

◆ energy()

float FTLRecHit::energy ( ) const
inline

get the id

Definition at line 59 of file FTLRecHit.h.

References energy_.

Referenced by Jet.Jet::rawEnergy(), and setEnergy().

59 { return energy_; }
float energy_
Definition: FTLRecHit.h:97

◆ id()

const DetId& FTLRecHit::id ( ) const
inline

Definition at line 62 of file FTLRecHit.h.

References id_.

Referenced by detid().

62 { return id_; }
DetId id_
Definition: FTLRecHit.h:96

◆ isTimeErrorValid()

bool FTLRecHit::isTimeErrorValid ( ) const

Definition at line 44 of file FTLRecHit.cc.

References isTimeValid(), and timeError().

44  {
45  if (!isTimeValid())
46  return false;
47  if (timeError() >= timereso_max)
48  return false;
49 
50  return true;
51 }
float timeError() const
Definition: FTLRecHit.h:79
bool isTimeValid() const
Definition: FTLRecHit.cc:37

◆ isTimeValid()

bool FTLRecHit::isTimeValid ( ) const

Definition at line 37 of file FTLRecHit.cc.

References timeError().

Referenced by isTimeErrorValid().

37  {
38  if (timeError() < 0)
39  return false;
40  else
41  return true;
42 }
float timeError() const
Definition: FTLRecHit.h:79

◆ mtdId()

const MTDDetId FTLRecHit::mtdId ( ) const
inline

Definition at line 65 of file FTLRecHit.h.

References id_.

65 { return MTDDetId(id_); }
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
DetId id_
Definition: FTLRecHit.h:96

◆ position()

float FTLRecHit::position ( ) const
inline

Definition at line 73 of file FTLRecHit.h.

References position_.

Referenced by setPosition().

73 { return position_; }
float position_
position is the distance from the center of the bar to hit
Definition: FTLRecHit.h:101

◆ positionError()

float FTLRecHit::positionError ( ) const
inline

Definition at line 82 of file FTLRecHit.h.

References positionError_.

82 { return positionError_; }
float positionError_
Definition: FTLRecHit.h:102

◆ row()

int FTLRecHit::row ( ) const
inline

Definition at line 67 of file FTLRecHit.h.

References row_.

67 { return row_; }
uint8_t row_
Definition: FTLRecHit.h:103

◆ setEnergy()

void FTLRecHit::setEnergy ( float  energy)
inline

Definition at line 60 of file FTLRecHit.h.

References energy(), and energy_.

60 { energy_ = energy; }
float energy_
Definition: FTLRecHit.h:97
float energy() const
get the id
Definition: FTLRecHit.h:59

◆ setFlag()

void FTLRecHit::setFlag ( int  flag)
inline

set the flags (from Flags or ESFlags)

Definition at line 86 of file FTLRecHit.h.

References RemoveAddSevLevel::flag, and flagBits_.

86 { flagBits_ |= (0x1 << flag); }
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:107

◆ setPosition()

void FTLRecHit::setPosition ( float  position)
inline

Definition at line 74 of file FTLRecHit.h.

References position(), and position_.

74 { position_ = position; }
float position() const
Definition: FTLRecHit.h:73
float position_
position is the distance from the center of the bar to hit
Definition: FTLRecHit.h:101

◆ setPositionError()

void FTLRecHit::setPositionError ( float  poserr)
inline

Definition at line 83 of file FTLRecHit.h.

References positionError_.

83 { positionError_ = poserr; }
float positionError_
Definition: FTLRecHit.h:102

◆ setTime()

void FTLRecHit::setTime ( float  time)
inline

Definition at line 71 of file FTLRecHit.h.

References time(), and time_.

71 { time_ = time; }
float time_
Definition: FTLRecHit.h:98
float time() const
Definition: FTLRecHit.h:70

◆ setTimeError()

void FTLRecHit::setTimeError ( float  err)
inline

Definition at line 80 of file FTLRecHit.h.

References submitPVResolutionJobs::err, and timeError_.

◆ time()

float FTLRecHit::time ( ) const
inline

Definition at line 70 of file FTLRecHit.h.

References time_.

Referenced by setTime().

70 { return time_; }
float time_
Definition: FTLRecHit.h:98

◆ timeError()

float FTLRecHit::timeError ( ) const
inline

Definition at line 79 of file FTLRecHit.h.

References timeError_.

Referenced by isTimeErrorValid(), and isTimeValid().

79 { return timeError_; }
float timeError_
Definition: FTLRecHit.h:99

◆ unsetFlag()

void FTLRecHit::unsetFlag ( int  flag)
inline

Definition at line 87 of file FTLRecHit.h.

References RemoveAddSevLevel::flag, and flagBits_.

87 { flagBits_ &= ~(0x1 << flag); }
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:107

Member Data Documentation

◆ column_

uint8_t FTLRecHit::column_
private

Definition at line 104 of file FTLRecHit.h.

Referenced by column().

◆ energy_

float FTLRecHit::energy_
private

Definition at line 97 of file FTLRecHit.h.

Referenced by energy(), and setEnergy().

◆ flagBits_

unsigned char FTLRecHit::flagBits_
private

store rechit condition (see Flags enum) in a bit-wise way

Definition at line 107 of file FTLRecHit.h.

Referenced by checkFlag(), setFlag(), and unsetFlag().

◆ id_

DetId FTLRecHit::id_
private

Definition at line 96 of file FTLRecHit.h.

Referenced by id(), and mtdId().

◆ position_

float FTLRecHit::position_
private

position is the distance from the center of the bar to hit

Definition at line 101 of file FTLRecHit.h.

Referenced by position(), and setPosition().

◆ positionError_

float FTLRecHit::positionError_
private

Definition at line 102 of file FTLRecHit.h.

Referenced by positionError(), and setPositionError().

◆ row_

uint8_t FTLRecHit::row_
private

Definition at line 103 of file FTLRecHit.h.

Referenced by row().

◆ time_

float FTLRecHit::time_
private

Definition at line 98 of file FTLRecHit.h.

Referenced by setTime(), and time().

◆ timeError_

float FTLRecHit::timeError_
private

Definition at line 99 of file FTLRecHit.h.

Referenced by setTimeError(), and timeError().