LDMX Software
SiStripHit.h
1
2#ifndef TRACKING_EVENT_SISTRIPHIT_H_
3#define TRACKING_EVENT_SISTRIPHIT_H_
4
5//----------------------//
6// C++ Standard Lib //
7//----------------------//
8#include <iostream>
9#include <vector>
10
11//----------//
12// ROOT //
13//----------//
14#include "TObject.h"
15
16namespace ldmx {
17
28 public:
30 SiStripHit() = default;
31
37 virtual ~SiStripHit() = default;
38
46 virtual void clear() = 0;
47
56 std::vector<short> getSamples() const { return samples_; }
57
66 long getTime() const { return time_; }
67
77 bool operator<(const SiStripHit& rhs) const {
78 return getTime() < rhs.getTime();
79 }
80
81 protected:
90 SiStripHit(std::vector<short> samples, long time)
91 : samples_(samples), time_(time) {}
92
94 void clearBase() {
95 samples_.clear();
96 time_ = 0;
97 }
98
100 std::vector<short> samples_;
101
103 long time_{0};
104
107
108}; // SiStripHit
109} // namespace ldmx
110
111#endif // TRACKING_EVENT_SISTRIPHIT_H_
Abstract base class for a silicon strip detector hit.
Definition SiStripHit.h:27
SiStripHit()=default
Default constructor.
long time_
The hit time stamp in units of ns.
Definition SiStripHit.h:103
std::vector< short > getSamples() const
Get the digitized (ADC) samples composing this hit.
Definition SiStripHit.h:56
virtual ~SiStripHit()=default
Destructor.
void clearBase()
Clear the fields owned by the base class.
Definition SiStripHit.h:94
virtual void clear()=0
Clear the data in the object.
ClassDef(SiStripHit, 1)
Class declaration needed by the ROOT dictionary.
SiStripHit(std::vector< short > samples, long time)
Constructor used by derived classes to initialize the shared fields.
Definition SiStripHit.h:90
long getTime() const
Get the time stamp of this hit.
Definition SiStripHit.h:66
bool operator<(const SiStripHit &rhs) const
When the less than operator is used for comparison, return true if this hit's time is less than the h...
Definition SiStripHit.h:77
std::vector< short > samples_
16 bit ADC samples associated with this hit.
Definition SiStripHit.h:100