LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evd::details::RawDigitInfo_t Class Reference

Information about a RawDigit; may contain uncompressed duplicate of data. More...

Classes

struct  SampleInfo_t
 

Public Member Functions

art::Ptr< raw::RawDigitDigitPtr () const
 Returns an art pointer to the actual digit. More...
 
raw::RawDigit const & Digit () const
 Returns an art pointer to the actual digit. More...
 
raw::ChannelID_t Channel () const
 Returns the channel of this digit (for convenience) More...
 
short MinCharge () const
 minimum charge More...
 
short MaxCharge () const
 maximum charge More...
 
raw::RawDigit::ADCvector_t const & Data () const
 average charge More...
 
void Fill (art::Ptr< raw::RawDigit > const &src)
 Parses the specified digit. More...
 
void Clear ()
 Deletes the data. More...
 
template<typename Stream >
void Dump (Stream &&out) const
 Dumps the content of the digit info. More...
 

Private Member Functions

void UncompressData () const
 Fills the uncompressed data cache. More...
 
void CollectSampleInfo () const
 Fills the sample info cache. More...
 
SampleInfo_t const & SampleInfo () const
 Returns the uncompressed data. More...
 

Private Attributes

art::Ptr< raw::RawDigitdigit
 a pointer to the actual digit More...
 
mutable::details::PointerToData_t< raw::RawDigit::ADCvector_t const > data
 Uncompressed data. More...
 
std::unique_ptr< SampleInfo_tsample_info
 Information collected from the uncompressed data. More...
 

Detailed Description

Information about a RawDigit; may contain uncompressed duplicate of data.

Definition at line 175 of file RawDataDrawer.cxx.

Member Function Documentation

raw::ChannelID_t evd::details::RawDigitInfo_t::Channel ( ) const
inline

Returns the channel of this digit (for convenience)

Definition at line 184 of file RawDataDrawer.cxx.

References raw::InvalidChannelID.

184 { return digit ? digit->Channel() : raw::InvalidChannelID; }
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:213
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
art::Ptr< raw::RawDigit > digit
a pointer to the actual digit
void evd::details::RawDigitInfo_t::Clear ( )

Deletes the data.

Definition at line 1581 of file RawDataDrawer.cxx.

1582  {
1583  data.Clear();
1584  sample_info.reset();
1585  }
std::unique_ptr< SampleInfo_t > sample_info
Information collected from the uncompressed data.
mutable::details::PointerToData_t< raw::RawDigit::ADCvector_t const > data
Uncompressed data.
void evd::details::RawDigitInfo_t::CollectSampleInfo ( ) const
private

Fills the sample info cache.

Definition at line 1617 of file RawDataDrawer.cxx.

References lar::util::MinMaxCollector< T >::min().

1618  {
1619  raw::RawDigit::ADCvector_t const& samples = Data();
1620 
1621  // lar::util::StatCollector<double> stat;
1622  // stat.add(samples.begin(), samples.end());
1623 
1625  samples.end());
1626 
1627  sample_info.reset(new SampleInfo_t);
1628  sample_info->min_charge = stat.min();
1629  sample_info->max_charge = stat.max();
1630  // sample_info->average_charge = stat.Average();
1631 
1632  } // RawDigitInfo_t::CollectSampleInfo()
std::unique_ptr< SampleInfo_t > sample_info
Information collected from the uncompressed data.
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:72
Keeps track of the minimum and maximum value we observed.
raw::RawDigit::ADCvector_t const & Data() const
average charge
raw::RawDigit::ADCvector_t const & evd::details::RawDigitInfo_t::Data ( ) const

average charge

Returns the uncompressed data

Definition at line 1569 of file RawDataDrawer.cxx.

Referenced by evd::RawDataDrawer::FillTQHisto().

1570  {
1571  if (!data.hasData()) UncompressData();
1572  return *data;
1573  } // RawDigitInfo_t::Data()
mutable::details::PointerToData_t< raw::RawDigit::ADCvector_t const > data
Uncompressed data.
void UncompressData() const
Fills the uncompressed data cache.
raw::RawDigit const& evd::details::RawDigitInfo_t::Digit ( ) const
inline

Returns an art pointer to the actual digit.

Definition at line 181 of file RawDataDrawer.cxx.

Referenced by evd::details::RawDigitCacheDataClass::CheckUpToDate().

181 { return *digit; }
art::Ptr< raw::RawDigit > digit
a pointer to the actual digit
art::Ptr<raw::RawDigit> evd::details::RawDigitInfo_t::DigitPtr ( ) const
inline

Returns an art pointer to the actual digit.

Definition at line 178 of file RawDataDrawer.cxx.

Referenced by evd::RawDataDrawer::FillTQHisto().

178 { return digit; }
art::Ptr< raw::RawDigit > digit
a pointer to the actual digit
template<typename Stream >
void evd::details::RawDigitInfo_t::Dump ( Stream &&  out) const

Dumps the content of the digit info.

