ATLAS Offline Software
Loading...
Searching...
No Matches
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
10JetHistoHTFiller::JetHistoHTFiller( const std::string& type, const std::string & name ,const IInterface* parent):
11 AthAlgTool( type, name, parent )
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
30StatusCode 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}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
JetHistoHTFiller(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode processJetContainer(const JetMonitoringAlg &parentAlg, const xAOD::JetContainer &jets, const EventContext &ctx) const
virtual StatusCode finalize()
virtual StatusCode initialize()
Gaudi::Property< std::string > m_group
Gaudi::Property< float > m_maxEta
Gaudi::Property< float > m_minPt
A monitoring algorithm in charge of filling histogram for a JetContainer.
Declare a monitored scalar variable.
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.
JetContainer_v1 JetContainer
Definition of the current "jet container version".