CMS 3D CMS Logo

FTLRecHit.cc
Go to the documentation of this file.
3 #include <cassert>
4 #include <cmath>
5 #include <limits>
6 
7 namespace {
8  constexpr float timereso_max = 10000;
9 }
10 
12  : FTLRecHit(DetId(), 0, 0, -1.f, -1.f, -1.f, -1.f, -1.f, std::numeric_limits<unsigned char>::max()) {}
13 
15  uint8_t row,
16  uint8_t column,
17  float energy,
18  float time,
19  float timeError,
20  float position,
21  float positionError,
22  uint32_t flagBits)
23  : id_(id),
24  energy_(energy),
25  time_(time),
26  timeError_(timeError),
27  position_(position),
28  positionError_(positionError),
29  row_(row),
30  column_(column),
31  flagBits_(flagBits) {}
32 
34  const DetId& id, float energy, float time, float timeError, float position, float positionError, uint32_t flagBits)
35  : FTLRecHit(id, 0, 0, energy, time, timeError, position, positionError, flagBits) {}
36 
37 bool FTLRecHit::isTimeValid() const {
38  if (timeError() < 0)
39  return false;
40  else
41  return true;
42 }
43 
45  if (!isTimeValid())
46  return false;
47  if (timeError() >= timereso_max)
48  return false;
49 
50  return true;
51 }
52 
54 bool FTLRecHit::checkFlags(const std::vector<int>& flagsvec) const {
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 }
62 
63 std::ostream& operator<<(std::ostream& s, const FTLRecHit& hit) {
64  if (hit.detid().det() == DetId::Forward && hit.detid().subdetId() == FastTime)
65  return s << FastTimeDetId(hit.detid()) << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
66  else
67  return s << "FTLRecHit undefined subdetector";
68 }
FTLRecHit
Definition: FTLRecHit.h:15
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
FastTimeDetId.h
FTLRecHit::FTLRecHit
FTLRecHit()
Definition: FTLRecHit.cc:11
FTLRecHit::isTimeErrorValid
bool isTimeErrorValid() const
Definition: FTLRecHit.cc:44
operator<<
std::ostream & operator<<(std::ostream &s, const FTLRecHit &hit)
Definition: FTLRecHit.cc:63
FTLRecHit::checkFlag
bool checkFlag(int flag) const
check if the flag is true
Definition: FTLRecHit.h:90
FTLRecHit::timeError
float timeError() const
Definition: FTLRecHit.h:79
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
FTLRecHit.h
FTLRecHit::checkFlags
bool checkFlags(const std::vector< int > &flagsvec) const
check if one of the flags in a set is true
Definition: FTLRecHit.cc:54
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
FastTime
Definition: ForwardSubdetector.h:6
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
std
Definition: JetResolutionObject.h:76
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
FastTimeDetId
Definition: FastTimeDetId.h:8
FTLRecHit::isTimeValid
bool isTimeValid() const
Definition: FTLRecHit.cc:37
DetId::Forward
Definition: DetId.h:30
ntuplemaker.time
time
Definition: ntuplemaker.py:310
hit
Definition: SiStripHitEffFromCalibTree.cc:88