LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 187 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 196 of file RawDataDrawer.cxx.

References raw::InvalidChannelID.

197  { return digit? digit->Channel(): raw::InvalidChannelID; }
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:211
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 1594 of file RawDataDrawer.cxx.

1594  {
1595  data.Clear();
1596  sample_info.reset();
1597  }
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 1628 of file RawDataDrawer.cxx.

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

1628  {
1629  raw::RawDigit::ADCvector_t const& samples = Data();
1630 
1631  // lar::util::StatCollector<double> stat;
1632  // stat.add(samples.begin(), samples.end());
1633 
1635  (samples.begin(), samples.end());
1636 
1637  sample_info.reset(new SampleInfo_t);
1638  sample_info->min_charge = stat.min();
1639  sample_info->max_charge = stat.max();
1640  // sample_info->average_charge = stat.Average();
1641 
1642  } // 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 1582 of file RawDataDrawer.cxx.

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

1582  {
1583  if (!data.hasData()) UncompressData();
1584  return *data;
1585  } // 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 193 of file RawDataDrawer.cxx.

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

193 { 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 190 of file RawDataDrawer.cxx.

190 { 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 1651 of file RawDataDrawer.cxx.

References raw::kNone.

1651  {
1652  out << " digit at " << ((void*) digit.get()) << " on channel #" << digit->Channel()
1653  << " with " << digit->NADC();
1654  if (digit->Compression() == kNone) out << " uncompressed data";
1655  else out << " data items compressed with <" << digit->Compression() << ">";
1656  if (data.hasData())
1657  out << " with data (" << data->size() << " samples)";
1658  else out << " without data";
1659  } // RawDigitInfo_t::Dump()
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:211
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:206
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
Definition: RawDigit.h:215
T const * get() const
Definition: Ptr.h:321
art::Ptr< raw::RawDigit > digit
a pointer to the actual digit
void evd::details::RawDigitInfo_t::Fill ( art::Ptr< raw::RawDigit > const &  src)

Parses the specified digit.

Definition at line 1588 of file RawDataDrawer.cxx.

1588  {
1589  data.Clear();
1590  digit = src;
1591  } // 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 203 of file RawDataDrawer.cxx.

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

203 { 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 200 of file RawDataDrawer.cxx.

200 { 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 1645 of file RawDataDrawer.cxx.

1645  {
1647  return *sample_info;
1648  } // 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 1600 of file RawDataDrawer.cxx.

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

1600  {
1601  data.Clear();
1602 
1603  if (!digit) return; // no original data, can't do anything
1604 
1606 
1607  if (digit->Compression() == kNone) {
1608  // no compression, we can refer to the original data directly
1609  data.PointToData(digit->ADCs());
1610  }
1611  else {
1612  // data is compressed, need to do the real work
1613  if (drawopt->fUncompressWithPed){//Use pedestal in uncompression
1614  int pedestal = (int)digit->GetPedestal();
1616  Uncompress(digit->ADCs(), samples, pedestal, digit->Compression());
1617  data.StealData(std::move(samples));
1618  }
1619  else{
1621  Uncompress(digit->ADCs(), samples, digit->Compression());
1622  data.StealData(std::move(samples));
1623  }
1624  }
1625  } // RawDigitInfo_t::UncompressData()
float GetPedestal() const
Definition: RawDigit.h:213
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
Definition: RawDigit.h:209
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:215
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:756
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 231 of file RawDataDrawer.cxx.

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

a pointer to the actual digit

Definition at line 228 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 234 of file RawDataDrawer.cxx.


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