Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
DerivationFramework::Reco_V0Finder Class Reference

#include <Reco_V0Finder.h>

Inheritance diagram for DerivationFramework::Reco_V0Finder:
Collaboration diagram for DerivationFramework::Reco_V0Finder:

Public Member Functions

 Reco_V0Finder (const std::string &t, const std::string &n, const IInterface *p)
 
StatusCode initialize () override
 
virtual StatusCode addBranches () const override
 

Private Attributes

std::vector< std::string > m_CollectionsToCheck
 
ToolHandle< InDet::InDetV0FinderToolm_v0FinderTool
 
SG::ReadHandleKey< xAOD::VertexContainerm_vertexKey
 
SG::WriteHandleKey< xAOD::VertexContainerm_v0Key { this, "V0ContainerName", "V0Candidates", "V0 container" }
 
SG::WriteHandleKey< xAOD::VertexContainerm_ksKey { this, "KshortContainerName", "KshortCandidates", "Ks container" }
 
SG::WriteHandleKey< xAOD::VertexContainerm_laKey
 
SG::WriteHandleKey< xAOD::VertexContainerm_lbKey
 
ToolHandle< InDet::V0MainDecoratorm_v0DecoTool {this, "Decorator", "InDet::V0MainDecorator"}
 

Detailed Description

Definition at line 22 of file Reco_V0Finder.h.

Constructor & Destructor Documentation

◆ Reco_V0Finder()

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

Definition at line 14 of file Reco_V0Finder.cxx.

