54 {
55
56 SG::WriteHandle<xAOD::VertexContainer> pairContainer{
m_pairName, ctx};
57 ATH_CHECK(pairContainer.
record(std::make_unique<xAOD::VertexContainer>(), std::make_unique<xAOD::VertexAuxContainer>()));
58 SG::WriteHandle<xAOD::VertexContainer> quadContainer{
m_quadName, ctx};
59 ATH_CHECK(quadContainer.
record(std::make_unique<xAOD::VertexContainer>(), std::make_unique<xAOD::VertexAuxContainer>()));
60 bool acceptEvent = false;
61
62
63
64 if( !
m_fourMuonTool->performSearch(pairContainer.
ptr(), quadContainer.
ptr(), acceptEvent, ctx).isSuccess() ) {
66 return StatusCode::FAILURE;
67 }
68
69
70
71
74
75
76
77 SG::WriteHandle<xAOD::VertexContainer> refPvContainer;
79
81 ATH_CHECK(refPvContainer.
record(std::make_unique<xAOD::VertexContainer>(), std::make_unique<xAOD::VertexAuxContainer>()));
82 }
83
85
87 if (quadContainer->size() >0) {
89 ATH_MSG_FATAL(
"refitting failed - check the vertices you passed");
90 return StatusCode::FAILURE;
91 }
92 }
93 if (pairContainer->size()>0) {
95 ATH_MSG_FATAL(
"refitting failed - check the vertices you passed");
96 return StatusCode::FAILURE;
97 }
98 }
99 } else {
100 if (quadContainer->size() >0) {
103 }
104 if (pairContainer->size() >0) {
107 }
108 }
109
110
111
112
113
116
121
122
125
126 xAOD::BPhysHypoHelper pairHelper("PAIR", pairVtx);
127
128
129
130
131
132 if( !pairHelper.setMass(muonPairMasses) )
ATH_MSG_WARNING(
"Decoration pair.setMass failed");
133
134 double massErr =
m_v0Tools->invariantMassError(pairHelper.vtx(), muonPairMasses);
135 if( !pairHelper.setMassErr(massErr) )
ATH_MSG_WARNING(
"Decoration pair.setMassErr failed");
136
137
138
143 static const SG::ConstAccessor<std::string> CombinationCodeAcc("CombinationCode");
144 ATH_MSG_DEBUG(CombinationCodeAcc(*pairVtx) <<
" : " << pairHelper.mass() <<
" +/- " << pairHelper.massErr());
145 }
146
147
150
151 xAOD::BPhysHypoHelper quadHelper("QUAD", quadVtx);
152
153
154
155
156
157 if( !quadHelper.setMass(muonQuadMasses) )
ATH_MSG_WARNING(
"Decoration quad.setMass failed");
158
159 double massErr =
m_v0Tools->invariantMassError(quadHelper.vtx(), muonQuadMasses);
160 if( !quadHelper.setMassErr(massErr) )
ATH_MSG_WARNING(
"Decoration quad.setMassErr failed");
161
162
163
168 static const SG::ConstAccessor<std::string> CombinationCodeAcc("CombinationCode");
169 ATH_MSG_DEBUG(CombinationCodeAcc(*quadVtx) <<
" : " << quadHelper.mass() <<
" +/- " << quadHelper.massErr());
170 }
171
172 return StatusCode::SUCCESS;
173 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
ToolHandle< DerivationFramework::FourMuonTool > m_fourMuonTool
Gaudi::Property< bool > m_refitPV
ToolHandle< Analysis::PrimaryVertexRefitter > m_pvRefitter
SG::WriteHandleKey< xAOD::VertexContainer > m_pairName
job options
PublicToolHandle< Trk::V0Tools > m_v0Tools
SG::ReadHandleKey< xAOD::VertexContainer > m_pvContainerName
Gaudi::Property< int > m_PV_max
SG::WriteHandleKey< xAOD::VertexContainer > m_refPVContainerName
Gaudi::Property< int > m_DoVertexType
void ProcessVertex(xAOD::BPhysHypoHelper &, xAOD::BPhysHelper::pv_type, std::vector< double > trackMasses) const
tools
SG::WriteHandleKey< xAOD::VertexContainer > m_quadName
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
constexpr double muonMassInMeV
the mass of the muon (in MeV)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Vertex_v1 Vertex
Define the latest version of the vertex class.