ATLAS Offline Software
DijetDEtaCondition.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 "./DijetDEtaCondition.h"
7 #include <sstream>
8 #include <stdexcept>
9 #include <TLorentzVector.h>
10 #include <limits>
11 #include <memory>
12 
14  double max):
15  m_min(min),
16  m_max(max) {
17 }
18 
19 
20 bool
22  const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const{
23 
24  if(ips.size() != 2){
25  std::stringstream ss;
26  ss << "Dijet::isSatisfied must see exactly 2 particles, but received "
27  << ips.size()
28  << '\n';
29 
30  throw std::runtime_error(ss.str());
31  }
32 
33  auto j0 = ips[0];
34  auto j1 = ips[1];
35 
36  auto eta0 = j0->eta();
37  auto eta1 = j1->eta();
38  auto adeta = std::abs(eta0 -eta1);
39 
40  bool pass = adeta >= m_min and adeta < m_max;
41 
42  if(collector){
43  std::stringstream ss0;
44  const void* address = static_cast<const void*>(this);
45  ss0 << "DijetDEtaCondition: (" << address
46  << ") adeta " << adeta
47  << " pass: " <<std::boolalpha << pass << " jet group: \n";
48 
49  std::stringstream ss1;
50 
51  for(const auto& ip : ips){
52  address = static_cast<const void*>(ip.get());
53  ss1 << " " << address << " " << ip->eta() << " e " << ip->e() << '\n';
54  }
55  ss1 << '\n';
56  collector -> collect(ss0.str(), ss1.str());
57  }
58  return pass;
59 
60 }
61 
62 std::string DijetDEtaCondition::toString() const {
63 
64 
65  std::stringstream ss;
66  const void* address = static_cast<const void*>(this);
67  ss << "DijetDEtaCondition: (" << address << ") Capacity: " << s_capacity
68  << " dEta min: " << m_min
69  << " dEta max: " << m_max <<'\n';
70 
71  return ss.str();
72 }
DijetDEtaCondition::s_capacity
static const unsigned int s_capacity
Definition: DijetDEtaCondition.h:48
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
DijetDEtaCondition::m_max
double m_max
Definition: DijetDEtaCondition.h:46
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
DijetDEtaCondition::DijetDEtaCondition
DijetDEtaCondition(double detaMin, double detaMax)
Definition: DijetDEtaCondition.cxx:13
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
DijetDEtaCondition::isSatisfied
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition: DijetDEtaCondition.cxx:21
DijetDEtaCondition::m_min
double m_min
Definition: DijetDEtaCondition.h:45
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
ITrigJetHypoInfoCollector.h
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
DijetDEtaCondition.h
DijetDEtaCondition::toString
std::string toString() const override
Definition: DijetDEtaCondition.cxx:62