LDMX Software
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ldmx::RawSiStripHit Class Reference

Implementation of a raw digitized hit from a silicon strip detector. More...

#include <RawSiStripHit.h>

Public Member Functions

 RawSiStripHit ()=default
 Default constructor.
 
 RawSiStripHit (std::vector< short > samples, long time)
 Constructor.
 
virtual ~RawSiStripHit ()
 Destructor.
 
void Clear ()
 Clear the vector of samples and set the timestamp to 0.
 
void Print () const
 Print the string representation of this object.
 
std::vector< short > getSamples () const
 Get the digitized (ADC) samples composing this hit.
 
long getTime () const
 Get the time stamp of this hit.
 
bool operator< (const RawSiStripHit &rhs) const
 When the less than operator is used for comparison, return true if this hit's time is less than the hit we are comparing against.
 

Protected Member Functions

 ClassDef (RawSiStripHit, 1)
 Class declaration needed by the ROOT dictionary.
 

Protected Attributes

std::vector< short > samples_
 16 bit ADC samples associated with this hit.
 
long time_ {0}
 The hit time stamp in units of ns.
 

Friends

std::ostream & operator<< (std::ostream &output, const RawSiStripHit &hit)
 Overload the stream insertion operator to output a string representation of this RawStripHit.
 

Detailed Description

Implementation of a raw digitized hit from a silicon strip detector.

This class is meant to encapsulate the raw data coming from a silicon strip detector prior to any additional processing. Typically, the raw data will contain a header with ID information and timestamp, a tail with error info and multiple 32 bit data samples.

Definition at line 26 of file RawSiStripHit.h.

Constructor & Destructor Documentation

◆ RawSiStripHit()

ldmx::RawSiStripHit::RawSiStripHit ( std::vector< short >  samples,
long  time 
)

Constructor.

Parameters
[in]samplesThe ADC samples composing this hit. For now, the size of a sample is assumed to be 16 bits.
[in]timeThe timestamp of this hit as set by the data acquisition system.

Definition at line 6 of file RawSiStripHit.cxx.

7 : samples_(samples), time_(time) {}
long time_
The hit time stamp in units of ns.
std::vector< short > samples_
16 bit ADC samples associated with this hit.

◆ ~RawSiStripHit()

virtual ldmx::RawSiStripHit::~RawSiStripHit ( )
inlinevirtual

Destructor.

Currently, the destructor does nothing.

Definition at line 46 of file RawSiStripHit.h.

46{};

Member Function Documentation

◆ Clear()

void ldmx::RawSiStripHit::Clear ( )

Clear the vector of samples and set the timestamp to 0.

This class is needed by ROOT when building the dictionary.

Definition at line 9 of file RawSiStripHit.cxx.

9 {
10 samples_.clear();
11 time_ = 0;
12}

References samples_, and time_.

◆ getSamples()

std::vector< short > ldmx::RawSiStripHit::getSamples ( ) const
inline

Get the digitized (ADC) samples composing this hit.

This can be a single value or multiple values depending on the readout being used.

Parameters
[in]samples_The ADC values composing this hit. For now, the size of a sample is assumed to be 16 bits.
Returns
[out] A std::vector of 16 bit samples.

Definition at line 73 of file RawSiStripHit.h.

73{ return samples_; }

References samples_.

◆ getTime()

long ldmx::RawSiStripHit::getTime ( ) const
inline

Get the time stamp of this hit.

This is the time stamp as set by the data aquisition system. This will typically be in units of ns.

Parameters
[in]time_The timestamp as set by the data acquisition system.
Returns
[out] The timestamp of this hit in ns.

Definition at line 85 of file RawSiStripHit.h.

85{ return time_; }

References time_.

Referenced by operator<().

◆ operator<()

bool ldmx::RawSiStripHit::operator< ( const RawSiStripHit rhs) const
inline

When the less than operator is used for comparison, return true if this hit's time is less than the hit we are comparing against.

Parameters
[in]rhsThe RawStripHit on the right side of the comparison.
Returns
[out] True if the timestamp of this hit is less than the hit being compared against.

Definition at line 96 of file RawSiStripHit.h.

96 {
97 return getTime() < rhs.getTime();
98 }
long getTime() const
Get the time stamp of this hit.

References getTime().

◆ Print()

void ldmx::RawSiStripHit::Print ( ) const
inline

Print the string representation of this object.

This class is needed by ROOT when building the dictionary.

Definition at line 60 of file RawSiStripHit.h.

60{ std::cout << this; }

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  output,
const RawSiStripHit hit 
)
friend

Overload the stream insertion operator to output a string representation of this RawStripHit.

Parameters
[in]outputThe output stream where the string representation will be inserted.
[in]hitThe RawSiStripHit to output.
Returns
[out] An ostream object with the string representation of RawSiStripHit inserted.

Definition at line 14 of file RawSiStripHit.cxx.

14 {
15 output << "[ RawSiStripHit ]: Samples: { ";
16 for (auto isample{0}; isample < (hit.samples_.size() - 1); ++isample)
17 output << hit.samples_[isample] << ", ";
18 output << hit.samples_[hit.samples_.size() - 1] << " } "
19 << "Time: " << hit.time_ << std::endl;
20
21 return output;
22}

Member Data Documentation

◆ samples_

std::vector<short> ldmx::RawSiStripHit::samples_
protected

16 bit ADC samples associated with this hit.

Definition at line 116 of file RawSiStripHit.h.

Referenced by Clear(), and getSamples().

◆ time_

long ldmx::RawSiStripHit::time_ {0}
protected

The hit time stamp in units of ns.

Definition at line 119 of file RawSiStripHit.h.

119{0};

Referenced by Clear(), and getTime().


The documentation for this class was generated from the following files: