Warning, file /include/ActsPodioEdm/MutableJacobian.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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
0021 namespace ActsPodioEdm {
0022 class JacobianCollection;
0023 }
0024
0025 namespace ActsPodioEdm {
0026
0027
0028
0029
0030
0031 class MutableJacobian {
0032 friend class JacobianCollection;
0033 friend class JacobianMutableCollectionIterator;
0034 friend class Jacobian;
0035
0036 public:
0037 using object_type = Jacobian;
0038 using collection_type = JacobianCollection;
0039
0040
0041 MutableJacobian() = default;
0042
0043
0044 MutableJacobian(const ActsPodioEdm::JacobianInfo& data);
0045
0046
0047 MutableJacobian(const MutableJacobian& other) = default;
0048
0049
0050 MutableJacobian& operator=(
0051 MutableJacobian other) &;
0052 MutableJacobian& operator=(MutableJacobian other) && =
0053 delete;
0054
0055
0056
0057 MutableJacobian clone(bool cloneRelations = true) const;
0058
0059
0060 ~MutableJacobian() = default;
0061
0062 public:
0063
0064 const ActsPodioEdm::JacobianInfo& getData() const;
0065
0066
0067 void setData(const ActsPodioEdm::JacobianInfo& data);
0068
0069 ActsPodioEdm::JacobianInfo& getData();
0070
0071
0072 bool isAvailable() const;
0073
0074 void unlink() { m_obj = podio::utils::MaybeSharedPtr<JacobianObj>{nullptr}; }
0075
0076 constexpr bool operator==(const MutableJacobian& other) const {
0077 return m_obj == other.m_obj;
0078 }
0079 bool operator==(const Jacobian& other) const;
0080
0081 constexpr bool operator!=(const MutableJacobian& other) const {
0082 return !(*this == other);
0083 }
0084 bool operator!=(const Jacobian& other) const { return !(*this == other); }
0085
0086
0087 bool operator<(const MutableJacobian& other) const {
0088 return podio::detail::getOrderKey(*this) <
0089 podio::detail::getOrderKey(other);
0090 }
0091
0092 podio::ObjectID id() const { return getObjectID(); }
0093
0094 const podio::ObjectID getObjectID() const;
0095
0096 friend std::hash<MutableJacobian>;
0097
0098 friend void swap(MutableJacobian& a, MutableJacobian& b) {
0099 using std::swap;
0100 swap(a.m_obj, b.m_obj);
0101 }
0102
0103 private:
0104
0105 explicit MutableJacobian(podio::utils::MaybeSharedPtr<JacobianObj> obj);
0106
0107 podio::utils::MaybeSharedPtr<JacobianObj> m_obj{new JacobianObj{},
0108 podio::utils::MarkOwned};
0109 };
0110
0111 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0112 void to_json(nlohmann::json& j, const MutableJacobian& value);
0113 #endif
0114
0115 }
0116
0117 template <>
0118 struct std::hash<ActsPodioEdm::MutableJacobian> {
0119 std::size_t operator()(const ActsPodioEdm::MutableJacobian& obj) const {
0120 return std::hash<ActsPodioEdm::JacobianObj*>{}(obj.m_obj.get());
0121 }
0122 };
0123
0124 #endif