CMS 3D CMS Logo

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

#include <FTLUncalibratedRecHit.h>

Public Types

enum  Flags { kGood =-1, kPoorReco, kSaturated, kOutOfTime }
 
typedef DetId key_type
 

Public Member Functions

float amplitude () const
 
bool checkFlag (Flags flag) const
 
 FTLUncalibratedRecHit ()
 
 FTLUncalibratedRecHit (const DetId &detId, float ampl, float time, float timeError, unsigned char flags=0)
 
DetId id () const
 
bool isSaturated () const
 
bool isTimeErrorValid () const
 
bool isTimeValid () const
 
void setAmplitude (float amplitude)
 
void setFlagBit (Flags flag)
 
void setId (DetId id)
 
void setTime (float time)
 
void setTimeError (float timeErr)
 
float time () const
 
float timeError () const
 
 ~FTLUncalibratedRecHit ()
 

Private Attributes

float amplitude_
 
unsigned char flags_
 
DetId id_
 
float time_
 
float timeError_
 

Detailed Description

Definition at line 7 of file FTLUncalibratedRecHit.h.

Member Typedef Documentation

Definition at line 11 of file FTLUncalibratedRecHit.h.

Member Enumeration Documentation

Enumerator
kGood 
kPoorReco 
kSaturated 
kOutOfTime 

Definition at line 13 of file FTLUncalibratedRecHit.h.

13  {
14  kGood=-1, // channel is good (mutually exclusive with other states) setFlagBit(kGood) reset flags_ to zero
15  kPoorReco, // channel has been badly reconstructed (e.g. bad shape, bad chi2 etc.)
16  kSaturated, // saturated channel
17  kOutOfTime // channel out of time
18  };

Constructor & Destructor Documentation

FTLUncalibratedRecHit::FTLUncalibratedRecHit ( )
FTLUncalibratedRecHit::FTLUncalibratedRecHit ( const DetId detId,
float  ampl,
float  time,
float  timeError,
unsigned char  flags = 0 
)
FTLUncalibratedRecHit::~FTLUncalibratedRecHit ( )

Definition at line 11 of file FTLUncalibratedRecHit.cc.

11  {
12 }

Member Function Documentation

float FTLUncalibratedRecHit::amplitude ( ) const
inline

Definition at line 24 of file FTLUncalibratedRecHit.h.

References amplitude_.

Referenced by FTLSimpleRecHitAlgo::makeRecHit(), and setAmplitude().

24 { return amplitude_; }
bool FTLUncalibratedRecHit::checkFlag ( FTLUncalibratedRecHit::Flags  flag) const

Definition at line 46 of file FTLUncalibratedRecHit.cc.

References RemoveAddSevLevel::flag, flags_, and kGood.

Referenced by isSaturated(), and setId().

46  {
47  if(flag == kGood){ if ( ! flags_ ) return true;else return false;} // if all flags are unset, then hit is good
48  return flags_ & ( 0x1<<flag);
49 }
DetId FTLUncalibratedRecHit::id ( ) const
inline

Definition at line 29 of file FTLUncalibratedRecHit.h.

References id_.

Referenced by FTLSimpleRecHitAlgo::makeRecHit(), and setId().

29 { return id_; }
bool FTLUncalibratedRecHit::isSaturated ( ) const

Definition at line 14 of file FTLUncalibratedRecHit.cc.

References checkFlag(), and kSaturated.

Referenced by setId().

bool FTLUncalibratedRecHit::isTimeErrorValid ( ) const

Definition at line 25 of file FTLUncalibratedRecHit.cc.

References isTimeValid(), and timeError().

Referenced by setId().

25  {
26  if(!isTimeValid())
27  return false;
28  if(timeError() >= 10000)
29  return false;
30 
31  return true;
32 }
bool FTLUncalibratedRecHit::isTimeValid ( ) const

Definition at line 18 of file FTLUncalibratedRecHit.cc.

References timeError().

Referenced by isTimeErrorValid(), and setId().

18  {
19  if(timeError() < 0)
20  return false;
21  else
22  return true;
23 }
void FTLUncalibratedRecHit::setAmplitude ( float  amplitude)
inline

Definition at line 31 of file FTLUncalibratedRecHit.h.

References amplitude(), and amplitude_.

void FTLUncalibratedRecHit::setFlagBit ( FTLUncalibratedRecHit::Flags  flag)

Definition at line 34 of file FTLUncalibratedRecHit.cc.

References RemoveAddSevLevel::flag, flags_, and kGood.

Referenced by setId().

34  {
35 
36  if (flag == kGood) {
37  //then set all bits to zero;
38  flags_ = 0;
39  return;
40  }
41  // else set the flagbit
42  flags_|= 0x1 << flag;
43 }
void FTLUncalibratedRecHit::setId ( DetId  id)
inline
void FTLUncalibratedRecHit::setTime ( float  time)
inline

Definition at line 32 of file FTLUncalibratedRecHit.h.

References time(), and time_.

void FTLUncalibratedRecHit::setTimeError ( float  timeErr)
inline

Definition at line 34 of file FTLUncalibratedRecHit.h.

References timeError_.

34 { timeError_ = timeErr; }
float FTLUncalibratedRecHit::time ( ) const
inline

Definition at line 25 of file FTLUncalibratedRecHit.h.

References time_.

Referenced by FTLSimpleRecHitAlgo::makeRecHit(), and setTime().

25 { return time_; }
float FTLUncalibratedRecHit::timeError ( ) const
inline

Definition at line 27 of file FTLUncalibratedRecHit.h.

References timeError_.

Referenced by isTimeErrorValid(), isTimeValid(), and FTLSimpleRecHitAlgo::makeRecHit().

Member Data Documentation

float FTLUncalibratedRecHit::amplitude_
private

Definition at line 45 of file FTLUncalibratedRecHit.h.

Referenced by amplitude(), and setAmplitude().

unsigned char FTLUncalibratedRecHit::flags_
private

Definition at line 49 of file FTLUncalibratedRecHit.h.

Referenced by checkFlag(), and setFlagBit().

DetId FTLUncalibratedRecHit::id_
private

Definition at line 48 of file FTLUncalibratedRecHit.h.

Referenced by id(), and setId().

float FTLUncalibratedRecHit::time_
private

Definition at line 46 of file FTLUncalibratedRecHit.h.

Referenced by setTime(), and time().

float FTLUncalibratedRecHit::timeError_
private

Definition at line 47 of file FTLUncalibratedRecHit.h.

Referenced by setTimeError(), and timeError().