 |
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"
122 return StatusCode::SUCCESS;
136 jpsiContainer = handle.
cptr();
138 if (!jpsiContainer) {
140 return StatusCode::RECOVERABLE;
155 for (
const xAOD::Vertex* jpsiCandidate : *jpsiContainer) {
170 m_vx->push_back(jpsiCandidate->x());
171 m_vy->push_back(jpsiCandidate->y());
172 m_vz->push_back(jpsiCandidate->z());
187 double orig_mass = (origTrk1+origTrk2).M();
188 double mass = (refTrk1+refTrk2).M();
193 m_jpsiChi2->push_back(jpsiCandidate->chiSquared());
204 return StatusCode::SUCCESS;
213 std::cout <<
"===================" << std::endl;
214 std::cout <<
"SUMMARY OF ANALYSIS" << std::endl;
215 std::cout <<
"===================" << std::endl;
216 std::cout <<
" " << std::endl;
217 std::cout <<
"Total number of events analysed: " <<
m_eventCntr << std::endl;
218 std::cout <<
"Total number of jpsi candidates: " <<
m_jpsiCntr << std::endl;
225 return StatusCode::SUCCESS;
290 m_vx =
new std::vector<double>;
291 m_vy =
new std::vector<double>;
292 m_vz =
new std::vector<double>;
316 float px = 0.,
py = 0.,
pz = 0.;
331 const std::vector<float>& refTrackPx =
hx(*vxCandidate);
332 const std::vector<float>& refTrackPy =
hy(*vxCandidate);
333 const std::vector<float>& refTrackPz =
hz(*vxCandidate);
335 if(trkIndex < refTrackPx.size() && refTrackPx.size() == refTrackPy.size() && refTrackPz.size()) {
336 px = refTrackPx[trkIndex];
337 py = refTrackPy[trkIndex];
338 pz = refTrackPz[trkIndex];
352 TLorentzVector lorentz;
366 if(origTrack==NULL) {
370 mom.SetPtEtaPhi(origTrack->
pt(), origTrack->
eta(), origTrack->
phi());
381 TLorentzVector lorentz;
393 if (
masses.size() != NTrk) {
394 ATH_MSG_WARNING(
"The provided number of masses does not match the number of tracks in the vertex");
399 uint ndimExp = (3*NTrk+3)*(3*NTrk+3+1)/2;
400 if (ndim == ndimExp) {
403 ATH_MSG_WARNING(
"Unknown covariance matrix dimension: " << ndim <<
", expected: " << ndimExp);
419 std::vector<CLHEP::HepLorentzVector> particleMom(NTrk);
420 std::vector<CLHEP::HepMatrix> particleDeriv(NTrk);
421 CLHEP::HepLorentzVector totalMom;
422 CLHEP::HepMatrix tmpDeriv(3,3);
425 for(
unsigned int it=0;
it<NTrk;
it++){
434 double e = (esq>0.) ? sqrt(esq) : 0.;
436 particleMom[
it] =
tmp;
440 tmpDeriv(1,1) = -
tmp.py();
441 tmpDeriv(2,1) =
tmp.px();
445 tmpDeriv(3,2) = -
sin(
theta)/fabs(invP);
446 tmpDeriv(1,3) = -
tmp.px()/invP;
447 tmpDeriv(2,3) = -
tmp.py()/invP;
448 tmpDeriv(3,3) = -
tmp.pz()/invP;
449 particleDeriv[
it] = tmpDeriv;
452 double dMdPx=0., dMdPy=0., dMdPz=0., dMdPhi=0., dMdTheta=0., dMdInvP=0.;
453 std::vector<double> Deriv(3*NTrk+3, 0.);
454 for(
unsigned int it=0;
it<NTrk;
it++){
455 dMdPx = ( totalMom.e() * particleMom[
it].px()/particleMom[
it].e() - totalMom.px() ) / totalMom.m();
456 dMdPy = ( totalMom.e() * particleMom[
it].py()/particleMom[
it].e() - totalMom.py() ) / totalMom.m();
457 dMdPz = ( totalMom.e() * particleMom[
it].pz()/particleMom[
it].e() - totalMom.pz() ) / totalMom.m();
459 dMdPhi = dMdPx*particleDeriv[
it](1,1) + dMdPy*particleDeriv[
it](2,1) + dMdPz*particleDeriv[
it](3,1);
460 dMdTheta = dMdPx*particleDeriv[
it](1,2) + dMdPy*particleDeriv[
it](2,2) + dMdPz*particleDeriv[
it](3,2);
461 dMdInvP = dMdPx*particleDeriv[
it](1,3) + dMdPy*particleDeriv[
it](2,3) + dMdPz*particleDeriv[
it](3,3);
463 Deriv[3*
it + 3 + 0] = dMdPhi; Deriv[3*
it + 3 + 1] = dMdTheta; Deriv[3*
it + 3 + 2] = dMdInvP;
467 for(
unsigned int i=0;
i<3*NTrk+3;
i++){
468 for(
unsigned int j=0; j<3*NTrk+3; j++){
469 err += Deriv[
i]*( (*fullCov)(
i,j))*Deriv[j];
476 return (
err>0.) ? sqrt(
err) : 0.;
502 for(
int i=1;
i<=(3+3*NTrk);
i++){
503 for(
int j=1; j<=
i; j++){
507 (*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
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
StatusCode finalize() override
JpsiExample(const std::string &name, ISvcLocator *pSvcLocator)
constexpr double muonMassInMeV
the mass of the muon (in MeV)
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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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
constexpr double JpsiMassInMeV
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