Commit ec9a8917 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Cluster: split into implementation and definition, remove some old members

parent 03f9fc25
......@@ -16,7 +16,7 @@
#include <TH2F.h>
#include <iostream>
#include "core/module/Module.hpp"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
#include "objects/Track.hpp"
......
......@@ -4,7 +4,7 @@
// Local
#include "AlignmentMillepede.h"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
using namespace corryvreckan;
using namespace std;
......@@ -152,9 +152,9 @@ void AlignmentMillepede::finalise() {
for(auto& cluster : track->clusters()) {
auto detectorID = cluster->detectorID();
auto detector = get_detector(detectorID);
ROOT::Math::XYZPoint pLocal(cluster->localX(), cluster->localY(), 0.);
ROOT::Math::XYZPoint pLocal(cluster->local().x(), cluster->local().y(), 0.);
const auto pGlobal = detector->localToGlobal(pLocal);
cluster->setClusterCentre(pGlobal.x(), pGlobal.y(), pGlobal.z());
cluster->setClusterCentre(pGlobal);
}
}
if(converg < m_convergence)
......@@ -285,9 +285,9 @@ bool AlignmentMillepede::putTrack(Track* track, const size_t nPlanes) {
const auto normal = detector->normal();
double nx = normal.x() / normal.z();
double ny = normal.y() / normal.z();
const double xg = cluster->globalX();
const double yg = cluster->globalY();
const double zg = cluster->globalZ();
const double xg = cluster->global().x();
const double yg = cluster->global().y();
const double zg = cluster->global().z();
// Calculate quasi-local coordinates.
const double zl = zg - detector->displacement().Z();
const double xl = xg - detector->displacement().X();
......
......@@ -10,7 +10,7 @@
#include <TProfile.h>
#include "core/module/Module.hpp"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Track.hpp"
namespace corryvreckan {
......
#include "AnalysisCLICpix.h"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
#include "objects/Track.hpp"
......@@ -273,8 +273,8 @@ StatusCode AnalysisCLICpix::run(std::shared_ptr<Clipboard> clipboard) {
for(auto& cluster : (trackclusters)) {
// Get the distance between this cluster and the track intercept (global)
double xcorr = cluster->globalX() - trackIntercept.X();
double ycorr = cluster->globalY() - trackIntercept.Y();
double xcorr = cluster->global().x() - trackIntercept.X();
double ycorr = cluster->global().y() - trackIntercept.Y();
// Fill histograms on correlations
hGlobalTrackDifferenceX->Fill(xcorr);
......@@ -343,7 +343,7 @@ StatusCode AnalysisCLICpix::run(std::shared_ptr<Clipboard> clipboard) {
hTrackInterceptsAssociated->Fill(trackIntercept.X(), trackIntercept.Y());
hGlobalResidualsX->Fill(xresidualBest);
hGlobalResidualsY->Fill(yresidualBest);
hGlobalAssociatedClusterPositions->Fill((bestCluster)->globalX(), (bestCluster)->globalY());
hGlobalAssociatedClusterPositions->Fill((bestCluster)->global().x(), (bestCluster)->global().y());
nClustersAssociated++;
hAssociatedClusterRow->Fill((bestCluster)->row());
hAssociatedClusterColumn->Fill((bestCluster)->column());
......@@ -563,7 +563,7 @@ void AnalysisCLICpix::fillClusterHistos(Clusters* clusters) {
// Fill cluster histograms
hClusterSizeAll->Fill(static_cast<double>((*itc)->size()));
hClusterTOTAll->Fill((*itc)->tot());
hGlobalClusterPositions->Fill((*itc)->globalX(), (*itc)->globalY());
hGlobalClusterPositions->Fill((*itc)->global().x(), (*itc)->global().y());
}
hClustersPerEvent->Fill(static_cast<double>(clusters->size()));
......
#include "AnalysisDUT.h"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
#include "objects/Track.hpp"
......@@ -257,11 +257,11 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
LOG(DEBUG) << " - Looking at next DUT cluster";
// Check distance between track and cluster
ROOT::Math::XYZPoint intercept = track->intercept(cluster->globalZ());
ROOT::Math::XYZPoint intercept = track->intercept(cluster->global().z());
// Correlation plots
hTrackCorrelationX->Fill(intercept.X() - cluster->globalX());
hTrackCorrelationY->Fill(intercept.Y() - cluster->globalY());
hTrackCorrelationX->Fill(intercept.X() - cluster->global().x());
hTrackCorrelationY->Fill(intercept.Y() - cluster->global().y());
hTrackCorrelationTime->Fill(track->timestamp() - cluster->timestamp());
auto associated_clusters = track->associatedClusters();
......@@ -271,8 +271,8 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
}
LOG(DEBUG) << "Found associated cluster";
double xdistance = intercept.X() - cluster->globalX();
double ydistance = intercept.Y() - cluster->globalY();
double xdistance = intercept.X() - cluster->global().x();
double ydistance = intercept.Y() - cluster->global().y();
double xabsdistance = fabs(xdistance);
double yabsdistance = fabs(ydistance);
......
......@@ -9,7 +9,7 @@
#include "AnalysisEfficiency.h"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
#include "objects/Track.hpp"
......
#include "AnalysisPowerPulsing.h"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/SpidrSignal.h"
using namespace corryvreckan;
......
#include "AnalysisTelescope.h"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/MCParticle.h"
#include <TDirectory.h>
......@@ -95,12 +95,12 @@ StatusCode AnalysisTelescope::run(std::shared_ptr<Clipboard> clipboard) {
}
auto name = detector->name();
ROOT::Math::XYZPoint intercept = track->intercept(cluster->globalZ());
ROOT::Math::XYZPoint intercept = track->intercept(cluster->global().z());
auto interceptLocal = detector->globalToLocal(intercept);
telescopeResidualsLocalX[name]->Fill(cluster->localX() - interceptLocal.X());
telescopeResidualsLocalY[name]->Fill(cluster->localY() - interceptLocal.Y());
telescopeResidualsX[name]->Fill(cluster->globalX() - intercept.X());
telescopeResidualsY[name]->Fill(cluster->globalY() - intercept.Y());
telescopeResidualsLocalX[name]->Fill(cluster->local().x() - interceptLocal.X());
telescopeResidualsLocalY[name]->Fill(cluster->local().y() - interceptLocal.Y());
telescopeResidualsX[name]->Fill(cluster->global().x() - intercept.X());
telescopeResidualsY[name]->Fill(cluster->global().y() - intercept.Y());
// Get the MC particles from the clipboard
MCParticles* mcParticles = reinterpret_cast<MCParticles*>(clipboard->get(name, "mcparticles"));
......@@ -109,8 +109,8 @@ StatusCode AnalysisTelescope::run(std::shared_ptr<Clipboard> clipboard) {
}
ROOT::Math::XYZPoint particlePosition = closestApproach(cluster->local(), mcParticles);
telescopeMCresidualsLocalX[name]->Fill(cluster->localX() + detector->size().X() / 2 - particlePosition.X());
telescopeMCresidualsLocalY[name]->Fill(cluster->localY() + detector->size().Y() / 2 - particlePosition.Y());
telescopeMCresidualsLocalX[name]->Fill(cluster->local().x() + detector->size().X() / 2 - particlePosition.X());
telescopeMCresidualsLocalY[name]->Fill(cluster->local().y() + detector->size().Y() / 2 - particlePosition.Y());
telescopeMCresidualsX[name]->Fill(interceptLocal.X() + detector->size().X() / 2 - particlePosition.X());
telescopeMCresidualsY[name]->Fill(interceptLocal.Y() + detector->size().Y() / 2 - particlePosition.Y());
}
......
......@@ -117,7 +117,7 @@ StatusCode Clustering4D::run(std::shared_ptr<Clipboard> clipboard) {
clusterWidthRow->Fill(cluster->rowWidth());
clusterWidthColumn->Fill(cluster->columnWidth());
clusterTot->Fill(cluster->tot());
clusterPositionGlobal->Fill(cluster->globalX(), cluster->globalY());
clusterPositionGlobal->Fill(cluster->global().x(), cluster->global().y());
deviceClusters->push_back(cluster);
}
......@@ -215,6 +215,6 @@ void Clustering4D::calculateClusterCentre(Cluster* cluster) {
cluster->setTimestamp(timestamp);
cluster->setDetectorID(detectorID);
cluster->setClusterCentre(positionGlobal.X(), positionGlobal.Y(), positionGlobal.Z());
cluster->setClusterCentreLocal(positionLocal.X(), positionLocal.Y(), positionLocal.Z());
cluster->setClusterCentre(positionGlobal);
cluster->setClusterCentreLocal(positionLocal);
}
......@@ -6,7 +6,7 @@
#include <TH2F.h>
#include <iostream>
#include "core/module/Module.hpp"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
namespace corryvreckan {
......
......@@ -121,7 +121,7 @@ StatusCode ClusteringSpatial::run(std::shared_ptr<Clipboard> clipboard) {
clusterWidthRow->Fill(cluster->rowWidth());
clusterWidthColumn->Fill(cluster->columnWidth());
clusterTot->Fill(cluster->tot());
clusterPositionGlobal->Fill(cluster->globalX(), cluster->globalY());
clusterPositionGlobal->Fill(cluster->global().x(), cluster->global().y());
deviceClusters->push_back(cluster);
}
......@@ -179,6 +179,6 @@ void ClusteringSpatial::calculateClusterCentre(Cluster* cluster) {
cluster->setError(m_detector->resolution());
cluster->setDetectorID(detectorID);
cluster->setClusterCentre(positionGlobal.X(), positionGlobal.Y(), positionGlobal.Z());
cluster->setClusterCentreLocal(positionLocal.X(), positionLocal.Y(), positionLocal.Z());
cluster->setClusterCentre(positionGlobal);
cluster->setClusterCentreLocal(positionLocal);
}
......@@ -6,7 +6,7 @@
#include <TH2F.h>
#include <iostream>
#include "core/module/Module.hpp"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
namespace corryvreckan {
/** @ingroup Modules
......
......@@ -31,9 +31,9 @@ StatusCode DUTAssociation::run(std::shared_ptr<Clipboard> clipboard) {
// Loop over all DUT clusters
for(auto& cluster : (*clusters)) {
// Check distance between track and cluster
ROOT::Math::XYZPoint intercept = track->intercept(cluster->globalZ());
double xdistance = intercept.X() - cluster->globalX();
double ydistance = intercept.Y() - cluster->globalY();
ROOT::Math::XYZPoint intercept = track->intercept(cluster->global().z());
double xdistance = intercept.X() - cluster->global().x();
double ydistance = intercept.Y() - cluster->global().y();
if(abs(xdistance) > spatialCut.x() || abs(ydistance) > spatialCut.y()) {
LOG(DEBUG) << "Discarding DUT cluster with distance (" << abs(xdistance) << "," << abs(ydistance) << ")";
continue;
......
......@@ -6,7 +6,7 @@
#include <TH2F.h>
#include <iostream>
#include "core/module/Module.hpp"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
#include "objects/Track.hpp"
......
......@@ -16,7 +16,7 @@
#include <TH2F.h>
#include <iostream>
#include "core/module/Module.hpp"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
#include "objects/Track.hpp"
......
......@@ -9,7 +9,7 @@
#include <iostream>
#include "core/module/Module.hpp"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
#include "objects/Track.hpp"
......
......@@ -49,15 +49,15 @@ void EtaCorrection::applyEta(Cluster* cluster) {
return;
}
double newX = cluster->localX();
double newY = cluster->localY();
double newX = cluster->local().x();
double newY = cluster->local().y();
if(cluster->columnWidth() == 2) {
double inPixelX = m_detector->pitch().X() * (cluster->column() - floor(cluster->column()));
// Apply the eta correction
if(m_correctX) {
newX = floor(cluster->localX() / m_detector->pitch().X()) * m_detector->pitch().X() +
newX = floor(cluster->local().x() / m_detector->pitch().X()) * m_detector->pitch().X() +
m_etaCorrectorX->Eval(inPixelX);
}
}
......@@ -67,7 +67,7 @@ void EtaCorrection::applyEta(Cluster* cluster) {
// Apply the eta correction
if(m_correctY) {
newY = floor(cluster->localY() / m_detector->pitch().Y()) * m_detector->pitch().Y() +
newY = floor(cluster->local().y() / m_detector->pitch().Y()) * m_detector->pitch().Y() +
m_etaCorrectorY->Eval(inPixelY);
}
}
......
......@@ -9,7 +9,7 @@
#include <iostream>
#include "core/module/Module.hpp"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
#include "objects/Track.hpp"
......
......@@ -11,7 +11,7 @@
#include <stdio.h>
#include <string.h>
#include "core/module/Module.hpp"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
#include "objects/Track.hpp"
......
......@@ -10,7 +10,7 @@
#include <sstream>
#include <stdio.h>
#include "core/module/Module.hpp"
#include "objects/Cluster.h"
#include "objects/Cluster.hpp"
#include "objects/Pixel.h"
#include "objects/Track.hpp"
......
Markdown is supported
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