Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:05

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef ACTSPODIOEDM_MutableJacobian_H
0004 #define ACTSPODIOEDM_MutableJacobian_H
0005 
0006 #include "ActsPodioEdm/JacobianObj.h"
0007 // Make the immutable class available from its mutable version but not vice
0008 // versa
0009 #include "ActsPodioEdm/Jacobian.h"
0010 #include "ActsPodioEdm/JacobianInfo.h"
0011 
0012 #include <cstdint>
0013 
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019 
0020 namespace ActsPodioEdm {
0021 
0022 /** @class MutableJacobian
0023  *  Jacobian matrix from the previous track state to the current one
0024  *  @author: Paul Gessinger, CERN
0025  */
0026 class MutableJacobian {
0027   friend class JacobianCollection;
0028   friend class JacobianMutableCollectionIterator;
0029   friend class Jacobian;
0030 
0031  public:
0032   using object_type = Jacobian;
0033   using collection_type = JacobianCollection;
0034 
0035   /// default constructor
0036   MutableJacobian();
0037 
0038   /// Constructor initializing all members
0039   MutableJacobian(ActsPodioEdm::JacobianInfo data);
0040 
0041   /// copy constructor
0042   MutableJacobian(const MutableJacobian& other) = default;
0043 
0044   /// copy-assignment operator
0045   MutableJacobian& operator=(MutableJacobian other);
0046 
0047   /// create a mutable deep-copy of the object with identical relations
0048   /// if cloneRelations=false, the relations are not cloned and will be empty
0049   MutableJacobian clone(bool cloneRelations = true) const;
0050 
0051   /// destructor
0052   ~MutableJacobian() = default;
0053 
0054  public:
0055   /// Access the the jacobian data
0056   const ActsPodioEdm::JacobianInfo& getData() const;
0057 
0058   /// Set the the jacobian data
0059   void setData(ActsPodioEdm::JacobianInfo value);
0060   /// Get mutable reference to the jacobian data
0061   ActsPodioEdm::JacobianInfo& getData();
0062   /// Get reference to the jacobian data
0063   [[deprecated("use getData instead")]] ActsPodioEdm::JacobianInfo& data();
0064 
0065   /// check whether the object is actually available
0066   bool isAvailable() const;
0067   /// disconnect from JacobianObj instance
0068   void unlink() { m_obj = podio::utils::MaybeSharedPtr<JacobianObj>{nullptr}; }
0069 
0070   bool operator==(const MutableJacobian& other) const {
0071     return m_obj == other.m_obj;
0072   }
0073   bool operator==(const Jacobian& other) const;
0074 
0075   bool operator!=(const MutableJacobian& other) const {
0076     return !(*this == other);
0077   }
0078   bool operator!=(const Jacobian& other) const { return !(*this == other); }
0079 
0080   // less comparison operator, so that objects can be e.g. stored in sets.
0081   bool operator<(const MutableJacobian& other) const {
0082     return m_obj < other.m_obj;
0083   }
0084 
0085   podio::ObjectID id() const { return getObjectID(); }
0086 
0087   const podio::ObjectID getObjectID() const;
0088 
0089   friend void swap(MutableJacobian& a, MutableJacobian& b) {
0090     using std::swap;
0091     swap(a.m_obj, b.m_obj);  // swap out the internal pointers
0092   }
0093 
0094  private:
0095   /// constructor from existing JacobianObj
0096   explicit MutableJacobian(podio::utils::MaybeSharedPtr<JacobianObj> obj);
0097 
0098   podio::utils::MaybeSharedPtr<JacobianObj> m_obj{nullptr};
0099 };
0100 
0101 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0102 void to_json(nlohmann::json& j, const MutableJacobian& value);
0103 #endif
0104 
0105 }  // namespace ActsPodioEdm
0106 
0107 #endif