Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | List of all members
AdcChannelData Class Reference

#include <AdcChannelData.h>

Public Types

using Name = std::string
 
using NameVector = std::vector< Name >
 
using FloatMap = std::map< Name, float >
 
using View = std::vector< AdcChannelData >
 
using ViewMap = std::map< Name, View >
 
using EventInfo = DuneEventInfo
 
using EventInfoPtr = std::shared_ptr< const EventInfo >
 
using ChannelInfo = DuneChannelInfo
 
using ChannelInfoPtr = std::shared_ptr< const ChannelInfo >
 
using Index = EventInfo::Index
 
using LongIndex = EventInfo::LongIndex
 
using Channel = ChannelInfo::Channel
 

Public Member Functions

void setEventInfo (EventInfoPtr pevi)
 
void setEventInfo (const EventInfo *pevi)
 
void setEventInfo (Index a_run, Index a_event, Index a_subRun=badIndex(), time_t a_time=0, int a_timerem=0, Index a_trigger=badIndex(), LongIndex a_triggerClock=badLongIndex())
 
bool hasEventInfo () const
 
EventInfoPtr getEventInfoPtr () const
 
const DuneEventInfogetEventInfo () const
 
AdcIndex run () const
 
AdcIndex subRun () const
 
AdcIndex event () const
 
time_t time () const
 
int timerem () const
 
AdcIndex trigger () const
 
AdcLongIndex triggerClock () const
 
AdcLongIndex triggerTick0 () const
 
void setChannelInfo (ChannelInfoPtr pchi)
 
void setChannelInfo (const ChannelInfo *pchi)
 
void setChannelInfo (Channel a_channel, Index a_fembID=badIndex(), Index a_fembChannel=badIndex(), Index a_channelStatus=badIndex())
 
bool hasChannelInfo () const
 
ChannelInfoPtr getChannelInfoPtr () const
 
const DuneChannelInfogetChannelInfo () const
 
Channel channel () const
 
Index fembID () const
 
Index fembChannel () const
 
Index channelStatus () const
 
AdcLongIndex tickOffset () const
 
 AdcChannelData (const AdcChannelData &rhs)
 
AdcChannelDataoperator= (const AdcChannelData &)=delete
 
 AdcChannelData ()=default
 
 AdcChannelData (AdcChannelData &&)=default
 
AdcChannelDataoperator= (AdcChannelData &&)=default
 
bool hasMetadata (Name mname) const
 
float getMetadata (Name mname, float def=0.0) const
 
void setMetadata (Name mname, float val)
 
bool hasAttribute (Name mname, float def=0.0) const
 
float getAttribute (Name mname, float def=0.0) const
 
void clear ()
 
void roisFromSignal ()
 
size_t viewSize () const
 
NameVector viewNames () const
 
bool hasView (Name vnam) const
 
const Viewview (Name vnam) const
 
ViewupdateView (Name vnam)
 
AdcIndex viewSize (Name vpnam) const
 
const AdcChannelDataviewEntry (Name vpnam, AdcIndex ient) const
 
AdcChannelDatamutableViewEntry (Name vpnam, AdcIndex ient)
 

Static Public Member Functions

static Index badIndex ()
 
static Index badLongIndex ()
 
static Index badChannel ()
 
static Index badSignal ()
 
static const EventInfobadEventInfo ()
 
static const ChannelInfobadChannelInfo ()
 
static AdcIndex dftNormalization ()
 

Public Attributes

AdcLongIndex channelClock =0
 
AdcInt tick0 = 0
 
AdcSignal pedestal =badSignal()
 
AdcSignal pedestalRms =0.0
 
AdcCountVector raw
 
AdcSignalVector samples
 
AdcSignalVectorVector binSamples
 
Name sampleUnit
 
AdcSignal sampleNoise =0.0
 
AdcFlagVector flags
 
AdcFilterVector signal
 
AdcRoiVector rois
 
AdcSignalVector dftmags
 
AdcSignalVector dftphases
 
FloatMap metadata
 
AdcChannelDataviewParent =nullptr
 
const raw::RawDigitdigit =nullptr
 
const recob::Wirewire =nullptr
 
AdcIndex digitIndex =badIndex()
 
AdcIndex wireIndex =badIndex()
 

Private Attributes

EventInfoPtr m_peventInfo
 
ChannelInfoPtr m_pchanInfo
 