Definition at line 1641 of file RawDataDrawer.cxx.

References raw::kNone.

1642  {
1643  out << " digit at " << ((void*)digit.get()) << " on channel #" << digit->Channel()
1644  << " with " << digit->NADC();
1645  if (digit->Compression() == kNone)
1646  out << " uncompressed data";
1647  else
1648  out << " data items compressed with <" << digit->Compression() << ">";
1649  if (data.hasData())
1650  out << " with data (" << data->size() << " samples)";
1651  else
1652  out << " without data";
1653  } // RawDigitInfo_t::Dump()
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:213
no compression
Definition: RawTypes.h:9
mutable::details::PointerToData_t< raw::RawDigit::ADCvector_t const > data
Uncompressed data.
size_t NADC() const
Number of elements in the compressed ADC sample vector.
Definition: RawDigit.h:201
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
Definition: RawDigit.h:229
art::Ptr< raw::RawDigit > digit
a pointer to the actual digit
T const * get() const
Definition: Ptr.h:138
void evd::details::RawDigitInfo_t::Fill ( art::Ptr< raw::RawDigit > const &  src)

Parses the specified digit.

Definition at line 1575 of file RawDataDrawer.cxx.

1576  {
1577  data.Clear();
1578  digit = src;
1579  } // RawDigitInfo_t::Fill()
mutable::details::PointerToData_t< raw::RawDigit::ADCvector_t const > data
Uncompressed data.
art::Ptr< raw::RawDigit > digit
a pointer to the actual digit
short evd::details::RawDigitInfo_t::MaxCharge ( ) const
inline

maximum charge

Definition at line 190 of file RawDataDrawer.cxx.

References details::PointerToData_t< T >::Clear(), and Fill().

190 { return SampleInfo().max_charge; }
SampleInfo_t const & SampleInfo() const
Returns the uncompressed data.
short evd::details::RawDigitInfo_t::MinCharge ( ) const
inline

minimum charge

Definition at line 187 of file RawDataDrawer.cxx.

187 { return SampleInfo().min_charge; }
SampleInfo_t const & SampleInfo() const
Returns the uncompressed data.
RawDigitInfo_t::SampleInfo_t const & evd::details::RawDigitInfo_t::SampleInfo ( ) const
private

Returns the uncompressed data.

Definition at line 1634 of file RawDataDrawer.cxx.

1635  {
1637  return *sample_info;
1638  } // SampleInfo()
std::unique_ptr< SampleInfo_t > sample_info
Information collected from the uncompressed data.
void CollectSampleInfo() const
Fills the sample info cache.
void evd::details::RawDigitInfo_t::UncompressData ( ) const
private

Fills the uncompressed data cache.

Definition at line 1587 of file RawDataDrawer.cxx.

References evd::RawDrawingOptions::fUncompressWithPed, raw::kNone, and raw::Uncompress().

1588  {
1589  data.Clear();
1590 
1591  if (!digit) return; // no original data, can't do anything
1592 
1594 
1595  if (digit->Compression() == kNone) {
1596  // no compression, we can refer to the original data directly
1597  data.PointToData(digit->ADCs());
1598  }
1599  else {
1600  // data is compressed, need to do the real work
1601  if (drawopt->fUncompressWithPed) { //Use pedestal in uncompression
1602  int pedestal = (int)digit->GetPedestal();
1604  samples.resize(digit->Samples());
1605  Uncompress(digit->ADCs(), samples, pedestal, digit->Compression());
1606  data.StealData(std::move(samples));
1607  }
1608  else {
1610  samples.resize(digit->Samples());
1611  Uncompress(digit->ADCs(), samples, digit->Compression());
1612  data.StealData(std::move(samples));
1613  }
1614  }
1615  } // RawDigitInfo_t::UncompressData()
float GetPedestal() const
Definition: RawDigit.h:221
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
Definition: RawDigit.h:209
ULong64_t Samples() const
Number of samples in the uncompressed ADC data.
Definition: RawDigit.h:217
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:72
no compression
Definition: RawTypes.h:9
mutable::details::PointerToData_t< raw::RawDigit::ADCvector_t const > data
Uncompressed data.
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
Definition: RawDigit.h:229
art::Ptr< raw::RawDigit > digit
a pointer to the actual digit
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
Definition: raw.cxx:744
bool fUncompressWithPed
Option to uncompress with pedestal. Turned off by default.

Member Data Documentation

mutable ::details::PointerToData_t<raw::RawDigit::ADCvector_t const> evd::details::RawDigitInfo_t::data
private

Uncompressed data.

Definition at line 217 of file RawDataDrawer.cxx.

art::Ptr<raw::RawDigit> evd::details::RawDigitInfo_t::digit
private

a pointer to the actual digit

Definition at line 214 of file RawDataDrawer.cxx.

std::unique_ptr<SampleInfo_t> evd::details::RawDigitInfo_t::sample_info
mutableprivate

Information collected from the uncompressed data.

Definition at line 220 of file RawDataDrawer.cxx.


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