LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
util::PlaneDataChangeTracker_t Class Reference

Detects the presence of a new event, data product or wire plane. More...

#include "ChangeTrackers.h"

Inheritance diagram for util::PlaneDataChangeTracker_t:
util::DataProductChangeTracker_t

Classes

struct  LocalState_t
 

Public Member Functions

 PlaneDataChangeTracker_t ()=default
 Default constructor: no current plane data. More...
 
 PlaneDataChangeTracker_t (art::Event const &evt, art::InputTag const &label, geo::PlaneID const &pid)
 Constructor: specifies current data product and TPC plane. More...
 
 PlaneDataChangeTracker_t (art::EventID const &evt_id, art::InputTag const &label, geo::PlaneID const &pid)
 Constructor: specifies current data product and TPC plane. More...
 
 operator std::string () const
 Returns a string representation of event and data product label. More...
 
State query

Returns the current input label

geo::PlaneID const & planeID () const
 Returns the current plane ID. More...
 
bool sameProduct (PlaneDataChangeTracker_t const &as) const
 Returns whether we are in the same event (the rest could differ) More...
 
bool sameTPC (PlaneDataChangeTracker_t const &as) const
 Returns whether we have the same data product and TPC as "as". More...
 
bool same (PlaneDataChangeTracker_t const &as) const
 Returns whether we have the same plane data as "as". More...
 
bool isValid () const
 Returns whether there is a data product and plane. More...
 
bool operator== (PlaneDataChangeTracker_t const &as) const
 Returns whether data product and TPC plane are the same as in "as". More...
 
bool operator!= (PlaneDataChangeTracker_t const &than) const
 Returns whether data product or TPC plane are different than in "than". More...
 
State change

Forget the current data product

void clear ()
 Set a new event and data product label as current. More...
 
void set (art::Event const &evt, art::InputTag const &label, geo::PlaneID const &pid)
 Set a new event and data product label as current. More...
 
bool update (PlaneDataChangeTracker_t const &new_prod)
 Update to a new data product, return true if it has changed. More...
 

Private Member Functions

void SetPlaneID (geo::PlaneID const &pid)
 
State query

Returns the current input label

art::InputTag const & inputLabel () const
 Returns whether we are in the same event (the rest could differ) More...
 
bool sameEvent (DataProductChangeTracker_t const &as) const
 Returns whether we are in the same event (the rest could differ) More...
 
bool same (DataProductChangeTracker_t const &as) const
 Returns whether we have same data product as in "as". More...
 
bool operator== (DataProductChangeTracker_t const &as) const
 Returns whether the event and input label are the same as in "as". More...
 
bool operator!= (DataProductChangeTracker_t const &than) const
 Returns whether the event or input label are different than in "than". More...
 
State query

Returns whether this tracker is in the same state as another

bool same (EventChangeTracker_t const &as) const
 Returns whether this tracker is in the same state as another. More...
 
bool operator== (EventChangeTracker_t const &as) const
 Returns whether this tracker is in the same state as another. More...
 
bool operator!= (EventChangeTracker_t const &than) const
 Returns whether this tracker is in a different state than another. More...
 
State change

Forget the current data product

void set (art::Event const &evt, art::InputTag const &label)
 Set a new event and data product label as current. More...
 
bool update (DataProductChangeTracker_t const &new_prod)
 Update to a new data product, return true if it has changed. More...
 
State change

Forgets the current event

void set (art::EventID const &evt_id)
 Sets the current event ID. More...
 
void set (art::Event const &evt)
 Sets the current event ID from the given event. More...
 
bool update (EventChangeTracker_t const &trk)
 Sets the current event, and returns true if it is changed. More...
 

Private Attributes

LocalState_t state
 

Detailed Description

Detects the presence of a new event, data product or wire plane.


The state of this class describes the current data product input as the event it belongs to (by its ID) and the input tag, and the current wire plane in the TPC.

Definition at line 218 of file ChangeTrackers.h.

Constructor & Destructor Documentation

util::PlaneDataChangeTracker_t::PlaneDataChangeTracker_t ( )
default

Default constructor: no current plane data.

util::PlaneDataChangeTracker_t::PlaneDataChangeTracker_t ( art::Event const &  evt,
art::InputTag const &  label,
geo::PlaneID const &  pid 
)
inline

Constructor: specifies current data product and TPC plane.

Definition at line 225 of file ChangeTrackers.h.