ViewMap m_views
 

Detailed Description

Definition at line 95 of file AdcChannelData.h.

Member Typedef Documentation

Definition at line 110 of file AdcChannelData.h.

Definition at line 106 of file AdcChannelData.h.

using AdcChannelData::ChannelInfoPtr = std::shared_ptr<const ChannelInfo>

Definition at line 107 of file AdcChannelData.h.

Definition at line 104 of file AdcChannelData.h.

using AdcChannelData::EventInfoPtr = std::shared_ptr<const EventInfo>

Definition at line 105 of file AdcChannelData.h.

using AdcChannelData::FloatMap = std::map<Name, float>

Definition at line 101 of file AdcChannelData.h.

Definition at line 108 of file AdcChannelData.h.

Definition at line 109 of file AdcChannelData.h.

Definition at line 99 of file AdcChannelData.h.

Definition at line 100 of file AdcChannelData.h.

Definition at line 102 of file AdcChannelData.h.

using AdcChannelData::ViewMap = std::map<Name, View>

Definition at line 103 of file AdcChannelData.h.

Constructor & Destructor Documentation

AdcChannelData::AdcChannelData ( const AdcChannelData rhs)
inline

Definition at line 217 of file AdcChannelData.h.

217  {
220  m_pchanInfo = rhs.m_pchanInfo;
221  };
ChannelInfoPtr m_pchanInfo
EventInfoPtr m_peventInfo
AdcLongIndex channelClock
AdcChannelData::AdcChannelData ( )
default
AdcChannelData::AdcChannelData ( AdcChannelData &&  )
default

Member Function Documentation

static Index AdcChannelData::badChannel ( )
inlinestatic

Definition at line 114 of file AdcChannelData.h.

114 { return EventInfo::badIndex(); }
static Index badIndex()
Definition: DuneEventInfo.h:30
static const ChannelInfo& AdcChannelData::badChannelInfo ( )
inlinestatic

Definition at line 121 of file AdcChannelData.h.

121  {
123  }
static const DuneChannelInfo & badChannelInfo()
static const EventInfo& AdcChannelData::badEventInfo ( )
inlinestatic

Definition at line 117 of file AdcChannelData.h.

117  {
118  return EventInfo::badEventInfo();
119  }
static const DuneEventInfo & badEventInfo()
Definition: DuneEventInfo.h:32
static Index AdcChannelData::badIndex ( )
inlinestatic

Definition at line 112 of file AdcChannelData.h.

112 { return EventInfo::badIndex(); }
static Index badIndex()
Definition: DuneEventInfo.h:30
static Index AdcChannelData::badLongIndex ( )
inlinestatic

Definition at line 113 of file AdcChannelData.h.

113 { return EventInfo::badLongIndex(); }
static LongIndex badLongIndex()
Definition: DuneEventInfo.h:31
static Index AdcChannelData::badSignal ( )
inlinestatic

Definition at line 115 of file AdcChannelData.h.

115 { return -99999; }
Channel AdcChannelData::channel ( ) const
inline

Definition at line 199 of file AdcChannelData.h.

199 { return getChannelInfo().channel; }
const DuneChannelInfo & getChannelInfo() const
Index AdcChannelData::channelStatus ( ) const
inline

Definition at line 202 of file AdcChannelData.h.

202 { return getChannelInfo().channelStatus; }
const DuneChannelInfo & getChannelInfo() const
void AdcChannelData::clear ( )
inline

Definition at line 386 of file AdcChannelData.h.

386  {
387  channelClock = 0;
388  pedestal = badSignal();
389  pedestalRms = 0.0;
390  tick0 = 0;
391  raw.clear();
392  samples.clear();
393  sampleUnit = "";
394  sampleNoise = 0.0;
395  flags.clear();
396  signal.clear();
397  rois.clear();
398  dftmags.clear();
399  dftphases.clear();
400  digit = nullptr;
401  wire = nullptr;
402  dftmags.clear();
403  dftphases.clear();
404  digitIndex = badIndex();
405  wireIndex = badIndex();
406  metadata.clear();
407  m_peventInfo.reset();
408  m_pchanInfo.reset();
409 }
Raw data description.
ChannelInfoPtr m_pchanInfo
const recob::Wire * wire
const raw::RawDigit * digit
EventInfoPtr m_peventInfo
static Index badSignal()
AdcSignal pedestalRms
AdcSignal sampleNoise
AdcRoiVector rois
AdcSignalVector dftphases
AdcSignal pedestal
AdcFilterVector signal
AdcLongIndex channelClock
AdcIndex digitIndex
AdcIndex wireIndex
static Index badIndex()
AdcSignalVector samples
AdcSignalVector dftmags
AdcFlagVector flags
static AdcIndex AdcChannelData::dftNormalization ( )
inlinestatic

