LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
evd::RawDataDrawer::ManyOperations Class Reference
Inheritance diagram for evd::RawDataDrawer::ManyOperations:
evd::RawDataDrawer::OperationBaseClass

Public Member Functions

 ManyOperations (geo::PlaneID const &pid, RawDataDrawer *data_drawer=nullptr)
 
virtual bool Initialize () override
 
virtual bool ProcessWire (geo::WireID const &wireID) override
 
virtual bool ProcessTick (size_t tick) override
 
virtual bool Operate (geo::WireID const &wireID, size_t tick, float adc) override
 
virtual bool Finish () override
 
virtual std::string Name () const override
 
OperationBaseClassOperator (size_t iOp)
 
OperationBaseClass const * Operator (size_t iOp) const
 
void AddOperation (std::unique_ptr< OperationBaseClass > new_op)
 
bool operator() (geo::WireID const &wireID, size_t tick, float adc)
 
geo::PlaneID const & PlaneID () const
 
RawDataDrawerRawDataDrawerPtr () const
 

Protected Attributes

RawDataDrawerpRawDataDrawer = nullptr
 

Private Attributes

std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
 

Detailed Description

Definition at line 722 of file RawDataDrawer.cxx.

Constructor & Destructor Documentation

evd::RawDataDrawer::ManyOperations::ManyOperations ( geo::PlaneID const &  pid,
RawDataDrawer data_drawer = nullptr 
)
inline

Definition at line 728 of file RawDataDrawer.cxx.

728  :
729  OperationBaseClass(pid, data_drawer)
730  {}
OperationBaseClass(geo::PlaneID const &pid, RawDataDrawer *data_drawer=nullptr)

Member Function Documentation

void evd::RawDataDrawer::ManyOperations::AddOperation ( std::unique_ptr< OperationBaseClass new_op)
inline

Definition at line 786 of file RawDataDrawer.cxx.

References art::errors::LogicError, and evd::RawDataDrawer::RunOperation().

Referenced by evd::RawDataDrawer::RawDigit2D().

787  {
788  if (!new_op) return;
789  if (PlaneID() != new_op->PlaneID()) {
791  << "RawDataDrawer::ManyOperations(): trying to run operations on "
792  << std::string(PlaneID()) << " and "
793  << std::string(new_op->PlaneID()) << " at the same time";
794  }
795  if (RawDataDrawerPtr()
796  && (RawDataDrawerPtr() != new_op->RawDataDrawerPtr())
797  )
798  {
800  << "RawDataDrawer::ManyOperations(): "
801  "trying to run operations on different RawDataDrawer"
802  ; // possible, but very unlikely
803  }
804  operations.emplace_back(std::move(new_op));
805  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
geo::PlaneID const & PlaneID() const
RawDataDrawer * RawDataDrawerPtr() const
virtual bool evd::RawDataDrawer::ManyOperations::Finish ( )
inlineoverridevirtual

Reimplemented from evd::RawDataDrawer::OperationBaseClass.

Definition at line 761 of file RawDataDrawer.cxx.

762  {
763  bool bAllOk = true;
764  for (std::unique_ptr<OperationBaseClass> const& op: operations)
765  if (!op->Finish()) bAllOk = false;
766  return bAllOk;
767  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
virtual bool evd::RawDataDrawer::ManyOperations::Initialize ( )
inlineoverridevirtual

Reimplemented from evd::RawDataDrawer::OperationBaseClass.

Definition at line 732 of file RawDataDrawer.cxx.

733  {
734  bool bAllOk = true;
735  for (std::unique_ptr<OperationBaseClass> const& op: operations)
736  if (!op->Initialize()) bAllOk = false;
737  return bAllOk;
738  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
virtual std::string evd::RawDataDrawer::ManyOperations::Name ( ) const
inlineoverridevirtual

Reimplemented from evd::RawDataDrawer::OperationBaseClass.

Definition at line 769 of file RawDataDrawer.cxx.

References util::flags::to_string().

770  {
771  std::string msg = cet::demangle_symbol(typeid(*this).name());
772  msg +=
773  (" [running " + std::to_string(operations.size()) + " operations:");
774  for (auto const& op: operations) {// it's unique_ptr<OperationBaseClass>
775  if (op) msg += " " + op->Name();
776  else msg += " <invalid>";
777  }
778  return msg + " ]";
779  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
std::string to_string(Flag_t< Storage > const flag)
Convert a flag into a stream (shows its index).
Definition: BitMask.h:187
virtual bool evd::RawDataDrawer::ManyOperations::Operate ( geo::WireID const &  wireID,
size_t  tick,
float  adc 
)
inlineoverridevirtual

Implements evd::RawDataDrawer::OperationBaseClass.

Definition at line 754 of file RawDataDrawer.cxx.

755  {
756  for (std::unique_ptr<OperationBaseClass> const& op: operations)
757  if (!op->Operate(wireID, tick, adc)) return false;
758  return true;
759  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
OperationBaseClass* evd::RawDataDrawer::ManyOperations::Operator ( size_t  iOp)
inline

Definition at line 781 of file RawDataDrawer.cxx.

782  { return operations.at(iOp).get(); }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
OperationBaseClass const* evd::RawDataDrawer::ManyOperations::Operator ( size_t  iOp) const
inline

Definition at line 783 of file RawDataDrawer.cxx.

784  { return operations.at(iOp).get(); }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
bool evd::RawDataDrawer::OperationBaseClass::operator() ( geo::WireID const &  wireID,
size_t  tick,
float  adc 
)
inlineinherited

Definition at line 708 of file RawDataDrawer.cxx.

709  { return Operate(wireID, tick, adc); }
virtual bool Operate(geo::WireID const &wireID, size_t tick, float adc)=0
geo::PlaneID const& evd::RawDataDrawer::OperationBaseClass::PlaneID ( ) const
inlineinherited

Definition at line 711 of file RawDataDrawer.cxx.

Referenced by evd::RawDataDrawer::RunOperation().

711 { return planeID; }
virtual bool evd::RawDataDrawer::ManyOperations::ProcessTick ( size_t  tick)
inlineoverridevirtual

Reimplemented from evd::RawDataDrawer::OperationBaseClass.

Definition at line 746 of file RawDataDrawer.cxx.

747  {
748  for (std::unique_ptr<OperationBaseClass> const& op: operations)
749  if (op->ProcessTick(tick)) return true;
750  return false;
751  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
virtual bool evd::RawDataDrawer::ManyOperations::ProcessWire ( geo::WireID const &  wireID)
inlineoverridevirtual

Reimplemented from evd::RawDataDrawer::OperationBaseClass.

Definition at line 740 of file RawDataDrawer.cxx.

741  {
742  for (std::unique_ptr<OperationBaseClass> const& op: operations)
743  if (op->ProcessWire(wireID)) return true;
744  return false;
745  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
RawDataDrawer* evd::RawDataDrawer::OperationBaseClass::RawDataDrawerPtr ( ) const
inlineinherited

Definition at line 712 of file RawDataDrawer.cxx.

712 { return pRawDataDrawer; }

Member Data Documentation

std::vector<std::unique_ptr<RawDataDrawer::OperationBaseClass> > evd::RawDataDrawer::ManyOperations::operations
private

Definition at line 724 of file RawDataDrawer.cxx.

RawDataDrawer* evd::RawDataDrawer::OperationBaseClass::pRawDataDrawer = nullptr
protectedinherited

Definition at line 715 of file RawDataDrawer.cxx.


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