227  :
229  {}
DataProductChangeTracker_t()=default
Default constructor: no current data product.
TCEvent evt
Definition: DataStructs.cxx:5
util::PlaneDataChangeTracker_t::PlaneDataChangeTracker_t ( art::EventID const &  evt_id,
art::InputTag const &  label,
geo::PlaneID const &  pid 
)
inline

Constructor: specifies current data product and TPC plane.

Definition at line 232 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::inputLabel().

235  :
236  DataProductChangeTracker_t(evt_id, label), state{pid}
237  {}
DataProductChangeTracker_t()=default
Default constructor: no current data product.

Member Function Documentation

void util::PlaneDataChangeTracker_t::clear ( )
inline

Set a new event and data product label as current.

Definition at line 280 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::clear().

The data type to uniquely identify a Plane.
Definition: geo_types.h:250
void SetPlaneID(geo::PlaneID const &pid)
void clear()
Set a new event and data product label as current.
art::InputTag const& util::DataProductChangeTracker_t::inputLabel ( ) const
inlineinherited
bool util::PlaneDataChangeTracker_t::isValid ( ) const
inline

Returns whether there is a data product and plane.

Definition at line 264 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::isValid().

bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:129
geo::PlaneID const & planeID() const
Returns the current plane ID.
bool isValid() const
Returns whether there is a current event and data product.
util::PlaneDataChangeTracker_t::operator std::string ( ) const
inline

Returns a string representation of event and data product label.

Definition at line 300 of file ChangeTrackers.h.

301  {
302  return DataProductChangeTracker_t::operator std::string()
303  + " " + std::string(planeID());
304  }
geo::PlaneID const & planeID() const
Returns the current plane ID.
bool util::EventChangeTracker_t::operator!= ( EventChangeTracker_t const &  than) const
inlineinherited

Returns whether this tracker is in a different state than another.

Definition at line 56 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

57  { return !same(than); }
bool same(EventChangeTracker_t const &as) const
Returns whether this tracker is in the same state as another.
bool util::DataProductChangeTracker_t::operator!= ( DataProductChangeTracker_t const &  than) const
inlineinherited

Returns whether the event or input label are different than in "than".

Definition at line 160 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

161  { return !same(than); }
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in "as".
bool util::PlaneDataChangeTracker_t::operator!= ( PlaneDataChangeTracker_t const &  than) const
inline

Returns whether data product or TPC plane are different than in "than".

Definition at line 272 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

273  { return !same(than); }
bool same(PlaneDataChangeTracker_t const &as) const
Returns whether we have the same plane data as "as".
bool util::EventChangeTracker_t::operator== ( EventChangeTracker_t const &  as) const
inlineinherited

Returns whether this tracker is in the same state as another.

Definition at line 53 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

53 { return same(as); }
bool same(EventChangeTracker_t const &as) const
Returns whether this tracker is in the same state as another.
bool util::DataProductChangeTracker_t::operator== ( DataProductChangeTracker_t const &  as) const
inlineinherited

Returns whether the event and input label are the same as in "as".

Definition at line 156 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

157  { return same(as); }
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in "as".
bool util::PlaneDataChangeTracker_t::operator== ( PlaneDataChangeTracker_t const &  as) const
inline

Returns whether data product and TPC plane are the same as in "as".

Definition at line 268 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

269  { return same(as); }
bool same(PlaneDataChangeTracker_t const &as) const
Returns whether we have the same plane data as "as".
geo::PlaneID const& util::PlaneDataChangeTracker_t::planeID ( ) const
inline

Returns the current plane ID.

Definition at line 246 of file ChangeTrackers.h.

References util::EventChangeTracker_t::state.

Referenced by same(), and sameTPC().

bool util::EventChangeTracker_t::same ( EventChangeTracker_t const &  as) const
inlineinherited
bool util::DataProductChangeTracker_t::same ( DataProductChangeTracker_t const &  as) const
inlineinherited

Returns whether we have same data product as in "as".

Definition at line 145 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::inputLabel().

Referenced by sameProduct().

146  { return sameEvent(as) && (inputLabel() == as.inputLabel()); }
art::InputTag const & inputLabel() const
Returns whether we are in the same event (the rest could differ)
bool sameEvent(DataProductChangeTracker_t const &as) const
Returns whether we are in the same event (the rest could differ)
bool util::PlaneDataChangeTracker_t::same ( PlaneDataChangeTracker_t const &  as) const
inline

Returns whether we have the same plane data as "as".

Definition at line 260 of file ChangeTrackers.h.

References planeID().

