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

Revert part of "Inline and const& some member functions" for objects

parent 865ecef6
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -46,10 +46,34 @@ PixelCharge::PixelCharge(Pixel pixel, Pulse pulse, const std::vector<const Propa
    pulse_ = std::move(pulse);
}

const Pixel& PixelCharge::getPixel() const {
    return pixel_;
}

Pixel::Index PixelCharge::getIndex() const {
    return getPixel().getIndex();
}

long PixelCharge::getCharge() const {
    return charge_;
}

unsigned long PixelCharge::getAbsoluteCharge() const {
    return static_cast<unsigned long>(std::abs(charge_));
}

const Pulse& PixelCharge::getPulse() const {
    return pulse_;
}

double PixelCharge::getGlobalTime() const {
    return global_time_;
}

double PixelCharge::getLocalTime() const {
    return local_time_;
}

/**
 * @throws MissingReferenceException If the pointed object is not in scope
 *
+6 −6
Original line number Diff line number Diff line
@@ -56,19 +56,19 @@ namespace allpix {
         * @brief Get the pixel containing the charges
         * @return Pixel indices in the grid
         */
        const Pixel& getPixel() const { return pixel_; }
        const Pixel& getPixel() const;

        /**
         * @brief Shortcut to retrieve the pixel indices
         * @return Index of the pixel
         */
        Pixel::Index getIndex() const { return getPixel().getIndex(); }
        Pixel::Index getIndex() const;

        /**
         * @brief Get the charge at the pixel
         * @return Total charge stored
         */
        long getCharge() const { return charge_; }
        long getCharge() const;

        /**
         * @brief Get the absolute charge value at the pixel
@@ -99,19 +99,19 @@ namespace allpix {
         *  @brief Get recoded charge pulse
         *  @return Constant reference to the full charge pulse
         */
        const Pulse& getPulse() const { return pulse_; }
        const Pulse& getPulse() const;

        /**
         * @brief Get time after start of event in global reference frame
         * @return Time from start event
         */
        double getGlobalTime() const { return global_time_; }
        double getGlobalTime() const;

        /**
         * @brief Get local time in the sensor
         * @return Time with respect to local sensor
         */
        double getLocalTime() const { return local_time_; }
        double getLocalTime() const;

        /**
         * @brief Print an ASCII representation of PixelCharge to the given stream
+8 −0
Original line number Diff line number Diff line
@@ -42,6 +42,14 @@ PixelHit::PixelHit(Pixel pixel,
    }
}

const Pixel& PixelHit::getPixel() const {
    return pixel_;
}

Pixel::Index PixelHit::getIndex() const {
    return getPixel().getIndex();
}

/**
 * @throws MissingReferenceException If the pointed object is not in scope
 *
+2 −2
Original line number Diff line number Diff line
@@ -50,13 +50,13 @@ namespace allpix {
         * @brief Get the pixel hit
         * @return Pixel indices in the grid
         */
        const Pixel& getPixel() const { return pixel_; }
        const Pixel& getPixel() const;

        /**
         * @brief Shortcut to retrieve the pixel indices
         * @return Index of the pixel
         */
        Pixel::Index getIndex() const { return getPixel().getIndex(); }
        Pixel::Index getIndex() const;

        /**
         * @brief Get the timing data of the hit in the global reference frame
+8 −0
Original line number Diff line number Diff line
@@ -49,6 +49,14 @@ int Pulse::getCharge() const {
    return static_cast<int>(std::lround(charge));
}

double Pulse::getBinning() const {
    return bin_;
}

bool Pulse::isInitialized() const {
    return initialized_;
}

Pulse& Pulse::operator+=(const Pulse& rhs) {
    // Allow to initialize uninitialized pulse
    if(!this->initialized_) {
Loading