Loading src/modules/DetectorHistogrammer/Cluster.cpp +2 −11 Original line number Diff line number Diff line Loading @@ -58,22 +58,13 @@ bool Cluster::addPixelHit(const PixelHit* pixel_hit) { return false; } std::pair<double, double> Cluster::getIndex() const { double x = 0, y = 0; for(const auto& pixel : this->getPixelHits()) { x += pixel->getPixel().getIndex().x() * pixel->getSignal(); y += pixel->getPixel().getIndex().y() * pixel->getSignal(); } return {x / getCharge(), y / getCharge()}; } ROOT::Math::XYZVector Cluster::getPosition() const { ROOT::Math::XYZPoint Cluster::getPosition() const { ROOT::Math::XYZVector meanPos; for(const auto& pixel : this->getPixelHits()) { meanPos = pixel->getPixel().getLocalCenter() * pixel->getSignal() + meanPos; } meanPos /= getCharge(); return meanPos; return static_cast<ROOT::Math::XYZPoint>(meanPos); } std::pair<unsigned int, unsigned int> Cluster::getSizeXY() const { Loading src/modules/DetectorHistogrammer/Cluster.hpp +1 −7 Original line number Diff line number Diff line Loading @@ -51,17 +51,11 @@ namespace allpix { */ std::pair<unsigned int, unsigned int> getSizeXY() const; /** * @brief Get the charge-weighted mean cluster position in index coordinates * @return Indices of weighted mean cluster position */ std::pair<double, double> getIndex() const; /** * @brief Get the charge-weighted mean cluster position in local coordinates * @return weighted mean cluster position */ ROOT::Math::XYZVector getPosition() const; ROOT::Math::XYZPoint getPosition() const; /** * @brief Get the seed PixelHit, i.e. the PixelHit with the largest charge Loading src/modules/DetectorHistogrammer/DetectorHistogrammerModule.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -351,8 +351,8 @@ void DetectorHistogrammerModule::run(Event* event) { cluster_size_x->Fill(clusSizesXY.first); cluster_size_y->Fill(clusSizesXY.second); auto [cluster_x, cluster_y] = clus.getIndex(); auto clusterPos = clus.getPosition(); auto [cluster_x, cluster_y] = detector_->getModel()->getPixelIndex(clusterPos); LOG(DEBUG) << "Cluster at indices " << cluster_x << ", " << cluster_y << "(" << clusterPos << " local coordinates) with charge " << Units::display(clus.getCharge(), "ke"); cluster_map->Fill(cluster_x, cluster_y); Loading Loading @@ -399,7 +399,6 @@ void DetectorHistogrammerModule::run(Event* event) { inPixel_um_x, inPixel_um_y, static_cast<double>(Units::convert(seed_pixel->getSignal(), "ke"))); cluster_seed_charge->Fill(static_cast<double>(Units::convert(seed_pixel->getSignal(), "ke"))); // Calculate residual with cluster position: auto residual_um_x = static_cast<double>(Units::convert(particlePos.x() - clusterPos.x(), "um")); auto residual_um_y = static_cast<double>(Units::convert(particlePos.y() - clusterPos.y(), "um")); Loading Loading
src/modules/DetectorHistogrammer/Cluster.cpp +2 −11 Original line number Diff line number Diff line Loading @@ -58,22 +58,13 @@ bool Cluster::addPixelHit(const PixelHit* pixel_hit) { return false; } std::pair<double, double> Cluster::getIndex() const { double x = 0, y = 0; for(const auto& pixel : this->getPixelHits()) { x += pixel->getPixel().getIndex().x() * pixel->getSignal(); y += pixel->getPixel().getIndex().y() * pixel->getSignal(); } return {x / getCharge(), y / getCharge()}; } ROOT::Math::XYZVector Cluster::getPosition() const { ROOT::Math::XYZPoint Cluster::getPosition() const { ROOT::Math::XYZVector meanPos; for(const auto& pixel : this->getPixelHits()) { meanPos = pixel->getPixel().getLocalCenter() * pixel->getSignal() + meanPos; } meanPos /= getCharge(); return meanPos; return static_cast<ROOT::Math::XYZPoint>(meanPos); } std::pair<unsigned int, unsigned int> Cluster::getSizeXY() const { Loading
src/modules/DetectorHistogrammer/Cluster.hpp +1 −7 Original line number Diff line number Diff line Loading @@ -51,17 +51,11 @@ namespace allpix { */ std::pair<unsigned int, unsigned int> getSizeXY() const; /** * @brief Get the charge-weighted mean cluster position in index coordinates * @return Indices of weighted mean cluster position */ std::pair<double, double> getIndex() const; /** * @brief Get the charge-weighted mean cluster position in local coordinates * @return weighted mean cluster position */ ROOT::Math::XYZVector getPosition() const; ROOT::Math::XYZPoint getPosition() const; /** * @brief Get the seed PixelHit, i.e. the PixelHit with the largest charge Loading
src/modules/DetectorHistogrammer/DetectorHistogrammerModule.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -351,8 +351,8 @@ void DetectorHistogrammerModule::run(Event* event) { cluster_size_x->Fill(clusSizesXY.first); cluster_size_y->Fill(clusSizesXY.second); auto [cluster_x, cluster_y] = clus.getIndex(); auto clusterPos = clus.getPosition(); auto [cluster_x, cluster_y] = detector_->getModel()->getPixelIndex(clusterPos); LOG(DEBUG) << "Cluster at indices " << cluster_x << ", " << cluster_y << "(" << clusterPos << " local coordinates) with charge " << Units::display(clus.getCharge(), "ke"); cluster_map->Fill(cluster_x, cluster_y); Loading Loading @@ -399,7 +399,6 @@ void DetectorHistogrammerModule::run(Event* event) { inPixel_um_x, inPixel_um_y, static_cast<double>(Units::convert(seed_pixel->getSignal(), "ke"))); cluster_seed_charge->Fill(static_cast<double>(Units::convert(seed_pixel->getSignal(), "ke"))); // Calculate residual with cluster position: auto residual_um_x = static_cast<double>(Units::convert(particlePos.x() - clusterPos.x(), "um")); auto residual_um_y = static_cast<double>(Units::convert(particlePos.y() - clusterPos.y(), "um")); Loading