8#include <tracking/trackFindingCDC/testFixtures/TrackFindingCDCTestWithTopology.h>
10#include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
11#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
12#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
14#include <tracking/trackFindingCDC/utilities/WeightedRelation.h>
16#include <tracking/trackFindingCDC/rootification/StoreWrapper.h>
17#include <tracking/trackFindingCDC/rootification/StoreWrappedObjPtr.h>
19#include <framework/datastore/StoreObjPtr.h>
20#include <framework/datastore/DataStore.h>
22#include <boost/python.hpp>
23#include <gtest/gtest.h>
26using namespace TrackFindingCDC;
29TEST(TrackFindingCDCTest, cpp_storeWrapper)
36TEST(TrackFindingCDCTest, cpp_storeWrappedObjPtr)
48 ::testing::Types<std::vector<CDCWireHit>,
49 std::vector<CDCSegment2D>,
50 std::vector<CDCTrack>,
51 std::vector<WeightedRelation<const CDCTrack> > >;
68 const std::string& objectName = storeObj.
getName();
75 ASSERT_NE(-1, PyRun_SimpleString(
"import basf2"));
76 ASSERT_NE(-1, PyRun_SimpleString(
"from ROOT import Belle2"));
79 std::string pyCmd_transferName_prototype =
"objectName = 'X'";
80 std::string pyCmd_transferName = pyCmd_transferName_prototype.replace(pyCmd_transferName_prototype.find(
"X"), 1, objectName);
81 ASSERT_NE(-1, PyRun_SimpleString(pyCmd_transferName.c_str()));
84 ASSERT_NE(-1, PyRun_SimpleString(
"pyStoreObj = Belle2.PyStoreObj(objectName)"));
85 ASSERT_NE(-1, PyRun_SimpleString(
"if not pyStoreObj: raise ValueError('PyStoreObj does not point to a "
86 "valid object on the DataStore')"));
87 ASSERT_NE(-1, PyRun_SimpleString(
"print('pyStoreObj.obj() is', pyStoreObj.obj())"));
88 ASSERT_NE(-1, PyRun_SimpleString(
"print('pyStoreObj.obj().unwrap() is', pyStoreObj.obj().unwrap())"));
In the store you can park objects that have to be accessed by various modules.
@ c_DontWriteOut
Object/array should be NOT saved by output modules.
static DataStore & Instance()
Instance of singleton Store.
void setInitializeActive(bool active)
Setter for m_initializeActive.
const std::string & getName() const
Return name under which the object is saved in the DataStore.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool create(bool replace=false)
Create a default object in the data store.
Type-safe access to single objects in the data store.
This class is for convenience access and registration of objects, that are stored inside the StoreWra...
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_DontWriteOut|DataStore::c_ErrorIfAlreadyRegistered)
Register the object/array in the DataStore.
This class provides the declaration of the common test fixture to all test of the track finding in th...
Abstract base class for different kinds of events.