Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:55:49

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