10 #include "GaudiKernel/IPartPropSvc.h"
22 m_v0Tools(
"Trk::V0Tools"),
23 m_vertexFitter(
"Trk::TrkVKalVrtFitter"),
24 m_vertexEstimator(
"InDet::VertexPointEstimator"),
25 m_inputTrackParticleContainerName(
"InDetTrackParticles"),
26 m_inputLowPtTrackContainerName(
"LowPtRoITrackParticles"),
27 m_conversionContainerName(
"BPhysConversionCandidates"),
28 m_maxDistBetweenTracks(10.0),
29 m_maxDeltaCotTheta(0.3),
30 m_requireDeltaQ(true),
34 m_maxGammaMass(100.0) {
36 declareInterface<DerivationFramework::IAugmentationTool>(
this);
64 return StatusCode::SUCCESS;
69 return StatusCode::SUCCESS;
75 std::vector<const xAOD::Vertex*> BVertices;
77 std::vector<const xAOD::TrackParticle*> BVertexTracks;
83 conversionContainer->setStore(conversionAuxContainer.get());
95 return StatusCode::SUCCESS;;
98 ATH_MSG_DEBUG(
"Low pT track particle container size " << lowPtTrackParticles->
size());
105 return StatusCode::FAILURE;
109 ATH_MSG_DEBUG(
"Using " << *itr <<
" as the source B vertex collection" );
118 ATH_MSG_DEBUG(
"Vertex Container (" << *itr <<
") contains " << BVtxContainer->
size() <<
" vertices" );
121 static const std::vector< VertexLink > vertexLinks;
124 BGammaLinks(*
vertex) = vertexLinks;
126 bool passedHypothesis =
false;
127 BVertexTracks.clear();
132 if (pass) passedHypothesis =
true;
135 if (!passedHypothesis)
continue;
139 std::vector<const xAOD::Vertex*> precedingVertices(1,
vertex);
142 for (
size_t i = 0;
i <
vertex->nTrackParticles(); ++
i) BVertexTracks.push_back(
vertex->trackParticle(
i));
149 auto itr1 =
std::find(BVertexTracks.begin(), BVertexTracks.end(), trackParticle1);
150 if (itr1 != BVertexTracks.end())
continue;
157 if (trackParticle1 == trackParticle2)
continue;
159 auto itr2 =
std::find(BVertexTracks.begin(), BVertexTracks.end(), trackParticle2);
160 if (itr2 != BVertexTracks.end())
continue;
165 TLorentzVector
e1,
e2, gamma_m, BcStar;
176 BcStar = mu1 + mu2 + mu3 +
e1 +
e2;
186 std::vector<float> RefTrackPx, RefTrackPy, RefTrackPz, RefTrackE;
187 std::vector<float> OrigTrackPx, OrigTrackPy, OrigTrackPz, OrigTrackE;
189 std::vector<const xAOD::TrackParticle*> trackPair;
191 trackPair.push_back(trackParticle1);
192 trackPair.push_back(trackParticle2);
198 if (convVertexCandidate) {
203 Photon.setPrecedingVertices(precedingVertices, BVtxContainer);
216 std::vector<Amg::Vector3D> positionList;
221 TLorentzVector
photon, electron1, electron2, ph;
224 photon = electron1 + electron2;
231 std::vector<float> B_Px = RefTrackPxAcc(*
vertex);
232 std::vector<float> B_Py = RefTrackPyAcc(*
vertex);
233 std::vector<float> B_Pz = RefTrackPzAcc(*
vertex);
235 TLorentzVector muon1, muon2, muon3;
236 muon1.SetXYZM(B_Px.at(0), B_Py.at(0), B_Pz.at(0),
Trk::muon);
237 muon2.SetXYZM(B_Px.at(1), B_Py.at(1), B_Pz.at(1),
Trk::muon);
238 muon3.SetXYZM(B_Px.at(2), B_Py.at(2), B_Pz.at(2),
Trk::muon);
240 TLorentzVector B_m = muon1 + muon2 + muon3;
245 RefTrackPx.push_back(
trackMomentum(convVertexCandidate, 0).Px());
246 RefTrackPx.push_back(
trackMomentum(convVertexCandidate, 1).Px());
248 RefTrackPy.push_back(
trackMomentum(convVertexCandidate, 0).Py());
249 RefTrackPy.push_back(
trackMomentum(convVertexCandidate, 1).Py());
251 RefTrackPz.push_back(
trackMomentum(convVertexCandidate, 0).Pz());
252 RefTrackPz.push_back(
trackMomentum(convVertexCandidate, 1).Pz());
254 for (
size_t i = 0;
i < B_Px.size();
i++) {
255 RefTrackPx.push_back(B_Px.at(
i));
256 RefTrackPy.push_back(B_Py.at(
i));
257 RefTrackPz.push_back(B_Pz.at(
i));
260 RefTrackE.push_back(electron1.E());
261 RefTrackE.push_back(electron2.E());
262 RefTrackE.push_back(muon1.E());
263 RefTrackE.push_back(muon2.E());
264 RefTrackE.push_back(muon3.E());
266 OrigTrackPx.push_back(
e1.Px());
267 OrigTrackPx.push_back(
e2.Px());
269 OrigTrackPy.push_back(
e1.Py());
270 OrigTrackPy.push_back(
e2.Py());
272 OrigTrackPz.push_back(
e1.Pz());
273 OrigTrackPz.push_back(
e2.Pz());
275 OrigTrackE.push_back(
e1.E());
276 OrigTrackE.push_back(
e2.E());
279 ATH_MSG_DEBUG(
"pt = " <<
photon.Pt() <<
" ph " << ph.Pt() <<
" mass " <<
photon.M() <<
" px size " << RefTrackPx.size() );
280 ATH_MSG_DEBUG(
"Candidate DeltaM = " << (B_m +
photon).M() <<
" MeV DiMuon " <<
" ( Mass = " << B_m.M() <<
" MeV )");
288 pxAcc(*convVertexCandidate) =
momentum.x();
289 pyAcc(*convVertexCandidate) =
momentum.y();
290 pzAcc(*convVertexCandidate) =
momentum.z();
295 deltaQAcc(*convVertexCandidate) = deltaQ;
296 gamma_massAcc(*convVertexCandidate) =
mass;
297 RefTrackPxAcc(*convVertexCandidate) = RefTrackPx;
298 RefTrackPyAcc(*convVertexCandidate) = RefTrackPy;
299 RefTrackPzAcc(*convVertexCandidate) = RefTrackPz;
300 RefTrackEAcc(*convVertexCandidate) = RefTrackE;
306 OrigTrackPxAcc(*convVertexCandidate) = OrigTrackPx;
307 OrigTrackPyAcc(*convVertexCandidate) = OrigTrackPy;
308 OrigTrackPzAcc(*convVertexCandidate) = OrigTrackPz;
309 OrigTrackEAcc(*convVertexCandidate) = OrigTrackE;
312 passed_GammaAcc(*convVertexCandidate) =
true;
314 conversionContainer->
push_back( convVertexCandidate );
320 BGammaLinks(*vertex).push_back(std::move(BGammaLink));
337 return StatusCode::SUCCESS;
354 return TVector3(
px,
py,
pz);