9 #include <cdc/dataobjects/CDCHit.h>
10 #include <cdc/dataobjects/CDCSimHit.h>
11 #include <mdst/dataobjects/MCParticle.h>
12 #include <framework/datastore/RelationVector.h>
18 CDCHit::CDCHit(
unsigned short tdcCount,
unsigned short charge,
19 unsigned short iSuperLayer,
unsigned short iLayer,
unsigned short iWire,
unsigned short status,
unsigned short tot,
20 signed short otherHitIndex,
unsigned short leadingEdgeCharge)
22 setTDCCount(tdcCount);
24 setWireID(iSuperLayer, iLayer, iWire);
27 setOtherHitIndex(otherHitIndex);
28 setADCCountAtLeadingEdge(leadingEdgeCharge);
34 const auto* bgDigit =
static_cast<const CDCHit*
>(bg);
35 const unsigned short tdc4Sg = m_tdcCount;
36 const unsigned short adc4Sg = m_adcCount;
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);
60 m_adcCount = adc4Sg + adc4Bg;
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.);
91 return DigitBase::c_DontAppend;
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
short getTDCCount() const
Getter for TDC count.
A common base for subdetector Digits.
EAppendStatus
Enum for return state of addBGDigit function.
Abstract base class for different kinds of events.