Belle II Software development
BaseEventTimeExtractor.icc.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#pragma once
9
10#include <tracking/eventTimeExtraction/findlets/BaseEventTimeExtractor.dcl.h>
11
12#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
13#include <framework/core/ModuleParamList.h>
14
15namespace Belle2 {
20 template<class ... AIOTypes>
22 {
23 return m_wasSuccessful;
24 }
25
26 template<class ... AIOTypes>
27 void BaseEventTimeExtractor<AIOTypes...>::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
28 {
29 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "overwriteExistingEstimation"),
30 m_param_overwriteExistingEstimation,
31 "Is it fine to overwrite the current EventT0?",
32 m_param_overwriteExistingEstimation);
34 Super::exposeParameters(moduleParamList, prefix);
35 }
37 template<class ... AIOTypes>
39 {
40 Super::initialize();
41 m_eventT0.registerInDataStore();
42 }
44 template<class ... AIOTypes>
46 {
47 Super::beginEvent();
48
49 m_wasSuccessful = false;
50
51 if (not m_eventT0.isValid()) {
52 m_eventT0.create();
53 }
54
55 m_eventT0Before = m_eventT0->getEventT0Component();
56 }
57
58 template<class ... AIOTypes>
60 {
61 if (m_eventT0Before) {
62 m_eventT0->setEventT0(*m_eventT0Before);
63 } else {
64 m_eventT0->clearEventT0();
65 }
66 }
68}
The Module parameter list class.
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
virtual void initialize() override
Initialize the event t0 store obj ptr.
virtual void beginEvent() override
Create the event t0 store obj ptr.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose our parameters to the super module.
bool wasSuccessful() const
Returns true if the last run t0 extraction was successful.
void resetEventT0() const
Reset the t0 value to cached value if it exists or clear it otherwise.
Abstract base class for different kinds of events.