ATLAS Offline Software
KLFitterSelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 // $Id: KLFitterSelector.cxx 666816 2015-05-13 10:59:36Z morrisj $
7 #include "TopEvent/Event.h"
9 
10 namespace top {
12  SignValueSelector("KLFitter", params) {
13  }
14 
16  // check we have a xAOD::KLFitterResultContainer
17  if (event.m_KLFitterResults == nullptr) {
18  return false;
19  }
20 
21  for (auto result : *event.m_KLFitterResults) {
22  // check for errors
23  if (
24  result->minuitDidNotConverge() == 0 &&
25  result->fitAbortedDueToNaN() == 0 &&
26  result->atLeastOneFitParameterAtItsLimit() == 0 &&
27  result->invalidTransferFunctionAtConvergence() == 0
28  ) {
29  bool passPermutation = checkFloat(result->logLikelihood(), value());
30  if (passPermutation) {
31  return true;
32  }
33  } // check for errors
34  } // Loop over Permutations - if we get this far, all Permutations have failed :(
35  return false;
36  }
37 }
KLFitterResult.h
get_generator_info.result
result
Definition: get_generator_info.py:21
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::SignValueSelector
Many of the tools need a sign (>=) and a value (2).
Definition: SignValueSelector.h:16
top::SignValueSelector::checkFloat
bool checkFloat(double value, double cut) const
Compare a cut supplied by the user with the value calculated in the event.
Definition: SignValueSelector.cxx:133
top::KLFitterSelector::apply
bool apply(const top::Event &) const override
This does stuff based on the information in an event.
Definition: KLFitterSelector.cxx:15
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
Event.h
top::SignValueSelector::value
double value() const
Get the cut value assigned in the constructor.
Definition: SignValueSelector.cxx:94
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
KLFitterSelector.h
top::KLFitterSelector::KLFitterSelector
KLFitterSelector(const std::string &params)
Definition: KLFitterSelector.cxx:11