9#include <cdc/dataobjects/CDCHit.h>
10#include <cdc/dataobjects/CDCSimHit.h>
11#include <mdst/dataobjects/MCParticle.h>
12#include <framework/datastore/RelationVector.h>
19 unsigned short iSuperLayer,
unsigned short iLayer,
unsigned short iWire,
unsigned short status,
unsigned short tot,
20 signed short otherHitIndex,
unsigned short leadingEdgeCharge)
34 const auto* bgDigit =
static_cast<const CDCHit*
>(bg);
37 const unsigned short tot4Sg =
m_tot;
38 const unsigned short tdc4Bg = bgDigit->getTDCCount();
39 const unsigned short adc4Bg = bgDigit->getADCCount();
40 const unsigned short tot4Bg = bgDigit->getTOT();
43 int diff =
static_cast<int>(
m_tdcCount) -
static_cast<int>(bgDigit->getTDCCount());
50 auto relSimHits = this->getRelationsFrom<CDCSimHit>();
51 for (
int i = relSimHits.size() - 1; i >= 0; --i) {
54 auto relMCParticles = this->getRelationsFrom<MCParticle>();
55 for (
int i = relMCParticles.size() - 1; i >= 0; --i) {
56 relMCParticles.remove(i);
66 unsigned short s1 = tdc4Sg;
67 unsigned short s2 = tdc4Bg;
68 unsigned short w1 = 32 * tot4Sg;
69 unsigned short w2 = 32 * tot4Bg;
70 if (tdc4Sg < tdc4Bg) {
76 const unsigned short e1 = s1 - w1;
77 const unsigned short e2 = s2 - w2;
80 double pulseW = w1 + w2;
83 }
else if (e1 <= s2) {
88 m_tot = std::min(std::round(pulseW / 32.), 29.);
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
void setADCCountAtLeadingEdge(unsigned short adcCount)
Setter for ADCcount at leading edge.
void setTDCCount(short tdcCount)
Setter for TDC count.
DigitBase::EAppendStatus addBGDigit(const DigitBase *bg) override
Implementation of the base class function.
unsigned short m_tdcCount
TDC count in ns.
CDCHit()
Empty constructor for ROOT IO.
void setOtherHitIndex(signed short index)
Setter for the other hit index.
unsigned short m_adcCount
ADC count of the integrated charge in the cell.
void setTOT(unsigned short tot)
Setter for TOT.
void setADCCount(unsigned short adcCount)
Setter for ADC count.
void setWireID(unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
Setter for Wire ID.
unsigned short m_tot
Time over threshod.
void setStatus(unsigned short status)
Setter for CDCHit status.
A common base for subdetector Digits.
EAppendStatus
Enum for return state of addBGDigit function.
@ c_DontAppend
do not append BG digit to digits
Abstract base class for different kinds of events.