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_MutableHadronicFinalState_H
0004 #define EDM4EIC_MutableHadronicFinalState_H
0005 
0006 #include "edm4eic/HadronicFinalStateObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/HadronicFinalState.h"
0009 
0010 #include "edm4eic/ReconstructedParticle.h"
0011 #include "podio/RelationRange.h"
0012 #include <vector>
0013 
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 
0016 #include <cstdint>
0017 
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021 
0022 
0023 
0024 namespace edm4eic {
0025 
0026 
0027 /** @class MutableHadronicFinalState
0028  *  Summed quantities of the hadronic final state
0029  *  @author: T. Kutz
0030  */
0031 class MutableHadronicFinalState {
0032 
0033   friend class HadronicFinalStateCollection;
0034   friend class HadronicFinalStateMutableCollectionIterator;
0035   friend class HadronicFinalState;
0036 
0037 public:
0038   using object_type = HadronicFinalState;
0039   using collection_type = HadronicFinalStateCollection;
0040 
0041   /// default constructor
0042   MutableHadronicFinalState();
0043 
0044   /// Constructor initializing all members
0045   MutableHadronicFinalState(float sigma, float pT, float gamma);
0046 
0047   /// copy constructor
0048   MutableHadronicFinalState(const MutableHadronicFinalState& other) = default;
0049 
0050   /// copy-assignment operator
0051   MutableHadronicFinalState& operator=(MutableHadronicFinalState other);
0052 
0053   /// create a mutable deep-copy of the object with identical relations
0054   /// if cloneRelations=false, the relations are not cloned and will be empty
0055   MutableHadronicFinalState clone(bool cloneRelations=true) const;
0056 
0057   /// destructor
0058   ~MutableHadronicFinalState() = default;
0059 
0060 
0061 public:
0062 
0063   /// Access the Longitudinal energy-momentum balance (aka E - pz)
0064   float getSigma() const;
0065 
0066   /// Access the Transverse momentum
0067   float getPT() const;
0068 
0069   /// Access the Hadronic angle
0070   float getGamma() const;
0071 
0072 
0073 
0074   /// Set the Longitudinal energy-momentum balance (aka E - pz)
0075   void setSigma(float value);
0076   /// Get mutable reference to Longitudinal energy-momentum balance (aka E - pz)
0077   float& getSigma();
0078   /// Get reference to Longitudinal energy-momentum balance (aka E - pz)
0079   [[deprecated("use getSigma instead")]]
0080   float& sigma();
0081 
0082   /// Set the Transverse momentum
0083   void setPT(float value);
0084   /// Get mutable reference to Transverse momentum
0085   float& getPT();
0086   /// Get reference to Transverse momentum
0087   [[deprecated("use getPT instead")]]
0088   float& pT();
0089 
0090   /// Set the Hadronic angle
0091   void setGamma(float value);
0092   /// Get mutable reference to Hadronic angle
0093   float& getGamma();
0094   /// Get reference to Hadronic angle
0095   [[deprecated("use getGamma instead")]]
0096   float& gamma();
0097 
0098 
0099 
0100   void addToHadrons(const edm4eic::ReconstructedParticle&);
0101   std::size_t hadrons_size() const;
0102   edm4eic::ReconstructedParticle getHadrons(std::size_t) const;
0103   std::vector<edm4eic::ReconstructedParticle>::const_iterator hadrons_begin() const;
0104   std::vector<edm4eic::ReconstructedParticle>::const_iterator hadrons_end() const;
0105   podio::RelationRange<edm4eic::ReconstructedParticle> getHadrons() const;
0106 
0107 
0108 
0109   /// check whether the object is actually available
0110   bool isAvailable() const;
0111   /// disconnect from HadronicFinalStateObj instance
0112   void unlink() { m_obj = podio::utils::MaybeSharedPtr<HadronicFinalStateObj>{nullptr}; }
0113 
0114   bool operator==(const MutableHadronicFinalState& other) const { return m_obj == other.m_obj; }
0115   bool operator==(const HadronicFinalState& other) const;
0116 
0117   bool operator!=(const MutableHadronicFinalState& other) const { return !(*this == other); }
0118   bool operator!=(const HadronicFinalState& other) const { return !(*this == other); }
0119 
0120   // less comparison operator, so that objects can be e.g. stored in sets.
0121   bool operator<(const MutableHadronicFinalState& other) const { return m_obj < other.m_obj; }
0122 
0123   podio::ObjectID id() const { return getObjectID(); }
0124 
0125   const podio::ObjectID getObjectID() const;
0126 
0127   friend void swap(MutableHadronicFinalState& a, MutableHadronicFinalState& b) {
0128     using std::swap;
0129     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0130   }
0131 
0132 private:
0133   /// constructor from existing HadronicFinalStateObj
0134   explicit MutableHadronicFinalState(podio::utils::MaybeSharedPtr<HadronicFinalStateObj> obj);
0135 
0136   podio::utils::MaybeSharedPtr<HadronicFinalStateObj> m_obj{nullptr};
0137 };
0138 
0139 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0140 void to_json(nlohmann::json& j, const MutableHadronicFinalState& value);
0141 #endif
0142 
0143 
0144 } // namespace edm4eic
0145 
0146 
0147 #endif