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

#include <TimingCondition.h>

Inheritance diagram for TimingCondition:
Collaboration diagram for TimingCondition:

Public Member Functions

 TimingCondition (double t_min, double t_max)
 
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_min
 
double m_max
 

Static Private Attributes

static const unsigned int s_capacity {1}
 

Detailed Description

Definition at line 22 of file TimingCondition.h.

Constructor & Destructor Documentation

◆ TimingCondition()

TimingCondition::TimingCondition ( double  t_min,
double  t_max 
)

Definition at line 13 of file TimingCondition.cxx.

14  :
15  m_min(t_min), m_max(t_max) {
16 }

Member Function Documentation

◆ capacity()

virtual unsigned int TimingCondition::capacity ( ) const
inlineoverridevirtual

Implements ICondition.

Definition at line 31 of file TimingCondition.h.

31 {return s_capacity;}

◆ isSatisfied()

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

Implements ICondition.

Definition at line 19 of file TimingCondition.cxx.

19  {
20 
21  if(ips.size() != 1){
22  std::stringstream ss;
23  ss << "TimingCondition::isSatisfied must see exactly 1 particle, but received "
24  << ips.size()
25  << '\n';
26  throw std::runtime_error(ss.str());
27  }
28 
29  auto jet = ips[0];
30 
31  float timing {0.};
32  if(!(jet->getAttribute("Timing",timing))){
33  throw std::runtime_error("ERROR: TimingCondition cannot retrieve jet moment 'Timing'");
34  }
35  bool pass = timing >= m_min and timing < m_max;
36 
37  if(collector){
38  std::stringstream ss0;
39  const void* address = static_cast<const void*>(this);
40  ss0 << "TimingCondition: (" << address
41  << ") timing[" << m_min << ", " << m_max << "]"
42  << " pass: " <<std::boolalpha << pass << '\n';
43 
44 
45  auto j_addr = static_cast<const void*>(jet.get());
46  std::stringstream ss1;
47 
48  ss1 << " jet : " << j_addr << ") timing " << timing << '\n';
49  collector -> collect(ss0.str(), ss1.str());
50  }
51  return pass;
52 
53 }

◆ toString()

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

Implements ICondition.

Definition at line 55 of file TimingCondition.cxx.

55  {
56 
57  std::stringstream ss;
58 
59  const void* address = static_cast<const void*>(this);
60  ss << "TimingCondition: (" << address << ") Capacity: " << s_capacity
61  << " timingMin "<< m_min
62  << " timingMax " << m_max
63  <<'\n';
64 
65  return ss.str();
66 }

Member Data Documentation

◆ m_max

double TimingCondition::m_max
private

Definition at line 37 of file TimingCondition.h.

◆ m_min

double TimingCondition::m_min
private

Definition at line 36 of file TimingCondition.h.

◆ s_capacity

const unsigned int TimingCondition::s_capacity {1}
staticprivate

Definition at line 38 of file TimingCondition.h.


The documentation for this class was generated from the following files:
TimingCondition::m_max
double m_max
Definition: TimingCondition.h:37
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
TimingCondition::m_min
double m_min
Definition: TimingCondition.h:36
TimingCondition::s_capacity
static const unsigned int s_capacity
Definition: TimingCondition.h:38
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
trigDumpTimers.timing
def timing(hist)
Definition: trigDumpTimers.py:13
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
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