4 #ifndef MUONTRACKINGGEOMETRY_TRANSFORMUTILS_H
5 #define MUONTRACKINGGEOMETRY_TRANSFORMUTILS_H
15 return std::make_unique<Amg::Transform3D>(
trf).release();
17 template <
class ObjType>
18 std::vector<ObjType *>
release(std::vector<std::unique_ptr<ObjType>>& objVec) {
19 std::vector<ObjType*> outVec{};
20 outVec.reserve(objVec.size());
21 for (std::unique_ptr<ObjType>&
obj : objVec) {
22 outVec.push_back(
obj.release());
27 template<
class ObjPtr>
28 std::vector<std::vector<ObjPtr*>>
29 release(std::vector<std::vector<std::unique_ptr<ObjPtr>>>& inVec){
30 std::vector<std::vector<ObjPtr*>> outVec{};
31 outVec.reserve(inVec.size());
32 for (
auto& in : inVec){
33 outVec.emplace_back(
release(in));
37 template <
class ObjType>
38 std::vector<std::unique_ptr<ObjType>>
toVec(
const std::vector<ObjType*>* vecPtr) {
39 std::vector<std::unique_ptr<ObjType>> outVec{};
40 outVec.reserve(vecPtr->size());
41 for (
auto obj : *vecPtr) {
42 outVec.emplace_back(
obj);