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

DetectorModel: correct some casts

parent 9550749d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -36,8 +36,8 @@ bool Cluster::addPixelHit(const PixelHit* pixel_hit) {
    auto ret = pixel_hits_.insert(pixel_hit);
    if(ret.second == true) {
        cluster_charge_ += pixel_hit->getSignal();
        unsigned int pixX = pixel_hit->getPixel().getIndex().x();
        unsigned int pixY = pixel_hit->getPixel().getIndex().y();
        auto pixX = pixel_hit->getPixel().getIndex().x();
        auto pixY = pixel_hit->getPixel().getIndex().y();
        minX_ = std::min(pixX, minX_);
        maxX_ = std::max(pixX, maxX_);
        minY_ = std::min(pixY, minY_);
@@ -79,7 +79,7 @@ std::set<const MCParticle*> Cluster::getMCParticles() const {
    return mc_particles_;
}

const PixelHit* Cluster::getPixelHit(unsigned int x, unsigned int y) const {
const PixelHit* Cluster::getPixelHit(int x, int y) const {
    for(const auto& pixel : this->getPixelHits()) {
        if(pixel->getPixel().getIndex().x() == x && pixel->getPixel().getIndex().y() == y) {
            return pixel;
+2 −2
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ namespace allpix {
         * @param  y Coordinate of the pixel in y direction
         * @return Pointer to matching PixelHit if available or a nullptr if not part of the cluster
         */
        const PixelHit* getPixelHit(unsigned int x, unsigned int y) const;
        const PixelHit* getPixelHit(int x, int y) const;

        /**
         * @brief Get the PixelHits contained in this cluster
@@ -91,7 +91,7 @@ namespace allpix {

        double cluster_charge_{};

        unsigned int minX_, minY_, maxX_, maxY_;
        int minX_, minY_, maxX_, maxY_;
    };
} // namespace allpix
#endif /*ALLPIX_DETECTOR_HISTOGRAMMER_CLUSTER_H */
+5 −5
Original line number Diff line number Diff line
@@ -71,13 +71,13 @@ void InducedTransferModule::run(Event* event) {
        // Find the nearest pixel
        auto [xpixel, ypixel] = model_->getPixelIndex(position_end);

        LOG(TRACE) << "Calculating induced charge from carriers below pixel "
                   << Pixel::Index(static_cast<unsigned int>(xpixel), static_cast<unsigned int>(ypixel)) << ", moved from "
                   << Units::display(position_start, {"um", "mm"}) << " to " << Units::display(position_end, {"um", "mm"})
                   << ", " << Units::display(propagated_charge.getGlobalTime() - deposited_charge->getGlobalTime(), "ns");
        LOG(TRACE) << "Calculating induced charge from carriers below pixel " << Pixel::Index(xpixel, ypixel)
                   << ", moved from " << Units::display(position_start, {"um", "mm"}) << " to "
                   << Units::display(position_end, {"um", "mm"}) << ", "
                   << Units::display(propagated_charge.getGlobalTime() - deposited_charge->getGlobalTime(), "ns");

        // Loop over NxN pixels:
        auto idx = Pixel::Index(static_cast<unsigned int>(xpixel), static_cast<unsigned int>(ypixel));
        auto idx = Pixel::Index(xpixel, ypixel);
        for(const auto& pixel_index : model_->getNeighbors(idx, distance_)) {
            auto ramo_end = detector_->getWeightingPotential(position_end, pixel_index);
            auto ramo_start = detector_->getWeightingPotential(position_start, pixel_index);