ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
HLT::MET::TCPufitFex Class Reference

#include <TCPufitFex.h>

Inheritance diagram for HLT::MET::TCPufitFex:
Collaboration diagram for HLT::MET::TCPufitFex:

Public Member Functions

 TCPufitFex (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor. More...
 
virtual StatusCode initialize () override
 Initialize the fex. More...
 
virtual StatusCode execute (const EventContext &context) const override
 Run the algorithm. More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
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. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

StatusCode initializeBase (const std::vector< std::string > &componentNames)
 Initialize the base class. More...
 
virtual StatusCode monitor (const xAOD::TrigMissingET &met, MonGroupBuilder &monitors) const
 Add monitor variables from an xAOD::TrigMissingET object. More...
 
virtual StatusCode flagMET (xAOD::TrigMissingET &met) const
 Flag suspicious values in the output MET. More...
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Protected Attributes

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

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. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

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

Detailed Description

Definition at line 40 of file TCPufitFex.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

◆ TCPufitFex()

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

Constructor.

Definition at line 34 of file TCPufitFex.cxx.

36  {

Member Function Documentation

◆ cardinality()

unsigned int AthReentrantAlgorithm::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.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ 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.

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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
79  met->defineComponents(m_componentNames);
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  }

◆ 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 & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ fillMET()

StatusCode HLT::MET::TCPufitFex::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 44 of file TCPufitFex.cxx.

49  : *clusters)
51  iclus->e(), iclus->eta(), iclus->phi());
52 
53  // We calculate the mean and variance from the 'nominal' grid
54  double mean;
55  double variance;
57  gridset[NoDisplacement], m_trimFraction, mean, variance);
58  // Calculate the threshold
59  float threshold = mean + m_nSigma * sqrt(variance);
60 
61  // Apply the masks
62  for (PufitGrid &grid : gridset.grids)
63  for (PufitGrid::Tower &tower : grid)
64  tower.mask(tower.sumEt() > threshold);
65 
66  // Select the right grid
68  const PufitGrid &grid = gridset[idx];
69 
70  // Build the pileup sum and prepare the vector of corrections
71  PufitUtils::CovarianceSum pileupSum;
72  std::vector<SignedKinematics> masked;
73  for (const PufitGrid::Tower &tower : grid)
74  {
75  if (!tower.masked())
76  {
77  float sigma =
79  tower.kinematics().absPt() * m_caloStoch * m_caloStoch;
80  pileupSum.add(tower, sigma);
81  }
82  else
83  masked.push_back(tower);
84  }
85 
86  // Save the sum over all towers to the corresponding component
87  grid.sum(PufitGrid::SumStrategy::All).fillMETComponent(0, met);
88  // Get the sum over the selected towers
89  METComponent sum = grid.sum(PufitGrid::SumStrategy::Masked);
90  // Save this uncorrected sum to the corresponding component
91  sum.fillMETComponent(1, met);
92 
93  // If variance is 0 then there are no towers in the trimmed mean calculation with energy > 0
94  // This will cause the fit to fail!
95  if (variance != 0)
96  {
97  // Perform the fit
98  std::vector<SignedKinematics> corrections = PufitUtils::pufit(
99  pileupSum.sum,
100  pileupSum.covariance,
101  mean,
102  variance,
103  masked,
105 
106  // Apply the corrections
107  for (const SignedKinematics &kin : corrections)
108  sum += kin;
109  }
110  sum.fillMET(met);
111  return StatusCode::SUCCESS;
112  }
113  } // namespace MET
114 } // namespace HLT

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ 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  }

◆ initialize()

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

Initialize the fex.

Definition at line 38 of file TCPufitFex.cxx.