Definition at line 336 of file AdcChannelData.h.

336 { return 22; }
AdcIndex AdcChannelData::event ( ) const
inline

Definition at line 176 of file AdcChannelData.h.

176 { return getEventInfo().event; }
const DuneEventInfo & getEventInfo() const
Index AdcChannelData::fembChannel ( ) const
inline

Definition at line 201 of file AdcChannelData.h.

201 { return getChannelInfo().fembChannel; }
const DuneChannelInfo & getChannelInfo() const
Index AdcChannelData::fembID ( ) const
inline

Definition at line 200 of file AdcChannelData.h.

200 { return getChannelInfo().fembID; }
const DuneChannelInfo & getChannelInfo() const
float AdcChannelData::getAttribute ( Name  mname,
float  def = 0.0 
) const
inline

Definition at line 291 of file AdcChannelData.h.

291  {
292  if ( mname.substr(0,3) == "../" ) {
293  if ( viewParent == nullptr ) return def;
294  return viewParent->getAttribute(mname.substr(3));
295  }
296  // For basic types, return the value.
297  if ( mname == "run" ) return run();
298  if ( mname == "subRun" ) return subRun();
299  if ( mname == "event" ) return event();
300  if ( mname == "trigger" ) return trigger();
301  if ( mname == "triggerClock" ) return triggerClock(); // lose precision here
302  if ( mname == "channelClock" ) return channelClock; // lose precision here
303  if ( mname == "channelClockOffset" ) return channelClock - triggerClock();
304  if ( mname == "channel" ) return channel();
305  if ( mname == "fembID" ) return fembID();
306  if ( mname == "fembChannel" ) return fembChannel();
307  if ( mname == "pedestal" ) return pedestal;
308  if ( mname == "pedestalRms" ) return pedestalRms;
309  if ( mname == "sampleNoise" ) return sampleNoise;
310  if ( mname == "digitIndex" ) return digitIndex;
311  if ( mname == "wireIndex" ) return wireIndex;
312  // For vectors, return the size.
313  if ( mname == "raw" ) return raw.size();
314  if ( mname == "samples" ) return samples.size();
315  if ( mname == "flags" ) return flags.size();
316  if ( mname == "signal" ) return signal.size();
317  if ( mname == "rois" ) return rois.size();
318  if ( mname == "dftmags" ) return dftmags.size();
319  if ( mname == "dftphases" ) return dftphases.size();
320  // For pointer, return false for null.
321  if ( mname == "digit" ) return digit != nullptr;
322  if ( mname == "wire" ) return wire != nullptr;
323  if ( mname == "metadata" ) return metadata.size();
324  // Otherwise return the metatdata field.
325  return getMetadata(mname, def);
326  }
AdcIndex subRun() const
Raw data description.
AdcIndex trigger() const
const recob::Wire * wire
const raw::RawDigit * digit
float getAttribute(Name mname, float def=0.0) const
Index fembID() const
AdcSignal pedestalRms
AdcSignal sampleNoise
AdcRoiVector rois
AdcChannelData * viewParent
Index fembChannel() const
AdcIndex run() const
float getMetadata(Name mname, float def=0.0) const
AdcIndex event() const
AdcSignalVector dftphases
Channel channel() const
AdcSignal pedestal
AdcFilterVector signal
AdcLongIndex channelClock
AdcIndex digitIndex
AdcIndex wireIndex
AdcSignalVector samples
AdcLongIndex triggerClock() const
AdcSignalVector dftmags
AdcFlagVector flags
const DuneChannelInfo& AdcChannelData::getChannelInfo ( ) const
inline

Definition at line 196 of file AdcChannelData.h.

196  {
197  return hasChannelInfo() ? *m_pchanInfo : badChannelInfo();
198  }
ChannelInfoPtr m_pchanInfo
bool hasChannelInfo() const
static const ChannelInfo & badChannelInfo()
ChannelInfoPtr AdcChannelData::getChannelInfoPtr ( ) const
inline

