ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
19bool
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
66std::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}
std::vector< pHypoJet > HypoJetVector
Definition HypoJetDefs.h:27
static Double_t ss
static const unsigned int s_capacity
std::string toString() const override
QjetMassCondition(double massMin, double massMax)
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override