16  :
17  base_class(t,n,p),
18  m_v0FinderTool("InDet::V0FinderTool", this)
19  {
20 
21  // Declare user-defined properties
22  declareProperty("CheckVertexContainers", m_CollectionsToCheck);
23  declareProperty("V0FinderTool", m_v0FinderTool);
24  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::Reco_V0Finder::addBranches ( ) const
overridevirtual

Definition at line 49 of file Reco_V0Finder.cxx.

50  {
51 
52  bool callV0Finder = false;
53  // Jpsi container and its auxilliary store
54  for(const auto &str : m_CollectionsToCheck){
55  const xAOD::VertexContainer* vertContainer = nullptr;
56  ATH_CHECK( evtStore()->retrieve(vertContainer, str) );
57  if(vertContainer->size() == 0) {
58  ATH_MSG_DEBUG("Container VertexContainer (" << str << ") is empty");
59  }else{
60  callV0Finder = true;
61  ATH_MSG_DEBUG("Container VertexContainer (" << str << ") has events N= " << vertContainer->size());
62  break;//No point checking other containers
63  }
64  }
65 
66  const EventContext& ctx = Gaudi::Hive::currentContext();
67  // InDetV0 container and its auxilliary store
68  //---- Recording section: write the results to StoreGate ---//
70  if ( h_V0.record(std::make_unique<xAOD::VertexContainer>() ,std::make_unique<xAOD::VertexAuxContainer>()).isFailure()){
71  ATH_MSG_ERROR("Storegate record of v0Container failed.");
72  return StatusCode::FAILURE;
73  }
74 
76  if ( h_Ks.record(std::make_unique<xAOD::VertexContainer>() ,std::make_unique<xAOD::VertexAuxContainer>()).isFailure()){
77  ATH_MSG_ERROR("Storegate record of ksContainer failed.");
78  return StatusCode::FAILURE;
79  }
80 
82  if( h_La.record(std::make_unique<xAOD::VertexContainer>() ,std::make_unique<xAOD::VertexAuxContainer>()).isFailure()){
83  ATH_MSG_ERROR("Storegate record of laContainer failed.");
84  return StatusCode::FAILURE;
85 
86  }
88  if(h_Lb.record(std::make_unique<xAOD::VertexContainer>() ,std::make_unique<xAOD::VertexAuxContainer>()).isFailure()){
89  ATH_MSG_ERROR("Storegate record of lbContainer failed.");
90  return StatusCode::FAILURE;
91  }
92 
93  xAOD::VertexContainer* v0Container(h_V0.ptr());
94  xAOD::VertexContainer* ksContainer(h_Ks.ptr());
95  xAOD::VertexContainer* laContainer(h_La.ptr());
96  xAOD::VertexContainer* lbContainer(h_Lb.ptr());
97  // Call V0Finder
98  if (callV0Finder) {
99  const xAOD::Vertex * primaryVertex(0);
100  SG::ReadHandle<xAOD::VertexContainer> importedVxContainer( m_vertexKey, ctx );
101  ATH_CHECK(importedVxContainer.isValid());
102 
103  if (importedVxContainer->size()==0){
104  ATH_MSG_WARNING("You have no primary vertices: " << importedVxContainer->size());
105  } else {
106  primaryVertex = (*importedVxContainer)[0];
107  }
108  ATH_CHECK( m_v0FinderTool->performSearch(h_V0.ptr(),
109  h_Ks.ptr(),
110  h_La.ptr(),
111  h_Lb.ptr(),
112  primaryVertex, importedVxContainer.cptr(), ctx));
113 
114  ATH_MSG_DEBUG("Reco_V0Finder v0Container->size() " << v0Container->size());
115  ATH_MSG_DEBUG("Reco_V0Finder ksContainer->size() " << ksContainer->size());
116  ATH_MSG_DEBUG("Reco_V0Finder laContainer->size() " << laContainer->size());
117  ATH_MSG_DEBUG("Reco_V0Finder lbContainer->size() " << lbContainer->size());
118 
119 
120  ATH_CHECK(m_v0DecoTool->decorateV0(h_V0.ptr(), ctx));
121  ATH_CHECK(m_v0DecoTool->decorateks(h_Ks.ptr() ,ctx));
122  ATH_CHECK(m_v0DecoTool->decoratela(h_La.ptr(), ctx));
123  ATH_CHECK(m_v0DecoTool->decoratelb(h_Lb.ptr(), ctx));
124  }
125 
126  return StatusCode::SUCCESS;
127  }

◆ initialize()

StatusCode DerivationFramework::Reco_V0Finder::initialize ( )
override

Definition at line 28 of file Reco_V0Finder.cxx.

29  {
30 
31  ATH_MSG_DEBUG("in initialize()");
32  // get the V0Finder tool
33  ATH_CHECK( m_v0FinderTool.retrieve());
34  ATH_CHECK( m_v0DecoTool.retrieve());
35 
36  ATH_CHECK(m_vertexKey.initialize());
37  ATH_CHECK(m_v0Key.initialize());
38  ATH_CHECK(m_ksKey.initialize());
39  ATH_CHECK(m_laKey.initialize());
40  ATH_CHECK(m_lbKey.initialize());
41 
42  return StatusCode::SUCCESS;
43 
44  }

Member Data Documentation

◆ m_CollectionsToCheck

std::vector<std::string> DerivationFramework::Reco_V0Finder::m_CollectionsToCheck
private

Definition at line 32 of file Reco_V0Finder.h.

◆ m_ksKey

SG::WriteHandleKey<xAOD::VertexContainer> DerivationFramework::Reco_V0Finder::m_ksKey { this, "KshortContainerName", "KshortCandidates", "Ks container" }
private

Definition at line 39 of file Reco_V0Finder.h.

◆ m_laKey

SG::WriteHandleKey<xAOD::VertexContainer> DerivationFramework::Reco_V0Finder::m_laKey
private
Initial value:
{ this, "LambdaContainerName", "LambdaCandidates",
"Lambda container" }

Definition at line 40 of file Reco_V0Finder.h.

◆ m_lbKey

SG::WriteHandleKey<xAOD::VertexContainer> DerivationFramework::Reco_V0Finder::m_lbKey
private
Initial value:
{ this, "LambdabarContainerName", "LambdabarCandidates",
"Lambdabar container" }

Definition at line 42 of file Reco_V0Finder.h.

◆ m_v0DecoTool

ToolHandle<InDet::V0MainDecorator> DerivationFramework::Reco_V0Finder::m_v0DecoTool {this, "Decorator", "InDet::V0MainDecorator"}
private

Definition at line 45 of file Reco_V0Finder.h.

◆ m_v0FinderTool

ToolHandle<InDet::InDetV0FinderTool> DerivationFramework::Reco_V0Finder::m_v0FinderTool
private

Definition at line 33 of file Reco_V0Finder.h.

◆ m_v0Key

SG::WriteHandleKey<xAOD::VertexContainer> DerivationFramework::Reco_V0Finder::m_v0Key { this, "V0ContainerName", "V0Candidates", "V0 container" }
private

Definition at line 38 of file Reco_V0Finder.h.

◆ m_vertexKey

SG::ReadHandleKey<xAOD::VertexContainer> DerivationFramework::Reco_V0Finder::m_vertexKey
private
Initial value:
{ this, "VxPrimaryCandidateName", "PrimaryVertices",
"key for retrieving vertices" }

Definition at line 35 of file Reco_V0Finder.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::Reco_V0Finder::m_v0FinderTool
ToolHandle< InDet::InDetV0FinderTool > m_v0FinderTool
Definition: Reco_V0Finder.h:33
DerivationFramework::Reco_V0Finder::m_lbKey
SG::WriteHandleKey< xAOD::VertexContainer > m_lbKey
Definition: Reco_V0Finder.h:42
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
DerivationFramework::Reco_V0Finder::m_CollectionsToCheck
std::vector< std::string > m_CollectionsToCheck
Definition: Reco_V0Finder.h:32
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
DerivationFramework::Reco_V0Finder::m_v0DecoTool
ToolHandle< InDet::V0MainDecorator > m_v0DecoTool
Definition: Reco_V0Finder.h:45
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DerivationFramework::Reco_V0Finder::m_ksKey
SG::WriteHandleKey< xAOD::VertexContainer > m_ksKey
Definition: Reco_V0Finder.h:39
str
Definition: BTagTrackIpAccessor.cxx:11
DerivationFramework::Reco_V0Finder::m_vertexKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
Definition: Reco_V0Finder.h:35
DerivationFramework::Reco_V0Finder::m_v0Key
SG::WriteHandleKey< xAOD::VertexContainer > m_v0Key
Definition: Reco_V0Finder.h:38
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DerivationFramework::Reco_V0Finder::m_laKey
SG::WriteHandleKey< xAOD::VertexContainer > m_laKey
Definition: Reco_V0Finder.h:40