Definition at line 195 of file AdcChannelData.h.

195 { return m_pchanInfo; }
ChannelInfoPtr m_pchanInfo
const DuneEventInfo& AdcChannelData::getEventInfo ( ) const
inline

Definition at line 171 of file AdcChannelData.h.

171  {
172  return hasEventInfo() ? *m_peventInfo : badEventInfo();
173  }
bool hasEventInfo() const
EventInfoPtr m_peventInfo
static const EventInfo & badEventInfo()
EventInfoPtr AdcChannelData::getEventInfoPtr ( ) const
inline

Definition at line 170 of file AdcChannelData.h.

170 { return m_peventInfo; }
EventInfoPtr m_peventInfo
float AdcChannelData::getMetadata ( Name  mname,
float  def = 0.0 
) const
inline

Definition at line 241 of file AdcChannelData.h.

241  {
242  if ( mname.substr(0,3) == "../" ) {
243  if ( viewParent == nullptr ) return def;
244  return viewParent->getMetadata(mname.substr(3));
245  }
246  FloatMap::const_iterator imtd = metadata.find(mname);
247  if ( imtd == metadata.end() ) return def;
248  return imtd->second;
249  }
intermediate_table::const_iterator const_iterator
AdcChannelData * viewParent
float getMetadata(Name mname, float def=0.0) const
bool AdcChannelData::hasAttribute ( Name  mname,
float  def = 0.0 
) const
inline

Definition at line 257 of file AdcChannelData.h.

257  {
258  if ( mname.substr(0,3) == "../" ) {
259  if ( viewParent == nullptr ) return false;
260  return viewParent->hasAttribute(mname.substr(3));
261  }
262  if ( mname == "run" ) return true;
263  if ( mname == "subRun" ) return true;
264  if ( mname == "event" ) return true;;
265  if ( mname == "trigger" ) return true;;
266  if ( mname == "triggerClock" ) return true;
267  if ( mname == "channelClock" ) return true;
268  if ( mname == "channelClockOffset" ) return true;
269  if ( mname == "channel" ) return true;
270  if ( mname == "fembID" ) return true;
271  if ( mname == "fembChannel" ) return true;
272  if ( mname == "pedestal" ) return true;
273  if ( mname == "pedestalRms" ) return true;
274  if ( mname == "sampleNoise" ) return true;
275  if ( mname == "digitIndex" ) return true;
276  if ( mname == "wireIndex" ) return true;
277  if ( mname == "raw" ) return true;
278  if ( mname == "samples" ) return true;
279  if ( mname == "flags" ) return true;
280  if ( mname == "signal" ) return true;
281  if ( mname == "rois" ) return true;
282  if ( mname == "dftmags" ) return true;
283  if ( mname == "dftphases" ) return true;
284  if ( mname == "digit" ) return true;
285  if ( mname == "wire" ) return true;
286  if ( mname == "metadata" ) return metadata.size();
287  return hasMetadata(mname);
288  }
bool hasMetadata(Name mname) const
AdcChannelData * viewParent
bool hasAttribute(Name mname, float def=0.0) const
bool AdcChannelData::hasChannelInfo ( ) const
inline

Definition at line 194 of file AdcChannelData.h.

194 { return bool(m_pchanInfo); }
ChannelInfoPtr m_pchanInfo
int bool
Definition: qglobal.h:345
bool AdcChannelData::hasEventInfo ( ) const
inline

Definition at line 169 of file AdcChannelData.h.

169 { return bool(m_peventInfo); }
EventInfoPtr m_peventInfo
int bool
Definition: qglobal.h:345
bool AdcChannelData::hasMetadata ( Name  mname) const
inline

Definition at line 232 of file AdcChannelData.h.

232  {
233  if ( mname.substr(0,3) == "../" ) {
234  if ( viewParent == nullptr ) return false;
235  return viewParent->hasMetadata(mname.substr(3));
236  }
237  return metadata.find(mname) != metadata.end();
238  }
bool hasMetadata(Name mname) const
AdcChannelData * viewParent
bool AdcChannelData::hasView ( Name  vnam) const

Definition at line 442 of file AdcChannelData.h.

