ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
DerivationFramework::AnyVertexSkimmingTool Class Reference

#include <AnyVertexSkimmingTool.h>

Inheritance diagram for DerivationFramework::AnyVertexSkimmingTool:
Collaboration diagram for DerivationFramework::AnyVertexSkimmingTool:

Public Member Functions

 AnyVertexSkimmingTool (const std::string &, const std::string &, const IInterface *)
 
StatusCode initialize () override
 
virtual bool eventPassesFilter () const override
 
 ~AnyVertexSkimmingTool ()
 

Private Attributes

Gaudi::Property< std::vector< std::string > > m_containerNames { this, "VertexContainerNames", {} }
 
SG::ReadHandleKeyArray< xAOD::VertexContainerm_keyArray {this, "ReadHandles", {} }
 
Gaudi::Property< bool > m_useHandles { this, "UseHandles", false }
 

Detailed Description

Definition at line 15 of file AnyVertexSkimmingTool.h.

Constructor & Destructor Documentation

◆ AnyVertexSkimmingTool()

DerivationFramework::AnyVertexSkimmingTool::AnyVertexSkimmingTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 11 of file AnyVertexSkimmingTool.cxx.

11  : base_class(t,n,p)
12 {}

◆ ~AnyVertexSkimmingTool()

DerivationFramework::AnyVertexSkimmingTool::~AnyVertexSkimmingTool ( )
default

Member Function Documentation

◆ eventPassesFilter()

bool DerivationFramework::AnyVertexSkimmingTool::eventPassesFilter ( ) const
overridevirtual

Definition at line 22 of file AnyVertexSkimmingTool.cxx.

22  {
23 
24  if(m_useHandles){
25  bool pass = false;
26  for(auto key : m_keyArray){
27  ATH_MSG_DEBUG("Key Checking: " << key.key());
29  if(!read.isValid()){
30  std::string error("AnyVertexSkimmingTool - Failed to retrieve : ");
31  error += key.key();
32  throw std::runtime_error(error);
33  }
34  if(not read->empty()) pass |= true;
35  }
36  return pass;
37  }else{
38  bool pass = false;
39  for(const std::string& name : m_containerNames){
40  ATH_MSG_DEBUG("Checking: " << name);
41  const xAOD::VertexContainer* container = nullptr;
42  if(evtStore()->retrieve(container, name).isFailure()){
43  std::string error("AnyVertexSkimmingTool - Failed to retrieve : ");
44  error += name;
45  throw std::runtime_error(error);
46  }
47  if(not container->empty()) pass |= true;
48  //Not breaking from loop early to ensure all containers are written - avoids production bugs
49  }
50  return pass;
51  }
52 }

◆ initialize()

StatusCode DerivationFramework::AnyVertexSkimmingTool::initialize ( )
override

Definition at line 16 of file AnyVertexSkimmingTool.cxx.

16  {
17  if(m_useHandles) for(const auto& str : m_containerNames) m_keyArray.emplace_back(str);
18  ATH_CHECK(m_keyArray.initialize(m_useHandles));
19  return StatusCode::SUCCESS;
20 }

Member Data Documentation

◆ m_containerNames

Gaudi::Property<std::vector<std::string> > DerivationFramework::AnyVertexSkimmingTool::m_containerNames { this, "VertexContainerNames", {} }
private

Definition at line 22 of file AnyVertexSkimmingTool.h.

◆ m_keyArray

SG::ReadHandleKeyArray<xAOD::VertexContainer> DerivationFramework::AnyVertexSkimmingTool::m_keyArray {this, "ReadHandles", {} }
private

Definition at line 23 of file AnyVertexSkimmingTool.h.

◆ m_useHandles

Gaudi::Property<bool> DerivationFramework::AnyVertexSkimmingTool::m_useHandles { this, "UseHandles", false }
private

Definition at line 24 of file AnyVertexSkimmingTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
read
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
Definition: openCoraCool.cxx:569
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
DerivationFramework::AnyVertexSkimmingTool::m_useHandles
Gaudi::Property< bool > m_useHandles
Definition: AnyVertexSkimmingTool.h:24
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DerivationFramework::AnyVertexSkimmingTool::m_containerNames
Gaudi::Property< std::vector< std::string > > m_containerNames
Definition: AnyVertexSkimmingTool.h:22
DerivationFramework::AnyVertexSkimmingTool::m_keyArray
SG::ReadHandleKeyArray< xAOD::VertexContainer > m_keyArray
Definition: AnyVertexSkimmingTool.h:23
str
Definition: BTagTrackIpAccessor.cxx:11
get_generator_info.error
error
Definition: get_generator_info.py:40
error
Definition: IImpactPoint3dEstimator.h:70
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37