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

Update for new EICD tracker data structures

parent 03eeec25
......@@ -51,11 +51,13 @@ namespace Jug {
// Create output collections
auto rawhits = m_outputHitCollection.createAndPut();
std::map<long long, int> cell_hit_map;
int ID = 0;
for (const auto& ahit : *simhits) {
// std::cout << ahit << "\n";
if (cell_hit_map.count(ahit.cellID()) == 0) {
cell_hit_map[ahit.cellID()] = rawhits->size();
eic::RawTrackerHit rawhit((long long)ahit.cellID(),
ID++,
ahit.truth().time * 1e6 + m_gaussDist() * 1e6, // ns->fs
std::llround(ahit.energyDeposit() * 1e6));
rawhits->push_back(rawhit);
......
......@@ -58,6 +58,7 @@ namespace Jug::Digi {
auto rawhits = m_outputHitCollection.createAndPut();
// eic::RawTrackerHitCollection* rawHitCollection = new eic::RawTrackerHitCollection();
std::map<long long, int> cell_hit_map;
int ID = 0;
for (const auto& ahit : *simhits) {
debug() << "--------------------" << ahit.cellID() << endmsg;
debug() << "Hit in cellID = " << ahit.cellID() << endmsg;
......@@ -67,7 +68,8 @@ namespace Jug::Digi {
// std::cout << ahit << "\n";
if (cell_hit_map.count(ahit.cellID()) == 0) {
cell_hit_map[ahit.cellID()] = rawhits->size();
eic::RawTrackerHit rawhit((long long)ahit.cellID(),
eic::RawTrackerHit rawhit((int64_t)ahit.cellID(),
ID++,
ahit.truth().time * 1e6 + m_gaussDist() * 1e3, // ns->fs
std::llround(ahit.energyDeposit() * 1e6));
rawhits->push_back(rawhit);
......
......@@ -58,6 +58,7 @@ namespace Jug::Digi {
auto rawhits = m_outputHitCollection.createAndPut();
// eic::RawTrackerHitCollection* rawHitCollection = new eic::RawTrackerHitCollection();
std::map<long long, int> cell_hit_map;
int ID = 0;
for (const auto& ahit : *simhits) {
debug() << "--------------------" << ahit.cellID() << endmsg;
debug() << "Hit in cellID = " << ahit.cellID() << endmsg;
......@@ -67,7 +68,8 @@ namespace Jug::Digi {
// std::cout << ahit << "\n";
if (cell_hit_map.count(ahit.cellID()) == 0) {
cell_hit_map[ahit.cellID()] = rawhits->size();
eic::RawTrackerHit rawhit((long long)ahit.cellID(),
eic::RawTrackerHit rawhit((int64_t)ahit.cellID(),
ID++,
ahit.truth().time * 1e6 + m_gaussDist() * 1e3, // ns->fs
std::llround(ahit.energyDeposit() * 1e6));
rawhits->push_back(rawhit);
......
......@@ -89,12 +89,12 @@ namespace Jug {
// std::array<double,3> posarr; pos.GetCoordinates(posarr);
// std::array<double,3> dimarr; dim.GetCoordinates(posarr);
// eic::TrackerHit hit;
eic::TrackerHit hit((long long)ahit.cellID(),
(float)ahit.time() / 1000, // ps
eic::TrackerHit hit{(long long)ahit.cellID(),
ahit.ID(),
{pos.x() / mm, pos.y() / mm, pos.z() / mm, (float)ahit.time()/1000}, // mm, ns
{(dim[0]/mm)*(dim[0]/mm), (dim[1]/mm)*(dim[1]/mm), 0.0, 0.0}, //
(float)ahit.charge() / 1.0e6, // GeV
(float)0.0,
{pos.x() / mm, pos.y() / mm, pos.z() / mm},
{(dim[0]/mm)*(dim[0]/mm), (dim[1]/mm)*(dim[1]/mm), 0.0});
0.0f};
rec_hits->push_back(hit);
}
return StatusCode::SUCCESS;
......
......@@ -92,6 +92,7 @@ namespace Jug::Reco {
// Get the fitted track parameter
bool m_hasFittedParams = false;
int ID = 0;
if (traj.hasTrackParameters(trackTip)) {
m_hasFittedParams = true;
const auto& boundParam = traj.trackParameters(trackTip);
......@@ -112,27 +113,19 @@ namespace Jug::Reco {
debug() << " chi2 = " << trajState.chi2Sum << endmsg;
eic::TrackParameters pars({parameter[Acts::eBoundLoc0], parameter[Acts::eBoundLoc1],
parameter[Acts::eBoundPhi], parameter[Acts::eBoundTheta],
parameter[Acts::eBoundQOverP], parameter[Acts::eBoundTime],
sqrt(covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)),
sqrt(covariance(Acts::eBoundLoc1, Acts::eBoundLoc1)),
sqrt(covariance(Acts::eBoundPhi, Acts::eBoundPhi)),
sqrt(covariance(Acts::eBoundTheta, Acts::eBoundTheta)),
sqrt(covariance(Acts::eBoundQOverP, Acts::eBoundQOverP)),
sqrt(covariance(Acts::eBoundTime, Acts::eBoundTime))});
eic::TrackParameters pars{
ID++,
{parameter[Acts::eBoundLoc0], parameter[Acts::eBoundLoc1]},
{sqrt(covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)),
sqrt(covariance(Acts::eBoundLoc1, Acts::eBoundLoc1))},
{parameter[Acts::eBoundPhi], parameter[Acts::eBoundTheta]},
{sqrt(covariance(Acts::eBoundPhi, Acts::eBoundPhi)),
sqrt(covariance(Acts::eBoundTheta, Acts::eBoundTheta))},
parameter[Acts::eBoundQOverP],
sqrt(covariance(Acts::eBoundQOverP, Acts::eBoundQOverP)),
parameter[Acts::eBoundTime],
sqrt(covariance(Acts::eBoundTime, Acts::eBoundTime))};
track_pars->push_back(pars);
// m_ePHI_fit = parameter[Acts::eBoundPhi];
// m_eTHETA_fit = parameter[Acts::eBoundTheta];
// m_eQOP_fit = parameter[Acts::eBoundQOverP];
// m_eT_fit = parameter[Acts::eBoundTime];
// m_err_eLOC0_fit = sqrt(covariance(Acts::eBoundLoc0, Acts::eBoundLoc0));
// m_err_eLOC1_fit = sqrt(covariance(Acts::eBoundLoc1, Acts::eBoundLoc1));
// m_err_ePHI_fit = sqrt(covariance(Acts::eBoundPhi, Acts::eBoundPhi));
// m_err_eTHETA_fit = sqrt(covariance(Acts::eBoundTheta, Acts::eBoundTheta));
// m_err_eQOP_fit = sqrt(covariance(Acts::eBoundQOverP, Acts::eBoundQOverP));
// m_err_eT_fit = sqrt(covariance(Acts::eBoundTime, Acts::eBoundTime));
}
auto tsize = trackTips.size();
......
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