CMS 3D CMS Logo

CTPPSDiamondDigi.h
Go to the documentation of this file.
1 #ifndef CTPPSDigi_CTPPSDiamondDigi_h
2 #define CTPPSDigi_CTPPSDiamondDigi_h
3 
13 #include <cstdint>
15 
17 public:
19  unsigned int ledgt_, unsigned int tedgt_, unsigned int threvolt, bool mhit_, unsigned short hptdcerror_);
22 
24  bool operator==(const CTPPSDiamondDigi& digi) const;
25 
27 
28  unsigned int leadingEdge() const { return ledgt; }
29 
30  unsigned int trailingEdge() const { return tedgt; }
31 
32  unsigned int thresholdVoltage() const { return threvolt; }
33 
34  bool multipleHit() const { return mhit; }
35 
37 
39  inline void setLeadingEdge(unsigned int ledgt_) { ledgt = ledgt_; }
40  inline void setTrailingEdge(unsigned int tedgt_) { tedgt = tedgt_; }
41  inline void setThresholdVoltage(unsigned int threvolt_) { threvolt = threvolt_; }
42  inline void setMultipleHit(bool mhit_) { mhit = mhit_; }
43  inline void setHPTDCErrorFlags(const HPTDCErrorFlags& hptdcerror_) { hptdcerror = hptdcerror_; }
44 
45 private:
46  // variable represents leading edge time
47  unsigned int ledgt;
48  // variable represents trailing edge time
49  unsigned int tedgt;
50  // variable represents threshold voltage
51  unsigned int threvolt;
52  // variable represents multi-hit
53  bool mhit;
55 };
56 
57 #include <iostream>
58 
59 inline bool operator<(const CTPPSDiamondDigi& one, const CTPPSDiamondDigi& other) {
60  if (one.leadingEdge() < other.leadingEdge())
61  return true;
62  if (one.leadingEdge() > other.leadingEdge())
63  return false;
64  if (one.trailingEdge() < other.trailingEdge())
65  return true;
66  if (one.trailingEdge() > other.trailingEdge())
67  return false;
68  if (one.multipleHit() < other.multipleHit())
69  return true;
70  if (one.multipleHit() > other.multipleHit())
71  return false;
72  if (one.hptdcErrorFlags().errorFlag() < other.hptdcErrorFlags().errorFlag())
73  return true;
74  if (one.hptdcErrorFlags().errorFlag() > other.hptdcErrorFlags().errorFlag())
75  return false;
76  if (one.thresholdVoltage() < other.thresholdVoltage())
77  return true;
78  if (one.thresholdVoltage() > other.thresholdVoltage())
79  return false;
80  return false;
81 }
82 
83 inline std::ostream& operator<<(std::ostream& o, const CTPPSDiamondDigi& digi) {
84  return o << " " << digi.leadingEdge() << " " << digi.trailingEdge() << " " << digi.thresholdVoltage() << " "
85  << digi.multipleHit() << " " << digi.hptdcErrorFlags().errorFlag();
86 }
87 
88 #endif
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
CTPPSDiamondDigi::tedgt
unsigned int tedgt
Definition: CTPPSDiamondDigi.h:49
CTPPSDiamondDigi::mhit
bool mhit
Definition: CTPPSDiamondDigi.h:53
HPTDCErrorFlags::errorFlag
unsigned short errorFlag() const
Definition: HPTDCErrorFlags.h:72
CTPPSDiamondDigi::~CTPPSDiamondDigi
~CTPPSDiamondDigi()
Definition: CTPPSDiamondDigi.h:21
CTPPSDiamondDigi::setHPTDCErrorFlags
void setHPTDCErrorFlags(const HPTDCErrorFlags &hptdcerror_)
Definition: CTPPSDiamondDigi.h:43
CTPPSDiamondDigi::threvolt
unsigned int threvolt
Definition: CTPPSDiamondDigi.h:51
CTPPSDiamondDigi::CTPPSDiamondDigi
CTPPSDiamondDigi()
Definition: CTPPSDiamondDigi.cc:15
operator<
bool operator<(const CTPPSDiamondDigi &one, const CTPPSDiamondDigi &other)
Definition: CTPPSDiamondDigi.h:59
CTPPSDiamondDigi
Definition: CTPPSDiamondDigi.h:16
CTPPSDiamondDigi::multipleHit
bool multipleHit() const
Definition: CTPPSDiamondDigi.h:34
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
HPTDCErrorFlags.h
HPTDCErrorFlags
Definition: HPTDCErrorFlags.h:15
CTPPSDiamondDigi::setThresholdVoltage
void setThresholdVoltage(unsigned int threvolt_)
Definition: CTPPSDiamondDigi.h:41
CTPPSDiamondDigi::thresholdVoltage
unsigned int thresholdVoltage() const
Definition: CTPPSDiamondDigi.h:32
trackingPlots.other
other
Definition: trackingPlots.py:1464
CTPPSDiamondDigi::setLeadingEdge
void setLeadingEdge(unsigned int ledgt_)
Set digi values.
Definition: CTPPSDiamondDigi.h:39
CTPPSDiamondDigi::leadingEdge
unsigned int leadingEdge() const
Return digi values number.
Definition: CTPPSDiamondDigi.h:28
operator<<
std::ostream & operator<<(std::ostream &o, const CTPPSDiamondDigi &digi)
Definition: CTPPSDiamondDigi.h:83
CTPPSDiamondDigi::ledgt
unsigned int ledgt
Definition: CTPPSDiamondDigi.h:47
CTPPSDiamondDigi::setTrailingEdge
void setTrailingEdge(unsigned int tedgt_)
Definition: CTPPSDiamondDigi.h:40
CTPPSDiamondDigi::operator==
bool operator==(const CTPPSDiamondDigi &digi) const
Digis are equal if they are have same ledt and tedt, threshold voltage, multihit flag,...
Definition: CTPPSDiamondDigi.cc:18
CTPPSDiamondDigi::setMultipleHit
void setMultipleHit(bool mhit_)
Definition: CTPPSDiamondDigi.h:42
CTPPSDiamondDigi::trailingEdge
unsigned int trailingEdge() const
Definition: CTPPSDiamondDigi.h:30
CTPPSDiamondDigi::hptdcerror
HPTDCErrorFlags hptdcerror
Definition: CTPPSDiamondDigi.h:54
CTPPSDiamondDigi::hptdcErrorFlags
HPTDCErrorFlags hptdcErrorFlags() const
Definition: CTPPSDiamondDigi.h:36