Commit c798fa78 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Update pid eicd

parent d644349c
......@@ -118,9 +118,14 @@ public:
}
// build hit
int ID = 0;
for (auto &it : hit_groups) {
for (auto &data : it.second) {
eic::RawPMTHit hit(it.first, (unsigned) data.signal, (unsigned) data.time/(m_timeStep/ns));
eic::RawPMTHit hit{
it.first,
ID++,
static_cast<uint32_t>(data.signal),
static_cast<uint32_t>(data.time/(m_timeStep/ns))};
raw.push_back(hit);
}
}
......
......@@ -80,19 +80,28 @@ namespace Jug::Reco {
// Create output collections
auto& hits = *m_outputHitCollection.createAndPut();
// reconstrut number of photo-electrons and time
// reconstruct number of photo-electrons and time
for (const auto& rh : rawhits) {
float npe = (rh.amplitude() - m_pedMean) / m_speMean;
if (npe >= m_minNpe) {
float time = rh.timeStamp() * (m_timeStep / ns);
float time = rh.time() * (m_timeStep / ns);
auto id = rh.cellID();
// global positions
auto gpos = m_geoSvc->cellIDPositionConverter()->position(id);
// local positions
auto pos =
m_geoSvc->cellIDPositionConverter()->findContext(id)->volumePlacement().position();
// cell dimension
auto dim = m_geoSvc->cellIDPositionConverter()->cellDimensions(id);
hits.push_back(eic::PMTHit{
id, npe, time, {gpos.x(), gpos.y(), gpos.z()}, {pos.x(), pos.y(), pos.z()}});
rh.cellID(),
rh.ID(),
npe,
time,
m_timeStep / ns,
{gpos.x(), gpos.y(), gpos.z()},
{pos.x(), pos.y(), pos.z()},
{dim[0]/mm, dim[1]/mm, dim[2]/mm}});
}
}
......
......@@ -26,7 +26,7 @@
// Event Model related classes
#include "FuzzyKClusters.h"
#include "eicd/PMTHitCollection.h"
#include "eicd/RIChClusterCollection.h"
#include "eicd/RingImageCollection.h"
using namespace Gaudi::Units;
using namespace Eigen;
......@@ -40,7 +40,7 @@ namespace Jug::Reco {
class PhotoRingClusters : public GaudiAlgorithm {
public:
DataHandle<eic::PMTHitCollection> m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this};
DataHandle<eic::RIChClusterCollection> m_outputClusterCollection{"outputClusterCollection",
DataHandle<eic::RingImageCollection> m_outputClusterCollection{"outputClusterCollection",
Gaudi::DataHandle::Writer, this};
// @TODO
// A more realistic way is to have tracker info as the input to determine how much clusters should be found
......@@ -95,10 +95,17 @@ namespace Jug::Reco {
auto res = alg.Fit(data, m_nRings, m_q, m_eps, m_nIters);
// local position
// @TODO: Many fields in RingImage not filled, need to assess
// if those are in fact needed
for (int i = 0; i < res.rows(); ++i) {
auto cl = clusters.create();
cl.ID(i);
cl.position({res(i, 0), res(i, 1), 0});
// @TODO: positionError() not set
// @TODO: theta() not set
// @TODO: thetaError() not set
cl.radius(res(i, 2));
// @TODO: radiusError not set
}
return StatusCode::SUCCESS;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment