Belle II Software  release-05-01-25
Observer3HitPrintResults.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jakob Lettenbichler *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/logging/Logger.h>
14 // #include <vxd/dataobjects/VxdID.h>
15 
16 #include <string>
17 #include <iostream>
18 #include <iomanip> // std::setprecision
19 
20 namespace Belle2 {
27  class Observer3HitPrintResults {
28  public:
30  template<class Var, class RangeType>
31  static void notify(const Var& filterType,
32  typename Var::variableType fResult,
33  const RangeType& range,
34  const typename Var::argumentType& outerHit,
35  const typename Var::argumentType& centerHit,
36  const typename Var::argumentType& innerHit)
37  {
38 
39  std::stringstream outputStream;
40  outputStream << filterType.name()
41  << " with outer-/center-/innerhit: "
42  << outerHit.getPosition().PrintStringXYZ()
43  << "/"
44  << centerHit.getPosition().PrintStringXYZ()
45  << "/"
46  << innerHit.getPosition().PrintStringXYZ()
47  << " having indices "
48  << outerHit.getArrayIndex()
49  << "/"
50  << centerHit.getArrayIndex()
51  << "/"
52  << innerHit.getArrayIndex()
53  << " and VxdIDs "
54  << outerHit.getVxdID()
55  << "/"
56  << centerHit.getVxdID()
57  << "/"
58  << innerHit.getVxdID()
59  << " results in "
60  << (range.contains(fResult) ? std::setprecision(6) : std::setprecision(18))
61  << fResult
62  << " & accepted: "
63  << (range.contains(fResult) ? std::string(">true<") : std::string(">false<"))
64  << " in range "
65  << range.getInf()
66  << "/"
67  << range.getSup();
68 
69  B2DEBUG(5, outputStream.str());
71  // if (range.contains(fResult)) {
72  // B2INFO(outputStream.str())
73  // } else {
74  // B2WARNING(outputStream.str())
75  // }
76  }
77 
78 
81 
82 
85  template < typename ... types >
86  static void initialize(const types& ...) {};
87 
88 
91  template < typename ... types >
92  static void terminate(const types& ...) {};
93  };
95 }
Belle2::Observer3HitPrintResults::terminate
static void terminate(const types &...)
static method used by the observed object to terminate the observer.
Definition: Observer3HitPrintResults.h:100
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Observer3HitPrintResults::notify
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
Definition: Observer3HitPrintResults.h:39
Belle2::Observer3HitPrintResults::Observer3HitPrintResults
Observer3HitPrintResults()
empty constructor:
Definition: Observer3HitPrintResults.h:88
Belle2::Observer3HitPrintResults::initialize
static void initialize(const types &...)
static method used by the observed object to initialize the observer.
Definition: Observer3HitPrintResults.h:94