Belle II Software development
Observer3HitPrintResults.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <framework/logging/Logger.h>
12// #include <vxd/dataobjects/VxdID.h>
13
14#include <string>
15#include <iostream>
16#include <iomanip> // std::setprecision
17
18namespace Belle2 {
26 public:
28 template<class Var, class RangeType>
29 static void notify(const Var& filterType,
30 typename Var::variableType fResult,
31 const RangeType& range,
32 const typename Var::argumentType& outerHit,
33 const typename Var::argumentType& centerHit,
34 const typename Var::argumentType& innerHit)
35 {
36
37 std::stringstream outputStream;
38 outputStream << filterType.name()
39 << " with outer-/center-/innerhit: "
40 << outerHit.getPosition().PrintStringXYZ()
41 << "/"
42 << centerHit.getPosition().PrintStringXYZ()
43 << "/"
44 << innerHit.getPosition().PrintStringXYZ()
45 << " having indices "
46 << outerHit.getArrayIndex()
47 << "/"
48 << centerHit.getArrayIndex()
49 << "/"
50 << innerHit.getArrayIndex()
51 << " and VxdIDs "
52 << outerHit.getVxdID()
53 << "/"
54 << centerHit.getVxdID()
55 << "/"
56 << innerHit.getVxdID()
57 << " results in "
58 << (range.contains(fResult) ? std::setprecision(6) : std::setprecision(18))
59 << fResult
60 << " & accepted: "
61 << (range.contains(fResult) ? std::string(">true<") : std::string(">false<"))
62 << " in range "
63 << range.getInf()
64 << "/"
65 << range.getSup();
66
67 B2DEBUG(5, outputStream.str());
69 // if (range.contains(fResult)) {
70 // B2INFO(outputStream.str())
71 // } else {
72 // B2WARNING(outputStream.str())
73 // }
74 }
75
76
79
80
83 template < typename ... types >
84 static void initialize(const types& ...) {};
85
86
89 template < typename ... types >
90 static void terminate(const types& ...) {};
91 };
93}
std::string PrintStringXYZ(unsigned precision=4) const
create a string containing vector in cartesian coordinates
Definition: B2Vector3.h:487
this observer does simply print the name of the SelectionVariable and the result of its value-functio...
static void terminate(const types &...)
static method used by the observed object to terminate the observer.
static void notify(const Var &filterType, typename Var::variableType fResult, const RangeType &range, const typename Var::argumentType &outerHit, const typename Var::argumentType &centerHit, const typename Var::argumentType &innerHit)
notifier producing a info message if SelectionVariable was accepted and a Warning if otherwise
static void initialize(const types &...)
static method used by the observed object to initialize the observer.
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior
Abstract base class for different kinds of events.