15#include "GaudiKernel/IIncidentSvc.h"
16#include "GaudiKernel/FileIncident.h"
24 base_class(
type, name, parent),
39 incSvc->addListener(
this,
"BeginInputFile", 60);
40 incSvc->addListener(
this,
"EndInputFile", 50);
41 return StatusCode::SUCCESS;
46 const FileIncident* fileInc =
dynamic_cast<const FileIncident*
>(&inc);
47 if (fileInc ==
nullptr) {
48 ATH_MSG_ERROR(
" Unable to get FileName from BeginInputFile/EndInputFile incident");
51 ATH_MSG_DEBUG(
"handle() " << inc.type() <<
" for " << fileInc->fileName());
58 std::list<SG::ObjectWithVersion<ExampleHitContainer> > allVersions;
65 auto ep_out_unique = std::make_unique<ExampleHitContainer>();
67 auto entry_out = std::make_unique<ExampleHit>();
68 entry_out->setX(entry->getX());
69 entry_out->setY(entry->getY());
70 entry_out->setZ(entry->getZ());
71 entry_out->setDetector(entry->getDetector());
72 ep_out_unique->push_back(std::move(entry_out));
73 ep_out = ep_out_unique.
get();
79 int weight = entry->getDetector().size() - 2;
80 int weight_out = entry_out->
getDetector().size() - 2;
81 entry_out->
setX((entry->getX() * weight + entry_out->
getX() * weight_out) / (weight + weight_out));
82 entry_out->
setY((entry->getY() * weight + entry_out->
getY() * weight_out) / (weight + weight_out));
83 entry_out->
setZ((entry->getZ() * weight + entry_out->
getZ() * weight_out) / (weight + weight_out));
84 entry_out->
setDetector(entry->getDetector().substr(0, entry->getDetector().size() - 1) + entry_out->
getDetector().substr(1));
87 if (ep_out !=
nullptr) {
89 ATH_MSG_INFO(
"Pedestal x = " << obj->getX() <<
" y = " << obj->getY() <<
" z = " << obj->getZ() <<
" string = " << obj->getDetector());
94 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
This file contains the class definition for the ExampleHitContainer class.
const T * get(size_type n) const
Access an element, as an rvalue.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
This class provides a data vector for ExampleHit objects in AthenaPool.
This class provides a dummy hit data object for AthenaPool.
void setZ(double z)
Set the Z coordinate.
void setX(double x)
Set the X coordinate.
void setDetector(const std::string &detector)
Set the detector string.
void setY(double y)
Set the Y coordinate.
const std::string & getDetector() const
associate a data object with its VersionedKey The object is held by a ReadHandle to delay its retriev...