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

MCParticle: also store total charge deposited by this MCParticle

parent 142e22c3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -60,6 +60,14 @@ ROOT::Math::XYZPoint MCParticle::getLocalReferencePoint() const {
    }
}

unsigned int MCParticle::getTotalDepositedCharge() const {
    return deposited_charge_;
}

void MCParticle::setTotalDepositedCharge(unsigned int total_charge) {
    deposited_charge_ = total_charge;
}

int MCParticle::getParticleID() const {
    return particle_id_;
}
+14 −1
Original line number Diff line number Diff line
@@ -94,6 +94,18 @@ namespace allpix {
         */
        double getLocalTime() const;

        /**
         * @brief Set the total number of charge carriers produced by this particle
         * @param total_charge Total charge deposited by this particle
         */
        void setTotalDepositedCharge(unsigned int total_charge);

        /**
         * @brief Return the total number of charge carriers deposited by this particle
         * @return Total number of deposited charge carriers
         */
        unsigned int getTotalDepositedCharge() const;

        /**
         * @brief Set the Monte-Carlo particle
         * @param mc_particle The Monte-Carlo particle
@@ -132,7 +144,7 @@ namespace allpix {
        /**
         * @brief ROOT class definition
         */
        ClassDefOverride(MCParticle, 9); // NOLINT
        ClassDefOverride(MCParticle, 10); // NOLINT
        /**
         * @brief Default constructor for ROOT I/O
         */
@@ -156,6 +168,7 @@ namespace allpix {
        int particle_id_{};
        double local_time_{};
        double global_time_{};
        unsigned int deposited_charge_{};

        PointerWrapper<MCParticle> parent_;
        PointerWrapper<MCTrack> track_;