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

#include <TrigTauGenericHypo.h>

Inheritance diagram for TrigTauGenericHypo:
Collaboration diagram for TrigTauGenericHypo:

Public Member Functions

 TrigTauGenericHypo (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode decide (std::vector< ITrigTauGenericHypoTool::ClusterInfo > &input) const override
 
virtual bool decide (const ITrigTauGenericHypoTool::ClusterInfo &i) const override
 

Private Attributes

HLT::Identifier m_decisionId
 
std::vector< int > m_member
 
std::vector< std::string > m_formula
 
std::vector< TFormula > m_store
 
Gaudi::Property< bool > m_decisionPerCluster { this, "DecisionPerCluster", true, "Is multiplicity requirement refering to taus ( false ) or RoIs/clusters with taus ( false ), relevant only in when multiplicity > 1" }
 
Gaudi::Property< bool > m_acceptAll { this, "AcceptAll", false, "Ignore selection" }
 
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }
 

Detailed Description

Definition at line 33 of file TrigTauGenericHypo.h.

Constructor & Destructor Documentation

◆ TrigTauGenericHypo()

TrigTauGenericHypo::TrigTauGenericHypo ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 29 of file TrigTauGenericHypo.cxx.

32  : base_class( type, name, parent ),
34 {
35  declareProperty("Details", m_member);
36  declareProperty("Formulas", m_formula);
37 }

Member Function Documentation

◆ decide() [1/2]

bool TrigTauGenericHypo::decide ( const ITrigTauGenericHypoTool::ClusterInfo i) const
overridevirtual

Definition at line 62 of file TrigTauGenericHypo.cxx.

62  {
63 
64  bool pass = false;
65 
66  auto passedCuts = Monitored::Scalar<unsigned int>( "CutCounter", 0 );
67  auto monitorIt = Monitored::Group( m_monTool, passedCuts );
68 
69  if ( m_acceptAll ) {
70  pass = true;
71  ATH_MSG_DEBUG( "AcceptAll property is set: taking all events" );
72  }
73 
74  // get tau collection
75  auto pTauCont = input.taucontainer;
76 
77  if( not pTauCont->empty() ){
78  ATH_MSG_DEBUG("Input tau collection has size " << pTauCont->size());
79  }else {
80  ATH_MSG_DEBUG("No taus in input collection: Rejecting");
81  return false;
82  }
83 
84  const xAOD::TauJet* aTau = pTauCont->back();
85 
86  // We have to implement the cuts here - Eventually, declare the formulas in the initialize
87  for(unsigned int i=0; i<m_member.size(); i++)
88  {
89  float theValue = 0;
90 
91  // Detail -1 ignores by convention the ID variables
92  if(m_member.at(i) != -1)
93  {
95  aTau->detail(myDetail, theValue);
96  }
97 
98  // What about upper and lower bounds? can work using x, y, z, t...
99  double theResult = m_store.at(i).Eval(theValue, aTau->pt(), aTau->eta());
100  ATH_MSG_DEBUG("Evaluating Hypothesis on ID Variable #: " << m_member.at(i) <<
101  " with cut = " << m_formula.at(i).c_str() <<
102  " and value x (ID), y (pT), z (Eta) = " << theValue <<", "<< aTau->pt() <<
103  ", " << aTau->eta() <<
104  ", Result = " << (theResult > 0.5));
105 
106  if(theResult < 0.5)
107  break; // cut failed
108  else
109  ++passedCuts;
110  }
111 
112  if ( passedCuts!=m_member.size() )
113  {
114  ATH_MSG_DEBUG(" REGTEST: Cut Number: " << passedCuts
115  << " did not pass the threshold");
116  return pass;
117  }
118 
119  pass = true;
120  ATH_MSG_DEBUG(" REGTEST: TE accepted !! ");
121 
122  return pass;
123 }

◆ decide() [2/2]

