LArSoft  v07_13_02
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 1647 of file RawDataDrawer.cxx.

1647  {
1648  data.Clear();
1649  sample_info.reset();
1650  }
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 1683 of file RawDataDrawer.cxx.

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

1683  {
1684  raw::RawDigit::ADCvector_t const& samples = Data();
1685 
1686  // lar::util::StatCollector<double> stat;
1687  // stat.add(samples.begin(), samples.end());
1688 
1690  (samples.begin(), samples.end());
1691 
1692  sample_info.reset(new SampleInfo_t);
1693  sample_info->min_charge = stat.min();
1694  sample_info->max_charge = stat.max();
1695  // sample_info->average_charge = stat.Average();
1696 
1697  } // 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 1635 of file RawDataDrawer.cxx.

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

1635  {
1636  if (!data.hasData()) UncompressData();
1637  return *data;
1638  } // 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.

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

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 1706 of file RawDataDrawer.cxx.

References raw::kNone.

1706  {
1707  out << " digit at " << ((void*) digit.get()) << " on channel #" << digit->Channel()
1708  << " with " << digit->NADC();
1709  if (digit->Compression() == kNone) out << " uncompressed data";
1710  else out << " data items compressed with <" << digit->Compression() << ">";
1711  if (data.hasData())
1712  out << " with data (" << data->size() << " samples)";
1713  else out << " without data";
1714  } // 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 1641 of file RawDataDrawer.cxx.

1641  {
1642  data.Clear();
1643  digit = src;
1644  } // 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 1700 of file RawDataDrawer.cxx.

1700  {
1702  return *sample_info;
1703  } // 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 1653 of file RawDataDrawer.cxx.

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

1653  {
1654  data.Clear();
1655 
1656  if (!digit) return; // no original data, can't do anything
1657 
1659 
1660  if (digit->Compression() == kNone) {
1661  // no compression, we can refer to the original data directly
1662  data.PointToData(digit->ADCs());
1663  }
1664  else {
1665  // data is compressed, need to do the real work
1666  if (drawopt->fUncompressWithPed){//Use pedestal in uncompression
1667  int pedestal = (int)digit->GetPedestal();
1669  samples.resize(digit->Samples());
1670  Uncompress(digit->ADCs(), samples, pedestal, digit->Compression());
1671  data.StealData(std::move(samples));
1672  }
1673  else{
1675  samples.resize(digit->Samples());
1676  Uncompress(digit->ADCs(), samples, digit->Compression());
1677  data.StealData(std::move(samples));
1678  }
1679  }
1680  } // 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
unsigned short Samples() const
Number of samples in the uncompressed ADC data.
Definition: RawDigit.h:212
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: