Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-14 08:50:39

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