CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
18  public:
19 
20  CTPPSDiamondDigi(unsigned int ledgt_, unsigned int tedgt_, unsigned int threvolt, bool mhit_, unsigned short hptdcerror_);
23 
25  bool operator==(const CTPPSDiamondDigi& digi) const;
26 
28 
29  unsigned int getLeadingEdge() const
30  {
31  return ledgt;
32  }
33 
34  unsigned int getTrailingEdge() const
35  {
36  return tedgt;
37  }
38 
39  unsigned int getThresholdVoltage() const
40  {
41  return threvolt;
42  }
43 
44  bool getMultipleHit() const
45  {
46  return mhit;
47  }
48 
50  {
51  return hptdcerror;
52  }
53 
55  inline void setLeadingEdge(unsigned int ledgt_)
56  {
57  ledgt = ledgt_;
58  }
59  inline void setTrailingEdge(unsigned int tedgt_)
60  {
61  tedgt = tedgt_;
62  }
63  inline void setThresholdVoltage(unsigned int threvolt_)
64  {
65  threvolt = threvolt_;
66  }
67  inline void setMultipleHit(bool mhit_)
68  {
69  mhit = mhit_;
70  }
71  inline void setHPTDCErrorFlags(const HPTDCErrorFlags& hptdcerror_)
72  {
73  hptdcerror = hptdcerror_;
74  }
75 
76 
77  private:
78  // variable represents leading edge time
79  unsigned int ledgt;
80  // variable represents trailing edge time
81  unsigned int tedgt;
82  // variable represents threshold voltage
83  unsigned int threvolt;
84  // variable represents multi-hit
85  bool mhit;
87 };
88 
89 #include <iostream>
90 
91 
92 inline bool operator< (const CTPPSDiamondDigi& one, const CTPPSDiamondDigi& other)
93 {
94  if( one.getLeadingEdge() < other.getLeadingEdge() )
95  return true;
96  if( one.getLeadingEdge() > other.getLeadingEdge() )
97  return false;
98  if( one.getTrailingEdge() < other.getTrailingEdge() )
99  return true;
100  if( one.getTrailingEdge() > other.getTrailingEdge() )
101  return false;
102  if( one.getMultipleHit() < other.getMultipleHit() )
103  return true;
104  if( one.getMultipleHit() > other.getMultipleHit() )
105  return false;
107  return true;
109  return false;
110  if( one.getThresholdVoltage() < other.getThresholdVoltage() )
111  return true;
112  if( one.getThresholdVoltage() > other.getThresholdVoltage() )
113  return false;
114  return false;
115 }
116 
117 
118 inline std::ostream & operator<<(std::ostream & o, const CTPPSDiamondDigi& digi)
119 {
120  return o << " " << digi.getLeadingEdge()
121  << " " << digi.getTrailingEdge()
122  << " " << digi.getThresholdVoltage()
123  << " " << digi.getMultipleHit()
124  << " " << digi.getHPTDCErrorFlags().getErrorFlag();
125 }
126 
127 #endif
128 
unsigned short getErrorFlag() const
void setTrailingEdge(unsigned int tedgt_)
unsigned int getThresholdVoltage() const
unsigned int ledgt
HPTDCErrorFlags getHPTDCErrorFlags() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
void setMultipleHit(bool mhit_)
unsigned int getLeadingEdge() const
Return digi values number.
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
unsigned int tedgt
unsigned int threvolt
bool operator==(const CTPPSDiamondDigi &digi) const
Digis are equal if they are have same ledt and tedt, threshold voltage, multihit flag, hptdcerror flags.
HPTDCErrorFlags hptdcerror
void setHPTDCErrorFlags(const HPTDCErrorFlags &hptdcerror_)
bool getMultipleHit() const
unsigned int getTrailingEdge() const
void setThresholdVoltage(unsigned int threvolt_)
void setLeadingEdge(unsigned int ledgt_)
Set digi values.