261  { return sameEvent(as) && (planeID() == as.planeID()); }
geo::PlaneID const & planeID() const
Returns the current plane ID.
bool sameEvent(DataProductChangeTracker_t const &as) const
Returns whether we are in the same event (the rest could differ)
bool util::DataProductChangeTracker_t::sameEvent ( DataProductChangeTracker_t const &  as) const
inlineinherited

Returns whether we are in the same event (the rest could differ)

Definition at line 141 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

142  { return EventChangeTracker_t::same(as); }
bool same(EventChangeTracker_t const &as) const
Returns whether this tracker is in the same state as another.
bool util::PlaneDataChangeTracker_t::sameProduct ( PlaneDataChangeTracker_t const &  as) const
inline

Returns whether we are in the same event (the rest could differ)

Definition at line 249 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::same().

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

250  { return DataProductChangeTracker_t::same(as); }
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in "as".
bool util::PlaneDataChangeTracker_t::sameTPC ( PlaneDataChangeTracker_t const &  as) const
inline

Returns whether we have the same data product and TPC as "as".

Definition at line 253 of file ChangeTrackers.h.

References planeID().

254  {
255  return sameEvent(as)
256  && (static_cast<geo::TPCID const&>(planeID()) == as.planeID());
257  }
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
geo::PlaneID const & planeID() const
Returns the current plane ID.
bool sameEvent(DataProductChangeTracker_t const &as) const
Returns whether we are in the same event (the rest could differ)
void util::EventChangeTracker_t::set ( art::EventID const &  evt_id)
inlineinherited

Sets the current event ID.

Definition at line 66 of file ChangeTrackers.h.

References util::EventChangeTracker_t::LocalState_t::event_id, and util::EventChangeTracker_t::state.

Referenced by util::DataProductChangeTracker_t::set().

66 { state.event_id = evt_id; }
art::EventID event_id
ID of the current event.
LocalState_t state
local state of the tracker (may inherit some more)
void util::EventChangeTracker_t::set ( art::Event const &  evt)
inlineinherited

Sets the current event ID from the given event.

Definition at line 69 of file ChangeTrackers.h.

References tca::evt.

69 { set(evt.id()); }
TCEvent evt
Definition: DataStructs.cxx:5
void util::DataProductChangeTracker_t::set ( art::Event const &  evt,
art::InputTag const &  label 
)
inlineinherited

Set a new event and data product label as current.

Definition at line 172 of file ChangeTrackers.h.

References util::EventChangeTracker_t::set().

Referenced by set().

void set(art::EventID const &evt_id)
Sets the current event ID.
void SetInputLabel(art::InputTag const &label)
TCEvent evt
Definition: DataStructs.cxx:5
void util::PlaneDataChangeTracker_t::set ( art::Event const &  evt,
art::InputTag const &  label,
geo::PlaneID const &  pid 
)
inline

Set a new event and data product label as current.

Definition at line 284 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::set().

void SetPlaneID(geo::PlaneID const &pid)
void set(art::Event const &evt, art::InputTag const &label)
Set a new event and data product label as current.
TCEvent evt
Definition: DataStructs.cxx:5
void util::PlaneDataChangeTracker_t::SetPlaneID ( geo::PlaneID const &  pid)
inlineprivate
bool util::EventChangeTracker_t::update ( EventChangeTracker_t const &  trk)
inlineinherited

Sets the current event, and returns true if it is changed.

Definition at line 72 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

73  {
74  if (same(trk)) return false;
75  *this = trk;
76  return true;
77  }
bool same(EventChangeTracker_t const &as) const
Returns whether this tracker is in the same state as another.
bool util::DataProductChangeTracker_t::update ( DataProductChangeTracker_t const &  new_prod)
inlineinherited

Update to a new data product, return true if it has changed.

Definition at line 176 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

Referenced by evd::TWQProjectionView::OnNewEvent().

177  {
178  if (same(new_prod)) return false;
179  *this = new_prod;
180  return true;
181  }
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in "as".
bool util::PlaneDataChangeTracker_t::update ( PlaneDataChangeTracker_t const &  new_prod)
inline

Update to a new data product, return true if it has changed.

Definition at line 290 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

291  {
292  if (same(new_prod)) return false;
293  *this = new_prod;
294  return true;
295  }
bool same(PlaneDataChangeTracker_t const &as) const
Returns whether we have the same plane data as "as".

Member Data Documentation

LocalState_t util::PlaneDataChangeTracker_t::state
private

Definition at line 311 of file ChangeTrackers.h.


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