ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
20bool
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
62std::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}
std::vector< pHypoJet > HypoJetVector
Definition HypoJetDefs.h:27
static Double_t ss
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
std::string toString() const override
static const unsigned int s_capacity
DijetDEtaCondition(double detaMin, double detaMax)