40  {
41  ATH_MSG_ERROR("Failed to retrieve " << m_clusterKey);
42  return StatusCode::FAILURE;

◆ 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()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ 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() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::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 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::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 InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
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 143 of file FexBase.h.

◆ m_caloNoise

Gaudi::Property<float> HLT::MET::TCPufitFex::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 86 of file TCPufitFex.h.

◆ m_caloStoch

Gaudi::Property<float> HLT::MET::TCPufitFex::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 90 of file TCPufitFex.h.

◆ m_clusterKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> HLT::MET::TCPufitFex::m_clusterKey
private
Initial value:
{
this, "ClusterName", "clusters", "Input cluster collection"}

Input clusters.

Definition at line 67 of file TCPufitFex.h.

◆ m_componentNames

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

The names of the output MET components.

Definition at line 72 of file FexBase.h.

◆ m_constraintImportance

Gaudi::Property<float> HLT::MET::TCPufitFex::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 94 of file TCPufitFex.h.

◆ 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 AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ 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 132 of file FexBase.h.

◆ m_maxEta

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

The eta range of the grid.

Definition at line 73 of file TCPufitFex.h.

◆ 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 135 of file FexBase.h.

◆ 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 127 of file FexBase.h.

◆ m_monTool

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

The monitoring tool.

Definition at line 130 of file FexBase.h.

◆ m_nEtaBins

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

The number of bins in eta.

Definition at line 76 of file TCPufitFex.h.

◆ m_nPhiBins

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

The number of bins in phi.

Definition at line 79 of file TCPufitFex.h.

◆ m_nSigma

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

The sigma threshold.

Definition at line 70 of file TCPufitFex.h.

◆ m_trimFraction

Gaudi::Property<float> HLT::MET::TCPufitFex::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 82 of file TCPufitFex.h.

◆ 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:
HLT::MET::PufitUtils::pufit
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.
Definition: PufitUtils.cxx:114
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
HLT::MET::TCPufitFex::m_clusterKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterKey
Input clusters.
Definition: TCPufitFex.h:67
mean
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition: dependence.cxx:254
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
HLT::MET::TCPufitFex::m_caloNoise
Gaudi::Property< float > m_caloNoise
The coefficient of the noise term in the calo resolution estimate.
Definition: TCPufitFex.h:86
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
HLT::MET::PufitGrid::SumStrategy::All
@ All
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
HLT::MET::FexBase::m_componentNames
std::vector< std::string > m_componentNames
The names of the output MET components.
Definition: FexBase.h:72
HLT::MET::FexBase::m_maxComponentMETSumEtRatio
Gaudi::Property< float > m_maxComponentMETSumEtRatio
Definition: FexBase.h:132
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HLT::MET::FexBase::fillMET
virtual StatusCode fillMET(xAOD::TrigMissingET &met, const EventContext &context, MonGroupBuilder &monitors) const =0
Calculate and fill the output MET value.
HLT::MET::StatusFlag::GlobalBigMEtSEtRatio
@ GlobalBigMEtSEtRatio
Definition: StatusFlags.h:61
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
HLT::MET::NoDisplacement
@ NoDisplacement
The grid is not shifted.
Definition: PeriodicGridBase.h:25
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
HLT::MET::GridDisplacement
GridDisplacement
Enum to describe the positioning of the grid.
Definition: PeriodicGridBase.h:23
HLT::MET::FexBase::m_baseInitialised
bool m_baseInitialised
Whether or not this class has been correctly initialised.
Definition: FexBase.h:143
HLT::MET::FexBase::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
The monitoring tool.
Definition: FexBase.h:130
HLT::MET::FexBase::monitor
virtual StatusCode monitor(const xAOD::TrigMissingET &met, MonGroupBuilder &monitors) const
Add monitor variables from an xAOD::TrigMissingET object.
Definition: FexBase.cxx:141
met
Definition: IMETSignificance.h:24
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
HLT::MET::FexBase::m_metContainerKey
SG::WriteHandleKey< xAOD::TrigMissingETContainer > m_metContainerKey
The output MET object.
Definition: FexBase.h:127
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
HLT::MET::FexBase::m_maxGlobalMETSumEtRatio
Gaudi::Property< float > m_maxGlobalMETSumEtRatio
Definition: FexBase.h:135
HLT::MET::PufitGrid::SumStrategy::Masked
@ Masked
HLT::MET::PufitUtils::selectGrid
GridDisplacement selectGrid(const PufitGridSet &grids)
Select the grid with the highest masked sumEt.
Definition: PufitUtils.cxx:95
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
HLT::MET::FexBase::flagMET
virtual StatusCode flagMET(xAOD::TrigMissingET &met) const
Flag suspicious values in the output MET.
Definition: FexBase.cxx:118
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
HLT::MET::TCPufitFex::m_trimFraction
Gaudi::Property< float > m_trimFraction
The trimming fraction.
Definition: TCPufitFex.h:82
HLT::MET::SignedKinematics::fromEnergyEtaPhi
static SignedKinematics fromEnergyEtaPhi(double energy, double eta, double phi)
Factory function to construct from energy, eta, phi (massless)
Definition: SignedKinematics.cxx:26
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
HLT::MET::PufitUtils::trimmedMeanAndVariance
void trimmedMeanAndVariance(const std::vector< double > &sorted, double trimFraction, double &mean, double &variance)
Calculate the trimmed mean and variance for a vector of tower sumEts.
Definition: PufitUtils.cxx:35
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
HLT::MET::TCPufitFex::m_constraintImportance
Gaudi::Property< float > m_constraintImportance
The relative constraint importance.
Definition: TCPufitFex.h:94
threshold
Definition: chainparser.cxx:74
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
HLT::MET::StatusFlag::ComponentBigMEtSEtRatio
@ ComponentBigMEtSEtRatio
Definition: StatusFlags.h:47
HLT::MET::TCPufitFex::m_caloStoch
Gaudi::Property< float > m_caloStoch
The coefficient of the stochastic term in the calo resolution estimate.
Definition: TCPufitFex.h:90
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::TrigMissingET_v1
Class holding the Missing ET trigger fex results.
Definition: TrigMissingET_v1.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
HLT::MET::TCPufitFex::m_nSigma
Gaudi::Property< float > m_nSigma
The sigma threshold.
Definition: TCPufitFex.h:70
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
xAOD::JetInput::Tower
@ Tower
Definition: JetContainerInfo.h:58
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >