ATLAS Offline Software
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
TimeSignificanceCondition Class Reference

#include <TimeSignificanceCondition.h>

Inheritance diagram for TimeSignificanceCondition:
Collaboration diagram for TimeSignificanceCondition:

Public Member Functions

 TimeSignificanceCondition (double t_minTimeSignificance, double t_maxTime)
 
float getTmin (const float pt, const float m_minTimeSignificance) const
 
bool isSatisfied (const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
 
std::string toString () const override
 
virtual unsigned int capacity () const override
 

Private Attributes

double m_minTimeSignificance
 
double m_maxTime
 

Static Private Attributes

static const unsigned int s_capacity {1}
 

Detailed Description

Definition at line 22 of file TimeSignificanceCondition.h.

Constructor & Destructor Documentation

◆ TimeSignificanceCondition()

TimeSignificanceCondition::TimeSignificanceCondition ( double  t_minTimeSignificance,
double  t_maxTime 
)

Definition at line 12 of file TimeSignificanceCondition.cxx.

12  :
13  m_minTimeSignificance(t_minTimeSignificance), m_maxTime(t_maxTime) {
14 }

Member Function Documentation

◆ capacity()

virtual unsigned int TimeSignificanceCondition::capacity ( ) const
inlineoverridevirtual

Implements ICondition.

Definition at line 34 of file TimeSignificanceCondition.h.

34  {
35  return s_capacity;
36  }

◆ getTmin()

float TimeSignificanceCondition::getTmin ( const float  pt,
const float  m_minTimeSignificance 
) const

Definition at line 17 of file TimeSignificanceCondition.cxx.

17  {
18 
19  // for now these are hardcoded, but they should eventually be taken from the conditions db so they can be updated more easily
20  float a {-0.812};
21  float b {-0.014};
22  float c {0.682};
23 
24  float minTime = minTimeSignificance*(std::exp(a+b*(pt/1000)) + c);
25  return minTime;
26 }

◆ isSatisfied()

bool TimeSignificanceCondition::isSatisfied ( const HypoJetVector ips,
const std::unique_ptr< ITrigJetHypoInfoCollector > &  collector 
) const
overridevirtual

Implements ICondition.

Definition at line 28 of file TimeSignificanceCondition.cxx.

28  {
29 
30  if (ips.size() != 1) {
31  std::stringstream ss;
32  ss << "TimeSignificanceCondition::isSatisfied must see exactly 1 particle, but received " << ips.size() << '\n';
33  throw std::runtime_error(ss.str());
34  }
35 
36  auto jet = ips[0];
37 
38  float timing {0.};
39  if (!(jet->getAttribute("Timing", timing))) {
40  throw std::runtime_error("ERROR: TimeSignificanceCondition cannot retrieve jet moment 'Timing'");
41  }
42 
43  float pt {0.};
44  if (!(pt = jet->pt())) {
45  throw std::runtime_error("ERROR: TimeSignificanceCondition cannot retrieve jet pt");
46  }
47 
48  float t_minTime = getTmin(pt, m_minTimeSignificance);
49 
50  bool pass = (timing >= t_minTime) and (timing < m_maxTime);
51 
52  if (collector) {
53  std::stringstream ss0;
54  const void* address = static_cast<const void*>(this);
55  ss0 << "TimeSignificanceCondition: (" << address << ") timing[" << t_minTime << ", " << m_maxTime << "]"
56  << " pass: " << std::boolalpha << pass << '\n';
57 
58  auto j_addr = static_cast<const void*>(jet.get());
59  std::stringstream ss1;
60 
61  ss1 << " jet : " << j_addr << ") timing " << timing << '\n';
62  collector->collect(ss0.str(), ss1.str());
63  }
64  return pass;
65 
66 }

◆ toString()

std::string TimeSignificanceCondition::toString ( ) const
overridevirtual

Implements ICondition.

Definition at line 68 of file TimeSignificanceCondition.cxx.

68  {
69 
70  std::stringstream ss;
71 
72  const void* address = static_cast<const void*>(this);
73  ss << "TimeSignificanceCondition: (" << address << ") Capacity: " << s_capacity
74  << " timeSignificanceMin "<< m_minTimeSignificance
75  << " timeMax " << m_maxTime
76  <<'\n';
77 
78  return ss.str();
79 }

Member Data Documentation

◆ m_maxTime

double TimeSignificanceCondition::m_maxTime
private

Definition at line 41 of file TimeSignificanceCondition.h.

◆ m_minTimeSignificance

double TimeSignificanceCondition::m_minTimeSignificance
private

Definition at line 40 of file TimeSignificanceCondition.h.

◆ s_capacity

const unsigned int TimeSignificanceCondition::s_capacity {1}
staticprivate

Definition at line 42 of file TimeSignificanceCondition.h.


The documentation for this class was generated from the following files:
TimeSignificanceCondition::m_maxTime
double m_maxTime
Definition: TimeSignificanceCondition.h:41
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
test_pyathena.pt
pt
Definition: test_pyathena.py:11
ITrigJetHypoInfoCollector::collect
virtual void collect(const std::string &, const std::string &)=0
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
TimeSignificanceCondition::getTmin
float getTmin(const float pt, const float m_minTimeSignificance) const
Definition: TimeSignificanceCondition.cxx:17
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
trigDumpTimers.timing
def timing(hist)
Definition: trigDumpTimers.py:13
TimeSignificanceCondition::s_capacity
static const unsigned int s_capacity
Definition: TimeSignificanceCondition.h:42
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
a
TList * a
Definition: liststreamerinfos.cxx:10
TimeSignificanceCondition::m_minTimeSignificance
double m_minTimeSignificance
Definition: TimeSignificanceCondition.h:40
python.compressB64.c
def c
Definition: compressB64.py:93