ATLAS Offline Software
JetHistoHTFiller.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 
10 JetHistoHTFiller::JetHistoHTFiller( const std::string& type, const std::string & name ,const IInterface* parent):
12  , m_failureOnMissingContainer(false)
13 {
14  declareInterface<IJetHistoFiller>(this);
15  declareProperty("FailureOnMissingContainer", m_failureOnMissingContainer);
16 
17 }
18 
19 
21  ATH_MSG_INFO(" Initializing " << name() << " with " << m_minPt << " and "<< m_maxEta);
22  return StatusCode::SUCCESS;
23 }
24 
26  ATH_MSG_INFO ("Finalizing " << name());
27  return StatusCode::SUCCESS;
28 }
29 
30 StatusCode JetHistoHTFiller::processJetContainer(const JetMonitoringAlg& parentAlg, const xAOD::JetContainer & jets, const EventContext& ) const {
31 
32  if ( jets.empty() ) {
34  ATH_MSG_ERROR("Input JetContainer could not be found or is empty");
35  return StatusCode::FAILURE;
36  } else {
37  ATH_MSG_DEBUG("Input JetContainer could not be found or is empty");
38  return StatusCode::SUCCESS;
39  }
40  }
41 
42  auto HT = Monitored::Scalar<float> ("jetHT", 0.0);
43  for (const auto *const jetItr : jets) {
44  float pt = jetItr->pt()/1000.;
45  if ( pt > m_minPt ) {
46  if (fabs(jetItr->eta()) < m_maxEta) HT += pt;
47  }
48  else { break; } // jets ordered by pT anyway
49  }
50 
51  parentAlg.fill(m_group, HT);
52 
53  return StatusCode::SUCCESS;
54 }
JetHistoHTFiller::m_maxEta
Gaudi::Property< float > m_maxEta
Definition: JetHistoHTFiller.h:27
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
JetHistoHTFiller::m_minPt
Gaudi::Property< float > m_minPt
Definition: JetHistoHTFiller.h:26
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
JetHistoHTFiller::initialize
virtual StatusCode initialize()
Definition: JetHistoHTFiller.cxx:20
test_pyathena.pt
pt
Definition: test_pyathena.py:11
JetHistoHTFiller::m_group
Gaudi::Property< std::string > m_group
Definition: JetHistoHTFiller.h:25
GenericMonitoringTool.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
JetHistoHTFiller::finalize
virtual StatusCode finalize()
Definition: JetHistoHTFiller.cxx:25
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AthMonitorAlgorithm::fill
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
JetHistoHTFiller::JetHistoHTFiller
JetHistoHTFiller(const std::string &type, const std::string &name, const IInterface *parent)
Definition: JetHistoHTFiller.cxx:10
JetHistoHTFiller::m_failureOnMissingContainer
bool m_failureOnMissingContainer
Definition: JetHistoHTFiller.h:28
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
JetMonitoringAlg
Definition: JetMonitoringAlg.h:26
JetHistoHTFiller::processJetContainer
virtual StatusCode processJetContainer(const JetMonitoringAlg &parentAlg, const xAOD::JetContainer &jets, const EventContext &ctx) const
Definition: JetHistoHTFiller.cxx:30
JetMonitoringAlg.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
AthAlgTool
Definition: AthAlgTool.h:26
JetHistoHTFiller.h