10#include <klm/dataobjects/bklm/BKLMHit1d.h>
13#include <klm/dataobjects/bklm/BKLMStatus.h>
16#include <framework/logging/Logger.h>
39 if (digitsWithTime.size() == 0) {
40 B2WARNING(
"Attempt to create a BKLMHit1d with no KLMDigits");
43 int stripMin = INT_MAX;
44 int stripMax = INT_MIN;
45 const KLMDigit* bklmDigit = digitsWithTime.front().first;
47 B2FATAL(
"Trying to construct a BKLMHit1d using KLMDigits from EKLM.");
53 for (
const std::pair<const KLMDigit*, double>& digitWithTime : digitsWithTime) {
54 const KLMDigit* digit = digitWithTime.first;
55 double correctedTime = digitWithTime.second;
60 B2WARNING(
"Attempt to combine non-parallel or distinct-module KLMDigits");
66 stripMin = std::min(stripMin, strip);
67 stripMax = std::max(stripMax, strip);
75 if (stripMax >= stripMin) {
76 m_Time /= ((stripMax - stripMin) + 1.0);
85 m_ModuleID(h.m_ModuleID),
87 m_EnergyDeposit(h.m_EnergyDeposit)
static void setStripInModule(int &module, int strip)
Set strip number in module identifier.
static void setLayerInModule(int &module, int layer)
Set layer number in module identifier.
static void setSectionInModule(int &module, int section)
Set section number in module identifier.
static void setSectorInModule(int &module, int sector)
Set sector number in module identifier.
static void setPlaneInModule(int &module, int plane)
Set plane number in module identifier.
Store one reconstructed BKLM 1D hit as a ROOT object.
BKLMHit1d()
Empty constructor for ROOT IO (needed to make the class storable)
float m_Time
reconstructed hit time (ns)
float m_EnergyDeposit
reconstructed pulse height (MeV)
int m_ModuleID
detector-module identifier
BKLMHit1d & operator=(const BKLMHit1d &)
Assignment operator.
static void setMaximalStrip(int &module, int strip)
Set maximal strip number.
KLM digit (class representing a digitized hit in RPCs or scintillators).
int getSubdetector() const
Get subdetector number.
int getLayer() const
Get layer number.
int getSection() const
Get section number.
int getPlane() const
Get plane number.
int getStrip() const
Get strip number.
bool isMultiStrip() const
Determine whether this digit is a multi-strip one or not.
int getSector() const
Get sector number.
int getLastStrip() const
Get last strip number (for multi-strip digits).
float getEnergyDeposit() const
Get energy deposit.
Defines interface for accessing relations of objects in StoreArray.
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
Abstract base class for different kinds of events.