CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
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)
 
const DetIdid () const
 
bool isTimeErrorValid () const
 
bool isTimeValid () 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

float energy_
 
unsigned char flagBits_
 store rechit condition (see Flags enum) in a bit-wise way More...
 
DetId id_
 
float time_
 
float timeError_
 

Detailed Description

based on EcalRecHit

Author
Lindsey Gray

Definition at line 14 of file FTLRecHit.h.

Member Typedef Documentation

Definition at line 16 of file FTLRecHit.h.

Member Enumeration Documentation

Enumerator
kGood 
kKilled 
kUnknown 

Definition at line 19 of file FTLRecHit.h.

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

Constructor & Destructor Documentation

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 12 of file FTLRecHit.cc.

13 {}
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:73
float time_
Definition: FTLRecHit.h:70
double f[11][100]
float timeError_
Definition: FTLRecHit.h:70
float energy_
Definition: FTLRecHit.h:70
DetId id_
Definition: FTLRecHit.h:69
Definition: DetId.h:18
FTLRecHit::FTLRecHit ( const DetId id,
float  energy,
float  time,
float  timeError,
uint32_t  flagBits = 0 
)

Definition at line 15 of file FTLRecHit.cc.

15  :
17 {}
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:73
float timeError() const
Definition: FTLRecHit.h:53
float energy() const
get the id
Definition: FTLRecHit.h:41
float time_
Definition: FTLRecHit.h:70
float time() const
Definition: FTLRecHit.h:47
float timeError_
Definition: FTLRecHit.h:70
float energy_
Definition: FTLRecHit.h:70
DetId id_
Definition: FTLRecHit.h:69

Member Function Documentation

bool FTLRecHit::checkFlag ( int  flag) const
inline

check if the flag is true

Definition at line 61 of file FTLRecHit.h.

References flagBits_.

Referenced by checkFlags().

61 {return flagBits_ & ( 0x1<<flag);}
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:73
bool FTLRecHit::checkFlags ( const std::vector< int > &  flagsvec) const

check if one of the flags in a set is true

Definition at line 37 of file FTLRecHit.cc.

References checkFlag().

37  {
38 
39  for (std::vector<int>::const_iterator flagPtr = flagsvec.begin();
40  flagPtr!= flagsvec.end(); ++flagPtr) { // check if one of the flags is up
41  if (checkFlag(*flagPtr)) return true;
42  }
43  return false;
44 }
bool checkFlag(int flag) const
check if the flag is true
Definition: FTLRecHit.h:61
const DetId& FTLRecHit::detid ( ) const
inline

Definition at line 45 of file FTLRecHit.h.

References id().

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

45 { return id(); }
const DetId & id() const
Definition: FTLRecHit.h:44
float FTLRecHit::energy ( ) const
inline

get the id

Definition at line 41 of file FTLRecHit.h.

References energy_.

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

41 { return energy_; }
float energy_
Definition: FTLRecHit.h:70
const DetId& FTLRecHit::id ( ) const
inline

Definition at line 44 of file FTLRecHit.h.

References id_.

Referenced by detid().

44 { return id_; }
DetId id_
Definition: FTLRecHit.h:69
bool FTLRecHit::isTimeErrorValid ( ) const

Definition at line 27 of file FTLRecHit.cc.

References isTimeValid(), and timeError().

27  {
28  if(!isTimeValid())
29  return false;
30  if(timeError() >= timereso_max)
31  return false;
32 
33  return true;
34 }
float timeError() const
Definition: FTLRecHit.h:53
bool isTimeValid() const
Definition: FTLRecHit.cc:20
bool FTLRecHit::isTimeValid ( ) const

Definition at line 20 of file FTLRecHit.cc.

References timeError().

Referenced by isTimeErrorValid().

20  {
21  if(timeError() < 0)
22  return false;
23  else
24  return true;
25 }
float timeError() const
Definition: FTLRecHit.h:53
void FTLRecHit::setEnergy ( float  energy)
inline

Definition at line 42 of file FTLRecHit.h.

References energy(), and energy_.

42 { energy_=energy; }
float energy() const
get the id
Definition: FTLRecHit.h:41
float energy_
Definition: FTLRecHit.h:70
void FTLRecHit::setFlag ( int  flag)
inline

set the flags (from Flags or ESFlags)

Definition at line 57 of file FTLRecHit.h.

References flagBits_.

57 {flagBits_|= (0x1 << flag);}
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:73
void FTLRecHit::setTime ( float  time)
inline

Definition at line 48 of file FTLRecHit.h.

References time(), and time_.

48 { time_=time; }
float time_
Definition: FTLRecHit.h:70
float time() const
Definition: FTLRecHit.h:47
void FTLRecHit::setTimeError ( float  err)
inline

Definition at line 54 of file FTLRecHit.h.

References timeError_.

54 { timeError_ = err; }
float timeError_
Definition: FTLRecHit.h:70
float FTLRecHit::time ( ) const
inline

Definition at line 47 of file FTLRecHit.h.

References time_.

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

47 { return time_; }
float time_
Definition: FTLRecHit.h:70
float FTLRecHit::timeError ( ) const
inline

Definition at line 53 of file FTLRecHit.h.

References timeError_.

Referenced by isTimeErrorValid(), and isTimeValid().

53 { return timeError_; }
float timeError_
Definition: FTLRecHit.h:70
void FTLRecHit::unsetFlag ( int  flag)
inline

Definition at line 58 of file FTLRecHit.h.

References flagBits_.

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

Member Data Documentation

float FTLRecHit::energy_
private

Definition at line 70 of file FTLRecHit.h.

Referenced by energy(), and setEnergy().

unsigned char FTLRecHit::flagBits_
private

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

Definition at line 73 of file FTLRecHit.h.

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

DetId FTLRecHit::id_
private

Definition at line 69 of file FTLRecHit.h.

Referenced by id().

float FTLRecHit::time_
private

Definition at line 70 of file FTLRecHit.h.

Referenced by setTime(), and time().

float FTLRecHit::timeError_
private

Definition at line 70 of file FTLRecHit.h.

Referenced by setTimeError(), and timeError().