ATLAS Offline Software
QjetMassCondition.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 "./QjetMassCondition.h"
7 #include <sstream>
8 #include <stdexcept>
9 #include <TLorentzVector.h>
10 #include <limits>
11 #include <memory>
12 
14  double massMax):m_min(massMin),
15  m_max(massMax){
16  }
17 
18 
19 bool
21  const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const{
22 
23  if(ips.size() != 4){
24  std::stringstream ss;
25  ss << "QjetMassCondition::isSatisfied must see exactly 4 particles, but received "
26  << ips.size()
27  << '\n';
28 
29  throw std::runtime_error(ss.str());
30  }
31 
32  auto j0 = ips[0];
33  auto j1 = ips[1];
34  auto j2 = ips[2];
35  auto j3 = ips[3];
36 
37  auto rj0 = j0 -> p4();
38  auto rj1 = j1 -> p4();
39  auto rj2 = j2 -> p4();
40  auto rj3 = j3 -> p4();
41 
42  auto mass = (rj0 + rj1 + rj2 + rj3).M();
43 
44  bool pass = mass >= m_min and mass < m_max;
45 
46  if(collector){
47  std::stringstream ss0;
48  const void* address = static_cast<const void*>(this);
49  ss0 << "QjetMassCondition: (" << address << ") "
50  << mass << " " << std::boolalpha << pass << " jet group: \n";
51 
52  std::stringstream ss1;
53 
54  for(const auto& ip : ips){
55  address = static_cast<const void*>(ip.get());
56  ss1 << " " << address << " eta " << ip->eta()
57  << " e " << ip->e() << " et: " << ip->et() << '\n';
58  }
59  ss1 << '\n';
60  collector -> collect(ss0.str(), ss1.str());
61  }
62  return pass;
63 
64 }
65 
66 std::string QjetMassCondition::toString() const {
67 
68 
69  std::stringstream ss;
70  const void* address = static_cast<const void*>(this);
71  ss << "QjetMassCondition: (" << address << ") Capacity: " << s_capacity
72 
73  << " mass min: " << m_min
74  << " mass max: " << m_max <<'\n';
75 
76  return ss.str();
77 }
QjetMassCondition::isSatisfied
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition: QjetMassCondition.cxx:20
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
QjetMassCondition.h
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
QjetMassCondition::m_min
double m_min
Definition: QjetMassCondition.h:44
QjetMassCondition::toString
std::string toString() const override
Definition: QjetMassCondition.cxx:66
doubleTestComp.j1
j1
Definition: doubleTestComp.py:21
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
ITrigJetHypoInfoCollector.h
QjetMassCondition::s_capacity
static const unsigned int s_capacity
Definition: QjetMassCondition.h:47
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
QjetMassCondition::m_max
double m_max
Definition: QjetMassCondition.h:45
QjetMassCondition::QjetMassCondition
QjetMassCondition(double massMin, double massMax)
Definition: QjetMassCondition.cxx:13
doubleTestComp.j2
j2
Definition: doubleTestComp.py:22