ATLAS Offline Software
Loading...
Searching...
No Matches
DijetMassCondition.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 massMax):
15 m_min(massMin),
16 m_max(massMax){
17 }
18
19
20bool
22 const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const{
23
24 if(ips.size() != 2){
25 std::stringstream ss;
26 ss << "DijetMassCondition::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 rj0 = j0 -> p4();
37 auto rj1 = j1 -> p4();
38
39 auto mass = (rj0 + rj1).M();
40
41 bool pass = mass >= m_min and mass < m_max;
42
43 if(collector){
44 std::stringstream ss0;
45 const void* address = static_cast<const void*>(this);
46 ss0 << "DijetMassCondition: (" << address << ") "
47 << mass << " "
48 << std::boolalpha << pass << " jet group: \n";
49
50 std::stringstream ss1;
51
52 for(const auto& ip : ips){
53 address = static_cast<const void*>(ip.get());
54 ss1 << " " << address << " " << ip->eta() << " e " << ip->e() << '\n';
55 }
56 ss1 << '\n';
57 collector -> collect(ss0.str(), ss1.str());
58 }
59 return pass;
60
61}
62
63std::string DijetMassCondition::toString() const {
64
65
66 std::stringstream ss;
67 const void* address = static_cast<const void*>(this);
68 ss << "DijetMassCondition: (" << address << ") Capacity: " << s_capacity
69
70 << " mass min: " << m_min
71 << " mass max: " << m_max <<'\n';
72
73 return ss.str();
74}
std::vector< pHypoJet > HypoJetVector
Definition HypoJetDefs.h:27
static Double_t ss
std::string toString() const override
DijetMassCondition(double massMin, double massMax)
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
static const unsigned int s_capacity