All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 ()
 
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)
 
- Private Member Functions inherited from util::DataProductChangeTracker_t
 DataProductChangeTracker_t ()=default
 Default constructor: no current data product. More...
 
 DataProductChangeTracker_t (art::Event const &evt, art::InputTag const &label)
 Constructor: specifies current event and data product label. More...
 
 DataProductChangeTracker_t (art::EventID const &evt_id, art::InputTag const &label)
 Constructor: specifies current event ID and data product label. More...
 
 operator std::string () const
 Returns a string representation of event and data product label. More...
 
art::InputTag const & inputLabel () const
 
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 isValid () const
 Returns whether there is a current event and data product. 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...
 
void clear ()
 
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...
 

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  :
228  DataProductChangeTracker_t(evt, label), state{pid}
229  {}
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 232 of file ChangeTrackers.h.

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

Definition at line 280 of file ChangeTrackers.h.

The data type to uniquely identify a Plane.
Definition: geo_types.h:472
void SetPlaneID(geo::PlaneID const &pid)
bool util::PlaneDataChangeTracker_t::isValid ( ) const
inline

Returns whether there is a data product and plane.

Definition at line 264 of file ChangeTrackers.h.

bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
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::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.

273  { return !same(than); }
bool same(PlaneDataChangeTracker_t const &as) const
Returns whether we have the same plane data as &quot;as&quot;.
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.

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

Returns the current plane ID.

Definition at line 246 of file ChangeTrackers.h.

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.

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::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.

250  { return DataProductChangeTracker_t::same(as); }
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in &quot;as&quot;.
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.

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:386
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::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.

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

Definition at line 313 of file ChangeTrackers.h.

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.

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 &quot;as&quot;.

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: