Belle II Software  release-05-02-19
CDCHit.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Heck, CDC group *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef CDCHIT_H
12 #define CDCHIT_H
13 
14 #include <framework/logging/Logger.h>
15 #include <cdc/dataobjects/WireID.h>
16 #include <framework/dataobjects/DigitBase.h>
17 
18 namespace Belle2 {
43  class CDCHit : public DigitBase {
44  public:
46  CDCHit() :
48  {
49  B2DEBUG(29, "Empty CDCHit Constructor called.");
50  }
51 
67  CDCHit(unsigned short tdcCount, unsigned short adcCount,
68  unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire, unsigned short status = 0, unsigned short tot = 0,
69  signed short otherHitIndex = -1, unsigned short leadingEdgeADC = 0);
70 
72  CDCHit(unsigned short tdcCount, unsigned short adcCount, const WireID& wireID, unsigned short status = 0, unsigned short tot = 0,
73  signed short otherHitIndex = -1, unsigned short leadingEdgeADC = 0)
74  {
75  setTDCCount(tdcCount);
76  setADCCount(adcCount);
77  setWireID(wireID);
78  setStatus(status);
79  setTOT(tot);
80  setOtherHitIndex(otherHitIndex);
81  setADCCountAtLeadingEdge(leadingEdgeADC);
82  }
83 
93  void setWireID(unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
94  {
95  B2DEBUG(29, "setWireId called with" << iSuperLayer << ", " << iLayer << ", " << iWire);
96  m_eWire = WireID(iSuperLayer, iLayer, iWire).getEWire();
97  }
98 
100  void setWireID(const WireID& wireID)
101  {
102  m_eWire = wireID.getEWire();
103  }
104 
109  void setStatus(unsigned short status)
110  {
111  B2DEBUG(29, "setStatus called with " << status);
112  m_status = status;
113  }
114 
116  void set2ndHitFlag()
117  {
118  m_status |= 0x01;
119  }
120 
122  void setAlreadyCheckedFlag()
123  {
124  m_status |= 0x02;
125  }
126 
131  void setTDCCount(short tdcCount)
132  {
133  B2DEBUG(29, "setTDCCount called with " << tdcCount);
134  m_tdcCount = tdcCount;
135  }
136 
138  void setADCCount(unsigned short adcCount)
139  {
140  m_adcCount = adcCount;
141  }
142 
144  void setOtherHitIndex(signed short index)
145  {
147  }
148 
150  void setOtherHitIndices(CDCHit* otherHit)
151  {
152  m_otherHitIndex = otherHit->getArrayIndex();
153  otherHit->setOtherHitIndex(this->getArrayIndex());
154  }
155 
157  void setADCCountAtLeadingEdge(unsigned short adcCount)
158  {
159  m_adcCountAtLeadingEdge = adcCount;
160  }
161 
163  void setTOT(unsigned short tot)
164  {
165  m_tot = tot;
166  }
167 
169  unsigned short getIWire() const
170  {
172  }
173 
175  unsigned short getILayer() const
176  {
178  }
179 
181  unsigned short getICLayer() const
182  {
184  }
185 
187  unsigned short getISuperLayer() const
188  {
190  }
191 
196  unsigned short getID() const
197  {
198  return m_eWire;
199  }
200 
202  unsigned short getStatus() const
203  {
204  return m_status;
205  }
206 
208  bool is2ndHit() const
209  {
210  bool tOrf = (m_status & 0x01) ? true : false;
211  return tOrf;
212  }
213 
215  bool isAlreadyChecked() const
216  {
217  bool tOrf = (m_status & 0x02) ? true : false;
218  return tOrf;
219  }
220 
222  short getTDCCount() const
223  {
224  return m_tdcCount;
225  }
226 
233  unsigned short getADCCount() const
234  {
235  return m_adcCount;
236  }
237 
239  signed short getOtherHitIndex() const
240  {
242  }
243 
245  unsigned short getADCCountAtLeadingEdge() const
246  {
248  }
249 
251  unsigned short getTOT() const
252  {
253  return m_tot;
254  }
255 
261  unsigned int getUniqueChannelID() const override {return static_cast<unsigned int>(m_eWire);}
262 
270 
271 
272  protected:
273 
279  unsigned short m_eWire;
280 
282  unsigned short m_tdcCount;
283 
285  unsigned short m_adcCount;
286 
288  unsigned short m_status;
289 
291  unsigned short m_tot;
292 
294  signed short m_otherHitIndex;
295 
297  unsigned short m_adcCountAtLeadingEdge;
298 
299  private:
302  };
304 } // end namespace Belle2
305 
306 #endif
Belle2::CDCHit::setStatus
void setStatus(unsigned short status)
Setter for CDCHit status.
Definition: CDCHit.h:117
Belle2::DigitBase::EAppendStatus
EAppendStatus
Enum for return state of addBGDigit function.
Definition: DigitBase.h:42
Belle2::CDCHit::getISuperLayer
unsigned short getISuperLayer() const
Getter for iSuperLayer.
Definition: CDCHit.h:195
Belle2::CDCHit::m_otherHitIndex
signed short m_otherHitIndex
Index to the other hit.
Definition: CDCHit.h:302
Belle2::WireID
Class to identify a wire inside the CDC.
Definition: WireID.h:44
Belle2::CDCHit::setOtherHitIndices
void setOtherHitIndices(CDCHit *otherHit)
Setter for the other hit indices.
Definition: CDCHit.h:158
Belle2::CDCHit::setAlreadyCheckedFlag
void setAlreadyCheckedFlag()
Setter for already-checked flag.
Definition: CDCHit.h:130
Belle2::CDCHit::getOtherHitIndex
signed short getOtherHitIndex() const
Getter for otherHitIndex.
Definition: CDCHit.h:247
Belle2::WireID::getILayer
unsigned short getILayer() const
Getter for layer within the Super-Layer.
Definition: WireID.h:146
Belle2::CDCHit::ClassDefOverride
ClassDefOverride(CDCHit, 8)
ROOT Macro.
Belle2::CDCHit::getID
unsigned short getID() const
Getter for encoded wire number.
Definition: CDCHit.h:204
Belle2::WireID::getEWire
unsigned short getEWire() const
Getter for encoded wire number.
Definition: WireID.h:164
Belle2::CDCHit
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:51
Belle2::CDCHit::m_status
unsigned short m_status
Status of CDCHit.
Definition: CDCHit.h:296
Belle2::CDCHit::getADCCountAtLeadingEdge
unsigned short getADCCountAtLeadingEdge() const
Getter for adcCountAtLeadingEdge.
Definition: CDCHit.h:253
Belle2::CDCHit::m_eWire
unsigned short m_eWire
Wire encoding.
Definition: CDCHit.h:287
Belle2::WireID::getISuperLayer
unsigned short getISuperLayer() const
Getter for Super-Layer.
Definition: WireID.h:140
Belle2::CDCHit::getTDCCount
short getTDCCount() const
Getter for TDC count.
Definition: CDCHit.h:230
Belle2::CDCHit::setOtherHitIndex
void setOtherHitIndex(signed short index)
Setter for the other hit index.
Definition: CDCHit.h:152
Belle2::CDCHit::getICLayer
unsigned short getICLayer() const
Getter for iCLayer (0-55).
Definition: CDCHit.h:189
Belle2::CDCHit::getStatus
unsigned short getStatus() const
Getter for CDCHit status.
Definition: CDCHit.h:210
Belle2::CDCHit::getTOT
unsigned short getTOT() const
Getter for TOT.
Definition: CDCHit.h:259
Belle2::CDCHit::getADCCount
unsigned short getADCCount() const
Getter for integrated charge.
Definition: CDCHit.h:241
Belle2::CDCHit::setTDCCount
void setTDCCount(short tdcCount)
Setter for TDC count.
Definition: CDCHit.h:139
Belle2::CDCHit::getILayer
unsigned short getILayer() const
Getter for iLayer.
Definition: CDCHit.h:183
Belle2::CDCHit::is2ndHit
bool is2ndHit() const
Getter for 2nd hit flag.
Definition: CDCHit.h:216
Belle2::CDCHit::m_adcCount
unsigned short m_adcCount
ADC count of the integrated charge in the cell.
Definition: CDCHit.h:293
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CDCHit::m_tot
unsigned short m_tot
Time over threshod.
Definition: CDCHit.h:299
Belle2::CDCHit::setADCCountAtLeadingEdge
void setADCCountAtLeadingEdge(unsigned short adcCount)
Setter for ADCcount at leading edge.
Definition: CDCHit.h:165
Belle2::CDCHit::set2ndHitFlag
void set2ndHitFlag()
Setter for 2nd hit flag.
Definition: CDCHit.h:124
Belle2::CDCHit::getIWire
unsigned short getIWire() const
Getter for iWire.
Definition: CDCHit.h:177
Belle2::CDCHit::setTOT
void setTOT(unsigned short tot)
Setter for TOT.
Definition: CDCHit.h:171
Belle2::CDCHit::setADCCount
void setADCCount(unsigned short adcCount)
Setter for ADC count.
Definition: CDCHit.h:146
Belle2::CDCHit::isAlreadyChecked
bool isAlreadyChecked() const
Getter for already-checked flag.
Definition: CDCHit.h:223
Belle2::RelationsInterface::getArrayIndex
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
Definition: RelationsObject.h:387
Belle2::CDCHit::m_tdcCount
unsigned short m_tdcCount
TDC count in ns.
Definition: CDCHit.h:290
Belle2::CDCHit::CDCHit
CDCHit()
Empty constructor for ROOT IO.
Definition: CDCHit.h:54
Belle2::CDCHit::setWireID
void setWireID(unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
Setter for Wire ID.
Definition: CDCHit.h:101
Belle2::CDCHit::getUniqueChannelID
unsigned int getUniqueChannelID() const override
Implementation of the base class function.
Definition: CDCHit.h:269
Belle2::WireID::getIWire
unsigned short getIWire() const
Getter for wire within the layer.
Definition: WireID.h:155
Belle2::WireID::getICLayer
unsigned short getICLayer() const
Getter for continuous layer numbering.
Definition: WireID.cc:26
Belle2::CDCHit::m_adcCountAtLeadingEdge
unsigned short m_adcCountAtLeadingEdge
ADC count at leading edge.
Definition: CDCHit.h:305
Belle2::DigitBase
A common base for subdetector Digits.
Definition: DigitBase.h:36
Belle2::CDCHit::addBGDigit
DigitBase::EAppendStatus addBGDigit(const DigitBase *bg) override
Implementation of the base class function.
Definition: CDCHit.cc:34