ATLAS Offline Software
DipzMLPLCondition.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "./DipzMLPLCondition.h"
8 
9 #include <sstream>
10 #include <cmath>
11 #include <algorithm>
12 #include <numeric>
13 
15  unsigned int capacity,
16  const std::string &decName_z,
17  const std::string &decName_negLogSigma2) :
18  m_workingPoint(wp),
19  m_capacity(capacity),
20  m_likelihoodCalculator(decName_z, decName_negLogSigma2)
21 {
22 
23 }
24 
26  const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
27 
28  if(collector){
29  std::stringstream ss0;
30  const void* address = static_cast<const void*>(this);
31  ss0 << "DipzMLPLCondition: (" << address << ") starts\n";
32  collector -> collect(ss0.str(), "");
33  }
34 
35  double logproduct = m_likelihoodCalculator(ips);
36 
37  bool pass = logproduct >= m_workingPoint;
38 
39  if(collector){
40  std::stringstream ss0;
41  const void* address = static_cast<const void*>(this);
42  ss0 << "DipzMLPLCondition: (" << address << ") logproduct term "
43  << logproduct << " >= "
44  << m_workingPoint << ": "
45  << std::boolalpha << pass << " jet group: \n";
46 
47  std::stringstream ss1;
48 
49  for(const auto& ip : ips){
50  address = static_cast<const void*>(ip.get());
51  ss1 << " " << address << " " << ip->eta() << " e " << ip->e() << '\n';
52  }
53  ss1 << '\n';
54  collector -> collect(ss0.str(), ss1.str());
55  }
56 
57  return pass;
58 
59 }
60 
61 std::string DipzMLPLCondition::toString() const {
62  std::stringstream ss;
63  const void* address = static_cast<const void*>(this);
64 
65  ss << "DipzMLPLCondition: (" << address << ") Capacity: " << m_capacity
66  << " working point: " << m_workingPoint;
67  ss <<'\n';
68 
69  return ss.str();
70 }
DipzMLPLCondition::m_capacity
const unsigned int m_capacity
Definition: DipzMLPLCondition.h:47
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
DipzMLPLCondition::toString
std::string toString() const override
Definition: DipzMLPLCondition.cxx:61
HypoJetDefs.h
DipzMLPLCondition::DipzMLPLCondition
DipzMLPLCondition(double wp, unsigned int capacity, const std::string &decName_z, const std::string &decName_negLogSigma2)
Definition: DipzMLPLCondition.cxx:14
DipzMLPLCondition.h
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
PlotSFuncertainty.wp
wp
Definition: PlotSFuncertainty.py:112
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
DipzMLPLCondition::m_workingPoint
double m_workingPoint
Definition: DipzMLPLCondition.h:46
ITrigJetHypoInfoCollector.h
DipzMLPLCondition::m_likelihoodCalculator
DipzLikelihood m_likelihoodCalculator
Definition: DipzMLPLCondition.h:51
Trig::FeatureAccessImpl::collect
void collect(const HLT::TriggerElement *te, std::vector< Trig::Feature< T > > &data, const std::string &label, unsigned int condition, const std::string &teName, const HLT::TrigNavStructure *navstructure)
actual feature acceess implementation It has (thanks to the ClassTraits) functionality to flatten con...
Definition: FeatureCollectAthena.h:299
DipzMLPLCondition::isSatisfied
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition: DipzMLPLCondition.cxx:25