Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 206 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 224 of file RawDataDrawer.cxx.

225  {
227  }
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:212
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
art::Ptr< raw::RawDigit > digit
a pointer to the actual digit
void evd::details::RawDigitInfo_t::Clear ( void  )

Deletes the data.

Definition at line 1809 of file RawDataDrawer.cxx.

1810  {
1811  data.Clear();
1812  sample_info.reset();
1813  }
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 1847 of file RawDataDrawer.cxx.

1848  {
1849  raw::RawDigit::ADCvector_t const& samples = Data();
1850 
1851  // lar::util::StatCollector<double> stat;
1852  // stat.add(samples.begin(), samples.end());
1853 
1855  samples.end());
1856 
1857  sample_info.reset(new SampleInfo_t);
1858  sample_info->min_charge = stat.min();
1859  sample_info->max_charge = stat.max();
1860  // sample_info->average_charge = stat.Average();
1861 
1862  } // 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:73
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 ( void  ) const

average charge

Returns the uncompressed data

Definition at line 1795 of file RawDataDrawer.cxx.

1796  {
1797  if (!data.hasData()) UncompressData();
1798  return *data;
1799  } // 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 217 of file RawDataDrawer.cxx.

218  {
219  return *digit;
220  }
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 210 of file RawDataDrawer.cxx.

211  {
212  return digit;
213  }
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 1873 of file RawDataDrawer.cxx.

1874  {
1875  out << " digit at " << ((void*)digit.get()) << " on channel #" << digit->Channel()
1876  << " with " << digit->NADC();
1877  if (digit->Compression() == kNone)
1878  out << " uncompressed data";
1879  else
1880  out << " data items compressed with <" << digit->Compression() << ">";
1881  if (data.hasData())
1882  out << " with data (" << data->size() << " samples)";
1883  else
1884  out << " without data";
1885  } // RawDigitInfo_t::Dump()
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:212
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:207
no compression
Definition: RawTypes.h:16
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
Definition: RawDigit.h:216
art::Ptr< raw::RawDigit > digit
a pointer to the actual digit
T const * get() const
Definition: Ptr.h:149
void evd::details::RawDigitInfo_t::Fill ( art::Ptr< raw::RawDigit > const &  src)

Parses the specified digit.

Definition at line 1802 of file RawDataDrawer.cxx.

1803  {
1804  data.Clear();
1805  digit = src;
1806  } // 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 238 of file RawDataDrawer.cxx.

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

minimum charge

Definition at line 231 of file RawDataDrawer.cxx.

232  {
233  return SampleInfo().min_charge;
234  }
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 1865 of file RawDataDrawer.cxx.

1866  {
1868  return *sample_info;
1869  } // 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 1816 of file RawDataDrawer.cxx.

1817  {
1818  data.Clear();
1819 
1820  if (!digit) return; // no original data, can't do anything
1821 
1823 
1824  if (digit->Compression() == kNone) {
1825  // no compression, we can refer to the original data directly
1826  data.PointToData(digit->ADCs());
1827  }
1828  else {
1829  // data is compressed, need to do the real work
1830  if (drawopt->fUncompressWithPed) { //Use pedestal in uncompression
1831  int pedestal = (int)digit->GetPedestal();
1833  samples.resize(digit->Samples());
1834  Uncompress(digit->ADCs(), samples, pedestal, digit->Compression());
1835  data.StealData(std::move(samples));
1836  }
1837  else {
1839  samples.resize(digit->Samples());
1840  Uncompress(digit->ADCs(), samples, digit->Compression());
1841  data.StealData(std::move(samples));
1842  }
1843  }
1844  } // RawDigitInfo_t::UncompressData()
float GetPedestal() const
Definition: RawDigit.h:214
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
Definition: RawDigit.h:210
ULong64_t Samples() const
Number of samples in the uncompressed ADC data.
Definition: RawDigit.h:213
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:73
mutable::details::PointerToData_t< raw::RawDigit::ADCvector_t const > data
Uncompressed data.
def move(depos, offset)
Definition: depos.py:107
no compression
Definition: RawTypes.h:16
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
Definition: RawDigit.h:216
art::Ptr< raw::RawDigit > digit
a pointer to the actual digit
void Uncompress(const gar::raw::ADCvector_t &adc, gar::raw::ADCvector_t &uncompressed, gar::raw::Compress_t compress)
Uncompresses a raw data buffer.
Definition: raw.cxx:183
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 269 of file RawDataDrawer.cxx.

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

a pointer to the actual digit

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


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