Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-05-11 08:50:15

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutableSimPulse_H
0004 #define EDM4EIC_MutableSimPulse_H
0005 
0006 #include "edm4eic/SimPulseObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/SimPulse.h"
0009 
0010 #include "edm4hep/MCParticle.h"
0011 #include "edm4hep/SimCalorimeterHit.h"
0012 #include "edm4hep/SimTrackerHit.h"
0013 #include "edm4hep/Vector3f.h"
0014 #include "podio/RelationRange.h"
0015 #include <cstdint>
0016 #include <vector>
0017 
0018 #include "podio/utilities/MaybeSharedPtr.h"
0019 
0020 #include <cstdint>
0021 
0022 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0023 #include "nlohmann/json_fwd.hpp"
0024 #endif
0025 
0026 // forward declarations
0027 namespace edm4eic {
0028 class SimPulseCollection;
0029 }
0030 
0031 
0032 namespace edm4eic {
0033 
0034 
0035 /** @class MutableSimPulse
0036  *  Simulated pulse prior to digitization.
0037  *  @author: D. Anderson, S. Gardner, S. Joosten., D. Kalinkin
0038  */
0039 class MutableSimPulse {
0040 
0041   friend class SimPulseCollection;
0042   friend class SimPulseMutableCollectionIterator;
0043   friend class SimPulse;
0044 
0045 public:
0046   using object_type = SimPulse;
0047   using collection_type = SimPulseCollection;
0048 
0049   /// default constructor
0050   MutableSimPulse();
0051 
0052   /// Constructor initializing all members
0053   MutableSimPulse(std::uint64_t cellID, float integral, edm4hep::Vector3f position, float time, float interval);
0054 
0055   /// copy constructor
0056   MutableSimPulse(const MutableSimPulse& other) = default;
0057 
0058   /// copy-assignment operator
0059   MutableSimPulse& operator=(MutableSimPulse other);
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   MutableSimPulse clone(bool cloneRelations=true) const;
0064 
0065   /// destructor
0066   ~MutableSimPulse() = default;
0067 
0068 
0069 public:
0070 
0071   /// Access the ID of the readout cell for this pulse.
0072   std::uint64_t getCellID() const;
0073 
0074   /// Access the Total pulse integral in relevant units.
0075   float getIntegral() const;
0076 
0077   /// Access the Position the pulse is evaluated in world coordinates [mm].
0078   const edm4hep::Vector3f& getPosition() const;
0079 
0080   /// Access the Start time for the pulse in [ns].
0081   float getTime() const;
0082 
0083   /// Access the Time interval between amplitude values [ns].
0084   float getInterval() const;
0085 
0086 
0087 
0088   /// Set the ID of the readout cell for this pulse.
0089   void setCellID(std::uint64_t value);
0090   /// Get mutable reference to ID of the readout cell for this pulse.
0091   std::uint64_t& getCellID();
0092   /// Get reference to ID of the readout cell for this pulse.
0093   [[deprecated("use getCellID instead")]]
0094   std::uint64_t& cellID();
0095 
0096   /// Set the Total pulse integral in relevant units.
0097   void setIntegral(float value);
0098   /// Get mutable reference to Total pulse integral in relevant units.
0099   float& getIntegral();
0100   /// Get reference to Total pulse integral in relevant units.
0101   [[deprecated("use getIntegral instead")]]
0102   float& integral();
0103 
0104   /// Set the Position the pulse is evaluated in world coordinates [mm].
0105   void setPosition(edm4hep::Vector3f value);
0106   /// Get mutable reference to Position the pulse is evaluated in world coordinates [mm].
0107   edm4hep::Vector3f& getPosition();
0108   /// Get reference to Position the pulse is evaluated in world coordinates [mm].
0109   [[deprecated("use getPosition instead")]]
0110   edm4hep::Vector3f& position();
0111 
0112   /// Set the Start time for the pulse in [ns].
0113   void setTime(float value);
0114   /// Get mutable reference to Start time for the pulse in [ns].
0115   float& getTime();
0116   /// Get reference to Start time for the pulse in [ns].
0117   [[deprecated("use getTime instead")]]
0118   float& time();
0119 
0120   /// Set the Time interval between amplitude values [ns].
0121   void setInterval(float value);
0122   /// Get mutable reference to Time interval between amplitude values [ns].
0123   float& getInterval();
0124   /// Get reference to Time interval between amplitude values [ns].
0125   [[deprecated("use getInterval instead")]]
0126   float& interval();
0127 
0128 
0129 
0130   void addToCalorimeterHits(const edm4hep::SimCalorimeterHit&);
0131   std::size_t calorimeterHits_size() const;
0132   edm4hep::SimCalorimeterHit getCalorimeterHits(std::size_t) const;
0133   std::vector<edm4hep::SimCalorimeterHit>::const_iterator calorimeterHits_begin() const;
0134   std::vector<edm4hep::SimCalorimeterHit>::const_iterator calorimeterHits_end() const;
0135   podio::RelationRange<edm4hep::SimCalorimeterHit> getCalorimeterHits() const;
0136   void addToTrackerHits(const edm4hep::SimTrackerHit&);
0137   std::size_t trackerHits_size() const;
0138   edm4hep::SimTrackerHit getTrackerHits(std::size_t) const;
0139   std::vector<edm4hep::SimTrackerHit>::const_iterator trackerHits_begin() const;
0140   std::vector<edm4hep::SimTrackerHit>::const_iterator trackerHits_end() const;
0141   podio::RelationRange<edm4hep::SimTrackerHit> getTrackerHits() const;
0142   void addToPulses(const edm4eic::SimPulse&);
0143   std::size_t pulses_size() const;
0144   edm4eic::SimPulse getPulses(std::size_t) const;
0145   std::vector<edm4eic::SimPulse>::const_iterator pulses_begin() const;
0146   std::vector<edm4eic::SimPulse>::const_iterator pulses_end() const;
0147   podio::RelationRange<edm4eic::SimPulse> getPulses() const;
0148   void addToParticles(const edm4hep::MCParticle&);
0149   std::size_t particles_size() const;
0150   edm4hep::MCParticle getParticles(std::size_t) const;
0151   std::vector<edm4hep::MCParticle>::const_iterator particles_begin() const;
0152   std::vector<edm4hep::MCParticle>::const_iterator particles_end() const;
0153   podio::RelationRange<edm4hep::MCParticle> getParticles() const;
0154   void addToAmplitude(const float&);
0155   std::size_t amplitude_size() const;
0156   float getAmplitude(std::size_t) const;
0157   std::vector<float>::const_iterator amplitude_begin() const;
0158   std::vector<float>::const_iterator amplitude_end() const;
0159   podio::RelationRange<float> getAmplitude() const;
0160 
0161 
0162 
0163   /// check whether the object is actually available
0164   bool isAvailable() const;
0165   /// disconnect from SimPulseObj instance
0166   void unlink() { m_obj = podio::utils::MaybeSharedPtr<SimPulseObj>{nullptr}; }
0167 
0168   bool operator==(const MutableSimPulse& other) const { return m_obj == other.m_obj; }
0169   bool operator==(const SimPulse& other) const;
0170 
0171   bool operator!=(const MutableSimPulse& other) const { return !(*this == other); }
0172   bool operator!=(const SimPulse& other) const { return !(*this == other); }
0173 
0174   // less comparison operator, so that objects can be e.g. stored in sets.
0175   bool operator<(const MutableSimPulse& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0176 
0177   podio::ObjectID id() const { return getObjectID(); }
0178 
0179   const podio::ObjectID getObjectID() const;
0180 
0181   friend void swap(MutableSimPulse& a, MutableSimPulse& b) {
0182     using std::swap;
0183     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0184   }
0185 
0186 private:
0187   /// constructor from existing SimPulseObj
0188   explicit MutableSimPulse(podio::utils::MaybeSharedPtr<SimPulseObj> obj);
0189 
0190   podio::utils::MaybeSharedPtr<SimPulseObj> m_obj{nullptr};
0191 };
0192 
0193 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0194 void to_json(nlohmann::json& j, const MutableSimPulse& value);
0195 #endif
0196 
0197 
0198 } // namespace edm4eic
0199 
0200 
0201 #endif