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, float energy, float time, float timeError, uint32_t flagBits=0)
 
 FTLRecHit (const DetId &id, uint8_t row, uint8_t column, float energy, float time, float timeError, uint32_t flagBits=0)
 
const DetIdid () const
 
bool isTimeErrorValid () const
 
bool isTimeValid () const
 
const MTDDetId mtdId () const
 
int row () const
 
void setEnergy (float energy)
 
void setFlag (int flag)
 set the flags (from Flags or ESFlags) More...
 
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_
 
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  : id_(DetId()),
13  energy_(-1.f),
14  time_(-1.f),
15  timeError_(-1.f),
16  row_(0),
17  column_(0),

◆ FTLRecHit() [2/3]

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

Definition at line 20 of file FTLRecHit.cc.

21  : id_(id), energy_(energy), time_(time), timeError_(timeError), row_(0), column_(0), flagBits_(flagBits) {}

◆ FTLRecHit() [3/3]

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

Definition at line 23 of file FTLRecHit.cc.

Member Function Documentation

◆ checkFlag()

bool FTLRecHit::checkFlag ( int  flag) const
inline

check if the flag is true

Definition at line 71 of file FTLRecHit.h.

71 { return flagBits_ & (0x1 << flag); }

References RemoveAddSevLevel::flag, and flagBits_.

Referenced by checkFlags().

◆ checkFlags()

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

check if one of the flags in a set is true

Definition at line 44 of file FTLRecHit.cc.

44  {
45  for (std::vector<int>::const_iterator flagPtr = flagsvec.begin(); flagPtr != flagsvec.end();
46  ++flagPtr) { // check if one of the flags is up
47  if (checkFlag(*flagPtr))
48  return true;
49  }
50  return false;
51 }

References checkFlag().

◆ column()

int FTLRecHit::column ( ) const
inline

Definition at line 55 of file FTLRecHit.h.

55 { return column_; }

References column_.

◆ detid()

const DetId& FTLRecHit::detid ( ) const
inline

Definition at line 50 of file FTLRecHit.h.

50 { return id(); }

References id().

Referenced by operator<().

◆ energy()

float FTLRecHit::energy ( ) const
inline

get the id

Definition at line 46 of file FTLRecHit.h.

46 { return energy_; }

References energy_.

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

◆ id()

const DetId& FTLRecHit::id ( ) const
inline

Definition at line 49 of file FTLRecHit.h.

49 { return id_; }

References id_.

Referenced by detid().

◆ isTimeErrorValid()

bool FTLRecHit::isTimeErrorValid ( ) const

Definition at line 34 of file FTLRecHit.cc.

34  {
35  if (!isTimeValid())
36  return false;
37  if (timeError() >= timereso_max)
38  return false;
39 
40  return true;
41 }

References isTimeValid(), and timeError().

◆ isTimeValid()

bool FTLRecHit::isTimeValid ( ) const

Definition at line 27 of file FTLRecHit.cc.

27  {
28  if (timeError() < 0)
29  return false;
30  else
31  return true;
32 }

References timeError().

Referenced by isTimeErrorValid().

◆ mtdId()

const MTDDetId FTLRecHit::mtdId ( ) const
inline

Definition at line 52 of file FTLRecHit.h.

52 { return MTDDetId(id_); }

References id_.

◆ row()

int FTLRecHit::row ( ) const
inline

Definition at line 54 of file FTLRecHit.h.

54 { return row_; }

References row_.

◆ setEnergy()

void FTLRecHit::setEnergy ( float  energy)
inline

Definition at line 47 of file FTLRecHit.h.

47 { energy_ = energy; }

References energy(), and energy_.

◆ setFlag()

void FTLRecHit::setFlag ( int  flag)
inline

set the flags (from Flags or ESFlags)

Definition at line 67 of file FTLRecHit.h.

67 { flagBits_ |= (0x1 << flag); }

References RemoveAddSevLevel::flag, and flagBits_.

◆ setTime()

void FTLRecHit::setTime ( float  time)
inline

Definition at line 58 of file FTLRecHit.h.

58 { time_ = time; }

References time(), and time_.

◆ setTimeError()

void FTLRecHit::setTimeError ( float  err)
inline

Definition at line 64 of file FTLRecHit.h.

64 { timeError_ = err; }

References runTheMatrix::err, and timeError_.

◆ time()

float FTLRecHit::time ( ) const
inline

Definition at line 57 of file FTLRecHit.h.

57 { return time_; }

References time_.

Referenced by setTime().

◆ timeError()

float FTLRecHit::timeError ( ) const
inline

Definition at line 63 of file FTLRecHit.h.

63 { return timeError_; }

References timeError_.

Referenced by isTimeErrorValid(), and isTimeValid().

◆ unsetFlag()

void FTLRecHit::unsetFlag ( int  flag)
inline

Definition at line 68 of file FTLRecHit.h.

68 { flagBits_ &= ~(0x1 << flag); }

References RemoveAddSevLevel::flag, and flagBits_.

Member Data Documentation

◆ column_

uint8_t FTLRecHit::column_
private

Definition at line 79 of file FTLRecHit.h.

Referenced by column().

◆ energy_

float FTLRecHit::energy_
private

Definition at line 78 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 82 of file FTLRecHit.h.

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

◆ id_

DetId FTLRecHit::id_
private

Definition at line 77 of file FTLRecHit.h.

Referenced by id(), and mtdId().

◆ row_

uint8_t FTLRecHit::row_
private

Definition at line 79 of file FTLRecHit.h.

Referenced by row().

◆ time_

float FTLRecHit::time_
private

Definition at line 78 of file FTLRecHit.h.

Referenced by setTime(), and time().

◆ timeError_

float FTLRecHit::timeError_
private

Definition at line 78 of file FTLRecHit.h.

Referenced by setTimeError(), and timeError().

f
double f[11][100]
Definition: MuScleFitUtils.cc:78
FTLRecHit::column
int column() const
Definition: FTLRecHit.h:55
FTLRecHit::column_
uint8_t column_
Definition: FTLRecHit.h:79
FTLRecHit::time
float time() const
Definition: FTLRecHit.h:57
FTLRecHit::checkFlag
bool checkFlag(int flag) const
check if the flag is true
Definition: FTLRecHit.h:71
FTLRecHit::timeError
float timeError() const
Definition: FTLRecHit.h:63
FTLRecHit::row_
uint8_t row_
Definition: FTLRecHit.h:79
FTLRecHit::id
const DetId & id() const
Definition: FTLRecHit.h:49
DetId
Definition: DetId.h:17
FTLRecHit::energy
float energy() const
get the id
Definition: FTLRecHit.h:46
FTLRecHit::energy_
float energy_
Definition: FTLRecHit.h:78
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
runTheMatrix.err
err
Definition: runTheMatrix.py:288
FTLRecHit::timeError_
float timeError_
Definition: FTLRecHit.h:78
FTLRecHit::time_
float time_
Definition: FTLRecHit.h:78
FTLRecHit::kGood
Definition: FTLRecHit.h:21
FTLRecHit::id_
DetId id_
Definition: FTLRecHit.h:77
FTLRecHit::flagBits_
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:82
FTLRecHit::kUnknown
Definition: FTLRecHit.h:23
MTDDetId
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
FTLRecHit::isTimeValid
bool isTimeValid() const
Definition: FTLRecHit.cc:27
FTLRecHit::row
int row() const
Definition: FTLRecHit.h:54
FTLRecHit::kKilled
Definition: FTLRecHit.h:22
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116