Belle II Software  release-06-01-15
VectorOfObservers< FilterType > Class Template Reference

WARNING TODO: More...

Inheritance diagram for VectorOfObservers< FilterType >:
Collaboration diagram for VectorOfObservers< FilterType >:

Public Types

typedef std::function< void(const FilterType &, typename FilterType::variableType, const typename FilterType::argumentType &, const typename FilterType::argumentType &)> observerFunction
 a typedef to make the stuff more readable
 
using CStyleFunctionPointer = void(*)(const typename FilterType::argumentType &, const typename FilterType::argumentType &, const FilterType &, typename FilterType::variableType)
 a typedef to make the c-style pointer more readable (can not be done with classic typedef)
 

Static Public Member Functions

template<typename range , typename ... otherTypes>
static void notify (const FilterType &filterType, typename FilterType::variableType filterResult, const range &, const typename FilterType::argumentType &outerHit, const typename FilterType::argumentType &innerHit, otherTypes ...)
 iterate over all stored Observers and execute their notify-function More...
 
template<typename ObserverType >
static void addObserver (observerFunction newObserver)
 collects observers to be executed during notify (can not be used so far, but is long-term goal)
 
template<typename ... types>
static void notify (const types &...)
 static method used by the observed object to notify the observer. More...
 
template<typename ... types>
static bool initialize (const types &...)
 static method used by the observed object to initialize the observer it is called once usually from the user.
 
template<typename ... types>
static void prepare (const types &...)
 static method used by the observed object to prepare the observer it is called by the boolean filter operator.
 
template<typename ... types>
static void collect (const types &...)
 static method used by the observed object to prepare the observer it is called by the boolean filter operator.
 
template<typename ... types>
static void terminate (const types &...)
 static method used by the observed object to terminate the observer.
 

Static Public Attributes

static std::vector< observerFunctionsm_collectedObservers = {}
 collects observers with std::function to be executed during notify (variant A) More...
 
static std::vector< CStyleFunctionPointersm_collectedObserversCSTYLE = {}
 collects observers with c-style function pointers to be executed during notify (variant B) More...
 

Detailed Description

template<class FilterType>
class VXDTFObserversTest::VectorOfObservers< FilterType >

WARNING TODO:

  • BasicRootObserver (same as BasicInfoObserver but with storing info to container instead of printing it to screen (not working here, since trackNodes are needed for this (secMapID, secIDs)
  • MCInfoObserver and subparts (mcParticleID, pT, isPrimary, purity level, pdgCode)
  • MCRootObserver like BasicRootObserver but for MCInfoObserver instead of BasicInfoObserver
  • How to get secID and secMapID? -> trackNode
  • How to get mcParticleID, pT, isPrimary, pdgCode? -> trackNode->SpacePoint->relation< MCParticle >
  • How to get purity? -> advanced version of question before
  • How to get the stuff into root-files? -> Observers store into static containers which are frequently emptied into another container which finally will be written to a root file this observer does simply collect other observers which are to be executed during ::notify

Definition at line 691 of file observers.cc.

Member Function Documentation

◆ notify() [1/2]

static void notify ( const FilterType &  filterType,
typename FilterType::variableType  filterResult,
const range &  ,
const typename FilterType::argumentType &  outerHit,
const typename FilterType::argumentType &  innerHit,
otherTypes ...   
)
inlinestatic

iterate over all stored Observers and execute their notify-function

the idea of the following three lines have to work in the end (I basically want to loop over all attached observers and execute their notify function):

or

Definition at line 704 of file observers.cc.

◆ notify() [2/2]

static void notify ( const types &  ...)
inlinestaticinherited

static method used by the observed object to notify the observer.

it is called at each accept.

Definition at line 37 of file VoidObserver.h.

Member Data Documentation

◆ sm_collectedObservers

std::vector< typename VectorOfObservers< FilterType >::observerFunction > sm_collectedObservers = {}
static

collects observers with std::function to be executed during notify (variant A)

initialize static member of variant A

Definition at line 738 of file observers.cc.

◆ sm_collectedObserversCSTYLE

std::vector< typename VectorOfObservers< FilterType >::CStyleFunctionPointer > sm_collectedObserversCSTYLE = {}
static

collects observers with c-style function pointers to be executed during notify (variant B)

initialize static member of variant B

Definition at line 740 of file observers.cc.


The documentation for this class was generated from the following file: