CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions
TwoBodyDecayLinearizationPointFinder Class Reference

#include <TwoBodyDecayLinearizationPointFinder.h>

Public Types

typedef PerigeeLinearizedTrackState::RefCountedLinearizedTrackState RefCountedLinearizedTrackState
 

Public Member Functions

virtual TwoBodyDecayLinearizationPointFinderclone (void) const
 
virtual const TwoBodyDecayParameters getLinearizationPoint (const std::vector< RefCountedLinearizedTrackState > &tracks, const double primaryMass, const double secondaryMass) const
 
 TwoBodyDecayLinearizationPointFinder (const edm::ParameterSet &config)
 
virtual ~TwoBodyDecayLinearizationPointFinder (void)
 

Detailed Description

Class TwoBodyDecayLinearizationPointFinder computes a rough estimate of the parameters of a decay. This serves as linearization point for TwoBodyDecayEstimator.

/author Edmund Widl

Definition at line 15 of file TwoBodyDecayLinearizationPointFinder.h.

Member Typedef Documentation

◆ RefCountedLinearizedTrackState

Definition at line 17 of file TwoBodyDecayLinearizationPointFinder.h.

Constructor & Destructor Documentation

◆ TwoBodyDecayLinearizationPointFinder()

TwoBodyDecayLinearizationPointFinder::TwoBodyDecayLinearizationPointFinder ( const edm::ParameterSet config)
inline

Definition at line 19 of file TwoBodyDecayLinearizationPointFinder.h.

19 {}

Referenced by clone().

◆ ~TwoBodyDecayLinearizationPointFinder()

virtual TwoBodyDecayLinearizationPointFinder::~TwoBodyDecayLinearizationPointFinder ( void  )
inlinevirtual

Definition at line 21 of file TwoBodyDecayLinearizationPointFinder.h.

21 {}

Member Function Documentation

◆ clone()

virtual TwoBodyDecayLinearizationPointFinder* TwoBodyDecayLinearizationPointFinder::clone ( void  ) const
inlinevirtual

Definition at line 27 of file TwoBodyDecayLinearizationPointFinder.h.

27  {
28  return new TwoBodyDecayLinearizationPointFinder(*this);
29  }

References TwoBodyDecayLinearizationPointFinder().

◆ getLinearizationPoint()

const TwoBodyDecayParameters TwoBodyDecayLinearizationPointFinder::getLinearizationPoint ( const std::vector< RefCountedLinearizedTrackState > &  tracks,
const double  primaryMass,
const double  secondaryMass 
) const
virtual

Definition at line 6 of file TwoBodyDecayLinearizationPointFinder.cc.