442  {
443  if ( vpnam.size() == 0 ) return true;
444  Name::size_type ipos = vpnam.find("/");
445  if ( ipos == Name::npos ) return m_views.count(vpnam);
446  Name vnam = vpnam.substr(0, ipos);
447  if ( ! hasView(vnam) ) return false;
448  Name vsnam = vpnam.substr(ipos + 1);
449  for ( const AdcChannelData& acd : view(vnam) ) {
450  if ( acd.hasView(vsnam) ) return true;
451  }
452  return false;
453 }
ChannelGroupService::Name Name
const View & view(Name vnam) const
bool hasView(Name vnam) const
AdcChannelData * AdcChannelData::mutableViewEntry ( Name  vpnam,
AdcIndex  ient 
)

Definition at line 518 of file AdcChannelData.h.

518  {
519  if ( vpnam.size() == 0 ) {
520  if ( ient == 0 ) return this;
521  else return nullptr;
522  }
523  Name::size_type ipos = vpnam.find("/");
524  if ( ipos == Name::npos ) {
525  View& myview = updateView(vpnam);
526  if ( ient < myview.size() ) return &myview[ient];
527  return nullptr;
528  }
529  Name vnam = vpnam.substr(0, ipos);
530  Name vsnam = vpnam.substr(ipos + 1);
531  AdcIndex ientRem = ient;
532  for ( AdcChannelData& dat : updateView(vnam) ) {
533  AdcIndex nvie = dat.viewSize(vsnam);
534  if ( ientRem < nvie ) return dat.mutableViewEntry(vsnam, ientRem);
535  ientRem -= nvie;
536  }
537  return nullptr;
538 }
AdcChannelData::View View
ChannelGroupService::Name Name
unsigned int AdcIndex
Definition: AdcTypes.h:15
View & updateView(Name vnam)
AdcChannelData& AdcChannelData::operator= ( const AdcChannelData )
delete
AdcChannelData& AdcChannelData::operator= ( AdcChannelData &&  )
default
void AdcChannelData::roisFromSignal ( )
inline

Definition at line 413 of file AdcChannelData.h.

413  {
414  rois.clear();
415  bool inRoi = false;
416  for ( unsigned int isig=0; isig<signal.size(); ++isig ) {
417  if ( inRoi ) {
418  AdcRoi& roi = rois.back();
419  if ( signal[isig] ) roi.second = isig;
420  else inRoi = false;
421  } else {
422  if ( signal[isig] ) {
423  rois.push_back(AdcRoi(isig, isig));
424  inRoi = true;
425  }
426  }
427  }
428 }
std::pair< AdcIndex, AdcIndex > AdcRoi
Definition: AdcTypes.h:54
AdcRoiVector rois
AdcFilterVector signal
AdcIndex AdcChannelData::run ( ) const
inline

Definition at line 174 of file AdcChannelData.h.

174 { return getEventInfo().run; }
const DuneEventInfo & getEventInfo() const
void AdcChannelData::setChannelInfo ( ChannelInfoPtr  pchi)
inline

Definition at line 184 of file AdcChannelData.h.

184 { m_pchanInfo = pchi; }
ChannelInfoPtr m_pchanInfo
void AdcChannelData::setChannelInfo ( const ChannelInfo pchi)
inline

Definition at line 185 of file AdcChannelData.h.

185 { m_pchanInfo.reset(pchi); }
ChannelInfoPtr m_pchanInfo
void AdcChannelData::setChannelInfo ( Channel  a_channel,
Index  a_fembID = badIndex(),
Index  a_fembChannel = badIndex(),
Index  a_channelStatus = badIndex() 
)
inline

Definition at line 186 of file AdcChannelData.h.

189  {
190  setChannelInfo(new ChannelInfo(a_channel, a_fembID, a_fembChannel, a_channelStatus));
191  }
void setChannelInfo(ChannelInfoPtr pchi)
DuneChannelInfo ChannelInfo
void AdcChannelData::setEventInfo ( EventInfoPtr  pevi)
inline

Definition at line 160 of file AdcChannelData.h.

160 { m_peventInfo = pevi; }
EventInfoPtr m_peventInfo
void AdcChannelData::setEventInfo ( const EventInfo pevi)
inline

Definition at line 161 of file AdcChannelData.h.

161 { m_peventInfo.reset(pevi); }
EventInfoPtr m_peventInfo
void AdcChannelData::setEventInfo ( Index  a_run,
Index  a_event,
Index  a_subRun = badIndex(),
time_t  a_time = 0,
int  a_timerem = 0,
Index  a_trigger = badIndex(),
LongIndex  a_triggerClock = badLongIndex() 
)
inline

