LArSoft  v10_04_05
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 176 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 185 of file RawDataDrawer.cxx.

References raw::InvalidChannelID.

185 { 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 1485 of file RawDataDrawer.cxx.

1486  {
1487  data.Clear();
1488  sample_info.reset();
1489  }
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 1521 of file RawDataDrawer.cxx.

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

1522  {
1523  raw::RawDigit::ADCvector_t const& samples = Data();
1524 
1526  samples.end());
1527 
1528  sample_info.reset(new SampleInfo_t);
1529  sample_info->min_charge = stat.min();
1530  sample_info->max_charge = stat.max();
1531 
1532  } // 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 1473 of file RawDataDrawer.cxx.

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

1474  {
1475  if (!data.hasData()) UncompressData();
1476  return *data;
1477  } // 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 182 of file RawDataDrawer.cxx.

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

182 { 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 179 of file RawDataDrawer.cxx.

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

179 { 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 1541 of file RawDataDrawer.cxx.

References raw::kNone.

1542  {
1543  out << " digit at " << ((void*)digit.get()) << " on channel #" << digit->Channel()
1544  << " with " << digit->NADC();
1545  if (digit->Compression() == kNone)
1546  out << " uncompressed data";
1547  else
1548  out << " data items compressed with <" << digit->Compression() << ">";
1549  if (data.hasData())
1550  out << " with data (" << data->size() << " samples)";
1551  else
1552  out << " without data";
1553  } // 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 1479 of file RawDataDrawer.cxx.

1480  {
1481  data.Clear();
1482  digit = src;
1483  } // 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 191 of file RawDataDrawer.cxx.

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

191 { 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 188 of file RawDataDrawer.cxx.

188 { 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 1534 of file RawDataDrawer.cxx.

1535  {
1537  return *sample_info;
1538  } // 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 1491 of file RawDataDrawer.cxx.

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

1492  {
1493  data.Clear();
1494 
1495  if (!digit) return; // no original data, can't do anything
1496 
1498 
1499  if (digit->Compression() == kNone) {
1500  // no compression, we can refer to the original data directly
1501  data.PointToData(digit->ADCs());
1502  }
1503  else {
1504  // data is compressed, need to do the real work
1505  if (drawopt->fUncompressWithPed) { //Use pedestal in uncompression
1506  int pedestal = (int)digit->GetPedestal();
1508  samples.resize(digit->Samples());
1509  Uncompress(digit->ADCs(), samples, pedestal, digit->Compression());
1510  data.StealData(std::move(samples));
1511  }
1512  else {
1514  samples.resize(digit->Samples());
1515  Uncompress(digit->ADCs(), samples, digit->Compression());
1516  data.StealData(std::move(samples));
1517  }
1518  }
1519  } // 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 218 of file RawDataDrawer.cxx.

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

a pointer to the actual digit

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


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