Public Member Functions | Private Attributes | List of all members
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)
 
bool Initialize () override
 
bool ProcessWire (geo::WireID const &wireID) override
 
bool ProcessTick (size_t tick) override
 
bool Operate (geo::WireID const &wireID, size_t tick, float adc) override
 
bool Finish () override
 
std::string Name () const override
 
OperationBaseClassOperator (size_t iOp)
 
OperationBaseClass const * Operator (size_t iOp) const
 
void AddOperation (std::unique_ptr< OperationBaseClass > new_op)
 
- Public Member Functions inherited from evd::RawDataDrawer::OperationBaseClass
 OperationBaseClass (geo::PlaneID const &pid, RawDataDrawer *data_drawer=nullptr)
 
virtual ~OperationBaseClass ()=default
 
bool operator() (geo::WireID const &wireID, size_t tick, float adc)
 
geo::PlaneID const & PlaneID () const
 
RawDataDrawerRawDataDrawerPtr () const
 

Private Attributes

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

Additional Inherited Members

- Protected Attributes inherited from evd::RawDataDrawer::OperationBaseClass
RawDataDrawerpRawDataDrawer = nullptr
 

Detailed Description

Definition at line 868 of file RawDataDrawer.cxx.

Constructor & Destructor Documentation

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

Definition at line 872 of file RawDataDrawer.cxx.

873  : OperationBaseClass(pid, data_drawer)
874  {}
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 943 of file RawDataDrawer.cxx.

944  {
945  if (!new_op) return;
946  if (PlaneID() != new_op->PlaneID()) {
948  << "RawDataDrawer::ManyOperations(): trying to run operations on "
949  << std::string(PlaneID()) << " and " << std::string(new_op->PlaneID())
950  << " at the same time";
951  }
952  if (RawDataDrawerPtr() && (RawDataDrawerPtr() != new_op->RawDataDrawerPtr())) {
954  << "RawDataDrawer::ManyOperations(): "
955  "trying to run operations on different RawDataDrawer"; // possible, but very unlikely
956  }
957  operations.emplace_back(std::move(new_op));
958  }
std::string string
Definition: nybbler.cc:12
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
def move(depos, offset)
Definition: depos.py:107
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
geo::PlaneID const & PlaneID() const
RawDataDrawer * RawDataDrawerPtr() const
bool evd::RawDataDrawer::ManyOperations::Finish ( )
inlineoverridevirtual

Reimplemented from evd::RawDataDrawer::OperationBaseClass.

Definition at line 909 of file RawDataDrawer.cxx.

910  {
911  bool bAllOk = true;
912  for (std::unique_ptr<OperationBaseClass> const& op : operations)
913  if (!op->Finish()) bAllOk = false;
914  return bAllOk;
915  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
bool evd::RawDataDrawer::ManyOperations::Initialize ( void  )
inlineoverridevirtual

Reimplemented from evd::RawDataDrawer::OperationBaseClass.

Definition at line 877 of file RawDataDrawer.cxx.

878  {
879  bool bAllOk = true;
880  for (std::unique_ptr<OperationBaseClass> const& op : operations)
881  if (!op->Initialize()) bAllOk = false;
882  return bAllOk;
883  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
std::string evd::RawDataDrawer::ManyOperations::Name ( void  ) const
inlineoverridevirtual

Reimplemented from evd::RawDataDrawer::OperationBaseClass.

Definition at line 918 of file RawDataDrawer.cxx.

919  {
920  std::string msg = cet::demangle_symbol(typeid(*this).name());
921  msg += (" [running " + std::to_string(operations.size()) + " operations:");
922  for (auto const& op : operations) { // it's unique_ptr<OperationBaseClass>
923  if (op)
924  msg += " " + op->Name();
925  else
926  msg += " <invalid>";
927  }
928  return msg + " ]";
929  }
void msg(const char *fmt,...)
Definition: message.cpp:107
std::string string
Definition: nybbler.cc:12
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
bool evd::RawDataDrawer::ManyOperations::Operate ( geo::WireID const &  wireID,
size_t  tick,
float  adc 
)
inlineoverridevirtual

Implements evd::RawDataDrawer::OperationBaseClass.

Definition at line 901 of file RawDataDrawer.cxx.

902  {
903  for (std::unique_ptr<OperationBaseClass> const& op : operations)
904  if (!op->Operate(wireID, tick, adc)) return false;
905  return true;
906  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
int16_t adc
Definition: CRTFragment.hh:202
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
OperationBaseClass* evd::RawDataDrawer::ManyOperations::Operator ( size_t  iOp)
inline

Definition at line 932 of file RawDataDrawer.cxx.

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

Definition at line 937 of file RawDataDrawer.cxx.

938  {
939  return operations.at(iOp).get();
940  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
bool evd::RawDataDrawer::ManyOperations::ProcessTick ( size_t  tick)
inlineoverridevirtual

Reimplemented from evd::RawDataDrawer::OperationBaseClass.

Definition at line 893 of file RawDataDrawer.cxx.

894  {
895  for (std::unique_ptr<OperationBaseClass> const& op : operations)
896  if (op->ProcessTick(tick)) return true;
897  return false;
898  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:75
bool evd::RawDataDrawer::ManyOperations::ProcessWire ( geo::WireID const &  wireID)
inlineoverridevirtual

Reimplemented from evd::RawDataDrawer::OperationBaseClass.

Definition at line 886 of file RawDataDrawer.cxx.

887  {
888  for (std::unique_ptr<OperationBaseClass> const& op : operations)
889  if (op->ProcessWire(wireID)) return true;
890  return false;
891  }
std::vector< std::unique_ptr< RawDataDrawer::OperationBaseClass > > operations

Member Data Documentation

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

Definition at line 869 of file RawDataDrawer.cxx.


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