Definition at line 162 of file AdcChannelData.h.

164  {
165  setEventInfo(new EventInfo(a_run, a_event, a_subRun, a_time, a_timerem, a_trigger, a_triggerClock));
166  }
void setEventInfo(EventInfoPtr pevi)
DuneEventInfo EventInfo
void AdcChannelData::setMetadata ( Name  mname,
float  val 
)
inline

Definition at line 252 of file AdcChannelData.h.

252  {
253  metadata[mname] = val;
254  }
AdcIndex AdcChannelData::subRun ( ) const
inline

Definition at line 175 of file AdcChannelData.h.

175 { return getEventInfo().subRun; }
const DuneEventInfo & getEventInfo() const
AdcLongIndex AdcChannelData::tickOffset ( ) const
inline

Definition at line 206 of file AdcChannelData.h.

206  {
207  AdcLongIndex tickoff = triggerTick0();
208  if ( tickoff == EventInfo::badLongIndex() ) tickoff = 0;
209  if ( tick0 < 0 ) return tickoff - AdcLongIndex(-tick0);
210  return tickoff + AdcLongIndex(tick0);
211  }
AdcLongIndex triggerTick0() const
static LongIndex badLongIndex()
Definition: DuneEventInfo.h:31
unsigned long AdcLongIndex
Definition: AdcTypes.h:16
time_t AdcChannelData::time ( ) const
inline

Definition at line 177 of file AdcChannelData.h.

177 { return getEventInfo().time; }
const DuneEventInfo & getEventInfo() const
int AdcChannelData::timerem ( ) const
inline

Definition at line 178 of file AdcChannelData.h.

178 { return getEventInfo().timerem; }
const DuneEventInfo & getEventInfo() const
AdcIndex AdcChannelData::trigger ( ) const
inline

Definition at line 179 of file AdcChannelData.h.

179 { return getEventInfo().trigger; }
const DuneEventInfo & getEventInfo() const
AdcLongIndex AdcChannelData::triggerClock ( ) const
inline

Definition at line 180 of file AdcChannelData.h.

180 { return getEventInfo().triggerClock; }
const DuneEventInfo & getEventInfo() const
LongIndex triggerClock
Definition: DuneEventInfo.h:27
AdcLongIndex AdcChannelData::triggerTick0 ( ) const
inline

Definition at line 181 of file AdcChannelData.h.

181 { return getEventInfo().triggerTick0; }
LongIndex triggerTick0
Definition: DuneEventInfo.h:28
const DuneEventInfo & getEventInfo() const
AdcChannelData::View & AdcChannelData::updateView ( Name  vnam)

Definition at line 466 of file AdcChannelData.h.

466  {
467  const Name myname = "AdcChannelData::updateView: ";
468  if ( vnam.size() == 0 ) {
469  std::cout << myname << "WARNING: View name may not be blank." << std::endl;
470  static View emptyView;
471  if ( emptyView.size() ) {
472  std::cout << myname << "ERROR: Empty view has been modified." << std::endl;
473  }
474  return emptyView;
475  }
476  return m_views[vnam];
477 }
AdcChannelData::View View
ChannelGroupService::Name Name
QTextStream & endl(QTextStream &s)
const AdcChannelData::View & AdcChannelData::view ( Name  vnam) const

Definition at line 457 of file AdcChannelData.h.

457  {
458  static const View empty;
459  ViewMap::const_iterator ivie = m_views.find(vnam);
460  if ( ivie == m_views.end() ) return empty;
461  return ivie->second;
462 }
AdcChannelData::View View
intermediate_table::const_iterator const_iterator
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:97
const AdcChannelData * AdcChannelData::viewEntry ( Name  vpnam,
AdcIndex  ient 
) const

Definition at line 494 of file AdcChannelData.h.

