|
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include "CLHEP/Vector/LorentzVector.h"
17 #include "CLHEP/Matrix/Vector.h"
18 #include "CLHEP/Matrix/Matrix.h"
19 #include "CLHEP/Matrix/SymMatrix.h"
23 #include "TLorentzVector.h"
121 return StatusCode::SUCCESS;
135 jpsiContainer = handle.
cptr();
137 if (!jpsiContainer) {
139 return StatusCode::RECOVERABLE;
154 for (
const xAOD::Vertex* jpsiCandidate : *jpsiContainer) {
169 m_vx->push_back(jpsiCandidate->x());
170 m_vy->push_back(jpsiCandidate->y());
171 m_vz->push_back(jpsiCandidate->z());
186 double orig_mass = (origTrk1+origTrk2).M();
187 double mass = (refTrk1+refTrk2).M();
192 m_jpsiChi2->push_back(jpsiCandidate->chiSquared());
203 return StatusCode::SUCCESS;
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;
224 return StatusCode::SUCCESS;
289 m_vx =
new std::vector<double>;
290 m_vy =
new std::vector<double>;
291 m_vz =
new std::vector<double>;
315 float px = 0.,
py = 0.,
pz = 0.;
330 const std::vector<float>& refTrackPx =
hx(*vxCandidate);
331 const std::vector<float>& refTrackPy =
hy(*vxCandidate);
332 const std::vector<float>& refTrackPz =
hz(*vxCandidate);
334 if(trkIndex < refTrackPx.size() && refTrackPx.size() == refTrackPy.size() && refTrackPz.size()) {
335 px = refTrackPx[trkIndex];
336 py = refTrackPy[trkIndex];
337 pz = refTrackPz[trkIndex];
351 TLorentzVector lorentz;
365 if(origTrack==NULL) {
369 mom.SetPtEtaPhi(origTrack->
pt(), origTrack->
eta(), origTrack->
phi());
380 TLorentzVector lorentz;
392 if (
masses.size() != NTrk) {
393 ATH_MSG_WARNING(
"The provided number of masses does not match the number of tracks in the vertex");
398 uint ndimExp = (3*NTrk+3)*(3*NTrk+3+1)/2;
399 if (ndim == ndimExp) {
402 ATH_MSG_WARNING(
"Unknown covariance matrix dimension: " << ndim <<
", expected: " << ndimExp);
418 std::vector<CLHEP::HepLorentzVector> particleMom(NTrk);
419 std::vector<CLHEP::HepMatrix> particleDeriv(NTrk);
420 CLHEP::HepLorentzVector totalMom;
421 CLHEP::HepMatrix tmpDeriv(3,3);
424 for(
unsigned int it=0;
it<NTrk;
it++){
433 double e = (esq>0.) ? sqrt(esq) : 0.;
435 particleMom[
it] =
tmp;
439 tmpDeriv(1,1) = -
tmp.py();
440 tmpDeriv(2,1) =
tmp.px();
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;
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();
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);
462 Deriv[3*
it + 3 + 0] = dMdPhi; Deriv[3*
it + 3 + 1] = dMdTheta; Deriv[3*
it + 3 + 2] = dMdInvP;
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];
475 return (
err>0.) ? sqrt(
err) : 0.;
501 for(
int i=1;
i<=(3+3*NTrk);
i++){
502 for(
int j=1; j<=
i; j++){
506 (*mtx).fillSymmetric(
i-1,j-1,
Matrix[ij]);
std::vector< double > * m_trkOrigPz2
virtual double pt() const override final
The transverse momentum ( ) of the particle.
std::vector< double > * m_trkRefitPy2
std::vector< double > * m_trkOrigPy2
std::vector< double > * m_vz
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
double trackCharge(const xAOD::Vertex *vxCandidate, int i) const
std::vector< double > * m_vy
Scalar phi() const
phi method
SG::ReadDecorHandleKey< xAOD::VertexContainer > m_refPX
TLorentzVector origTrack4Momentum(const xAOD::Vertex *vxCandidate, int trkIndex, double mass) const
std::vector< double > * m_trkRefitPz2
const_pointer_type cptr()
Dereference the pointer.
std::vector< double > * m_jpsiMassError
float charge() const
Returns the charge.
std::vector< double > * m_trkOrigPy1
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
StatusCode finalize() override
JpsiExample(const std::string &name, ISvcLocator *pSvcLocator)
Scalar theta() const
theta method
SG::ReadDecorHandleKey< xAOD::VertexContainer > m_refPY
std::vector< double > * m_trkOrigCharge1
std::vector< double > * m_trkRefitPy1
std::vector< double > * m_trkOrigPx2
std::vector< double > * m_jpsiMassRec
double invariantMassError(const xAOD::Vertex *vxCandidate, const std::vector< double > &masses) const
TVector3 origTrackMomentum(const xAOD::Vertex *vxCandidate, int trkIndex) const
Handle class for reading a decoration on an object.
std::vector< double > * m_trkRefitPx1
::StatusCode StatusCode
StatusCode definition for legacy code.
Amg::MatrixX * convertVKalCovMatrix(int NTrk, const std::vector< float > &Matrix) const
void initializeBranches(void)
std::vector< double > * m_trkRefitPz1
TLorentzVector track4Momentum(const xAOD::Vertex *vxCandidate, int trkIndex, double mass) const
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
std::vector< double > * m_jpsiMass
std::vector< double > * m_trkOrigPz1
std::vector< double > * m_jpsiChi2
std::vector< double > * m_trkOrigCharge2
std::vector< double > * m_jpsiMassPullMC
StatusCode initialize() override
double massErrorVKalVrt(const xAOD::Vertex *vxCandidate, const std::vector< double > &masses) const
const std::vector< float > & covariance() const
Returns the covariance matrix as a simple vector of values.
std::vector< double > * m_vx
Class describing a Vertex.
std::vector< double > * m_trkOrigPx1
#define ATH_MSG_WARNING(x)
StatusCode execute() override
SG::ReadHandleKey< xAOD::VertexContainer > m_JpsiCandidatesKey
Name of J/psi container.
Handle class for reading a decoration on an object.
Class describing a TrackParticle.
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
size_type size() const noexcept
Returns the number of elements in the collection.
std::vector< double > * m_jpsiMassPullRec
SG::ReadDecorHandleKey< xAOD::VertexContainer > m_refPZ
TVector3 trackMomentum(const xAOD::Vertex *vxCandidate, uint trkIndex) const
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
std::vector< double > * m_trkRefitPx2