Commit 06916ac7 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

MCParticle: add isPrimary() method and update doc strings

parent 014d2e11
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -75,14 +75,21 @@ void MCParticle::setParent(const MCParticle* mc_particle) {
}

/**
 * Object is stored as TRef and can only be accessed if pointed object is in scope
 * Object is stored as \ref allpix::Object::PointerWrapper and can only be accessed if pointed object is in scope
 */
const MCParticle* MCParticle::getParent() const {
    return parent_.get();
}

/**
 * Object is stored as TRef and can only be accessed if pointed object is in scope
 * Object is stored as \ref allpix::Object::PointerWrapper and can only be accessed if pointed object is in scope
 */
bool MCParticle::isPrimary() const {
    return (parent_.get() == nullptr);
}

/**
 * Object is stored as \ref allpix::Object::PointerWrapper and can only be accessed if pointed object is in scope
 */
const MCParticle* MCParticle::getPrimary() const {
    auto* parent = parent_.get();
@@ -94,7 +101,7 @@ void MCParticle::setTrack(const MCTrack* mc_track) {
}

/**
 * Object is stored as TRef and can only be accessed if pointed object is in scope
 * Object is stored as \ref allpix::Object::PointerWrapper and can only be accessed if pointed object is in scope
 */
const MCTrack* MCParticle::getTrack() const {
    return track_.get();
+6 −0
Original line number Diff line number Diff line
@@ -68,6 +68,12 @@ namespace allpix {
         */
        ROOT::Math::XYZPoint getLocalReferencePoint() const;

        /**
         * @brief Check if this MCParticle is a primary particle by checking if the parent particle reference is a nullptr.
         * @return Bollean flag indicating whether this MCParticle is a primary particle
         */
        bool isPrimary() const;

        /**
         * @brief Get PDG particle id for the particle
         * @return Particle id