virtual StatusCode TrigTauGenericHypo::decide ( std::vector< ITrigTauGenericHypoTool::ClusterInfo > &  input) const
overridevirtual

◆ initialize()

StatusCode TrigTauGenericHypo::initialize ( )
overridevirtual

Definition at line 40 of file TrigTauGenericHypo.cxx.

40  {
41 
42  if ( !m_monTool.empty() ) CHECK( m_monTool.retrieve() );
43 
44  ATH_MSG_DEBUG("Tool configured for chain/id: " << m_decisionId <<
45  ", AcceptAll = " << (m_acceptAll ? "True" : "False"));
46 
47  // Here we store the formulas since they need to compile
48  m_store.reserve(m_member.size());
49  msg(MSG::DEBUG) << "Cuts: ";
50  for(unsigned int i=0; i<m_member.size(); i++)
51  {
52  m_store.push_back(TFormula(("TauHypoCut"+m_formula.at(i)).c_str(), m_formula.at(i).c_str()));
53  msg(MSG::DEBUG) << "(" << m_formula.at(i) << ") ";
54  // x is the ID variables, y is Tau pT and z is Tau eta
55  }
56  msg(MSG::DEBUG) << endmsg;
57 
58  return StatusCode::SUCCESS;
59 }

Member Data Documentation

◆ m_acceptAll

Gaudi::Property<bool> TrigTauGenericHypo::m_acceptAll { this, "AcceptAll", false, "Ignore selection" }
private

Definition at line 66 of file TrigTauGenericHypo.h.

◆ m_decisionId

HLT::Identifier TrigTauGenericHypo::m_decisionId
private

Definition at line 59 of file TrigTauGenericHypo.h.

◆ m_decisionPerCluster

Gaudi::Property<bool> TrigTauGenericHypo::m_decisionPerCluster { this, "DecisionPerCluster", true, "Is multiplicity requirement refering to taus ( false ) or RoIs/clusters with taus ( false ), relevant only in when multiplicity > 1" }
private

Definition at line 64 of file TrigTauGenericHypo.h.

◆ m_formula

std::vector<std::string> TrigTauGenericHypo::m_formula
private

Definition at line 61 of file TrigTauGenericHypo.h.

◆ m_member

std::vector<int> TrigTauGenericHypo::m_member
private

Definition at line 60 of file TrigTauGenericHypo.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> TrigTauGenericHypo::m_monTool { this, "MonTool", "", "Monitoring tool" }
private

Definition at line 68 of file TrigTauGenericHypo.h.

◆ m_store

std::vector<TFormula> TrigTauGenericHypo::m_store
private

Definition at line 62 of file TrigTauGenericHypo.h.


The documentation for this class was generated from the following files:
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
TrigTauGenericHypo::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigTauGenericHypo.h:68
TPConverterConstBase::base_class
TPConverterConstBase base_class
Definition: TPConverter.h:779
xAOD::TauJet_v3::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
TrigTauGenericHypo::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition: TrigTauGenericHypo.h:66
TrigTauGenericHypo::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigTauGenericHypo.h:59
HLT::Identifier::fromToolName
static HLT::Identifier fromToolName(const std::string &tname)
Definition: HLTIdentifier.cxx:31
xAOD::TauJet_v3::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
xAOD::TauJetParameters::Detail
Detail
Enum for tau parameters - used mainly for backward compatibility with the analysis code.
Definition: TauDefs.h:156
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigTauGenericHypo::m_formula
std::vector< std::string > m_formula
Definition: TrigTauGenericHypo.h:61
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
xAOD::TauJet_v3::detail
bool detail(TauJetParameters::Detail detail, int &value) const
Set veto flag.
Definition: TauJet_v3.cxx:292
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigTauGenericHypo::m_member
std::vector< int > m_member
Definition: TrigTauGenericHypo.h:60
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigTauGenericHypo::m_store
std::vector< TFormula > m_store
Definition: TrigTauGenericHypo.h:62
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7