File indexing completed on 2025-01-18 09:28:05
0001
0002
0003 #ifndef ACTSPODIOEDM_MutableJacobian_H
0004 #define ACTSPODIOEDM_MutableJacobian_H
0005
0006 #include "ActsPodioEdm/JacobianObj.h"
0007
0008
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
0023
0024
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
0036 MutableJacobian();
0037
0038
0039 MutableJacobian(ActsPodioEdm::JacobianInfo data);
0040
0041
0042 MutableJacobian(const MutableJacobian& other) = default;
0043
0044
0045 MutableJacobian& operator=(MutableJacobian other);
0046
0047
0048
0049 MutableJacobian clone(bool cloneRelations = true) const;
0050
0051
0052 ~MutableJacobian() = default;
0053
0054 public:
0055
0056 const ActsPodioEdm::JacobianInfo& getData() const;
0057
0058
0059 void setData(ActsPodioEdm::JacobianInfo value);
0060
0061 ActsPodioEdm::JacobianInfo& getData();
0062
0063 [[deprecated("use getData instead")]] ActsPodioEdm::JacobianInfo& data();
0064
0065
0066 bool isAvailable() const;
0067
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
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);
0092 }
0093
0094 private:
0095
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 }
0106
0107 #endif