LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 210 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 216 of file ChangeTrackers.h.

220  {}
DataProductChangeTracker_t()=default
Default constructor: no current data product.
TCEvent evt
Definition: DataStructs.cxx:8
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 223 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::inputLabel().

226  : DataProductChangeTracker_t(evt_id, label), state{pid}
227  {}
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 268 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::clear().

269  {
272  }
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
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 256 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::isValid().

bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:210
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 292 of file ChangeTrackers.h.

293  {
294  return DataProductChangeTracker_t::operator std::string() + " " + std::string(planeID());
295  }
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 54 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

54 { 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 151 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

151 { 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 262 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

262 { 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 51 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

51 { 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 148 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

148 { 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 259 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

259 { 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 235 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 136 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::inputLabel().

Referenced by sameProduct().

137  {
138  return sameEvent(as) && (inputLabel() == as.inputLabel());
139  }
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 250 of file ChangeTrackers.h.

References planeID().

251  {
252  return sameEvent(as) && (planeID() == as.planeID());
253  }
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 130 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

131  {
132  return EventChangeTracker_t::same(as);
133  }
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 238 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::same().

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

239  {
241  }
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 244 of file ChangeTrackers.h.

References planeID().

245  {
246  return sameEvent(as) && (static_cast<geo::TPCID const&>(planeID()) == as.planeID());
247  }
The data type to uniquely identify a TPC.
Definition: geo_types.h:381
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 63 of file ChangeTrackers.h.

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

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

63 { 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 66 of file ChangeTrackers.h.

References tca::evt.

66 { set(evt.id()); }
TCEvent evt
Definition: DataStructs.cxx:8
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 164 of file ChangeTrackers.h.

References util::EventChangeTracker_t::set().

Referenced by set().

165  {
167  SetInputLabel(label);
168  }
void set(art::EventID const &evt_id)
Sets the current event ID.
void SetInputLabel(art::InputTag const &label)
TCEvent evt
Definition: DataStructs.cxx:8
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 275 of file ChangeTrackers.h.

References util::DataProductChangeTracker_t::set().

276  {
278  SetPlaneID(pid);
279  }
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:8
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 69 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

70  {
71  if (same(trk)) return false;
72  *this = trk;
73  return true;
74  }
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 171 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

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

172  {
173  if (same(new_prod)) return false;
174  *this = new_prod;
175  return true;
176  }
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 282 of file ChangeTrackers.h.

References util::EventChangeTracker_t::same().

283  {
284  if (same(new_prod)) return false;
285  *this = new_prod;
286  return true;
287  }
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 302 of file ChangeTrackers.h.


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