Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:30

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutableCherenkovParticleID_H
0004 #define EDM4EIC_MutableCherenkovParticleID_H
0005 
0006 #include "edm4eic/CherenkovParticleIDObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/CherenkovParticleID.h"
0009 
0010 #include "edm4eic/CherenkovParticleIDHypothesis.h"
0011 #include "edm4eic/MCRecoTrackerHitAssociation.h"
0012 #include "podio/RelationRange.h"
0013 #include <vector>
0014 
0015 #include "podio/utilities/MaybeSharedPtr.h"
0016 
0017 #include <cstdint>
0018 
0019 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0020 #include "nlohmann/json_fwd.hpp"
0021 #endif
0022 
0023 // forward declarations
0024 namespace edm4eic {
0025 class TrackSegment;
0026 class MutableTrackSegment;
0027 }
0028 
0029 
0030 namespace edm4eic {
0031 
0032 
0033 /** @class MutableCherenkovParticleID
0034  *  Cherenkov detector PID
0035  *  @author: A. Kiselev, C. Chatterjee, C. Dilks
0036  */
0037 class MutableCherenkovParticleID {
0038 
0039   friend class CherenkovParticleIDCollection;
0040   friend class CherenkovParticleIDMutableCollectionIterator;
0041   friend class CherenkovParticleID;
0042 
0043 public:
0044   using object_type = CherenkovParticleID;
0045   using collection_type = CherenkovParticleIDCollection;
0046 
0047   /// default constructor
0048   MutableCherenkovParticleID();
0049 
0050   /// Constructor initializing all members
0051   MutableCherenkovParticleID(float npe, float refractiveIndex, float photonEnergy);
0052 
0053   /// copy constructor
0054   MutableCherenkovParticleID(const MutableCherenkovParticleID& other) = default;
0055 
0056   /// copy-assignment operator
0057   MutableCherenkovParticleID& operator=(MutableCherenkovParticleID other);
0058 
0059   /// create a mutable deep-copy of the object with identical relations
0060   /// if cloneRelations=false, the relations are not cloned and will be empty
0061   MutableCherenkovParticleID clone(bool cloneRelations=true) const;
0062 
0063   /// destructor
0064   ~MutableCherenkovParticleID() = default;
0065 
0066 
0067 public:
0068 
0069   /// Access the Overall photoelectron count
0070   float getNpe() const;
0071 
0072   /// Access the Average refractive index at the Cherenkov photons' vertices
0073   float getRefractiveIndex() const;
0074 
0075   /// Access the Average energy for these Cherenkov photons [GeV]
0076   float getPhotonEnergy() const;
0077 
0078 
0079   /// Access the reconstructed charged particle
0080   const edm4eic::TrackSegment getChargedParticle() const;
0081 
0082   /// Set the Overall photoelectron count
0083   void setNpe(float value);
0084   /// Get mutable reference to Overall photoelectron count
0085   float& getNpe();
0086   /// Get reference to Overall photoelectron count
0087   [[deprecated("use getNpe instead")]]
0088   float& npe();
0089 
0090   /// Set the Average refractive index at the Cherenkov photons' vertices
0091   void setRefractiveIndex(float value);
0092   /// Get mutable reference to Average refractive index at the Cherenkov photons' vertices
0093   float& getRefractiveIndex();
0094   /// Get reference to Average refractive index at the Cherenkov photons' vertices
0095   [[deprecated("use getRefractiveIndex instead")]]
0096   float& refractiveIndex();
0097 
0098   /// Set the Average energy for these Cherenkov photons [GeV]
0099   void setPhotonEnergy(float value);
0100   /// Get mutable reference to Average energy for these Cherenkov photons [GeV]
0101   float& getPhotonEnergy();
0102   /// Get reference to Average energy for these Cherenkov photons [GeV]
0103   [[deprecated("use getPhotonEnergy instead")]]
0104   float& photonEnergy();
0105 
0106 
0107   /// Set the reconstructed charged particle
0108   void setChargedParticle(const edm4eic::TrackSegment& value);
0109 
0110   void addToRawHitAssociations(const edm4eic::MCRecoTrackerHitAssociation&);
0111   std::size_t rawHitAssociations_size() const;
0112   edm4eic::MCRecoTrackerHitAssociation getRawHitAssociations(std::size_t) const;
0113   std::vector<edm4eic::MCRecoTrackerHitAssociation>::const_iterator rawHitAssociations_begin() const;
0114   std::vector<edm4eic::MCRecoTrackerHitAssociation>::const_iterator rawHitAssociations_end() const;
0115   podio::RelationRange<edm4eic::MCRecoTrackerHitAssociation> getRawHitAssociations() const;
0116   void addToHypotheses(const edm4eic::CherenkovParticleIDHypothesis&);
0117   std::size_t hypotheses_size() const;
0118   edm4eic::CherenkovParticleIDHypothesis getHypotheses(std::size_t) const;
0119   std::vector<edm4eic::CherenkovParticleIDHypothesis>::const_iterator hypotheses_begin() const;
0120   std::vector<edm4eic::CherenkovParticleIDHypothesis>::const_iterator hypotheses_end() const;
0121   podio::RelationRange<edm4eic::CherenkovParticleIDHypothesis> getHypotheses() const;
0122   void addToThetaPhiPhotons(const edm4hep::Vector2f&);
0123   std::size_t thetaPhiPhotons_size() const;
0124   edm4hep::Vector2f getThetaPhiPhotons(std::size_t) const;
0125   std::vector<edm4hep::Vector2f>::const_iterator thetaPhiPhotons_begin() const;
0126   std::vector<edm4hep::Vector2f>::const_iterator thetaPhiPhotons_end() const;
0127   podio::RelationRange<edm4hep::Vector2f> getThetaPhiPhotons() const;
0128 
0129 
0130 
0131   /// check whether the object is actually available
0132   bool isAvailable() const;
0133   /// disconnect from CherenkovParticleIDObj instance
0134   void unlink() { m_obj = podio::utils::MaybeSharedPtr<CherenkovParticleIDObj>{nullptr}; }
0135 
0136   bool operator==(const MutableCherenkovParticleID& other) const { return m_obj == other.m_obj; }
0137   bool operator==(const CherenkovParticleID& other) const;
0138 
0139   bool operator!=(const MutableCherenkovParticleID& other) const { return !(*this == other); }
0140   bool operator!=(const CherenkovParticleID& other) const { return !(*this == other); }
0141 
0142   // less comparison operator, so that objects can be e.g. stored in sets.
0143   bool operator<(const MutableCherenkovParticleID& other) const { return m_obj < other.m_obj; }
0144 
0145   podio::ObjectID id() const { return getObjectID(); }
0146 
0147   const podio::ObjectID getObjectID() const;
0148 
0149   friend void swap(MutableCherenkovParticleID& a, MutableCherenkovParticleID& b) {
0150     using std::swap;
0151     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0152   }
0153 
0154 private:
0155   /// constructor from existing CherenkovParticleIDObj
0156   explicit MutableCherenkovParticleID(podio::utils::MaybeSharedPtr<CherenkovParticleIDObj> obj);
0157 
0158   podio::utils::MaybeSharedPtr<CherenkovParticleIDObj> m_obj{nullptr};
0159 };
0160 
0161 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0162 void to_json(nlohmann::json& j, const MutableCherenkovParticleID& value);
0163 #endif
0164 
0165 
0166 } // namespace edm4eic
0167 
0168 
0169 #endif