ATLAS Offline Software
Loading...
Searching...
No Matches
HLT::MET::MHTPufitFex Class Reference

#include <MHTPufitFex.h>

Inheritance diagram for HLT::MET::MHTPufitFex:
Collaboration diagram for HLT::MET::MHTPufitFex:

Public Member Functions

 MHTPufitFex (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor.
virtual StatusCode initialize () override
 Initialize the fex.
virtual StatusCode execute (const EventContext &context) const override
 Run the algorithm.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

StatusCode initializeBase (const std::vector< std::string > &componentNames)
 Initialize the base class.
virtual StatusCode monitor (const xAOD::TrigMissingET &met, MonGroupBuilder &monitors) const
 Add monitor variables from an xAOD::TrigMissingET object.
virtual StatusCode flagMET (xAOD::TrigMissingET &met) const
 Flag suspicious values in the output MET.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

std::vector< std::string > m_componentNames
 The names of the output MET components.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

virtual StatusCode fillMET (xAOD::TrigMissingET &met, const EventContext &context, MonGroupBuilder &monitors) const override
 Calculate and fill the output MET value.
double getSigma (const SignedKinematics &kin) const
 Calculate the estimate on the variance of a tower.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::JetContainerm_inputJetsKey
 Input objects.
SG::ReadDecorHandleKey< xAOD::JetContainerm_inputJvtKey
 The input JVT decoration.
SG::ReadHandleKey< xAOD::IParticleContainerm_inputKey
 The input clusters or PFOs.
Gaudi::Property< bool > m_jetCalibIncludesAreaSub
SG::ReadHandleKey< xAOD::EventShapem_rhoKey
Gaudi::Property< float > m_nSigma
 The sigma threshold.
Gaudi::Property< float > m_maxEta
 The eta range of the grid.
Gaudi::Property< std::size_t > m_nEtaBins
 The number of bins in eta.
Gaudi::Property< std::size_t > m_nPhiBins
Gaudi::Property< float > m_trimFraction
 The trimming fraction.
Gaudi::Property< float > m_caloNoise
 The coefficient of the noise term in the calo resolution estimate.
Gaudi::Property< float > m_caloStoch
 The coefficient of the stochastic term in the calo resolution estimate.
Gaudi::Property< float > m_constraintImportance
 The relative constraint importance.
Gaudi::Property< float > m_jvtCut
Gaudi::Property< float > m_minPt
Gaudi::Property< float > m_maxPt
Gaudi::Property< float > m_forwardPt
Gaudi::Property< float > m_centralEta
Gaudi::Property< bool > m_useDetectorEta
SG::WriteHandleKey< xAOD::TrigMissingETContainerm_metContainerKey
 The output MET object.
ToolHandle< GenericMonitoringToolm_monTool
 The monitoring tool.
Gaudi::Property< float > m_maxComponentMETSumEtRatio
Gaudi::Property< float > m_maxGlobalMETSumEtRatio
bool m_baseInitialised {false}
 Whether or not this class has been correctly initialised.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 36 of file MHTPufitFex.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MHTPufitFex()

HLT::MET::MHTPufitFex::MHTPufitFex ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor.

Definition at line 36 of file MHTPufitFex.cxx.

37 : FexBase(name, pSvcLocator)
38 {
39 }
FexBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition FexBase.cxx:43

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode HLT::MET::FexBase::execute ( const EventContext & context) const
overridevirtualinherited

Run the algorithm.

Definition at line 60 of file FexBase.cxx.

61 {
62 if (!m_baseInitialised) {
63 ATH_MSG_ERROR("Base class was not initialised! This means that the "
64 << "derived class was not correctly written!");
65 return StatusCode::FAILURE;
66 }
67 ATH_MSG_DEBUG("Executing " << name() << "...");
68 Monitored::Timer totalTimer("TIME_Total");
69 // Create the output
70 auto metCont = std::make_unique<xAOD::TrigMissingETContainer>();
71 auto metContAux = std::make_unique<xAOD::TrigMissingETAuxContainer>();
72 metCont->setStore(metContAux.get() );
73
74 // Create the actual output object
75 metCont->push_back(std::make_unique<xAOD::TrigMissingET>());
76 xAOD::TrigMissingET* met = metCont->back();
77
78 // Initialise the components
80 // We also need to initialise all of the values. This is not done by the EDM
81 // class so you can easily get missing aux element errors if you don't do
82 // this
83 met->setEx(0);
84 met->setEy(0);
85 met->setEz(0);
86 met->setSumEt(0);
87 met->setSumE(0);
88 met->setFlag(0);
89 met->setRoiWord(0);
90
91 MonGroupBuilder monitors;
92 CHECK( fillMET(*met, context, monitors) );
93 // Add flags
94 CHECK( flagMET(*met) );
95 // Add extra monitors
96 CHECK( monitor(*met, monitors) );
97 // Create the actual group and trigger the monitoring
98 monitors.build(m_monTool);
99
100 // Output REGTEST information
101 if (msgLvl(MSG::DEBUG) ) {
102 ATH_MSG_DEBUG( "REGTEST " << METComponent(*met) );
103 ATH_MSG_DEBUG( "REGTEST flag = " << met->flag() );
104 ATH_MSG_DEBUG( "REGTEST Name, status, values: ");
105 for (std::size_t ii = 0; ii < met->getNumberOfComponents(); ++ii)
106 ATH_MSG_DEBUG( "REGTEST "
107 << met->nameOfComponent(ii) << ", "
108 << met->statusComponent(ii) << ", "
109 << METComponent(ii, *met) );
110 }
111
112 // Push this output to the store
113 auto handle = SG::makeHandle(m_metContainerKey, context);
114 CHECK( handle.record( std::move(metCont), std::move(metContAux) ) );
115 return StatusCode::SUCCESS;
116 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
bool msgLvl(const MSG::Level lvl) const
virtual StatusCode flagMET(xAOD::TrigMissingET &met) const
Flag suspicious values in the output MET.
Definition FexBase.cxx:118
std::vector< std::string > m_componentNames
The names of the output MET components.
Definition FexBase.h:48
bool m_baseInitialised
Whether or not this class has been correctly initialised.
Definition FexBase.h:119
ToolHandle< GenericMonitoringTool > m_monTool
The monitoring tool.
Definition FexBase.h:106
virtual StatusCode fillMET(xAOD::TrigMissingET &met, const EventContext &context, MonGroupBuilder &monitors) const =0
Calculate and fill the output MET value.
SG::WriteHandleKey< xAOD::TrigMissingETContainer > m_metContainerKey
The output MET object.
Definition FexBase.h:103
virtual StatusCode monitor(const xAOD::TrigMissingET &met, MonGroupBuilder &monitors) const
Add monitor variables from an xAOD::TrigMissingET object.
Definition FexBase.cxx:141
int flag() const
Get the status flag.
void setEy(float s)
Set the y component of the missing energy.
void setRoiWord(uint32_t s)
Set the ROI word.
void setEx(float s)
Set the x component of the missing energy.
const std::string & nameOfComponent(unsigned int index) const
Get the name of a component.
void setSumE(float s)
Set the sum of the ET of the missing energy.
void setSumEt(float s)
Set the sum of the ET of the missing energy.
unsigned int getNumberOfComponents() const
Get the number of components.
short statusComponent(unsigned int index) const
Get Status.
void defineComponents(const std::vector< std::string > &componentNames)
Define each of the components by name.
void setFlag(int s)
Set the status flag.
void setEz(float s)
Set the z component of the missing energy.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
TrigMissingET_v1 TrigMissingET
Define the most recent version of the TrigMissingET class.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ fillMET()

StatusCode HLT::MET::MHTPufitFex::fillMET ( xAOD::TrigMissingET & met,
const EventContext & context,
MonGroupBuilder & monitors ) const
overrideprivatevirtual

Calculate and fill the output MET value.

Parameters
metThe object to fill
contextThe event context
monitors[out]Any extra monitors to fill

Implements HLT::MET::FexBase.

Definition at line 60 of file MHTPufitFex.cxx.

64 {
65 using namespace PufitUtils;
66 // Retrieve the input
67 auto inputJets = SG::makeHandle(m_inputJetsKey, context);
68 if (!inputJets.isValid())
69 {
70 ATH_MSG_ERROR("Failed to retrieve " << m_inputJetsKey);
71 return StatusCode::FAILURE;
72 }
73 auto jvtAcc = SG::makeHandle<float>(m_inputJvtKey, context);
74 auto inputs = SG::makeHandle(m_inputKey, context);
75 if (!inputs.isValid())
76 {
77 ATH_MSG_ERROR("Failed to retrieve " << m_inputKey);
78 return StatusCode::FAILURE;
79 }
80
81 double rho = 0;
83 {
84 auto rhoHandle = SG::makeHandle(m_rhoKey, context);
85 if (!rhoHandle->getDensity(xAOD::EventShape::Density, rho))
86 {
87 ATH_MSG_ERROR("EventShape density not available!");
88 return StatusCode::FAILURE;
89 }
90 }
91
92 // Create the grid
93 PufitGrid grid(m_maxEta, m_nEtaBins, m_nPhiBins);
94 CovarianceSum pileupSum;
95 METComponent sum;
96 METComponent uncorrSum;
97
98 // Keep track of which clusters/PFOs we have decided are included in a HS jet
99 std::set<const xAOD::IParticle *> hardScatterInputs;
100 std::vector<SignedKinematics> hardScatterJets;
101 std::vector<float> jetAreas;
102 for (const xAOD::Jet *ijet : *inputJets)
103 {
104 float eta = m_useDetectorEta ? accDetectorEta(*ijet) : ijet->eta();
105 if (std::abs(eta) > m_centralEta)
106 {
107 if (ijet->pt() < m_forwardPt)
108 continue;
109 }
110 else
111 {
112 if (ijet->pt() < m_minPt)
113 continue;
114 else if (ijet->pt() < m_maxPt && jvtAcc(*ijet) < m_jvtCut)
115 continue;
116 }
117 // If we're here then the jet has passed the selection
118 hardScatterJets.push_back(*ijet);
119 jetAreas.push_back(accArea(*ijet));
120 for (const auto &link : ijet->constituentLinks())
121 {
122 if (link.isValid())
123 {
124 const xAOD::IParticle *constituent = *link;
125 if (const xAOD::IParticle *original = xAOD::getOriginalObject(*constituent))
126 hardScatterInputs.insert(original);
127 else
128 hardScatterInputs.insert(constituent);
129 }
130 else
131 ATH_MSG_WARNING("Invalid constituent link!");
132 }
133 } //> end loop over jets
134
135 if (hardScatterJets.size() > 0)
136 {
137 for (const xAOD::IParticle *ipart : *inputs)
138 {
139 const xAOD::IParticle *original = xAOD::getOriginalObject(*ipart);
140 if (!original)
141 original = ipart;
142 bool isHS = hardScatterInputs.count(original);
143 SignedKinematics kin = SignedKinematics::fromEnergyEtaPhi(
144 ipart->e(), ipart->eta(), ipart->phi());
145 if (!isHS)
146 pileupSum.add(kin, getSigma(kin));
147
148 // Figure out which tower this particle belongs in
149 bool outOfRange = false;
150 std::size_t idx = grid.getIndex(ipart->eta(), ipart->phi(), outOfRange);
151 if (!outOfRange)
152 {
153 PufitGrid::Tower &tower = grid[idx];
154 tower += kin;
155 if (isHS)
156 // mask a tower that has *any* clusters from HS jets in it
157 tower.mask();
158 }
159 }
160
161 // Calculate the expected PU contributions to each jet
162 double towerMean = 0;
163 double towerVariance = 0;
164 unmaskedMeanAndVariance(grid, towerMean, towerVariance);
165 float towerArea = grid.etaWidth() * grid.phiWidth();
166 std::vector<double> means;
167 std::vector<double> variances;
168 means.reserve(jetAreas.size());
169 variances.reserve(jetAreas.size());
170 for (float area : jetAreas)
171 {
172 means.push_back(towerMean * area / towerArea);
173 variances.push_back(towerVariance * area / towerArea);
174 }
175
176 std::vector<SignedKinematics> corrections = pufit(
177 pileupSum.sum,
178 pileupSum.covariance,
179 means,
180 variances,
181 hardScatterJets,
183
184 for (std::size_t ii = 0; ii < hardScatterJets.size(); ++ii)
185 {
186 SignedKinematics kin = hardScatterJets.at(ii);
187 uncorrSum += kin;
189 // Add back the energy that was subtracted by the rho sub part of the
190 // calibration otherwise pufit will overcount this effect
192 jetAreas.at(ii) * rho, kin.eta(), kin.phi());
193 sum += kin;
194 sum += corrections.at(ii);
195 }
196 }
197
198 uncorrSum.fillMETComponent(0, met);
199 sum.fillMET(met);
200
201 return StatusCode::SUCCESS;
202 }
Scalar eta() const
pseudorapidity method
#define ATH_MSG_WARNING(x)
double area(double R)
Gaudi::Property< float > m_minPt
Definition MHTPufitFex.h:94
Gaudi::Property< bool > m_useDetectorEta
Gaudi::Property< bool > m_jetCalibIncludesAreaSub
Definition MHTPufitFex.h:58
Gaudi::Property< float > m_forwardPt
Definition MHTPufitFex.h:99
Gaudi::Property< float > m_centralEta
Gaudi::Property< float > m_constraintImportance
The relative constraint importance.
Definition MHTPufitFex.h:88
SG::ReadDecorHandleKey< xAOD::JetContainer > m_inputJvtKey
The input JVT decoration.
Definition MHTPufitFex.h:53
SG::ReadHandleKey< xAOD::EventShape > m_rhoKey
Definition MHTPufitFex.h:61
SG::ReadHandleKey< xAOD::IParticleContainer > m_inputKey
The input clusters or PFOs.
Definition MHTPufitFex.h:56
Gaudi::Property< float > m_maxEta
The eta range of the grid.
Definition MHTPufitFex.h:68
Gaudi::Property< std::size_t > m_nPhiBins
Definition MHTPufitFex.h:73
Gaudi::Property< std::size_t > m_nEtaBins
The number of bins in eta.
Definition MHTPufitFex.h:71
Gaudi::Property< float > m_jvtCut
Definition MHTPufitFex.h:92
double getSigma(const SignedKinematics &kin) const
Calculate the estimate on the variance of a tower.
SG::ReadHandleKey< xAOD::JetContainer > m_inputJetsKey
Input objects.
Definition MHTPufitFex.h:50
Gaudi::Property< float > m_maxPt
Definition MHTPufitFex.h:96
static SignedKinematics fromEnergyEtaPhi(double energy, double eta, double phi)
Factory function to construct from energy, eta, phi (massless)
Eigen::VectorXd pufit(const Eigen::Vector2d &pileupSum, const Eigen::Matrix2d &pileupCovariance, const Eigen::VectorXd &towerExpectations, const Eigen::VectorXd &towerVariances, const Eigen::VectorXd &correctionDirections, double constraintImportance)
Perform the pile-up fit.
void unmaskedMeanAndVariance(const PufitGrid &grid, double &mean, double &variance)
Calculate the mean and variance of unmasked towers.
float towerArea(float eta)
Get the GCaloTower areas from their eta bins.
Jet_v1 Jet
Definition of the current "jet version".
const IParticle * getOriginalObject(const IParticle &copy)
This function can be used to conveniently get a pointer back to the original object from which a copy...

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ flagMET()

StatusCode HLT::MET::FexBase::flagMET ( xAOD::TrigMissingET & met) const
protectedvirtualinherited

Flag suspicious values in the output MET.

Parameters
metThe xAOD::TrigMissingET object to flag

Definition at line 118 of file FexBase.cxx.

119 {
120 // Start with the components
121 // Keep a flag to OR into the main value
122 int overall = 0;
123 for (std::size_t ii = 0; ii < met.getNumberOfComponents(); ++ii) {
124 METComponent component(ii, met);
125 if (component.sumEt > 0 &&
126 component.met() / component.sumEt > m_maxComponentMETSumEtRatio) {
127 component.status |= StatusFlag::ComponentBigMEtSEtRatio;
129 }
130 met.setStatusComponent(ii, component.status);
131 }
132 METComponent total(met);
133 total.status |= overall;
134 if (total.sumEt > 0 &&
135 total.met() / total.sumEt > m_maxGlobalMETSumEtRatio)
136 total.status |= StatusFlag::GlobalBigMEtSEtRatio;
137 met.setFlag(total.status);
138 return StatusCode::SUCCESS;
139 }
Gaudi::Property< float > m_maxGlobalMETSumEtRatio
Definition FexBase.h:111
Gaudi::Property< float > m_maxComponentMETSumEtRatio
Definition FexBase.h:108
void setStatusComponent(unsigned int index, float value)
Set Status.

◆ getSigma()

double HLT::MET::MHTPufitFex::getSigma ( const SignedKinematics & kin) const
private

Calculate the estimate on the variance of a tower.

Parameters
kinThe kinematics of the tower

Definition at line 31 of file MHTPufitFex.cxx.

32 {
33 return m_caloNoise * m_caloNoise + kin.absPt() * m_caloStoch * m_caloStoch;
34 }
Gaudi::Property< float > m_caloStoch
The coefficient of the stochastic term in the calo resolution estimate.
Definition MHTPufitFex.h:84
Gaudi::Property< float > m_caloNoise
The coefficient of the noise term in the calo resolution estimate.
Definition MHTPufitFex.h:80

◆ initialize()

StatusCode HLT::MET::MHTPufitFex::initialize ( )
overridevirtual

Initialize the fex.

Definition at line 41 of file MHTPufitFex.cxx.

42 {
43 CHECK(m_inputJetsKey.initialize());
44 if (m_inputJvtKey.key().find(".") == std::string::npos)
45 m_inputJvtKey = m_inputJetsKey.key() + "." + m_inputJvtKey.key();
46 else if (SG::contKeyFromKey(m_inputJvtKey.key()) != m_inputJvtKey.key())
47 {
48 ATH_MSG_ERROR("Input JVT key does not match the input jet key!");
49 return StatusCode::FAILURE;
50 }
51 CHECK(m_inputJvtKey.initialize());
52
53 CHECK(m_inputKey.initialize());
54
56
57 return initializeBase({"UncorrJets"});
58 }
StatusCode initializeBase(const std::vector< std::string > &componentNames)
Initialize the base class.
Definition FexBase.cxx:48
std::string contKeyFromKey(const std::string &key)
Extract the container part of key.

◆ initializeBase()

StatusCode HLT::MET::FexBase::initializeBase ( const std::vector< std::string > & componentNames)
protectedinherited

Initialize the base class.

Parameters
componentNamesThe names of any components in the output MET object.

The xAOD::TrigMissingET writes out a main 'met' value but can also write out extra MET components - either for debugging, monitoring or further use offline. The object has to be initialized with this names, they cannot be extended after this, so this information must be available for the base class to use.

Definition at line 48 of file FexBase.cxx.

50 {
51 ATH_MSG_DEBUG("Initialising FexBase base class");
52 m_baseInitialised = true;
53 m_componentNames = componentNames;
54 CHECK( m_metContainerKey.initialize() );
55 if (!m_monTool.empty())
56 CHECK( m_monTool.retrieve() );
57 return StatusCode::SUCCESS;
58 }

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ monitor()

StatusCode HLT::MET::FexBase::monitor ( const xAOD::TrigMissingET & met,
MonGroupBuilder & monitors ) const
protectedvirtualinherited

Add monitor variables from an xAOD::TrigMissingET object.

Parameters
metThe object to fill from
monitorsExtra variables to be monitored

Definition at line 141 of file FexBase.cxx.

144 {
145 METComponent metComponent(met);
146 // Increase the capacity of the vector
147 monitors.increaseCapacity(16, true);
148 // Add the standard variables
149 monitors.add(Monitored::Scalar("EF_MEx_log", toLog10GeV(metComponent.mpx) ) );
150 monitors.add(Monitored::Scalar("EF_MEy_log", toLog10GeV(metComponent.mpy) ) );
151 monitors.add(Monitored::Scalar("EF_MEz_log", toLog10GeV(metComponent.mpz) ) );
152 monitors.add(Monitored::Scalar("EF_MET_log", toLog10GeV(metComponent.met() ) ) );
153 monitors.add(Monitored::Scalar("EF_ME_log", toLog10GeV(metComponent.magnitude() ) ) );
154 monitors.add(Monitored::Scalar("EF_SumEt_log", toLog10GeV(metComponent.sumEt) ) );
155 monitors.add(Monitored::Scalar("EF_SumE_log", toLog10GeV(metComponent.sumE, -9e9) ) );
156 monitors.add(Monitored::Scalar("EF_MEx_lin", toLinGeV(metComponent.mpx) ) );
157 monitors.add(Monitored::Scalar("EF_MEy_lin", toLinGeV(metComponent.mpy) ) );
158 monitors.add(Monitored::Scalar("EF_MEz_lin", toLinGeV(metComponent.mpz) ) );
159 monitors.add(Monitored::Scalar("EF_MET_lin", toLinGeV(metComponent.met() ) ) );
160 monitors.add(Monitored::Scalar("EF_ME_lin", toLinGeV(metComponent.magnitude() ) ) );
161 monitors.add(Monitored::Scalar("EF_SumEt_lin", toLinGeV(metComponent.sumEt) ) );
162 monitors.add(Monitored::Scalar("EF_SumE_lin", toLinGeV(metComponent.sumE) ) );
163 monitors.add(Monitored::Scalar(
164 "EF_XS", toLinGeV(metComponent.met() ) / toLinGeV(metComponent.sumEt, 1) ) );
165 monitors.add(Monitored::Scalar("EF_MET_phi", metComponent.phi() ) );
166 return StatusCode::SUCCESS;
167 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_baseInitialised

bool HLT::MET::FexBase::m_baseInitialised {false}
privateinherited

Whether or not this class has been correctly initialised.

Definition at line 119 of file FexBase.h.

119{false};

◆ m_caloNoise

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_caloNoise
private
Initial value:
{
this, "CaloNoise", 50,
"The coefficient of the noise term in the calorimeter resolution estimate [MeV]"}

The coefficient of the noise term in the calo resolution estimate.

Definition at line 80 of file MHTPufitFex.h.

80 {
81 this, "CaloNoise", 50,
82 "The coefficient of the noise term in the calorimeter resolution estimate [MeV]"};

◆ m_caloStoch

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_caloStoch
private
Initial value:
{
this, "CaloStochastic", 15.81,
"The coefficient of the stochastic term in the calorimeter resolution estimate [MeV^1/2]"}

The coefficient of the stochastic term in the calo resolution estimate.

Definition at line 84 of file MHTPufitFex.h.

84 {
85 this, "CaloStochastic", 15.81,
86 "The coefficient of the stochastic term in the calorimeter resolution estimate [MeV^1/2]"};

◆ m_centralEta

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_centralEta
private
Initial value:
{
this, "CentralEta", 2.4, "The boundary between the central and border regions"}

Definition at line 101 of file MHTPufitFex.h.

101 {
102 this, "CentralEta", 2.4, "The boundary between the central and border regions"};

◆ m_componentNames

std::vector<std::string> HLT::MET::FexBase::m_componentNames
protectedinherited

The names of the output MET components.

Definition at line 48 of file FexBase.h.

◆ m_constraintImportance

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_constraintImportance
private
Initial value:
{
this, "ConstraintImportance", 1,
"The relative importance of the two constraints to the fit"}

The relative constraint importance.

Definition at line 88 of file MHTPufitFex.h.

88 {
89 this, "ConstraintImportance", 1,
90 "The relative importance of the two constraints to the fit"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_forwardPt

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_forwardPt
private
Initial value:
{
this, "ForwardPt", 30*Gaudi::Units::GeV, "The minimum pt in the forward region"}

Definition at line 99 of file MHTPufitFex.h.

99 {
100 this, "ForwardPt", 30*Gaudi::Units::GeV, "The minimum pt in the forward region"};

◆ m_inputJetsKey

SG::ReadHandleKey<xAOD::JetContainer> HLT::MET::MHTPufitFex::m_inputJetsKey
private
Initial value:
{
this, "InputJetsName", "", "The input jet container"}

Input objects.

Definition at line 50 of file MHTPufitFex.h.

50 {
51 this, "InputJetsName", "", "The input jet container"};

◆ m_inputJvtKey

SG::ReadDecorHandleKey<xAOD::JetContainer> HLT::MET::MHTPufitFex::m_inputJvtKey
private
Initial value:
{
this, "InputJvtName", "Jvt", "The input JVT name"}

The input JVT decoration.

Definition at line 53 of file MHTPufitFex.h.

53 {
54 this, "InputJvtName", "Jvt", "The input JVT name"};

◆ m_inputKey

SG::ReadHandleKey<xAOD::IParticleContainer> HLT::MET::MHTPufitFex::m_inputKey
private
Initial value:
{
this, "InputName", "", "The input clusters or PFOs"}

The input clusters or PFOs.

Definition at line 56 of file MHTPufitFex.h.

56 {
57 this, "InputName", "", "The input clusters or PFOs"};

◆ m_jetCalibIncludesAreaSub

Gaudi::Property<bool> HLT::MET::MHTPufitFex::m_jetCalibIncludesAreaSub
private
Initial value:
{
this, "JetCalibIncludesAreaSub", true,
"Whether the calibration applied to the jets includes area subtraction"}

Definition at line 58 of file MHTPufitFex.h.

58 {
59 this, "JetCalibIncludesAreaSub", true,
60 "Whether the calibration applied to the jets includes area subtraction"};

◆ m_jvtCut

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_jvtCut
private
Initial value:
{
this, "JvtCut", 0.59, "The JVT selection in the central region"}

Definition at line 92 of file MHTPufitFex.h.

92 {
93 this, "JvtCut", 0.59, "The JVT selection in the central region"};

◆ m_maxComponentMETSumEtRatio

Gaudi::Property<float> HLT::MET::FexBase::m_maxComponentMETSumEtRatio
privateinherited
Initial value:
{
"MaxComponentMETSumEtRatio", 1.,
"The maximum MET/SumEt ratio per component"}

Definition at line 108 of file FexBase.h.

108 {
109 "MaxComponentMETSumEtRatio", 1.,
110 "The maximum MET/SumEt ratio per component"};

◆ m_maxEta

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_maxEta
private
Initial value:
{
this, "MaxEta", 5, "The maximum eta range"}

The eta range of the grid.

Definition at line 68 of file MHTPufitFex.h.

68 {
69 this, "MaxEta", 5, "The maximum eta range"};

◆ m_maxGlobalMETSumEtRatio

Gaudi::Property<float> HLT::MET::FexBase::m_maxGlobalMETSumEtRatio
privateinherited
Initial value:
{
"MaxGlobalMETSumEtRatio", 1.,
"The maximum MET/SumEt ratio for the total value"}

Definition at line 111 of file FexBase.h.

111 {
112 "MaxGlobalMETSumEtRatio", 1.,
113 "The maximum MET/SumEt ratio for the total value"};

◆ m_maxPt

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_maxPt
private
Initial value:
{
this, "MaxPt", 120*Gaudi::Units::GeV,
"The maximum pT (in the central region), above which the JVT selection is not applied"}

Definition at line 96 of file MHTPufitFex.h.

96 {
97 this, "MaxPt", 120*Gaudi::Units::GeV,
98 "The maximum pT (in the central region), above which the JVT selection is not applied"};

◆ m_metContainerKey

SG::WriteHandleKey<xAOD::TrigMissingETContainer> HLT::MET::FexBase::m_metContainerKey
privateinherited
Initial value:
{
this, "METContainerKey", "HLT_MET", "Name of the output MET object"}

The output MET object.

Definition at line 103 of file FexBase.h.

103 {
104 this, "METContainerKey", "HLT_MET", "Name of the output MET object"};

◆ m_minPt

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_minPt
private
Initial value:
{
this, "MinPt", 20*Gaudi::Units::GeV, "The minimum pT (in the central region)"}

Definition at line 94 of file MHTPufitFex.h.

94 {
95 this, "MinPt", 20*Gaudi::Units::GeV, "The minimum pT (in the central region)"};

◆ m_monTool

ToolHandle<GenericMonitoringTool> HLT::MET::FexBase::m_monTool
privateinherited
Initial value:
{
this, "MonTool", "", "Monitoring tool"}

The monitoring tool.

Definition at line 106 of file FexBase.h.

106 {
107 this, "MonTool", "", "Monitoring tool"};

◆ m_nEtaBins

Gaudi::Property<std::size_t> HLT::MET::MHTPufitFex::m_nEtaBins
private
Initial value:
{
this, "NEtaBins", 14, "The number of eta bins"}

The number of bins in eta.

Definition at line 71 of file MHTPufitFex.h.

71 {
72 this, "NEtaBins", 14, "The number of eta bins"};

◆ m_nPhiBins

Gaudi::Property<std::size_t> HLT::MET::MHTPufitFex::m_nPhiBins
private
Initial value:
{
this, "NPhiBins", 8, "The number of phi bins"}

Definition at line 73 of file MHTPufitFex.h.

73 {
74 this, "NPhiBins", 8, "The number of phi bins"};

◆ m_nSigma

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_nSigma
private
Initial value:
{
this, "NSigma", 5, "Set the threshold at mean + NSigma*variance"}

The sigma threshold.

Definition at line 65 of file MHTPufitFex.h.

65 {
66 this, "NSigma", 5, "Set the threshold at mean + NSigma*variance"};

◆ m_rhoKey

SG::ReadHandleKey<xAOD::EventShape> HLT::MET::MHTPufitFex::m_rhoKey
private
Initial value:
{
this, "JetEventShapeName", "",
"The name of the event shape container for the area correction"}

Definition at line 61 of file MHTPufitFex.h.

61 {
62 this, "JetEventShapeName", "",
63 "The name of the event shape container for the area correction"};

◆ m_trimFraction

Gaudi::Property<float> HLT::MET::MHTPufitFex::m_trimFraction
private
Initial value:
{
this, "TrimFraction", 0.9,
"The fraction of bins to use when calculating the mean and variance"}

The trimming fraction.

Definition at line 76 of file MHTPufitFex.h.

76 {
77 this, "TrimFraction", 0.9,
78 "The fraction of bins to use when calculating the mean and variance"};

◆ m_useDetectorEta

Gaudi::Property<bool> HLT::MET::MHTPufitFex::m_useDetectorEta
private
Initial value:
{
this, "UseDetectorEta", true, "Whether to use the 'DectectorEta' value to select central/forward jets"}

Definition at line 103 of file MHTPufitFex.h.

103 {
104 this, "UseDetectorEta", true, "Whether to use the 'DectectorEta' value to select central/forward jets"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: