Belle II Software  release-08-01-10
VXDTFObserversTest Namespace Reference

TODO next steps: More...

Classes

class  ObserversTest
 Test class for testing and developing new Observers. More...
 
class  counter
 a tiny counter class for counting stuff More...
 
class  CountContainer
 a container for counting accepted and rejected stuff, just delivers some interfaces to make the code more readable More...
 
class  counterMC
 a tiny counter class for counting stuff retrieved from MC-bla More...
 
class  CountUsedObserver
 this observer does simply count the number of times, the attached SelectionVariable was used More...
 
class  CountAcceptRejectObserver
 this observer does simply count the number of times, the attached SelectionVariable was accepted or rejected More...
 
class  CountBadCaseObserver
 this observer does simply count the number of times, the attached Filter resulted in isinf or isnan More...
 
class  InfoObserver
 this observer does simply print the name of the SelectionVariable and the result of its value-function as a Warning More...
 
class  CountAcceptedRejectedMCParticleObserver
 this observer identifies the McParticles responsible for creating underlying clusters for given spacePoints and counts how often a particle type was accepted and how often it was rejected More...
 
class  ProvideBasicInfoObserver
 this observer combines all the easy-to-get info retrievable by observers and prints it to screen More...
 
class  VectorOfObservers
 WARNING TODO: More...
 

Functions

VXD::SensorInfoBase provideSensorInfo (VxdID aVxdID, double globalX=0., double globalY=0., double globalZ=-0.)
 this is a small helper function to create a sensorInfo to be used
 
PXDCluster providePXDCluster (double u, double v, VxdID aVxdID, double uError=0.1, double vError=0.1)
 returns a pxdCluster with given sensorID and local coordinates
 
SVDCluster provideSVDCluster (VxdID aVxdID, bool isU, double position, double error=0.1)
 returns a svdCluster with given sensorID, uType and local position
 
SpacePoint provideSpacePointDummy (unsigned short i, double X, double Y, double Z)
 when given index number for vxdID and global coordinates, a SpacePoint lying there will be returned
 
 TEST_F (ObserversTest, TestRelationSetup)
 initialize static member of variant Try2 More...
 
 TEST_F (ObserversTest, TestMCDataAccess)
 tests possibility of accessing MCData More...
 
 TEST_F (ObserversTest, TestObserverFlexibility)
 presents the functionality of the SpacePoint-creating function written above More...
 
 TEST_F (ObserversTest, ignoreMe)
 ignore what is written in this test, is simply used as a temporary storage for currently not used code-snippets More...
 

Detailed Description

TODO next steps:

  • write an observer reading relevant info (like whether two clusters of a spacePoint are related to the same mcParticle)
  • implement easy container to be filled by observers
  • write an observer which fills this container
  • write all the other observers planned

Function Documentation

◆ TEST_F() [1/4]

VXDTFObserversTest::TEST_F ( ObserversTest  ,
ignoreMe   
)

ignore what is written in this test, is simply used as a temporary storage for currently not used code-snippets

a tiny CollectedObservers class for CollectedObservers stuff

Definition at line 956 of file observers.cc.

957  {
958  //garbage:
959  // VectorOfObservers<Distance3DSquared>::addObserver(CountUsedObserver::notify);
960  // auto storeFunc = std::bind((void(*)(const SpacePoint&, const SpacePoint&, const Belle2::Distance3DSquared&, float))&CountUsedObserver::notify, std::placeholders::_1, std::placeholders::_2, Distance3DSquared(), std::placeholders::_3);
961  // auto storeFunc1 = std::bind(void(*)(const typename Distance3DSquared::argumentType&, const typename Distance3DSquared::argumentType&, const Distance3DSquared&, typename Distance3DSquared::variableType) /*&CountUsedObserver::notify*/), std::placeholders::_1, std::placeholders::_2, Distance3DSquared(), std::placeholders::_3);
962 
963 // ObserverVector<Distance3DSquared>::sm_collectedObservers.push_back(storeFunc);
964  // ObserverVector<Distance3DSquared>::sm_collectedObservers.push_back(std::bind((void(*)(const SpacePoint&, const SpacePoint&, const Belle2::Distance3DSquared&, float))&CountUsedObserver::notify, std::placeholders::_1, std::placeholders::_2, Distance3DSquared(), std::placeholders::_3));
965  // std::vector< typename ObserverVector<FilterType>::observerFunction >();
966  // ObserverVector<VectorOfObservers>::sm_collectedObservers = std::vector< typename VectorOfObservers<Distance3DSquared>::observerFunction >();
967 // ErrorObserver anErrorBla();
968  // WarningObserver aWarningBla();
969  // ObserverVector<Distance3DSquared>::addObserver(aWarningBla/*, filterBla*/);
970  // ObserverVector<Distance3DSquared>::addObserver(aBla/*, filterBla*/);
971  // // // // // // Distance3DSquared filterBla();
972 
974 // template<class FilterType> class CollectedObservers {
975 // public:
976 // typedef std::function< void (const typename FilterType::argumentType&, const typename FilterType::argumentType&, const FilterType&, typename FilterType::variableType)> observerFunction;
977 //
978 // /** collects observers to be executed during notify */
979 // static std::vector< observerFunction > collectedObservers;
980 // CollectedObservers() {};
981 // ~CollectedObservers() {};
982 // };
983 
984 // static void addObserver( CountUsedObserver& newObserver) {
985 // // static void addObserver(observerFunction newObserver) {
986 // ObserverVector<FilterType>::sm_collectedObservers.push_back(std::bind(&newObserver::notify, std::placeholders::_1, std::placeholders::_2, FilterType(), std::placeholders::_3));
987 // }
988  }

◆ TEST_F() [2/4]

VXDTFObserversTest::TEST_F ( ObserversTest  ,
TestMCDataAccess   
)

tests possibility of accessing MCData

TODO further tests!

Definition at line 811 of file observers.cc.

◆ TEST_F() [3/4]

VXDTFObserversTest::TEST_F ( ObserversTest  ,
TestObserverFlexibility   
)

presents the functionality of the SpacePoint-creating function written above

variant A (doesn't work, because of static function(?)):

variant B:

doesn't work, different type, additionally static_cast doesn't work too (reinterpret_casat too dangerous, didn't try):

long-term goal, something comparable to this:

Definition at line 895 of file observers.cc.

◆ TEST_F() [4/4]

VXDTFObserversTest::TEST_F ( ObserversTest  ,
TestRelationSetup   
)

initialize static member of variant Try2

tests whether the setup of relations is doing what it is supposed to do

Definition at line 761 of file observers.cc.