ATLAS Offline Software
JpsiExample.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // JpsiExample.cxx
6 // Author: James Catmore (James.Catmore@cern.ch), E. Bouhova-Thacker (e.bouhova@cern.ch)
7 // This is an example showing the use of the JpsiFinder tool and alg, getting the actual Jpsis
8 // from StoreGate
9 
11 
13 #include "xAODTracking/Vertex.h"
16 #include "CLHEP/Vector/LorentzVector.h"
17 #include "CLHEP/Matrix/Vector.h"
18 #include "CLHEP/Matrix/Matrix.h"
19 #include "CLHEP/Matrix/SymMatrix.h"
20 #include "TFile.h"
21 #include "TTree.h"
22 #include "TVector3.h"
23 #include "TLorentzVector.h"
25 
27 
28 JpsiExample::JpsiExample(const std::string& name, ISvcLocator* pSvcLocator) :
29  AthAlgorithm(name, pSvcLocator),
30  m_muonMass(105.66)
31 {
32 
33  // Declare user-defined properties - cuts and vertexing method
34  declareProperty("muonMass" , m_muonMass);
35  declareProperty("outputNTupleName", m_userFName);
36  declareProperty("JpsiCandidates" ,m_JpsiCandidatesKey = "JpsiCandidates");
37 
38  declareProperty("RefTrackPx", m_refPX);
39  declareProperty("RefTrackPy", m_refPY);
40  declareProperty("RefTrackPz", m_refPZ);
41 
42  // Global Counters; for truth statistics
43  m_eventCntr = 0;
44  m_jpsiCntr = 0;
45 
46  m_jpsiMass = 0;
47  m_jpsiMassError = 0;
48  m_jpsiMassRec = 0;
50  m_jpsiMassPullMC = 0;
51  m_jpsiChi2 = 0;
52 
53  m_trkRefitPx1 = 0;
54  m_trkRefitPy1 = 0;
55  m_trkRefitPz1 = 0;
56  m_trkRefitPx2 = 0;
57  m_trkRefitPy2 = 0;
58  m_trkRefitPz2 = 0;
59 
60  m_vx = 0;
61  m_vy = 0;
62  m_vz = 0;
63 
64  m_trkOrigCharge1 = 0;
65  m_trkOrigPx1 = 0;
66  m_trkOrigPy1 = 0;
67  m_trkOrigPz1 = 0;
68  m_trkOrigCharge2 = 0;
69  m_trkOrigPx2 = 0;
70  m_trkOrigPy2 = 0;
71  m_trkOrigPz2 = 0;
72 
73  m_outputFile = 0;
74  m_auxTree = 0;
75 }
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
78 
80 
81 
82  ATH_MSG_DEBUG("in initialize()");
83 
84  // Open n-tuple file
85  m_outputFile = new TFile(m_userFName.c_str(),"recreate");
86  // Auxiliary n-tuples not covered by the automatic n-tuple makers
87  // Decay angles
88  initializeBranches(); //
89  m_auxTree = new TTree("AUX","AUX");
90  m_auxTree->Branch("jpsiMass", &m_jpsiMass);
91  m_auxTree->Branch("jpsiMassError", &m_jpsiMassError);
92  m_auxTree->Branch("jpsiMassRec", &m_jpsiMassRec);
93  m_auxTree->Branch("jpsiMassPullRec", &m_jpsiMassPullRec);
94  m_auxTree->Branch("jpsiMassPullMC", &m_jpsiMassPullMC);
95  m_auxTree->Branch("jpsiChi2", &m_jpsiChi2);
96 
97 // m_auxTree->Branch("trkRefitCharge1", &m_trkRefitCharge1);
98  m_auxTree->Branch("trkRefitPx1", &m_trkRefitPx1);
99  m_auxTree->Branch("trkRefitPy1", &m_trkRefitPy1);
100  m_auxTree->Branch("trkRefitPz1", &m_trkRefitPz1);
101 // m_auxTree->Branch("trkRefitCharge2", &m_trkRefitCharge2);
102  m_auxTree->Branch("trkRefitPx2", &m_trkRefitPx2);
103  m_auxTree->Branch("trkRefitPy2", &m_trkRefitPy2);
104  m_auxTree->Branch("trkRefitPz2", &m_trkRefitPz2);
105 
106  m_auxTree->Branch("vx",m_vx);
107  m_auxTree->Branch("vy",m_vy);
108  m_auxTree->Branch("vz",m_vz);
109 
110  m_auxTree->Branch("trkOrigCharge1", &m_trkOrigCharge1);
111  m_auxTree->Branch("trkOrigPx1", &m_trkOrigPx1);
112  m_auxTree->Branch("trkOrigPy1", &m_trkOrigPy1);
113  m_auxTree->Branch("trkOrigPz1", &m_trkOrigPz1);
114  m_auxTree->Branch("trkOrigCharge2", &m_trkOrigCharge2);
115  m_auxTree->Branch("trkOrigPx2", &m_trkOrigPx2);
116  m_auxTree->Branch("trkOrigPy2", &m_trkOrigPy2);
117  m_auxTree->Branch("trkOrigPz2", &m_trkOrigPz2);
118 
119 // m_auxTree->Branch("rxyError", &m_rxyError);
120  ATH_CHECK(m_JpsiCandidatesKey.initialize());
121  return StatusCode::SUCCESS;
122 
123 }
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
126 
128 
129 
130  ATH_MSG_DEBUG("in execute()");
131 
132  // Read in the Jpsis from StoreGate
133  const xAOD::VertexContainer* jpsiContainer(0);
135  jpsiContainer = handle.cptr();
136 
137  if (!jpsiContainer) {
138  ATH_MSG_ERROR("No Jpsi Container Found, skipping event");
139  return StatusCode::RECOVERABLE;
140  } else {
141  ATH_MSG_DEBUG("Obtained jpsiContainer");
142  }
143  ATH_MSG_DEBUG("number of jpsi candidates " << jpsiContainer->size());
144  m_jpsiCntr += jpsiContainer->size(); // Count the Jpsis
145 
146 
147  // Set the auxilliary branches of the ntuple to zero
148  // to avoid accumulation
149  clearBranches();
150 
151  ++m_eventCntr; // Increment event counter
152 
153  // Extract information from the Jpsi candidates
154  for (const xAOD::Vertex* jpsiCandidate : *jpsiContainer) {
155  //ATH_MSG_INFO("Cov. matrix " << jpsiCandidate->covariance().size());
156 
157  // refitted track parameters
158  TLorentzVector refTrk1 = track4Momentum(jpsiCandidate, 0, m_muonMass);
159  m_trkRefitPx1->push_back(refTrk1.Px());
160  m_trkRefitPy1->push_back(refTrk1.Py());
161  m_trkRefitPz1->push_back(refTrk1.Pz());
162 
163  TLorentzVector refTrk2 = track4Momentum(jpsiCandidate, 1, m_muonMass);
164  m_trkRefitPx2->push_back(refTrk2.Px());
165  m_trkRefitPy2->push_back(refTrk2.Py());
166  m_trkRefitPz2->push_back(refTrk2.Pz());
167 
168  //vertex position
169  m_vx->push_back(jpsiCandidate->x());
170  m_vy->push_back(jpsiCandidate->y());
171  m_vz->push_back(jpsiCandidate->z());
172 
173  TLorentzVector origTrk1 = origTrack4Momentum(jpsiCandidate, 0, m_muonMass);
174  m_trkOrigCharge1->push_back(trackCharge(jpsiCandidate, 0));
175  m_trkOrigPx1->push_back(origTrk1.Px());
176  m_trkOrigPy1->push_back(origTrk1.Py());
177  m_trkOrigPz1->push_back(origTrk1.Pz());
178 
179  TLorentzVector origTrk2 = origTrack4Momentum(jpsiCandidate, 1, m_muonMass);
180  m_trkOrigCharge2->push_back(trackCharge(jpsiCandidate, 1));
181  m_trkOrigPx2->push_back(origTrk2.Px());
182  m_trkOrigPy2->push_back(origTrk2.Py());
183  m_trkOrigPz2->push_back(origTrk2.Pz());
184 
185  // Calculate the invariant masses and their errors
186  double orig_mass = (origTrk1+origTrk2).M(); // mass from original tracks
187  double mass = (refTrk1+refTrk2).M(); // mass from refitted tracks
188  double error = invariantMassError(jpsiCandidate, std::vector<double>(2, m_muonMass)); // invariant mass error
189 
190  m_jpsiMass->push_back(mass);
191  m_jpsiMassError->push_back(error);
192  m_jpsiChi2->push_back(jpsiCandidate->chiSquared());
193  m_jpsiMassRec->push_back(orig_mass);
194  m_jpsiMassPullRec->push_back((mass-orig_mass)/error);
195  m_jpsiMassPullMC->push_back((mass-3096.88)/error);
196 
197  }
198 
199  // Write all data to the nTuple
200  m_auxTree->Fill();
201 
202  // END OF ANALYSIS
203  return StatusCode::SUCCESS;
204 }
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
207 
209 
210  ATH_MSG_DEBUG("in finalize()");
211 
212  std::cout << "===================" << std::endl;
213  std::cout << "SUMMARY OF ANALYSIS" << std::endl;
214  std::cout << "===================" << std::endl;
215  std::cout << " " << std::endl;
216  std::cout << "Total number of events analysed: " << m_eventCntr << std::endl;
217  std::cout << "Total number of jpsi candidates: " << m_jpsiCntr << std::endl;
218  // Save auxiliary n-tuple
219  m_outputFile->cd();
220  m_auxTree->Write();
221  m_auxTree->Print();
222  // Close file
223  m_outputFile->Close();
224  return StatusCode::SUCCESS;
225 }
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
228 
230 
231  m_jpsiMass->clear();
232  m_jpsiMassError->clear();
233  m_jpsiMassRec->clear();
234  m_jpsiMassPullRec->clear();
235  m_jpsiMassPullMC->clear();
236  m_jpsiChi2->clear();
237 
238 // m_trkRefitCharge1->clear();
239  m_trkRefitPx1->clear();
240  m_trkRefitPy1->clear();
241  m_trkRefitPz1->clear();
242 // m_trkRefitCharge2->clear();
243  m_trkRefitPx2->clear();
244  m_trkRefitPy2->clear();
245  m_trkRefitPz2->clear();
246 
247  m_vx->clear();
248  m_vy->clear();
249  m_vz->clear();
250 
251  m_trkOrigCharge1->clear();
252  m_trkOrigPx1->clear();
253  m_trkOrigPy1->clear();
254  m_trkOrigPz1->clear();
255  m_trkOrigCharge2->clear();
256  m_trkOrigPx2->clear();
257  m_trkOrigPy2->clear();
258  m_trkOrigPz2->clear();
259 
260 // m_rxyError->clear();
261 
262  return;
263 
264 }
265 
266 // ************************************************************************************************
267 // -------------------------------------------------------------------------------------------------
268 // initializeBranches - initializes branches of auxilliary ntuple
269 // -------------------------------------------------------------------------------------------------
270 
272 
273  m_jpsiMass = new std::vector<double>;
274  m_jpsiMassError = new std::vector<double>;
275  m_jpsiMassRec = new std::vector<double>;
276  m_jpsiMassPullRec = new std::vector<double>;
277  m_jpsiMassPullMC = new std::vector<double>;
278  m_jpsiChi2 = new std::vector<double>;
279 
280 // m_trkRefitCharge1 = new std::vector<double>;
281  m_trkRefitPx1 = new std::vector<double>;
282  m_trkRefitPy1 = new std::vector<double>;
283  m_trkRefitPz1 = new std::vector<double>;
284 // m_trkRefitCharge2 = new std::vector<double>;
285  m_trkRefitPx2 = new std::vector<double>;
286  m_trkRefitPy2 = new std::vector<double>;
287  m_trkRefitPz2 = new std::vector<double>;
288 
289  m_vx = new std::vector<double>;
290  m_vy = new std::vector<double>;
291  m_vz = new std::vector<double>;
292 
293  m_trkOrigCharge1 = new std::vector<double>;
294  m_trkOrigPx1 = new std::vector<double>;
295  m_trkOrigPy1 = new std::vector<double>;
296  m_trkOrigPz1 = new std::vector<double>;
297  m_trkOrigCharge2 = new std::vector<double>;
298  m_trkOrigPx2 = new std::vector<double>;
299  m_trkOrigPy2 = new std::vector<double>;
300  m_trkOrigPz2 = new std::vector<double>;
301 
302 // m_rxyError = new std::vector<double>;
303 
304  return;
305 
306 }
307 
308 // *********************************************************************************
309 // ---------------------------------------------------------------------------------
310 // trackMomentum: returns refitted track momentum
311 // ---------------------------------------------------------------------------------
312 
313 TVector3 JpsiExample::trackMomentum(const xAOD::Vertex * vxCandidate, uint trkIndex) const
314 {
315  float px = 0., py = 0., pz = 0.;
316 // assert(vxCandidate!=0);
317 // assert(i<vxCandidate->vxTrackAtVertex().size());
318 
319 // if (0 != vxCandidate) {
320 // const Trk::TrackParameters* aPerigee = vxCandidate->vxTrackAtVertex()[trkIndex].perigeeAtVertex();
321 // px = aPerigee->momentum()[Trk::px];
322 // py = aPerigee->momentum()[Trk::py];
323 // pz = aPerigee->momentum()[Trk::pz];
324 // }
325 
329 
330  const std::vector<float>& refTrackPx = hx(*vxCandidate);
331  const std::vector<float>& refTrackPy = hy(*vxCandidate);
332  const std::vector<float>& refTrackPz = hz(*vxCandidate);
333 
334  if(trkIndex < refTrackPx.size() && refTrackPx.size() == refTrackPy.size() && refTrackPz.size()) {
335  px = refTrackPx[trkIndex];
336  py = refTrackPy[trkIndex];
337  pz = refTrackPz[trkIndex];
338  }
339 
340  TVector3 mom(px,py,pz);
341  return mom;
342 }
343 
344 // ---------------------------------------------------------------------------------
345 // track4Momentum: returns refitted track 4-momentum given mass hypothesis
346 // ---------------------------------------------------------------------------------
347 
348 TLorentzVector JpsiExample::track4Momentum(const xAOD::Vertex * vxCandidate, int trkIndex, double mass) const
349 {
350  TVector3 mom = trackMomentum(vxCandidate, trkIndex);
351  TLorentzVector lorentz;
352  lorentz.SetVectM(mom, mass);
353  return lorentz;
354 }
355 
356 
357 // ---------------------------------------------------------------------------------
358 // origTrackMomentum: returns original track momentum
359 // ---------------------------------------------------------------------------------
360 
361 TVector3 JpsiExample::origTrackMomentum(const xAOD::Vertex * vxCandidate, int trkIndex) const
362 {
363  TVector3 mom;
364  const xAOD::TrackParticle* origTrack = vxCandidate->trackParticle(trkIndex);
365  if(origTrack==NULL) {
366  return mom;
367  }
368 
369  mom.SetPtEtaPhi(origTrack->pt(), origTrack->eta(), origTrack->phi());
370  return mom;
371 }
372 
373 // ---------------------------------------------------------------------------------
374 // origTrack4Momentum: returns original track 4-momentum given mass hypothesis
375 // ---------------------------------------------------------------------------------
376 
377 TLorentzVector JpsiExample::origTrack4Momentum(const xAOD::Vertex * vxCandidate, int trkIndex, double mass) const
378 {
379  TVector3 mom = origTrackMomentum(vxCandidate, trkIndex);
380  TLorentzVector lorentz;
381  lorentz.SetVectM(mom, mass);
382  return lorentz;
383 }
384 
385 // ---------------------------------------------------------------------------------
386 // invariantMassError: returns invariant mass error
387 // ---------------------------------------------------------------------------------
388 
389 double JpsiExample::invariantMassError(const xAOD::Vertex* vxCandidate, const std::vector<double> &masses) const
390 {
391  uint NTrk = vxCandidate->vxTrackAtVertex().size();
392  if (masses.size() != NTrk) {
393  ATH_MSG_WARNING("The provided number of masses does not match the number of tracks in the vertex");
394  return -999999.;
395  }
396 
397  uint ndim = vxCandidate->covariance().size();
398  uint ndimExp = (3*NTrk+3)*(3*NTrk+3+1)/2;
399  if (ndim == ndimExp) {
400  return massErrorVKalVrt(vxCandidate,masses);
401  } else {
402  ATH_MSG_WARNING("Unknown covariance matrix dimension: " << ndim << ", expected: " << ndimExp);
403  return -999999.;
404  }
405 }
406 
407 // ---------------------------------------------------------------------------------
408 // massErrorVKalVrt: returns invariant mass error for vertex created by VKalVrtFitter
409 // ---------------------------------------------------------------------------------
410 
411 double JpsiExample::massErrorVKalVrt(const xAOD::Vertex * vxCandidate, const std::vector<double> &masses) const
412 {
413  unsigned int NTrk = vxCandidate->vxTrackAtVertex().size();
414 
415  // construct the full covariance matrix
416  Amg::MatrixX* fullCov = convertVKalCovMatrix(NTrk, vxCandidate->covariance());
417 
418  std::vector<CLHEP::HepLorentzVector> particleMom(NTrk);
419  std::vector<CLHEP::HepMatrix> particleDeriv(NTrk);
420  CLHEP::HepLorentzVector totalMom;
421  CLHEP::HepMatrix tmpDeriv(3,3);
422 
423  double phi=0.,theta=0.,invP=0.;
424  for( unsigned int it=0; it<NTrk; it++){
425  const Trk::TrackParameters* bPer = vxCandidate->vxTrackAtVertex()[it].perigeeAtVertex();
426  phi = bPer->parameters()[Trk::phi];
427  theta = bPer->parameters()[Trk::theta];
428  invP = bPer->parameters()[Trk::qOverP];
429  CLHEP::HepLorentzVector tmp( cos(phi)*sin(theta)/fabs(invP),
430  sin(phi)*sin(theta)/fabs(invP),
431  cos(theta)/fabs(invP) );
432  double esq = tmp.px()*tmp.px() + tmp.py()*tmp.py() + tmp.pz()*tmp.pz() + masses[it]*masses[it];
433  double e = (esq>0.) ? sqrt(esq) : 0.;
434  tmp.setE(e);
435  particleMom[it] = tmp;
436  totalMom += tmp;
437 
438 // d(Px,Py,Pz)/d(Phi,Theta,InvP)
439  tmpDeriv(1,1) = - tmp.py();
440  tmpDeriv(2,1) = tmp.px();
441  tmpDeriv(3,1) = 0.;
442  tmpDeriv(1,2) = cos(phi) * tmp.pz();
443  tmpDeriv(2,2) = sin(phi) * tmp.pz();
444  tmpDeriv(3,2) = - sin(theta)/fabs(invP);
445  tmpDeriv(1,3) = - tmp.px()/invP;
446  tmpDeriv(2,3) = - tmp.py()/invP;
447  tmpDeriv(3,3) = - tmp.pz()/invP;
448  particleDeriv[it] = tmpDeriv;
449  }
450 
451  double dMdPx=0., dMdPy=0., dMdPz=0., dMdPhi=0., dMdTheta=0., dMdInvP=0.;
452  std::vector<double> Deriv(3*NTrk+3, 0.);
453  for(unsigned int it=0; it<NTrk; it++){
454  dMdPx = ( totalMom.e() * particleMom[it].px()/particleMom[it].e() - totalMom.px() ) / totalMom.m();
455  dMdPy = ( totalMom.e() * particleMom[it].py()/particleMom[it].e() - totalMom.py() ) / totalMom.m();
456  dMdPz = ( totalMom.e() * particleMom[it].pz()/particleMom[it].e() - totalMom.pz() ) / totalMom.m();
457 
458  dMdPhi = dMdPx*particleDeriv[it](1,1) + dMdPy*particleDeriv[it](2,1) + dMdPz*particleDeriv[it](3,1);
459  dMdTheta = dMdPx*particleDeriv[it](1,2) + dMdPy*particleDeriv[it](2,2) + dMdPz*particleDeriv[it](3,2);
460  dMdInvP = dMdPx*particleDeriv[it](1,3) + dMdPy*particleDeriv[it](2,3) + dMdPz*particleDeriv[it](3,3);
461 
462  Deriv[3*it + 3 + 0] = dMdPhi; Deriv[3*it + 3 + 1] = dMdTheta; Deriv[3*it + 3 + 2] = dMdInvP;
463  }
464 
465  double err = 0;
466  for(unsigned int i=0; i<3*NTrk+3; i++){
467  for(unsigned int j=0; j<3*NTrk+3; j++){
468  err += Deriv[i]*( (*fullCov)(i,j))*Deriv[j];
469  }
470  }
471 
472  // cleanup
473  delete fullCov;
474 
475  return (err>0.) ? sqrt(err) : 0.;
476 }
477 
478 // ---------------------------------------------------------------------------------
479 // trackCharge: returns charge of the i-th track
480 // ---------------------------------------------------------------------------------
481 
482 double JpsiExample::trackCharge(const xAOD::Vertex * vxCandidate, int i) const
483 {
484  if(vxCandidate!=NULL && vxCandidate->trackParticle(i)!=NULL) {
485  return vxCandidate->trackParticle(i)->charge();
486  }
487 
488  return -999999;
489 }
490 
491 // ---------------------------------------------------------------------------------
492 // convertVKalCovMatrix: converts xAOD covariance matrix (i.e. std::vector<float>)
493 // into an actual matrix
494 // ---------------------------------------------------------------------------------
495 
496 Amg::MatrixX * JpsiExample::convertVKalCovMatrix(int NTrk, const std::vector<float> & Matrix) const
497 {
498  // stolen from VKalVrtFitter
499  Amg::MatrixX * mtx = new Amg::MatrixX(3+3*NTrk,3+3*NTrk);
500  long int ij=0;
501  for(int i=1; i<=(3+3*NTrk); i++){
502  for(int j=1; j<=i; j++){
503  if(i==j) {
504  (*mtx)(i-1,j-1)=Matrix[ij];
505  }else{
506  (*mtx).fillSymmetric(i-1,j-1,Matrix[ij]);
507  }
508  ij++;
509  }
510  }
511 
512  return mtx;
513 }
Matrix
Definition: Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/Matrix.h:15
JpsiExample::m_trkOrigPz2
std::vector< double > * m_trkOrigPz2
Definition: JpsiExample.h:78
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
JpsiExample::m_trkRefitPy2
std::vector< double > * m_trkRefitPy2
Definition: JpsiExample.h:64
JpsiExample::m_trkOrigPy2
std::vector< double > * m_trkOrigPy2
Definition: JpsiExample.h:77
JpsiExample::m_vz
std::vector< double > * m_vz
Definition: JpsiExample.h:69
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
test_pyathena.px
px
Definition: test_pyathena.py:18
JpsiExample::m_eventCntr
int m_eventCntr
Definition: JpsiExample.h:48
JpsiExample::trackCharge
double trackCharge(const xAOD::Vertex *vxCandidate, int i) const
Definition: JpsiExample.cxx:482
JpsiExample::m_vy
std::vector< double > * m_vy
Definition: JpsiExample.h:68
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
JpsiExample::m_refPX
SG::ReadDecorHandleKey< xAOD::VertexContainer > m_refPX
Definition: JpsiExample.h:87
JpsiExample::origTrack4Momentum
TLorentzVector origTrack4Momentum(const xAOD::Vertex *vxCandidate, int trkIndex, double mass) const
Definition: JpsiExample.cxx:377
JpsiExample::m_trkRefitPz2
std::vector< double > * m_trkRefitPz2
Definition: JpsiExample.h:65
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
JpsiExample::m_jpsiMassError
std::vector< double > * m_jpsiMassError
Definition: JpsiExample.h:52
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:150
JpsiExample::m_trkOrigPy1
std::vector< double > * m_trkOrigPy1
Definition: JpsiExample.h:73
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
JpsiExample::finalize
StatusCode finalize() override
Definition: JpsiExample.cxx:208
JpsiExample::JpsiExample
JpsiExample(const std::string &name, ISvcLocator *pSvcLocator)
Definition: JpsiExample.cxx:28
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
JpsiExample::m_userFName
std::string m_userFName
Definition: JpsiExample.h:46
JpsiExample::m_refPY
SG::ReadDecorHandleKey< xAOD::VertexContainer > m_refPY
Definition: JpsiExample.h:88
skel.it
it
Definition: skel.GENtoEVGEN.py:423
JpsiExample::m_trkOrigCharge1
std::vector< double > * m_trkOrigCharge1
Definition: JpsiExample.h:71
JpsiExample::m_trkRefitPy1
std::vector< double > * m_trkRefitPy1
Definition: JpsiExample.h:60
JpsiExample::m_muonMass
double m_muonMass
Definition: JpsiExample.h:45
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
JpsiExample::m_trkOrigPx2
std::vector< double > * m_trkOrigPx2
Definition: JpsiExample.h:76
JpsiExample::m_jpsiMassRec
std::vector< double > * m_jpsiMassRec
Definition: JpsiExample.h:53
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
JpsiExample::invariantMassError
double invariantMassError(const xAOD::Vertex *vxCandidate, const std::vector< double > &masses) const
Definition: JpsiExample.cxx:389
JpsiExample::origTrackMomentum
TVector3 origTrackMomentum(const xAOD::Vertex *vxCandidate, int trkIndex) const
Definition: JpsiExample.cxx:361
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
fitman.hy
def hy
Definition: fitman.py:515
JpsiExample::m_outputFile
TFile * m_outputFile
Definition: JpsiExample.h:83
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
lumiFormat.i
int i
Definition: lumiFormat.py:92
Trk::theta
@ theta
Definition: ParamDefs.h:72
JpsiExample::m_trkRefitPx1
std::vector< double > * m_trkRefitPx1
Definition: JpsiExample.h:59
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
JpsiExample::convertVKalCovMatrix
Amg::MatrixX * convertVKalCovMatrix(int NTrk, const std::vector< float > &Matrix) const
Definition: JpsiExample.cxx:496
JpsiExample::initializeBranches
void initializeBranches(void)
Definition: JpsiExample.cxx:271
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
VxTrackAtVertex.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
JpsiExample::m_trkRefitPz1
std::vector< double > * m_trkRefitPz1
Definition: JpsiExample.h:61
JpsiExample::track4Momentum
TLorentzVector track4Momentum(const xAOD::Vertex *vxCandidate, int trkIndex, double mass) const
Definition: JpsiExample.cxx:348
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
Trk::ParametersBase
Definition: ParametersBase.h:55
JpsiExample::m_jpsiMass
std::vector< double > * m_jpsiMass
Definition: JpsiExample.h:51
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Vertex.h
AthAlgorithm
Definition: AthAlgorithm.h:47
JpsiExample::m_auxTree
TTree * m_auxTree
Definition: JpsiExample.h:84
Amg::py
@ py
Definition: GeoPrimitives.h:39
JpsiExample::m_jpsiCntr
int m_jpsiCntr
Definition: JpsiExample.h:49
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
JpsiExample::m_trkOrigPz1
std::vector< double > * m_trkOrigPz1
Definition: JpsiExample.h:74
JpsiExample::m_jpsiChi2
std::vector< double > * m_jpsiChi2
Definition: JpsiExample.h:56
JpsiExample::m_trkOrigCharge2
std::vector< double > * m_trkOrigCharge2
Definition: JpsiExample.h:75
JpsiExample::m_jpsiMassPullMC
std::vector< double > * m_jpsiMassPullMC
Definition: JpsiExample.h:55
JpsiExample::initialize
StatusCode initialize() override
Definition: JpsiExample.cxx:79
JpsiExample::clearBranches
void clearBranches(void)
Definition: JpsiExample.cxx:229
TrackParticle.h
JpsiExample::massErrorVKalVrt
double massErrorVKalVrt(const xAOD::Vertex *vxCandidate, const std::vector< double > &masses) const
Definition: JpsiExample.cxx:411
xAOD::Vertex_v1::covariance
const std::vector< float > & covariance() const
Returns the covariance matrix as a simple vector of values.
VertexContainer.h
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
JpsiExample::m_vx
std::vector< double > * m_vx
Definition: JpsiExample.h:67
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
JpsiExample::m_trkOrigPx1
std::vector< double > * m_trkOrigPx1
Definition: JpsiExample.h:72
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
JpsiExample::execute
StatusCode execute() override
Definition: JpsiExample.cxx:127
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
fitman.hx
def hx
Definition: fitman.py:514
JpsiExample.h
JpsiExample::m_JpsiCandidatesKey
SG::ReadHandleKey< xAOD::VertexContainer > m_JpsiCandidatesKey
Name of J/psi container.
Definition: JpsiExample.h:86
ReadDecorHandle.h
Handle class for reading a decoration on an object.
Trk::phi
@ phi
Definition: ParamDefs.h:81
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
fitman.hz
def hz
Definition: fitman.py:516
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
xAOD::Vertex_v1::vxTrackAtVertex
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
Definition: Vertex_v1.cxx:181
error
Definition: IImpactPoint3dEstimator.h:70
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
JpsiExample::m_jpsiMassPullRec
std::vector< double > * m_jpsiMassPullRec
Definition: JpsiExample.h:54
JpsiExample::m_refPZ
SG::ReadDecorHandleKey< xAOD::VertexContainer > m_refPZ
Definition: JpsiExample.h:89
JpsiExample::trackMomentum
TVector3 trackMomentum(const xAOD::Vertex *vxCandidate, uint trkIndex) const
Definition: JpsiExample.cxx:313
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
SUSY_SimplifiedModel_PreInclude.masses
dictionary masses
Definition: SUSY_SimplifiedModel_PreInclude.py:7
JpsiExample::m_trkRefitPx2
std::vector< double > * m_trkRefitPx2
Definition: JpsiExample.h:63