9  {
10  GlobalPoint linPoint = tracks[0]->linearizationPoint();
11  PerigeeLinearizedTrackState *linTrack1 = dynamic_cast<PerigeeLinearizedTrackState *>(tracks[0].get());
12  PerigeeLinearizedTrackState *linTrack2 = dynamic_cast<PerigeeLinearizedTrackState *>(tracks[1].get());
13  if (!linTrack1 || !linTrack2)
14  return TwoBodyDecayParameters();
15 
16  GlobalVector firstMomentum = linTrack1->predictedState().momentum();
17  GlobalVector secondMomentum = linTrack2->predictedState().momentum();
18 
19  AlgebraicVector secondaryMomentum1(3);
20  secondaryMomentum1[0] = firstMomentum.x();
21  secondaryMomentum1[1] = firstMomentum.y();
22  secondaryMomentum1[2] = firstMomentum.z();
23 
24  AlgebraicVector secondaryMomentum2(3);
25  secondaryMomentum2[0] = secondMomentum.x();
26  secondaryMomentum2[1] = secondMomentum.y();
27  secondaryMomentum2[2] = secondMomentum.z();
28 
29  AlgebraicVector primaryMomentum = secondaryMomentum1 + secondaryMomentum2;
30 
32  AlgebraicMatrix rotMat = decayModel.rotationMatrix(primaryMomentum[0], primaryMomentum[1], primaryMomentum[2]);
33  AlgebraicMatrix invRotMat = rotMat.T();
34 
35  double p = primaryMomentum.norm();
36  double pSquared = p * p;
37  double gamma = sqrt(pSquared + primaryMass * primaryMass) / primaryMass;
38  double betaGamma = p / primaryMass;
39  AlgebraicSymMatrix lorentzTransformation(4, 1);
40  lorentzTransformation[0][0] = gamma;
41  lorentzTransformation[3][3] = gamma;
42  lorentzTransformation[0][3] = -betaGamma;
43 
44  double p1 = secondaryMomentum1.norm();
45  AlgebraicVector boostedLorentzMomentum1(4);
46  boostedLorentzMomentum1[0] = sqrt(p1 * p1 + secondaryMass * secondaryMass);
47  boostedLorentzMomentum1.sub(2, invRotMat * secondaryMomentum1);
48 
49  AlgebraicVector restFrameLorentzMomentum1 = lorentzTransformation * boostedLorentzMomentum1;
50  AlgebraicVector restFrameMomentum1 = restFrameLorentzMomentum1.sub(2, 4);
51  double perp1 = sqrt(restFrameMomentum1[0] * restFrameMomentum1[0] + restFrameMomentum1[1] * restFrameMomentum1[1]);
52  double theta1 = atan2(perp1, restFrameMomentum1[2]);
53  double phi1 = atan2(restFrameMomentum1[1], restFrameMomentum1[0]);
54 
55  double p2 = secondaryMomentum2.norm();
56  AlgebraicVector boostedLorentzMomentum2(4);
57  boostedLorentzMomentum2[0] = sqrt(p2 * p2 + secondaryMass * secondaryMass);
58  boostedLorentzMomentum2.sub(2, invRotMat * secondaryMomentum2);
59 
60  AlgebraicVector restFrameLorentzMomentum2 = lorentzTransformation * boostedLorentzMomentum2;
61  AlgebraicVector restFrameMomentum2 = restFrameLorentzMomentum2.sub(2, 4);
62  double perp2 = sqrt(restFrameMomentum2[0] * restFrameMomentum2[0] + restFrameMomentum2[1] * restFrameMomentum2[1]);
63  double theta2 = atan2(perp2, restFrameMomentum2[2]);
64  double phi2 = atan2(restFrameMomentum2[1], restFrameMomentum2[0]);
65 
66  double pi = 3.141592654;
67  double relSign = -1.;
68 
69  if (phi1 < 0)
70  phi1 += 2 * pi;
71  if (phi2 < 0)
72  phi2 += 2 * pi;
73  if (phi1 > phi2)
74  relSign = 1.;
75 
76  double momentumSquared1 = secondaryMomentum1.normsq();
77  double energy1 = sqrt(secondaryMass * secondaryMass + momentumSquared1);
78  double momentumSquared2 = secondaryMomentum2.normsq();
79  double energy2 = sqrt(secondaryMass * secondaryMass + momentumSquared2);
80  double sumMomentaSquared = (secondaryMomentum1 + secondaryMomentum2).normsq();
81  double sumEnergiesSquared = (energy1 + energy2) * (energy1 + energy2);
82  double estimatedPrimaryMass = sqrt(sumEnergiesSquared - sumMomentaSquared);
83 
85  linParam[TwoBodyDecayParameters::x] = linPoint.x();
86  linParam[TwoBodyDecayParameters::y] = linPoint.y();
87  linParam[TwoBodyDecayParameters::z] = linPoint.z();
88  linParam[TwoBodyDecayParameters::px] = primaryMomentum[0];
89  linParam[TwoBodyDecayParameters::py] = primaryMomentum[1];
90  linParam[TwoBodyDecayParameters::pz] = primaryMomentum[2];
91  linParam[TwoBodyDecayParameters::theta] = 0.5 * (theta1 - theta2 + pi);
92  linParam[TwoBodyDecayParameters::phi] = 0.5 * (phi1 + phi2 + relSign * pi);
93  linParam[TwoBodyDecayParameters::mass] = estimatedPrimaryMass;
94 
95  return TwoBodyDecayParameters(linParam);
96 }

References TwoBodyDecayParameters::dimension, CustomPhysics_cfi::gamma, get, TwoBodyDecayParameters::mass, TrajectoryStateClosestToPoint::momentum(), AlCaHLTBitMon_ParallelJobs::p, p1, p2, perp2(), TwoBodyDecayParameters::phi, pi, PerigeeLinearizedTrackState::predictedState(), TwoBodyDecayConstraintProducer_cff::primaryMass, TwoBodyDecayParameters::px, TwoBodyDecayParameters::py, TwoBodyDecayParameters::pz, TwoBodyDecayModel::rotationMatrix(), TwoBodyDecayConstraintProducer_cff::secondaryMass, mathSSE::sqrt(), TwoBodyDecayParameters::theta, tracks, TwoBodyDecayParameters::x, PV3DBase< T, PVType, FrameType >::x(), TwoBodyDecayParameters::y, PV3DBase< T, PVType, FrameType >::y(), TwoBodyDecayParameters::z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by TwoBodyDecayFitter::estimate().

Vector3DBase
Definition: Vector3DBase.h:8
PerigeeLinearizedTrackState::predictedState
const TrajectoryStateClosestToPoint & predictedState() const
Definition: PerigeeLinearizedTrackState.h:212
TwoBodyDecayConstraintProducer_cff.secondaryMass
secondaryMass
Definition: TwoBodyDecayConstraintProducer_cff.py:11
TwoBodyDecayParameters::phi
Definition: TwoBodyDecayParameters.h:17
TwoBodyDecayParameters::dimension
Definition: TwoBodyDecayParameters.h:19
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
TwoBodyDecayParameters::mass
Definition: TwoBodyDecayParameters.h:17
CustomPhysics_cfi.gamma
gamma
Definition: CustomPhysics_cfi.py:17
TwoBodyDecayConstraintProducer_cff.primaryMass
primaryMass
Define the TBD.
Definition: TwoBodyDecayConstraintProducer_cff.py:9
TwoBodyDecayParameters::pz
Definition: TwoBodyDecayParameters.h:17
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
p2
double p2[4]
Definition: TauolaWrapper.h:90
TwoBodyDecayParameters::theta
Definition: TwoBodyDecayParameters.h:17
Point3DBase< float, GlobalTag >
TwoBodyDecayModel
Definition: TwoBodyDecayModel.h:15
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
TwoBodyDecayParameters
Definition: TwoBodyDecayParameters.h:14
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
TwoBodyDecayParameters::z
Definition: TwoBodyDecayParameters.h:17
p1
double p1[4]
Definition: TauolaWrapper.h:89
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
perp2
T perp2() const
Squared magnitude of transverse component.
Definition: Basic3DVectorLD.h:130
get
#define get
TwoBodyDecayParameters::y
Definition: TwoBodyDecayParameters.h:17
TwoBodyDecayParameters::x
Definition: TwoBodyDecayParameters.h:17
TwoBodyDecayParameters::py
Definition: TwoBodyDecayParameters.h:17
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
TwoBodyDecayParameters::px
Definition: TwoBodyDecayParameters.h:17
TwoBodyDecayLinearizationPointFinder::TwoBodyDecayLinearizationPointFinder
TwoBodyDecayLinearizationPointFinder(const edm::ParameterSet &config)
Definition: TwoBodyDecayLinearizationPointFinder.h:19
pi
const Double_t pi
Definition: trackSplitPlot.h:36
PerigeeLinearizedTrackState
Definition: PerigeeLinearizedTrackState.h:33
TrajectoryStateClosestToPoint::momentum
GlobalVector momentum() const
Definition: TrajectoryStateClosestToPoint.h:92