12 #include <tracking/trackFindingCDC/filters/base/Filter.dcl.h>
13 #include <tracking/trackFindingCDC/numerics/WithWeight.h>
14 #include <tracking/trackFindingCDC/numerics/Weight.h>
16 #include <genfit/MeasuredStateOnPlane.h>
17 #include <genfit/Exception.h>
18 #include <framework/logging/Logger.h>
28 class ModuleParamList;
45 template <
class AState,
class AnAdvancer>
46 class AdvanceFilter :
public
47 TrackFindingCDC::Filter<std::pair<const std::vector<TrackFindingCDC::WithWeight<const AState*>>, AState*>> {
49 using Super = TrackFindingCDC::Filter<std::pair<const std::vector<TrackFindingCDC::WithWeight<const AState*>>, AState*>>;
52 AdvanceFilter() :
Super()
60 m_advancer.exposeParameters(moduleParamList, prefix);
64 TrackFindingCDC::Weight
operator()(
const std::pair<
const std::vector<TrackFindingCDC::WithWeight<const AState*>>, AState*>& pair)
67 m_advancer.setMaterialEffectsToParameterValue();
69 const std::vector<TrackFindingCDC::WithWeight<const AState*>>& previousStates = pair.first;
70 B2ASSERT(
"Can not extrapolate with nothing", not previousStates.empty());
72 const AState* lastState = previousStates.back();
73 AState* currentState = pair.second;
75 B2ASSERT(
"Can not extrapolate with nothing", lastState->mSoPSet());
78 double returnValue = NAN;
81 returnValue =
m_advancer.extrapolateToPlane(mSoP, plane);
83 B2DEBUG(50,
"Plane extraction failed: " << e.what());
86 if (not std::isnan(returnValue)) {
87 currentState->setMeasuredStateOnPlane(mSoP);