Belle II Software  release-05-02-19
BaseEventTimeExtractor.icc.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/eventTimeExtraction/findlets/BaseEventTimeExtractor.dcl.h>
13 
14 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
15 #include <framework/core/ModuleParamList.h>
16 
17 namespace Belle2 {
22  template<class ... AIOTypes>
24  {
25  return m_wasSuccessful;
26  }
27 
28  template<class ... AIOTypes>
29  void BaseEventTimeExtractor<AIOTypes...>::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
30  {
31  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "overwriteExistingEstimation"),
32  m_param_overwriteExistingEstimation,
33  "Is it fine to overwrite the current EventT0?",
34  m_param_overwriteExistingEstimation);
35 
36  Super::exposeParameters(moduleParamList, prefix);
37  }
38 
39  template<class ... AIOTypes>
41  {
42  Super::initialize();
43  m_eventT0.registerInDataStore();
44  }
45 
46  template<class ... AIOTypes>
48  {
49  Super::beginEvent();
50 
51  m_wasSuccessful = false;
52 
53  if (not m_eventT0.isValid()) {
54  m_eventT0.create();
55  }
56 
57  m_eventT0Before = m_eventT0->getEventT0Component();
58  }
59 
60  template<class ... AIOTypes>
62  {
63  if (m_eventT0Before) {
64  m_eventT0->setEventT0(*m_eventT0Before);
65  } else {
66  m_eventT0->clearEventT0();
67  }
68  }
70 }
Belle2::BaseEventTimeExtractor::initialize
virtual void initialize() override
Initialize the event t0 store obj ptr.
Definition: BaseEventTimeExtractor.icc.h:48
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::BaseEventTimeExtractor::wasSuccessful
bool wasSuccessful() const
Returns true if the last run t0 extraction was successful.
Definition: BaseEventTimeExtractor.icc.h:31
Belle2::BaseEventTimeExtractor::exposeParameters
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose our parameters to the super module.
Definition: BaseEventTimeExtractor.icc.h:37
Belle2::BaseEventTimeExtractor::beginEvent
virtual void beginEvent() override
Create the event t0 store obj ptr.
Definition: BaseEventTimeExtractor.icc.h:55
Belle2::BaseEventTimeExtractor::resetEventT0
void resetEventT0() const
Reset the t0 value to cached value if it exists or clear it otherwise.
Definition: BaseEventTimeExtractor.icc.h:69