CMS 3D CMS Logo

FTLUncalibratedRecHit.cc
Go to the documentation of this file.
2 #include <cmath>
3 #include <limits>
4 
6  : amplitude_(-1.f, -1.f),
7  time_(-1.f, -1.f),
8  timeError_(-1.f),
9  id_(DetId()),
10  row_(0),
11  column_(0),
12  flags_(std::numeric_limits<unsigned char>::max()) {}
13 
15  const DetId& id, std::pair<float, float> ampl, std::pair<float, float> time, float timeError, unsigned char flags)
16  : amplitude_(ampl), time_(time), timeError_(timeError), id_(id), row_(0), column_(0), flags_(flags) {}
17 
19  uint8_t row,
20  uint8_t column,
21  std::pair<float, float> ampl,
22  std::pair<float, float> time,
23  float timeError,
24  unsigned char flags)
25  : amplitude_(ampl), time_(time), timeError_(timeError), id_(id), row_(row), column_(column), flags_(flags) {}
26 
28 
30 
32  if (timeError() < 0)
33  return false;
34  else
35  return true;
36 }
37 
39  if (!isTimeValid())
40  return false;
41  if (timeError() >= 10000)
42  return false;
43 
44  return true;
45 }
46 
48  if (flag == kGood) {
49  //then set all bits to zero;
50  flags_ = 0;
51  return;
52  }
53  // else set the flagbit
54  flags_ |= 0x1 << flag;
55 }
56 
58  if (flag == kGood) {
59  if (!flags_)
60  return true;
61  else
62  return false;
63  } // if all flags are unset, then hit is good
64  return flags_ & (0x1 << flag);
65 }
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
FTLUncalibratedRecHit::flags_
unsigned char flags_
Definition: FTLUncalibratedRecHit.h:63
FTLUncalibratedRecHit::Flags
Flags
Definition: FTLUncalibratedRecHit.h:11
FTLUncalibratedRecHit::kGood
Definition: FTLUncalibratedRecHit.h:12
FTLUncalibratedRecHit::setFlagBit
void setFlagBit(Flags flag)
Definition: FTLUncalibratedRecHit.cc:47
FTLUncalibratedRecHit::isSaturated
bool isSaturated() const
Definition: FTLUncalibratedRecHit.cc:29
FTLUncalibratedRecHit::isTimeValid
bool isTimeValid() const
Definition: FTLUncalibratedRecHit.cc:31
DetId
Definition: DetId.h:17
FTLUncalibratedRecHit::checkFlag
bool checkFlag(Flags flag) const
Definition: FTLUncalibratedRecHit.cc:57
FTLUncalibratedRecHit::~FTLUncalibratedRecHit
~FTLUncalibratedRecHit()
Definition: FTLUncalibratedRecHit.cc:27
FTLUncalibratedRecHit::kSaturated
Definition: FTLUncalibratedRecHit.h:14
FTLUncalibratedRecHit.h
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
std
Definition: JetResolutionObject.h:76
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
ntuplemaker.time
time
Definition: ntuplemaker.py:310
HLT_2018_cff.flags
flags
Definition: HLT_2018_cff.py:11758
FTLUncalibratedRecHit::FTLUncalibratedRecHit
FTLUncalibratedRecHit()
Definition: FTLUncalibratedRecHit.cc:5
FTLUncalibratedRecHit::isTimeErrorValid
bool isTimeErrorValid() const
Definition: FTLUncalibratedRecHit.cc:38
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
FTLUncalibratedRecHit::timeError
float timeError() const
Definition: FTLUncalibratedRecHit.h:36