ATLAS Offline Software
Loading...
Searching...
No Matches
MomentCondition.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4#
5#include "./MomentCondition.h"
8
9#include <sstream>
10#include <cmath>
11#include <TLorentzVector.h>
12
14 double mMax,
15 const std::string& moment) :
16m_min(mMin), m_max(mMax), m_moment(moment) {
17}
18
19
21 const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
22
23 float momentValue;
24
25 if (!(ip -> getAttribute(m_moment, momentValue))){
26
27 if(collector){
28 auto j_addr = static_cast<const void*>(ip.get());
29
30 std::stringstream ss0;
31 ss0 << "MomentCondition: "
32 << " unable to retrieve " << m_moment << '\n';
33 std::stringstream ss1;
34 ss1 << " jet : ("<< j_addr << ")";
35 collector->collect(ss0.str(), ss1.str());
36 }
37 return false;
38 }
39
40 bool pass = m_min <= momentValue and m_max > momentValue;
41
42 if(collector){
43 const void* address = static_cast<const void*>(this);
44
45 std::stringstream ss0;
46 ss0 << "MomentCondition: ("<< address
47 << ") min cut value " << m_min
48 << " max cut value " << m_max
49 << " moment " << m_moment
50 << " pass: " << std::boolalpha << pass << '\n';
51
52 auto j_addr = static_cast<const void*>(ip.get());
53 std::stringstream ss1;
54 ss1 << " jet : ("<< j_addr << ") "
55 "moment " << m_moment << " value: " << momentValue<< '\n';
56
57 collector->collect(ss0.str(), ss1.str());
58
59 }
60 return pass;
61}
62
63bool
65 const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const {
66 auto result = isSatisfied(ips[0], c);
67 return result;
68}
69
70
71std::string MomentCondition::toString() const {
72 std::stringstream ss;
73 ss << "MomentCondition (" << this << ") "
74 << " moment: " << m_moment
75 << " min " << m_min
76 << " max " << m_max
77 <<'\n';
78
79 return ss.str();
80}
std::vector< pHypoJet > HypoJetVector
Definition HypoJetDefs.h:27
std::shared_ptr< const HypoJet::IJet > pHypoJet
Definition HypoJetDefs.h:25
static Double_t ss
std::string m_moment
MomentCondition(double mMin, double mMax, const std::string &moment)
std::string toString() const override
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override