494  {
495  if ( vpnam.size() == 0 ) {
496  if ( ient == 0 ) return this;
497  else return nullptr;
498  }
499  Name::size_type ipos = vpnam.find("/");
500  if ( ipos == Name::npos ) {
501  const View& myview = view(vpnam);
502  if ( ient < myview.size() ) return &myview[ient];
503  return nullptr;
504  }
505  Name vnam = vpnam.substr(0, ipos);
506  Name vsnam = vpnam.substr(ipos + 1);
507  AdcIndex ientRem = ient;
508  for ( const AdcChannelData& dat : view(vnam) ) {
509  AdcIndex nvie = dat.viewSize(vsnam);
510  if ( ientRem < nvie ) return dat.viewEntry(vsnam, ientRem);
511  ientRem -= nvie;
512  }
513  return nullptr;
514 }
AdcChannelData::View View
ChannelGroupService::Name Name
unsigned int AdcIndex
Definition: AdcTypes.h:15
const View & view(Name vnam) const
AdcChannelData::NameVector AdcChannelData::viewNames ( ) const

Definition at line 432 of file AdcChannelData.h.

432  {
433  NameVector vnams;
434  for ( ViewMap::value_type ivie : m_views ) {
435  vnams.push_back(ivie.first);
436  }
437  return vnams;
438 }
std::vector< string > NameVector
size_t AdcChannelData::viewSize ( ) const
inline

Definition at line 340 of file AdcChannelData.h.

340 { return m_views.size(); }
AdcIndex AdcChannelData::viewSize ( Name  vpnam) const

Definition at line 481 of file AdcChannelData.h.

481  {
482  if ( vpnam.size() == 0 ) return 1;
483  Name::size_type ipos = vpnam.find("/");
484  if ( ipos == Name::npos ) return view(vpnam).size();
485  Name vnam = vpnam.substr(0, ipos);
486  Name vsnam = vpnam.substr(ipos + 1);
487  AdcIndex nvie = 0;
488  for ( const AdcChannelData& dat : view(vnam) ) nvie += dat.viewSize(vsnam);
489  return nvie;
490 }
ChannelGroupService::Name Name
unsigned int AdcIndex
Definition: AdcTypes.h:15
const View & view(Name vnam) const

Member Data Documentation

AdcSignalVectorVector AdcChannelData::binSamples

Definition at line 132 of file AdcChannelData.h.

AdcLongIndex AdcChannelData::channelClock =0

Definition at line 126 of file AdcChannelData.h.

AdcSignalVector AdcChannelData::dftmags

Definition at line 138 of file AdcChannelData.h.

AdcSignalVector AdcChannelData::dftphases

Definition at line 139 of file AdcChannelData.h.

const raw::RawDigit* AdcChannelData::digit =nullptr

Definition at line 144 of file AdcChannelData.h.

AdcIndex AdcChannelData::digitIndex =badIndex()

Definition at line 146 of file AdcChannelData.h.

AdcFlagVector AdcChannelData::flags

Definition at line 135 of file AdcChannelData.h.

ChannelInfoPtr AdcChannelData::m_pchanInfo
private

Definition at line 152 of file AdcChannelData.h.

EventInfoPtr AdcChannelData::m_peventInfo
private

Definition at line 151 of file AdcChannelData.h.

ViewMap AdcChannelData::m_views
private

Definition at line 155 of file AdcChannelData.h.

FloatMap AdcChannelData::metadata

Definition at line 140 of file AdcChannelData.h.

AdcSignal AdcChannelData::pedestal =badSignal()

Definition at line 128 of file AdcChannelData.h.

AdcSignal AdcChannelData::pedestalRms =0.0

Definition at line 129 of file AdcChannelData.h.

AdcCountVector AdcChannelData::raw

Definition at line 130 of file AdcChannelData.h.

AdcRoiVector AdcChannelData::rois

Definition at line 137 of file AdcChannelData.h.

AdcSignal AdcChannelData::sampleNoise =0.0

Definition at line 134 of file AdcChannelData.h.

AdcSignalVector AdcChannelData::samples

Definition at line 131 of file AdcChannelData.h.

Name AdcChannelData::sampleUnit

Definition at line 133 of file AdcChannelData.h.

AdcFilterVector AdcChannelData::signal

Definition at line 136 of file AdcChannelData.h.

AdcInt AdcChannelData::tick0 = 0

Definition at line 127 of file AdcChannelData.h.

AdcChannelData* AdcChannelData::viewParent =nullptr

Definition at line 141 of file AdcChannelData.h.

const recob::Wire* AdcChannelData::wire =nullptr

Definition at line 145 of file AdcChannelData.h.

AdcIndex AdcChannelData::wireIndex =badIndex()

Definition at line 147 of file AdcChannelData.h.


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