ATLAS Offline Software
JpsiPlusDsCascade.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
5 // JpsiPlusDsCascade.cxx, (c) ATLAS Detector software
11 #include "GaudiKernel/IPartPropSvc.h"
16 #include <algorithm>
18 #include "HepPDT/ParticleDataTable.hh"
19 
22 
23 namespace DerivationFramework {
25  typedef std::vector<VertexLink> VertexLinkVector;
26  typedef std::vector<const xAOD::TrackParticle*> TrackBag;
27 
29 
30  // retrieving vertex Fitter
31  ATH_CHECK( m_iVertexFitter.retrieve());
32 
33  // retrieving the V0 tools
34  ATH_CHECK( m_V0Tools.retrieve());
35 
36  // retrieving the Cascade tools
37  ATH_CHECK( m_CascadeTools.retrieve());
38 
39  // Get the beam spot service
41 
42  IPartPropSvc* partPropSvc = nullptr;
43  ATH_CHECK( service("PartPropSvc", partPropSvc, true) );
44  auto pdt = partPropSvc->PDT();
45 
46  // retrieve particle masses
48  if(m_vtx0MassHypo < 0.)
50  if(m_vtx1MassHypo < 0.) {
51  if(abs(m_Dx_pid) == 411) m_vtx1MassHypo = BPhysPVCascadeTools::getParticleMass(pdt, MC::DPLUS);
53  }
54 
57  if(m_vtx1Daug1MassHypo < 0.) {
58  if(abs(m_Dx_pid) == 411) m_vtx1Daug1MassHypo = BPhysPVCascadeTools::getParticleMass(pdt, MC::PIPLUS);
60  }
63 
64  return StatusCode::SUCCESS;
65  }
66 
67 
69  {
70  std::vector<Trk::VxCascadeInfo*> cascadeinfoContainer;
71  constexpr int topoN = 2;
72  std::array<xAOD::VertexContainer*, topoN> Vtxwritehandles;
73  std::array<xAOD::VertexAuxContainer*, topoN> Vtxwritehandlesaux;
74  if(m_cascadeOutputsKeys.size() !=topoN) { ATH_MSG_FATAL("Incorrect number of VtxContainers"); return StatusCode::FAILURE; }
75 
76  for(int i =0; i<topoN;i++){
77  Vtxwritehandles[i] = new xAOD::VertexContainer();
78  Vtxwritehandlesaux[i] = new xAOD::VertexAuxContainer();
79  Vtxwritehandles[i]->setStore(Vtxwritehandlesaux[i]);
80  ATH_CHECK(evtStore()->record(Vtxwritehandles[i] , m_cascadeOutputsKeys[i] ));
81  ATH_CHECK(evtStore()->record(Vtxwritehandlesaux[i], m_cascadeOutputsKeys[i] + "Aux."));
82  }
83 
84  //----------------------------------------------------
85  // retrieve primary vertices
86  //----------------------------------------------------
87  const xAOD::Vertex * primaryVertex(nullptr);
88  const xAOD::VertexContainer *pvContainer(nullptr);
90  ATH_MSG_DEBUG("Found " << m_VxPrimaryCandidateName << " in StoreGate!");
91 
92  if (pvContainer->size()==0){
93  ATH_MSG_WARNING("You have no primary vertices: " << pvContainer->size());
94  return StatusCode::RECOVERABLE;
95  } else {
96  primaryVertex = (*pvContainer)[0];
97  }
98 
99  //----------------------------------------------------
100  // Try to retrieve refitted primary vertices
101  //----------------------------------------------------
102  xAOD::VertexContainer* refPvContainer = nullptr;
103  xAOD::VertexAuxContainer* refPvAuxContainer = nullptr;
104  if (m_refitPV) {
105  if (evtStore()->contains<xAOD::VertexContainer>(m_refPVContainerName)) {
106  // refitted PV container exists. Get it from the store gate
107  ATH_CHECK(evtStore()->retrieve(refPvContainer , m_refPVContainerName ));
108  ATH_CHECK(evtStore()->retrieve(refPvAuxContainer, m_refPVContainerName + "Aux."));
109  } else {
110  // refitted PV container does not exist. Create a new one.
111  refPvContainer = new xAOD::VertexContainer;
112  refPvAuxContainer = new xAOD::VertexAuxContainer;
113  refPvContainer->setStore(refPvAuxContainer);
114  ATH_CHECK(evtStore()->record(refPvContainer , m_refPVContainerName));
115  ATH_CHECK(evtStore()->record(refPvAuxContainer, m_refPVContainerName+"Aux."));
116  }
117  }
118 
119  ATH_CHECK(performSearch(&cascadeinfoContainer));
120 
122  if(not evt.isValid()) ATH_MSG_ERROR("Cannot Retrieve " << m_eventInfo_key.key() );
124  helper.SetMinNTracksInPV(m_PV_minNTracks);
125 
126  // Decorators for the main vertex: chi2, ndf, pt and pt error, plus the V0 vertex variables
127  SG::AuxElement::Decorator<VertexLinkVector> CascadeLinksDecor("CascadeVertexLinks");
128  SG::AuxElement::Decorator<VertexLinkVector> JpsiLinksDecor("JpsiVertexLinks");
129  SG::AuxElement::Decorator<VertexLinkVector> DxLinksDecor("DxVertexLinks");
130  SG::AuxElement::Decorator<float> chi2_decor("ChiSquared");
131  SG::AuxElement::Decorator<float> ndof_decor("NumberDoF");
132  SG::AuxElement::Decorator<float> Pt_decor("Pt");
133  SG::AuxElement::Decorator<float> PtErr_decor("PtErr");
134  SG::AuxElement::Decorator<float> Mass_svdecor("Dx_mass");
135  SG::AuxElement::Decorator<float> MassErr_svdecor("Dx_massErr");
136  SG::AuxElement::Decorator<float> Pt_svdecor("Dx_Pt");
137  SG::AuxElement::Decorator<float> PtErr_svdecor("Dx_PtErr");
138  SG::AuxElement::Decorator<float> Lxy_svdecor("Dx_Lxy");
139  SG::AuxElement::Decorator<float> LxyErr_svdecor("Dx_LxyErr");
140  SG::AuxElement::Decorator<float> Tau_svdecor("Dx_Tau");
141  SG::AuxElement::Decorator<float> TauErr_svdecor("Dx_TauErr");
142 
143  SG::AuxElement::Decorator<float> MassMumu_decor("Mumu_mass");
144  SG::AuxElement::Decorator<float> MassKX_svdecor("KX_mass");
145  SG::AuxElement::Decorator<float> MassKXpi_svdecor("KXpi_mass");
146 
147  ATH_MSG_DEBUG("cascadeinfoContainer size " << cascadeinfoContainer.size());
148 
149  // Get Jpsi container and identify the input Jpsi
150  const xAOD::VertexContainer *jpsiContainer(nullptr);
151  ATH_CHECK(evtStore()->retrieve(jpsiContainer , m_vertexContainerKey ));
152  const xAOD::VertexContainer *dxContainer(nullptr);
154 
155  for (Trk::VxCascadeInfo* x : cascadeinfoContainer) {
156  if(x==nullptr) {
157  ATH_MSG_ERROR("cascadeinfoContainer is null");
158  //x is dereferenced if we pass this
159  return StatusCode::FAILURE;
160  }
161 
162  // the cascade fitter returns:
163  // std::vector<xAOD::Vertex*>, each xAOD::Vertex contains the refitted track parameters (perigee at the vertex position)
164  // vertices[iv] the links to the original TPs and a covariance of size 3+5*NTRK; the chi2 of the total fit
165  // is split between the cascade vertices as per track contribution
166  // std::vector< std::vector<TLorentzVector> >, each std::vector<TLorentzVector> contains the refitted momenta (TLorentzVector)
167  // momenta[iv][...] of all tracks in the corresponding vertex, including any pseudotracks (from cascade vertices)
168  // originating in this vertex; the masses are as assigned in the cascade fit
169  // std::vector<Amg::MatrixX>, the corresponding covariance matrices in momentum space
170  // covariance[iv]
171  // int nDoF, double Chi2
172  //
173  // the invariant mass, pt, lifetime etc. errors should be calculated using the covariance matrices in momentum space as these
174  // take into account the full track-track and track-vertex correlations
175  //
176  // in the case of Jpsi+V0: vertices[0] is the V0 vertex, vertices[1] is the B/Lambda_b(bar) vertex, containing the 2 Jpsi tracks.
177  // The covariance terms between the two vertices are not stored. In momentum space momenta[0] contains the 2 V0 tracks,
178  // their momenta add up to the momentum of the 3rd track in momenta[1], the first two being the Jpsi tracks
179 
180  const std::vector<xAOD::Vertex*> &cascadeVertices = x->vertices();
181  if(cascadeVertices.size()!=topoN)
182  ATH_MSG_ERROR("Incorrect number of vertices");
183  if(cascadeVertices[0] == nullptr || cascadeVertices[1] == nullptr) ATH_MSG_ERROR("Error null vertex");
184  // Keep vertices (bear in mind that they come in reverse order!)
185  for(int i =0;i<topoN;i++) Vtxwritehandles[i]->push_back(cascadeVertices[i]);
186 
187  x->setSVOwnership(false); // Prevent Container from deleting vertices
188  const auto mainVertex = cascadeVertices[1]; // this is the B_c+/- vertex
189  const std::vector< std::vector<TLorentzVector> > &moms = x->getParticleMoms();
190 
191  // Set links to cascade vertices
192  std::vector<const xAOD::Vertex*> verticestoLink;
193  verticestoLink.push_back(cascadeVertices[0]);
194  if(Vtxwritehandles[1] == nullptr) ATH_MSG_ERROR("Vtxwritehandles[1] is null");
195  if(!BPhysPVCascadeTools::LinkVertices(CascadeLinksDecor, verticestoLink, Vtxwritehandles[0], cascadeVertices[1]))
196  ATH_MSG_ERROR("Error decorating with cascade vertices");
197 
198  // Identify the input Jpsi
199  const xAOD::Vertex* jpsiVertex = BPhysPVCascadeTools::FindVertex<2>(jpsiContainer, cascadeVertices[1]);
200  ATH_MSG_DEBUG("1 pt Jpsi tracks " << cascadeVertices[1]->trackParticle(0)->pt() << ", " << cascadeVertices[1]->trackParticle(1)->pt());
201  if (jpsiVertex) ATH_MSG_DEBUG("2 pt Jpsi tracks " << jpsiVertex->trackParticle(0)->pt() << ", " << jpsiVertex->trackParticle(1)->pt());
202 
203  // Identify the input D_(s)+
204  const xAOD::Vertex* dxVertex = BPhysPVCascadeTools::FindVertex<3>(dxContainer, cascadeVertices[0]);;
205  ATH_MSG_DEBUG("1 pt D_(s)+ tracks " << cascadeVertices[0]->trackParticle(0)->pt() << ", " << cascadeVertices[0]->trackParticle(1)->pt() << ", " << cascadeVertices[0]->trackParticle(2)->pt());
206  if (dxVertex) ATH_MSG_DEBUG("2 pt D_(s)+ tracks " << dxVertex->trackParticle(0)->pt() << ", " << dxVertex->trackParticle(1)->pt() << ", " << dxVertex->trackParticle(2)->pt());
207 
208  // Set links to input vertices
209  std::vector<const xAOD::Vertex*> jpsiVerticestoLink;
210  if (jpsiVertex) jpsiVerticestoLink.push_back(jpsiVertex);
211  else ATH_MSG_WARNING("Could not find linking Jpsi");
212  if(!BPhysPVCascadeTools::LinkVertices(JpsiLinksDecor, jpsiVerticestoLink, jpsiContainer, cascadeVertices[1]))
213  ATH_MSG_ERROR("Error decorating with Jpsi vertices");
214 
215  std::vector<const xAOD::Vertex*> dxVerticestoLink;
216  if (dxVertex) dxVerticestoLink.push_back(dxVertex);
217  else ATH_MSG_WARNING("Could not find linking D_(s)+");
218  if(!BPhysPVCascadeTools::LinkVertices(DxLinksDecor, dxVerticestoLink, dxContainer, cascadeVertices[1]))
219  ATH_MSG_ERROR("Error decorating with D_(s)+ vertices");
220 
221  bool tagDp(true);
222  if (dxVertex) {
223  if(abs(m_Dx_pid)==411 && (dxVertex->trackParticle(2)->charge()==-1)) tagDp = false;
224  }
225 
226  double mass_b = m_vtx0MassHypo;
227  double mass_d = m_vtx1MassHypo;
228  std::vector<double> massesJpsi;
229  massesJpsi.push_back(m_vtx0Daug1MassHypo);
230  massesJpsi.push_back(m_vtx0Daug2MassHypo);
231  std::vector<double> massesDx;
232  if(tagDp){
233  massesDx.push_back(m_vtx1Daug1MassHypo);
234  massesDx.push_back(m_vtx1Daug2MassHypo);
235  }else{ // Change the order for D-
236  massesDx.push_back(m_vtx1Daug2MassHypo);
237  massesDx.push_back(m_vtx1Daug1MassHypo);
238  }
239  massesDx.push_back(m_vtx1Daug3MassHypo);
240  std::vector<double> Masses;
241  Masses.push_back(m_vtx0Daug1MassHypo);
242  Masses.push_back(m_vtx0Daug2MassHypo);
243  Masses.push_back(m_vtx1MassHypo);
244 
245  // loop over candidates -- Don't apply PV_minNTracks requirement here
246  // because it may result in exclusion of the high-pt PV.
247  // get good PVs
248 
249 
250  xAOD::BPhysHypoHelper vtx(m_hypoName, mainVertex);
251 
252  // Get refitted track momenta from all vertices, charged tracks only
254 
255  // Decorate main vertex
256  //
257  // 1.a) mass, mass error
258  BPHYS_CHECK( vtx.setMass(m_CascadeTools->invariantMass(moms[1])) );
259  BPHYS_CHECK( vtx.setMassErr(m_CascadeTools->invariantMassError(moms[1],x->getCovariance()[1])) );
260  // 1.b) pt and pT error (the default pt of mainVertex is != the pt of the full cascade fit!)
261  Pt_decor(*mainVertex) = m_CascadeTools->pT(moms[1]);
262  PtErr_decor(*mainVertex) = m_CascadeTools->pTError(moms[1],x->getCovariance()[1]);
263  // 1.c) chi2 and ndof (the default chi2 of mainVertex is != the chi2 of the full cascade fit!)
264  chi2_decor(*mainVertex) = x->fitChi2();
265  ndof_decor(*mainVertex) = x->nDoF();
266 
267  float massMumu = 0.;
268  if (jpsiVertex) {
269  TLorentzVector p4_mu1, p4_mu2;
270  p4_mu1.SetPtEtaPhiM(jpsiVertex->trackParticle(0)->pt(),
271  jpsiVertex->trackParticle(0)->eta(),
272  jpsiVertex->trackParticle(0)->phi(), m_vtx0Daug1MassHypo);
273  p4_mu2.SetPtEtaPhiM(jpsiVertex->trackParticle(1)->pt(),
274  jpsiVertex->trackParticle(1)->eta(),
275  jpsiVertex->trackParticle(1)->phi(), m_vtx0Daug2MassHypo);
276  massMumu = (p4_mu1 + p4_mu2).M();
277  }
278  MassMumu_decor(*mainVertex) = massMumu;
279 
280  float massKX = 0., massKXpi = 0.;
281  if (dxVertex) {
282  TLorentzVector p4_h1, p4_h2, p4_h3;
283  if(tagDp){
284  p4_h1.SetPtEtaPhiM(dxVertex->trackParticle(0)->pt(),
285  dxVertex->trackParticle(0)->eta(),
286  dxVertex->trackParticle(0)->phi(), m_vtx1Daug1MassHypo);
287  p4_h2.SetPtEtaPhiM(dxVertex->trackParticle(1)->pt(),
288  dxVertex->trackParticle(1)->eta(),
289  dxVertex->trackParticle(1)->phi(), m_vtx1Daug2MassHypo);
290  }else{ // Change the order for D-
291  p4_h1.SetPtEtaPhiM(dxVertex->trackParticle(0)->pt(),
292  dxVertex->trackParticle(0)->eta(),
293  dxVertex->trackParticle(0)->phi(), m_vtx1Daug2MassHypo);
294  p4_h2.SetPtEtaPhiM(dxVertex->trackParticle(1)->pt(),
295  dxVertex->trackParticle(1)->eta(),
296  dxVertex->trackParticle(1)->phi(), m_vtx1Daug1MassHypo);
297  }
298  p4_h3.SetPtEtaPhiM(dxVertex->trackParticle(2)->pt(),
299  dxVertex->trackParticle(2)->eta(),
300  dxVertex->trackParticle(2)->phi(), m_vtx1Daug3MassHypo);
301  massKX = (p4_h1 + p4_h2).M();
302  massKXpi = (p4_h1 + p4_h2 + p4_h3).M();
303  }
304  MassKX_svdecor(*mainVertex) = massKX;
305  MassKXpi_svdecor(*mainVertex) = massKXpi;
306 
307  ATH_CHECK(helper.FillCandwithRefittedVertices(m_refitPV, pvContainer,
308  refPvContainer, &(*m_pvRefitter), m_PV_max, m_DoVertexType, x, 1, mass_b, vtx));
309 
310 
311  // 4) decorate the main vertex with V0 vertex mass, pt, lifetime and lxy values (plus errors)
312  // V0 points to the main vertex, so lifetime and lxy are w.r.t the main vertex
313  Mass_svdecor(*mainVertex) = m_CascadeTools->invariantMass(moms[0]);
314  MassErr_svdecor(*mainVertex) = m_CascadeTools->invariantMassError(moms[0],x->getCovariance()[0]);
315  Pt_svdecor(*mainVertex) = m_CascadeTools->pT(moms[0]);
316  PtErr_svdecor(*mainVertex) = m_CascadeTools->pTError(moms[0],x->getCovariance()[0]);
317  Lxy_svdecor(*mainVertex) = m_CascadeTools->lxy(moms[0],cascadeVertices[0],cascadeVertices[1]);
318  LxyErr_svdecor(*mainVertex) = m_CascadeTools->lxyError(moms[0],x->getCovariance()[0],cascadeVertices[0],cascadeVertices[1]);
319  Tau_svdecor(*mainVertex) = m_CascadeTools->tau(moms[0],cascadeVertices[0],cascadeVertices[1]);
320  TauErr_svdecor(*mainVertex) = m_CascadeTools->tauError(moms[0],x->getCovariance()[0],cascadeVertices[0],cascadeVertices[1]);
321 
322  // Some checks in DEBUG mode
323  ATH_MSG_DEBUG("chi2 " << x->fitChi2()
324  << " chi2_1 " << m_V0Tools->chisq(cascadeVertices[0])
325  << " chi2_2 " << m_V0Tools->chisq(cascadeVertices[1])
326  << " vprob " << m_CascadeTools->vertexProbability(x->nDoF(),x->fitChi2()));
327  ATH_MSG_DEBUG("ndf " << x->nDoF() << " ndf_1 " << m_V0Tools->ndof(cascadeVertices[0]) << " ndf_2 " << m_V0Tools->ndof(cascadeVertices[1]));
328  ATH_MSG_DEBUG("V0Tools mass_d " << m_V0Tools->invariantMass(cascadeVertices[0],massesDx)
329  << " error " << m_V0Tools->invariantMassError(cascadeVertices[0],massesDx)
330  << " mass_J " << m_V0Tools->invariantMass(cascadeVertices[1],massesJpsi)
331  << " error " << m_V0Tools->invariantMassError(cascadeVertices[1],massesJpsi));
332  // masses and errors, using track masses assigned in the fit
333  double Mass_B = m_CascadeTools->invariantMass(moms[1]);
334  double Mass_D = m_CascadeTools->invariantMass(moms[0]);
335  double Mass_B_err = m_CascadeTools->invariantMassError(moms[1],x->getCovariance()[1]);
336  double Mass_D_err = m_CascadeTools->invariantMassError(moms[0],x->getCovariance()[0]);
337  ATH_MSG_DEBUG("Mass_B " << Mass_B << " Mass_D " << Mass_D);
338  ATH_MSG_DEBUG("Mass_B_err " << Mass_B_err << " Mass_D_err " << Mass_D_err);
339  double mprob_B = m_CascadeTools->massProbability(mass_b,Mass_B,Mass_B_err);
340  double mprob_D = m_CascadeTools->massProbability(mass_d,Mass_D,Mass_D_err);
341  ATH_MSG_DEBUG("mprob_B " << mprob_B << " mprob_D " << mprob_D);
342  // masses and errors, assigning user defined track masses
343  ATH_MSG_DEBUG("Mass_b " << m_CascadeTools->invariantMass(moms[1],Masses)
344  << " Mass_d " << m_CascadeTools->invariantMass(moms[0],massesDx));
345  ATH_MSG_DEBUG("Mass_b_err " << m_CascadeTools->invariantMassError(moms[1],x->getCovariance()[1],Masses)
346  << " Mass_d_err " << m_CascadeTools->invariantMassError(moms[0],x->getCovariance()[0],massesDx));
347  ATH_MSG_DEBUG("pt_b " << m_CascadeTools->pT(moms[1])
348  << " pt_d " << m_CascadeTools->pT(moms[0])
349  << " pt_dp " << m_V0Tools->pT(cascadeVertices[0]));
350  ATH_MSG_DEBUG("ptErr_b " << m_CascadeTools->pTError(moms[1],x->getCovariance()[1])
351  << " ptErr_d " << m_CascadeTools->pTError(moms[0],x->getCovariance()[0])
352  << " ptErr_dp " << m_V0Tools->pTError(cascadeVertices[0]));
353  ATH_MSG_DEBUG("lxy_B " << m_V0Tools->lxy(cascadeVertices[1],primaryVertex) << " lxy_D " << m_V0Tools->lxy(cascadeVertices[0],cascadeVertices[1]));
354  ATH_MSG_DEBUG("lxy_b " << m_CascadeTools->lxy(moms[1],cascadeVertices[1],primaryVertex) << " lxy_d " << m_CascadeTools->lxy(moms[0],cascadeVertices[0],cascadeVertices[1]));
355  ATH_MSG_DEBUG("lxyErr_b " << m_CascadeTools->lxyError(moms[1],x->getCovariance()[1],cascadeVertices[1],primaryVertex)
356  << " lxyErr_d " << m_CascadeTools->lxyError(moms[0],x->getCovariance()[0],cascadeVertices[0],cascadeVertices[1])
357  << " lxyErr_dp " << m_V0Tools->lxyError(cascadeVertices[0],cascadeVertices[1]));
358  ATH_MSG_DEBUG("tau_B " << m_CascadeTools->tau(moms[1],cascadeVertices[1],primaryVertex,mass_b)
359  << " tau_dp " << m_V0Tools->tau(cascadeVertices[0],cascadeVertices[1],massesDx));
360  ATH_MSG_DEBUG("tau_b " << m_CascadeTools->tau(moms[1],cascadeVertices[1],primaryVertex)
361  << " tau_d " << m_CascadeTools->tau(moms[0],cascadeVertices[0],cascadeVertices[1])
362  << " tau_D " << m_CascadeTools->tau(moms[0],cascadeVertices[0],cascadeVertices[1],mass_d));
363  ATH_MSG_DEBUG("tauErr_b " << m_CascadeTools->tauError(moms[1],x->getCovariance()[1],cascadeVertices[1],primaryVertex)
364  << " tauErr_d " << m_CascadeTools->tauError(moms[0],x->getCovariance()[0],cascadeVertices[0],cascadeVertices[1])
365  << " tauErr_dp " << m_V0Tools->tauError(cascadeVertices[0],cascadeVertices[1],massesDx));
366  ATH_MSG_DEBUG("TauErr_b " << m_CascadeTools->tauError(moms[1],x->getCovariance()[1],cascadeVertices[1],primaryVertex,mass_b)
367  << " TauErr_d " << m_CascadeTools->tauError(moms[0],x->getCovariance()[0],cascadeVertices[0],cascadeVertices[1],mass_d)
368  << " TauErr_dp " << m_V0Tools->tauError(cascadeVertices[0],cascadeVertices[1],massesDx,mass_d));
369 
370  ATH_MSG_DEBUG("CascadeTools main vert wrt PV " << " CascadeTools SV " << " V0Tools SV");
371  ATH_MSG_DEBUG("a0z " << m_CascadeTools->a0z(moms[1],cascadeVertices[1],primaryVertex)
372  << ", " << m_CascadeTools->a0z(moms[0],cascadeVertices[0],cascadeVertices[1])
373  << ", " << m_V0Tools->a0z(cascadeVertices[0],cascadeVertices[1]));
374  ATH_MSG_DEBUG("a0zErr " << m_CascadeTools->a0zError(moms[1],x->getCovariance()[1],cascadeVertices[1],primaryVertex)
375  << ", " << m_CascadeTools->a0zError(moms[0],x->getCovariance()[0],cascadeVertices[0],cascadeVertices[1])
376  << ", " << m_V0Tools->a0zError(cascadeVertices[0],cascadeVertices[1]));
377  ATH_MSG_DEBUG("a0xy " << m_CascadeTools->a0xy(moms[1],cascadeVertices[1],primaryVertex)
378  << ", " << m_CascadeTools->a0xy(moms[0],cascadeVertices[0],cascadeVertices[1])
379  << ", " << m_V0Tools->a0xy(cascadeVertices[0],cascadeVertices[1]));
380  ATH_MSG_DEBUG("a0xyErr " << m_CascadeTools->a0xyError(moms[1],x->getCovariance()[1],cascadeVertices[1],primaryVertex)
381  << ", " << m_CascadeTools->a0xyError(moms[0],x->getCovariance()[0],cascadeVertices[0],cascadeVertices[1])
382  << ", " << m_V0Tools->a0xyError(cascadeVertices[0],cascadeVertices[1]));
383  ATH_MSG_DEBUG("a0 " << m_CascadeTools->a0(moms[1],cascadeVertices[1],primaryVertex)
384  << ", " << m_CascadeTools->a0(moms[0],cascadeVertices[0],cascadeVertices[1])
385  << ", " << m_V0Tools->a0(cascadeVertices[0],cascadeVertices[1]));
386  ATH_MSG_DEBUG("a0Err " << m_CascadeTools->a0Error(moms[1],x->getCovariance()[1],cascadeVertices[1],primaryVertex)
387  << ", " << m_CascadeTools->a0Error(moms[0],x->getCovariance()[0],cascadeVertices[0],cascadeVertices[1])
388  << ", " << m_V0Tools->a0Error(cascadeVertices[0],cascadeVertices[1]));
389  ATH_MSG_DEBUG("x0 " << m_V0Tools->vtx(cascadeVertices[0]).x() << " y0 " << m_V0Tools->vtx(cascadeVertices[0]).y() << " z0 " << m_V0Tools->vtx(cascadeVertices[0]).z());
390  ATH_MSG_DEBUG("x1 " << m_V0Tools->vtx(cascadeVertices[1]).x() << " y1 " << m_V0Tools->vtx(cascadeVertices[1]).y() << " z1 " << m_V0Tools->vtx(cascadeVertices[1]).z());
391  ATH_MSG_DEBUG("X0 " << primaryVertex->x() << " Y0 " << primaryVertex->y() << " Z0 " << primaryVertex->z());
392  ATH_MSG_DEBUG("rxy0 " << m_V0Tools->rxy(cascadeVertices[0]) << " rxyErr0 " << m_V0Tools->rxyError(cascadeVertices[0]));
393  ATH_MSG_DEBUG("rxy1 " << m_V0Tools->rxy(cascadeVertices[1]) << " rxyErr1 " << m_V0Tools->rxyError(cascadeVertices[1]));
394  ATH_MSG_DEBUG("Rxy0 wrt PV " << m_V0Tools->rxy(cascadeVertices[0],primaryVertex) << " RxyErr0 wrt PV " << m_V0Tools->rxyError(cascadeVertices[0],primaryVertex));
395  ATH_MSG_DEBUG("Rxy1 wrt PV " << m_V0Tools->rxy(cascadeVertices[1],primaryVertex) << " RxyErr1 wrt PV " << m_V0Tools->rxyError(cascadeVertices[1],primaryVertex));
396  ATH_MSG_DEBUG("number of covariance matrices " << (x->getCovariance()).size());
397  } // loop over cascadeinfoContainer
398 
399  // Deleting cascadeinfo since this won't be stored.
400  // Vertices have been kept in m_cascadeOutputs and should be owned by their container
401  for (auto x : cascadeinfoContainer) delete x;
402 
403  return StatusCode::SUCCESS;
404  }
405 
406 
407  JpsiPlusDsCascade::JpsiPlusDsCascade(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p),
408  m_vertexContainerKey(""),
409  m_vertexDxContainerKey(""),
410  m_cascadeOutputsKeys{ "JpsiPlusDsCascadeVtx1", "JpsiPlusDsCascadeVtx2" },
411  m_VxPrimaryCandidateName("PrimaryVertices"),
412  m_jpsiMassLower(0.0),
413  m_jpsiMassUpper(10000.0),
414  m_DxMassLower(0.0),
415  m_DxMassUpper(10000.0),
416  m_MassLower(0.0),
417  m_MassUpper(20000.0),
418  m_vtx0MassHypo(-1),
419  m_vtx1MassHypo(-1),
420  m_vtx0Daug1MassHypo(-1),
421  m_vtx0Daug2MassHypo(-1),
422  m_vtx1Daug1MassHypo(-1),
423  m_vtx1Daug2MassHypo(-1),
424  m_vtx1Daug3MassHypo(-1),
425  m_mass_jpsi(-1),
426  m_Dx_pid(431),
427  m_constrDx(true),
428  m_constrJpsi(true),
429  m_chi2cut(-1.0),
430  m_iVertexFitter("Trk::TrkVKalVrtFitter"),
431  m_pvRefitter("Analysis::PrimaryVertexRefitter"),
432  m_V0Tools("Trk::V0Tools"),
433  m_CascadeTools("DerivationFramework::CascadeTools")
434  {
435  declareProperty("JpsiVertices", m_vertexContainerKey);
436  declareProperty("DxVertices", m_vertexDxContainerKey);
437  declareProperty("VxPrimaryCandidateName", m_VxPrimaryCandidateName);
438  declareProperty("RefPVContainerName", m_refPVContainerName = "RefittedPrimaryVertices");
439  declareProperty("JpsiMassLowerCut", m_jpsiMassLower);
440  declareProperty("JpsiMassUpperCut", m_jpsiMassUpper);
441  declareProperty("DxMassLowerCut", m_DxMassLower);
442  declareProperty("DxMassUpperCut", m_DxMassUpper);
443  declareProperty("MassLowerCut", m_MassLower);
444  declareProperty("MassUpperCut", m_MassUpper);
445  declareProperty("HypothesisName", m_hypoName = "Bc");
446  declareProperty("Vtx0MassHypo", m_vtx0MassHypo);
447  declareProperty("Vtx1MassHypo", m_vtx1MassHypo);
448  declareProperty("Vtx0Daug1MassHypo", m_vtx0Daug1MassHypo);
449  declareProperty("Vtx0Daug2MassHypo", m_vtx0Daug2MassHypo);
450  declareProperty("Vtx1Daug1MassHypo", m_vtx1Daug1MassHypo);
451  declareProperty("Vtx1Daug2MassHypo", m_vtx1Daug2MassHypo);
452  declareProperty("Vtx1Daug3MassHypo", m_vtx1Daug3MassHypo);
453  declareProperty("JpsiMass", m_mass_jpsi);
454  declareProperty("DxHypothesis", m_Dx_pid);
455  declareProperty("ApplyDxMassConstraint", m_constrDx);
456  declareProperty("ApplyJpsiMassConstraint", m_constrJpsi);
457  declareProperty("Chi2Cut", m_chi2cut);
458  declareProperty("RefitPV", m_refitPV = true);
459  declareProperty("MaxnPV", m_PV_max = 999);
460  declareProperty("MinNTracksInPV", m_PV_minNTracks = 0);
461  declareProperty("DoVertexType", m_DoVertexType = 7);
462  declareProperty("TrkVertexFitterTool", m_iVertexFitter);
463  declareProperty("PVRefitter", m_pvRefitter);
464  declareProperty("V0Tools", m_V0Tools);
465  declareProperty("CascadeTools", m_CascadeTools);
466  declareProperty("CascadeVertexCollections", m_cascadeOutputsKeys);
467  }
468 
470 
471  StatusCode JpsiPlusDsCascade::performSearch(std::vector<Trk::VxCascadeInfo*> *cascadeinfoContainer) const
472  {
473  ATH_MSG_DEBUG( "JpsiPlusDsCascade::performSearch" );
474  assert(cascadeinfoContainer!=nullptr);
475 
476  // Get TrackParticle container (for setting links to the original tracks)
477  const xAOD::TrackParticleContainer *trackContainer(nullptr);
478  ATH_CHECK(evtStore()->retrieve(trackContainer , "InDetTrackParticles" ));
479 
480  // Get Jpsi container
481  const xAOD::VertexContainer *jpsiContainer(nullptr);
482  ATH_CHECK(evtStore()->retrieve(jpsiContainer , m_vertexContainerKey ));
483 
484  // Get V0 container
485  const xAOD::VertexContainer *dxContainer(nullptr);
487 
488 
489 
490  double mass_d = m_vtx1MassHypo;
491  std::vector<const xAOD::TrackParticle*> tracksJpsi;
492  std::vector<const xAOD::TrackParticle*> tracksDx;
493  std::vector<const xAOD::TrackParticle*> tracksBc;
494  std::vector<double> massesJpsi;
495  massesJpsi.push_back(m_vtx0Daug1MassHypo);
496  massesJpsi.push_back(m_vtx0Daug2MassHypo);
497  std::vector<double> massesDx;
498  massesDx.push_back(m_vtx1Daug1MassHypo);
499  massesDx.push_back(m_vtx1Daug2MassHypo);
500  massesDx.push_back(m_vtx1Daug3MassHypo);
501  std::vector<double> massesDm; // Alter the order of masses for D-
502  massesDm.push_back(m_vtx1Daug2MassHypo);
503  massesDm.push_back(m_vtx1Daug1MassHypo);
504  massesDm.push_back(m_vtx1Daug3MassHypo);
505  std::vector<double> Masses;
506  Masses.push_back(m_vtx0Daug1MassHypo);
507  Masses.push_back(m_vtx0Daug2MassHypo);
508  Masses.push_back(m_vtx1MassHypo);
509 
510  // Select the J/psi candidates before calling cascade fit
511  std::vector<const xAOD::Vertex*> selectedJpsiCandidates;
512  for(auto vxcItr=jpsiContainer->cbegin(); vxcItr!=jpsiContainer->cend(); ++vxcItr) {
513 
514  // Check the passed flag first
515  const xAOD::Vertex* vtx = *vxcItr;
516  SG::AuxElement::Accessor<Char_t> flagAcc1("passed_Jpsi");
517  if(flagAcc1.isAvailable(*vtx)){
518  if(!flagAcc1(*vtx)) continue;
519  }
520 
521  // Check J/psi candidate invariant mass and skip if need be
522  double mass_Jpsi = m_V0Tools->invariantMass(*vxcItr, massesJpsi);
523  if (mass_Jpsi < m_jpsiMassLower || mass_Jpsi > m_jpsiMassUpper) {
524  ATH_MSG_DEBUG(" Original Jpsi candidate rejected by the mass cut: mass = "
525  << mass_Jpsi << " != (" << m_jpsiMassLower << ", " << m_jpsiMassUpper << ")" );
526  continue;
527  }
528  selectedJpsiCandidates.push_back(*vxcItr);
529  }
530  if(selectedJpsiCandidates.size()<1) return StatusCode::SUCCESS;
531 
532  // Select the D_s+/D+ candidates before calling cascade fit
533  std::vector<const xAOD::Vertex*> selectedDxCandidates;
534  for(auto vxcItr=dxContainer->cbegin(); vxcItr!=dxContainer->cend(); ++vxcItr) {
535 
536  // Check the passed flag first
537  const xAOD::Vertex* vtx = *vxcItr;
538  if(abs(m_Dx_pid)==431) { // D_s+/-
539  SG::AuxElement::Accessor<Char_t> flagAcc1("passed_Ds");
540  if(flagAcc1.isAvailable(*vtx)){
541  if(!flagAcc1(*vtx)) continue;
542  }
543  }
544 
545  if(abs(m_Dx_pid)==411) { // D+/-
546  SG::AuxElement::Accessor<Char_t> flagAcc1("passed_Dp");
547  SG::AuxElement::Accessor<Char_t> flagAcc2("passed_Dm");
548  bool isDp(true);
549  bool isDm(true);
550  if(flagAcc1.isAvailable(*vtx)){
551  if(!flagAcc1(*vtx)) isDp = false;
552  }
553  if(flagAcc2.isAvailable(*vtx)){
554  if(!flagAcc2(*vtx)) isDm = false;
555  }
556  if(!(isDp||isDm)) continue;
557  }
558 
559 
560  // Ensure the total charge is correct
561  if(abs((*vxcItr)->trackParticle(0)->charge()+(*vxcItr)->trackParticle(1)->charge()+(*vxcItr)->trackParticle(2)->charge()) != 1){
562  ATH_MSG_DEBUG(" Original D+ candidate rejected by the charge requirement: "
563  << (*vxcItr)->trackParticle(0)->charge() << ", " << (*vxcItr)->trackParticle(1)->charge() << ", " << (*vxcItr)->trackParticle(2)->charge() );
564  continue;
565  }
566 
567  // Check D_(s)+/- candidate invariant mass and skip if need be
568  double mass_D;
569  if(abs(m_Dx_pid)==411 && (*vxcItr)->trackParticle(2)->charge()<0) // D-
570  mass_D = m_V0Tools->invariantMass(*vxcItr,massesDm);
571  else // D+, D_s+/-
572  mass_D = m_V0Tools->invariantMass(*vxcItr,massesDx);
573  ATH_MSG_DEBUG("D_(s) mass " << mass_D);
574  if(mass_D < m_DxMassLower || mass_D > m_DxMassUpper) {
575  ATH_MSG_DEBUG(" Original D_(s) candidate rejected by the mass cut: mass = "
576  << mass_D << " != (" << m_DxMassLower << ", " << m_DxMassUpper << ")" );
577  continue;
578  }
579 
580  // Add loose cut on K+k- mass for D_s->phi pi
581  if(m_Dx_pid==431){
582  TLorentzVector p4Kp_in, p4Km_in;
583  p4Kp_in.SetPtEtaPhiM( (*vxcItr)->trackParticle(0)->pt(),
584  (*vxcItr)->trackParticle(0)->eta(),
585  (*vxcItr)->trackParticle(0)->phi(), m_vtx1Daug1MassHypo);
586  p4Km_in.SetPtEtaPhiM( (*vxcItr)->trackParticle(1)->pt(),
587  (*vxcItr)->trackParticle(1)->eta(),
588  (*vxcItr)->trackParticle(1)->phi(), m_vtx1Daug2MassHypo);
589  double mass_phi = (p4Kp_in + p4Km_in).M();
590  ATH_MSG_DEBUG("phi mass " << mass_phi);
591  if(mass_phi > 1200) {
592  ATH_MSG_DEBUG(" Original phi candidate rejected by the mass cut: mass = " << mass_phi );
593  continue;
594  }
595  }
596  selectedDxCandidates.push_back(*vxcItr);
597  }
598  if(selectedDxCandidates.size()<1) return StatusCode::SUCCESS;
599 
600  // Select J/psi D_(s)+ candidates
601  // Iterate over Jpsi vertices
602  for(auto jpsiItr=selectedJpsiCandidates.cbegin(); jpsiItr!=selectedJpsiCandidates.cend(); ++jpsiItr) {
603 
604  size_t jpsiTrkNum = (*jpsiItr)->nTrackParticles();
605  tracksJpsi.clear();
606  for( unsigned int it=0; it<jpsiTrkNum; it++) tracksJpsi.push_back((*jpsiItr)->trackParticle(it));
607 
608  if (tracksJpsi.size() != 2 || massesJpsi.size() != 2 ) {
609  ATH_MSG_INFO("problems with Jpsi input");
610  }
611 
612  // Iterate over D_(s)+/- vertices
613  for(auto dxItr=selectedDxCandidates.cbegin(); dxItr!=selectedDxCandidates.cend(); ++dxItr) {
614 
615  // Check identical tracks in input
616  if(std::find(tracksJpsi.cbegin(), tracksJpsi.cend(), (*dxItr)->trackParticle(0)) != tracksJpsi.cend()) continue;
617  if(std::find(tracksJpsi.cbegin(), tracksJpsi.cend(), (*dxItr)->trackParticle(1)) != tracksJpsi.cend()) continue;
618  if(std::find(tracksJpsi.cbegin(), tracksJpsi.cend(), (*dxItr)->trackParticle(2)) != tracksJpsi.cend()) continue;
619 
620  size_t dxTrkNum = (*dxItr)->nTrackParticles();
621  tracksDx.clear();
622  for( unsigned int it=0; it<dxTrkNum; it++) tracksDx.push_back((*dxItr)->trackParticle(it));
623  if (tracksDx.size() != 3 || massesDx.size() != 3 ) {
624  ATH_MSG_INFO("problems with D_(s) input");
625  }
626 
627  ATH_MSG_DEBUG("using tracks" << tracksJpsi[0] << ", " << tracksJpsi[1] << ", " << tracksDx[0] << ", " << tracksDx[1] << ", " << tracksDx[2]);
628  tracksBc.clear();
629  for( unsigned int it=0; it<jpsiTrkNum; it++) tracksBc.push_back((*jpsiItr)->trackParticle(it));
630  for( unsigned int it=0; it<dxTrkNum; it++) tracksBc.push_back((*dxItr)->trackParticle(it));
631 
632  // Apply the user's settings to the fitter
633  // Reset
634  std::unique_ptr<Trk::IVKalState> state (m_iVertexFitter->makeState());
635  // Robustness
636  int robustness = 0;
637  m_iVertexFitter->setRobustness(robustness, *state);
638  // Build up the topology
639  // Vertex list
640  std::vector<Trk::VertexID> vrtList;
641  // D_(s)+/- vertex
642  Trk::VertexID vID;
643  if (m_constrDx) {
644  if(abs(m_Dx_pid)==411 && (*dxItr)->trackParticle(2)->charge()<0) // D-
645  vID = m_iVertexFitter->startVertex(tracksDx,massesDm,*state,mass_d);
646  else // D+, D_s+/-
647  vID = m_iVertexFitter->startVertex(tracksDx,massesDx,*state,mass_d);
648  } else {
649  if(abs(m_Dx_pid)==411 && (*dxItr)->trackParticle(2)->charge()<0) // D-
650  vID = m_iVertexFitter->startVertex(tracksDx,massesDm,*state);
651  else // D+, D_s+/-
652  vID = m_iVertexFitter->startVertex(tracksDx,massesDx,*state);
653  }
654  vrtList.push_back(vID);
655  // B vertex including Jpsi
656  Trk::VertexID vID2 = m_iVertexFitter->nextVertex(tracksJpsi,massesJpsi,vrtList,*state);
657  if (m_constrJpsi) {
658  std::vector<Trk::VertexID> cnstV;
659  cnstV.clear();
660  if ( !m_iVertexFitter->addMassConstraint(vID2,tracksJpsi,cnstV,*state,m_mass_jpsi).isSuccess() ) {
661  ATH_MSG_WARNING("addMassConstraint failed");
662  //return StatusCode::FAILURE;
663  }
664  }
665  // Do the work
666  std::unique_ptr<Trk::VxCascadeInfo> result(m_iVertexFitter->fitCascade(*state));
667 
668  if (result != nullptr) {
669  // reset links to original tracks
670  BPhysPVCascadeTools::PrepareVertexLinks(result.get(), trackContainer);
671  ATH_MSG_DEBUG("storing tracks " << ((result->vertices())[0])->trackParticle(0) << ", "
672  << ((result->vertices())[0])->trackParticle(1) << ", "
673  << ((result->vertices())[0])->trackParticle(2) << ", "
674  << ((result->vertices())[1])->trackParticle(0) << ", "
675  << ((result->vertices())[1])->trackParticle(1));
676  // necessary to prevent memory leak
677  result->setSVOwnership(true);
678 
679  // Chi2/DOF cut
680  double bChi2DOF = result->fitChi2()/result->nDoF();
681  ATH_MSG_DEBUG("Candidate chi2/DOF is " << bChi2DOF);
682  bool chi2CutPassed = (m_chi2cut <= 0.0 || bChi2DOF < m_chi2cut);
683 
684  const std::vector< std::vector<TLorentzVector> > &moms = result->getParticleMoms();
685  double mass = m_CascadeTools->invariantMass(moms[1]);
686  if(chi2CutPassed) {
687  if (mass >= m_MassLower && mass <= m_MassUpper) {
688  cascadeinfoContainer->push_back(result.release());
689  } else {
690  ATH_MSG_DEBUG("Candidate rejected by the mass cut: mass = "
691  << mass << " != (" << m_MassLower << ", " << m_MassUpper << ")" );
692  }
693  }
694  }
695 
696  } //Iterate over D_(s)+ vertices
697 
698  } //Iterate over Jpsi vertices
699 
700  ATH_MSG_DEBUG("cascadeinfoContainer size " << cascadeinfoContainer->size());
701 
702  return StatusCode::SUCCESS;
703  }
704 
705 }
706 
707 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::BPhysHypoHelper::setMass
bool setMass(const float val)
Set given invariant mass and its error.
Definition: BPhysHypoHelper.cxx:49
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
xAOD::Vertex_v1::x
float x() const
Returns the x position.
V0Tools.h
DerivationFramework::JpsiPlusDsCascade::m_vtx0Daug1MassHypo
double m_vtx0Daug1MassHypo
Definition: JpsiPlusDsCascade.h:61
DerivationFramework::JpsiPlusDsCascade::initialize
virtual StatusCode initialize() override
Definition: JpsiPlusDsCascade.cxx:28
DerivationFramework::JpsiPlusDsCascade::m_vtx1MassHypo
double m_vtx1MassHypo
Definition: JpsiPlusDsCascade.h:60
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
get_generator_info.result
result
Definition: get_generator_info.py:21
xAOD::VertexAuxContainer_v1
Temporary container used until we have I/O for AuxStoreInternal.
Definition: VertexAuxContainer_v1.h:32
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
DerivationFramework::JpsiPlusDsCascade::m_MassLower
double m_MassLower
Definition: JpsiPlusDsCascade.h:57
Trk::VxCascadeInfo
Definition: VxCascadeInfo.h:75
Trk::VertexID
int VertexID
Definition: IVertexCascadeFitter.h:23
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
DerivationFramework::JpsiPlusDsCascade::m_DxMassUpper
double m_DxMassUpper
Definition: JpsiPlusDsCascade.h:56
DerivationFramework::BPhysPVCascadeTools::LinkVertices
static bool LinkVertices(SG::AuxElement::Decorator< VertexLinkVector > &decor, const std::vector< const xAOD::Vertex * > &vertices, const xAOD::VertexContainer *vertexContainer, const xAOD::Vertex *vert)
Definition: BPhysPVCascadeTools.cxx:460
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
DerivationFramework::JpsiPlusDsCascade::m_chi2cut
double m_chi2cut
Definition: JpsiPlusDsCascade.h:71
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:150
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
DerivationFramework::JpsiPlusDsCascade::m_PV_minNTracks
size_t m_PV_minNTracks
Definition: JpsiPlusDsCascade.h:86
DerivationFramework::BPhysPVCascadeTools::getParticleMass
static double getParticleMass(const HepPDT::ParticleDataTable *pdt, int pdg)
Definition: BPhysPVCascadeTools.cxx:491
DerivationFramework::JpsiPlusDsCascade::m_constrJpsi
bool m_constrJpsi
Definition: JpsiPlusDsCascade.h:70
DerivationFramework::JpsiPlusDsCascade::m_constrDx
bool m_constrDx
Definition: JpsiPlusDsCascade.h:69
skel.it
it
Definition: skel.GENtoEVGEN.py:423
DerivationFramework::JpsiPlusDsCascade::performSearch
StatusCode performSearch(std::vector< Trk::VxCascadeInfo * > *cascadeinfoContainer) const
Definition: JpsiPlusDsCascade.cxx:471
DerivationFramework::JpsiPlusDsCascade::m_CascadeTools
ToolHandle< DerivationFramework::CascadeTools > m_CascadeTools
Definition: JpsiPlusDsCascade.h:77
test_pyathena.pt
pt
Definition: test_pyathena.py:11
DerivationFramework::JpsiPlusDsCascade::m_jpsiMassLower
double m_jpsiMassLower
Definition: JpsiPlusDsCascade.h:53
DerivationFramework::JpsiPlusDsCascade::m_V0Tools
ToolHandle< Trk::V0Tools > m_V0Tools
Definition: JpsiPlusDsCascade.h:76
DerivationFramework::JpsiPlusDsCascade::m_vtx1Daug3MassHypo
double m_vtx1Daug3MassHypo
Definition: JpsiPlusDsCascade.h:65
DataVector::cend
const_iterator cend() const noexcept
Return a const_iterator pointing past the end of the collection.
DerivationFramework::JpsiPlusDsCascade::m_PV_max
int m_PV_max
Definition: JpsiPlusDsCascade.h:84
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
DerivationFramework::JpsiPlusDsCascade::addBranches
virtual StatusCode addBranches() const override
Pass the thinning service
Definition: JpsiPlusDsCascade.cxx:68
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
DerivationFramework::JpsiPlusDsCascade::m_vertexContainerKey
std::string m_vertexContainerKey
Definition: JpsiPlusDsCascade.h:47
xAOD::VertexContainer
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Definition: VertexContainer.h:14
x
#define x
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
DerivationFramework::JpsiPlusDsCascade::m_pvRefitter
ToolHandle< Analysis::PrimaryVertexRefitter > m_pvRefitter
Definition: JpsiPlusDsCascade.h:75
TrkVKalVrtFitter.h
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
DerivationFramework::JpsiPlusDsCascade::m_MassUpper
double m_MassUpper
Definition: JpsiPlusDsCascade.h:58
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
xAOD::BPhysHypoHelper
Definition: BPhysHypoHelper.h:73
DerivationFramework::BPhysPVCascadeTools::SetVectorInfo
static void SetVectorInfo(xAOD::BPhysHelper &, const Trk::VxCascadeInfo *)
Definition: BPhysPVCascadeTools.cxx:424
BPHYS_CHECK
#define BPHYS_CHECK(EXP)
Useful CHECK macro.
Definition: BPhysHelper.h:738
DerivationFramework::JpsiPlusDsCascade::m_Dx_pid
int m_Dx_pid
Definition: JpsiPlusDsCascade.h:68
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:58
xAOD::VertexAuxContainer
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
Definition: VertexAuxContainer.h:19
lumiFormat.i
int i
Definition: lumiFormat.py:92
beamspotman.n
n
Definition: beamspotman.py:731
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
BPhysHypoHelper.h
: B-physcis xAOD helpers.
DerivationFramework::JpsiPlusDsCascade::m_VxPrimaryCandidateName
std::string m_VxPrimaryCandidateName
Name of primary vertex container.
Definition: JpsiPlusDsCascade.h:51
DerivationFramework::JpsiPlusDsCascade::m_iVertexFitter
ToolHandle< Trk::TrkVKalVrtFitter > m_iVertexFitter
Definition: JpsiPlusDsCascade.h:74
DerivationFramework::JpsiPlusDsCascade::m_vertexDxContainerKey
std::string m_vertexDxContainerKey
Definition: JpsiPlusDsCascade.h:48
DerivationFramework::BPhysPVCascadeTools::PrepareVertexLinks
static void PrepareVertexLinks(Trk::VxCascadeInfo *result, const xAOD::TrackParticleContainer *importedTrackCollection)
Definition: BPhysPVCascadeTools.cxx:204
MUON
xAOD::Muon MUON
D3PD INCLUDES.
Definition: TileCellFillerTool.h:37
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
DerivationFramework::TrackBag
std::vector< const xAOD::TrackParticle * > TrackBag
Definition: BPhysAddMuonBasedInvMass.h:32
xAOD::Vertex_v1::z
float z() const
Returns the z position.
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DerivationFramework::VertexLink
ElementLink< xAOD::VertexContainer > VertexLink
Definition: Cascade3Plus1.cxx:23
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
BPhysPVCascadeTools.h
JpsiPlusDsCascade.h
DerivationFramework::JpsiPlusDsCascade::~JpsiPlusDsCascade
~JpsiPlusDsCascade()
Definition: JpsiPlusDsCascade.cxx:469
DerivationFramework::BPhysPVCascadeTools
Definition: BPhysPVCascadeTools.h:34
DerivationFramework::JpsiPlusDsCascade::m_refPVContainerName
std::string m_refPVContainerName
Definition: JpsiPlusDsCascade.h:80
DerivationFramework::JpsiPlusDsCascade::m_vtx0Daug2MassHypo
double m_vtx0Daug2MassHypo
Definition: JpsiPlusDsCascade.h:62
DerivationFramework::JpsiPlusDsCascade::m_vtx1Daug2MassHypo
double m_vtx1Daug2MassHypo
Definition: JpsiPlusDsCascade.h:64
CascadeTools.h
DerivationFramework::JpsiPlusDsCascade::m_refitPV
bool m_refitPV
Definition: JpsiPlusDsCascade.h:79
IVertexFitter.h
VxCascadeInfo.h
DerivationFramework::JpsiPlusDsCascade::m_DoVertexType
int m_DoVertexType
Definition: JpsiPlusDsCascade.h:85
mc.mass_b
mass_b
Definition: mc.PhPy8EG_A14NNPDF23_gg4l_example.py:21
DerivationFramework::VertexLinkVector
std::vector< VertexLink > VertexLinkVector
Definition: Cascade3Plus1.cxx:24
VertexContainer.h
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::JpsiPlusDsCascade::m_mass_jpsi
double m_mass_jpsi
Definition: JpsiPlusDsCascade.h:67
DerivationFramework::JpsiPlusDsCascade::m_cascadeOutputsKeys
std::vector< std::string > m_cascadeOutputsKeys
Definition: JpsiPlusDsCascade.h:49
xAOD::Vertex_v1::y
float y() const
Returns the y position.
DerivationFramework::JpsiPlusDsCascade::m_vtx1Daug1MassHypo
double m_vtx1Daug1MassHypo
Definition: JpsiPlusDsCascade.h:63
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
DataVector::cbegin
const_iterator cbegin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
DerivationFramework::JpsiPlusDsCascade::m_jpsiMassUpper
double m_jpsiMassUpper
Definition: JpsiPlusDsCascade.h:54
AthAlgTool
Definition: AthAlgTool.h:26
DerivationFramework::JpsiPlusDsCascade::m_vtx0MassHypo
double m_vtx0MassHypo
Definition: JpsiPlusDsCascade.h:59
DerivationFramework::JpsiPlusDsCascade::m_eventInfo_key
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
Definition: JpsiPlusDsCascade.h:73
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DerivationFramework::JpsiPlusDsCascade::JpsiPlusDsCascade
JpsiPlusDsCascade(const std::string &t, const std::string &n, const IInterface *p)
Definition: JpsiPlusDsCascade.cxx:407
HepMCHelpers.h
xAOD::BPhysHypoHelper::setMassErr
bool setMassErr(const float val)
invariant mass error
Definition: BPhysHypoHelper.cxx:54
VertexAuxContainer.h
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
DerivationFramework::JpsiPlusDsCascade::m_DxMassLower
double m_DxMassLower
Definition: JpsiPlusDsCascade.h:55
DerivationFramework::JpsiPlusDsCascade::m_hypoName
std::string m_hypoName
name of the mass hypothesis.
Definition: JpsiPlusDsCascade.h:81