10 : thePrimaryMass(mPrimary), theSecondaryMass(mSecondary) {}
21 std::pair<AlgebraicMatrix, AlgebraicMatrix>
dqsdpx = this->
dqsdpx(param);
22 std::pair<AlgebraicMatrix, AlgebraicMatrix>
dqsdpy = this->
dqsdpy(param);
23 std::pair<AlgebraicMatrix, AlgebraicMatrix>
dqsdpz = this->
dqsdpz(param);
25 std::pair<AlgebraicMatrix, AlgebraicMatrix>
dqsdphi = this->
dqsdphi(param);
26 std::pair<AlgebraicMatrix, AlgebraicMatrix>
dqsdm = this->
dqsdm(param);
29 dqplusdz.sub(1,
px, dqsdpx.first);
30 dqplusdz.sub(1,
py, dqsdpy.first);
31 dqplusdz.sub(1,
pz, dqsdpz.first);
32 dqplusdz.sub(1,
theta, dqsdtheta.first);
33 dqplusdz.sub(1,
phi, dqsdphi.first);
34 dqplusdz.sub(1,
mass, dqsdm.first);
37 dqminusdz.sub(1,
px, dqsdpx.second);
38 dqminusdz.sub(1,
py, dqsdpy.second);
39 dqminusdz.sub(1,
pz, dqsdpz.second);
40 dqminusdz.sub(1,
theta, dqsdtheta.second);
41 dqminusdz.sub(1,
phi, dqsdphi.second);
42 dqminusdz.sub(1,
mass, dqsdm.second);
44 return std::make_pair(dqplusdz, dqminusdz);
48 const TwoBodyDecay &tbd,
const std::vector<bool> &selector)
const {
55 throw cms::Exception(
"BadConfig") <<
"@SUB=TwoBodyDecayDerivatives::selectedDerivatives" 56 <<
"selector has bad dimension (size=" << selector.size() <<
").";
59 int nSelected =
std::count(selector.begin(), selector.end(),
true);
64 std::pair<AlgebraicMatrix, AlgebraicMatrix>
dqsdzi;
69 dqplusdz.sub(1, iSelected, dqsdzi.first);
70 dqminusdz.sub(1, iSelected, dqsdzi.second);
75 return std::make_pair(dqplusdz, dqminusdz);
87 double pT2 = px * px + py *
py;
88 double p2 = pT2 + pz *
pz;
92 double sphi =
sin(phi);
93 double cphi =
cos(phi);
94 double stheta =
sin(theta);
95 double ctheta =
cos(theta);
99 double c2 =
sqrt(c1 * c1 - 1.);
100 double c3 = 0.5 * c2 * ctheta /
c1;
107 pplus[2][0] = 0.5 * p + c3 * c4;
111 pminus[0][0] = -pplus[0][0];
112 pminus[1][0] = -pplus[1][0];
113 pminus[2][0] = 0.5 * p - c3 * c4;
118 dRotMatdpx[0][0] = pz / (pT *
p) * (1. - px * px * (1. / pT2 + 1. / p2));
119 dRotMatdpx[0][1] = px * py / (pT * pT2);
120 dRotMatdpx[0][2] = (1. - px * px /
p2) / p;
122 dRotMatdpx[1][0] = -px * py * pz / (pT *
p) * (1. / pT2 + 1. / p2);
123 dRotMatdpx[1][1] = (1. - px * px / pT2) / pT;
124 dRotMatdpx[1][2] = -px * py / (p *
p2);
126 dRotMatdpx[2][0] = -(1. / pT - pT /
p2) * px / p;
127 dRotMatdpx[2][1] = 0.;
128 dRotMatdpx[2][2] = -px * pz / (p *
p2);
131 double dpplusdpx = px * (0.5 / p + c3 / c4);
134 dqplusdpx[0][0] += px * dpplusdpx /
p;
135 dqplusdpx[1][0] += py * dpplusdpx /
p;
136 dqplusdpx[2][0] += pz * dpplusdpx /
p;
139 double dpminusdpx = px * (0.5 / p - c3 / c4);
142 dqminusdpx[0][0] += px * dpminusdpx /
p;
143 dqminusdpx[1][0] += py * dpminusdpx /
p;
144 dqminusdpx[2][0] += pz * dpminusdpx /
p;
147 return std::make_pair(dqplusdpx, dqminusdpx);
159 double pT2 = px * px + py *
py;
160 double p2 = pT2 + pz *
pz;
164 double sphi =
sin(phi);
165 double cphi =
cos(phi);
166 double stheta =
sin(theta);
167 double ctheta =
cos(theta);
171 double c2 =
sqrt(c1 * c1 - 1.);
172 double c3 = 0.5 * c2 * ctheta /
c1;
179 pplus[2][0] = 0.5 * p + c3 * c4;
183 pminus[0][0] = -pplus[0][0];
184 pminus[1][0] = -pplus[1][0];
185 pminus[2][0] = 0.5 * p - c3 * c4;
190 dRotMatdpy[0][0] = -px * py * pz / (pT *
p) * (1. / pT2 + 1. / p2);
191 dRotMatdpy[0][1] = (py * py / pT2 - 1.) /
pT;
192 dRotMatdpy[0][2] = -px * py / (p *
p2);
194 dRotMatdpy[1][0] = pz / (pT *
p) * (1. - py * py * (1. / pT2 + 1. / p2));
195 dRotMatdpy[1][1] = -px * py / (pT * pT2);
196 dRotMatdpy[1][2] = (1. - py * py /
p2) / p;
198 dRotMatdpy[2][0] = -(1. / pT - pT /
p2) * py / p;
199 dRotMatdpy[2][1] = 0.;
200 dRotMatdpy[2][2] = -py * pz / (p *
p2);
203 double dpplusdpy = py * (0.5 / p + c3 / c4);
206 dqplusdpy[0][0] += px * dpplusdpy /
p;
207 dqplusdpy[1][0] += py * dpplusdpy /
p;
208 dqplusdpy[2][0] += pz * dpplusdpy /
p;
211 double dpminusdpy = py * (0.5 / p - c3 / c4);
214 dqminusdpy[0][0] += px * dpminusdpy /
p;
215 dqminusdpy[1][0] += py * dpminusdpy /
p;
216 dqminusdpy[2][0] += pz * dpminusdpy /
p;
219 return std::make_pair(dqplusdpy, dqminusdpy);
231 double pT2 = px * px + py *
py;
232 double p2 = pT2 + pz *
pz;
236 double sphi =
sin(phi);
237 double cphi =
cos(phi);
238 double stheta =
sin(theta);
239 double ctheta =
cos(theta);
243 double c2 =
sqrt(c1 * c1 - 1.);
244 double c3 = 0.5 * c2 * ctheta /
c1;
251 pplus[2][0] = 0.5 * p + c3 * c4;
255 pminus[0][0] = -pplus[0][0];
256 pminus[1][0] = -pplus[1][0];
257 pminus[2][0] = 0.5 * p - c3 * c4;
262 dRotMatdpz[0][0] = px / (pT *
p) * (1. - pz * pz / p2);
263 dRotMatdpz[0][1] = 0.;
264 dRotMatdpz[0][2] = -px * pz / (p *
p2);
266 dRotMatdpz[1][0] = py / (p *
pT) * (1. - pz * pz / p2);
267 dRotMatdpz[1][1] = 0.;
268 dRotMatdpz[1][2] = -py * pz / (p *
p2);
270 dRotMatdpz[2][0] = pT * pz / (p *
p2);
271 dRotMatdpz[2][1] = 0.;
272 dRotMatdpz[2][2] = (1. - pz * pz /
p2) / p;
275 double dpplusdpz = pz * (0.5 / p + c3 / c4);
278 dqplusdpz[0][0] += px * dpplusdpz /
p;
279 dqplusdpz[1][0] += py * dpplusdpz /
p;
280 dqplusdpz[2][0] += pz * dpplusdpz /
p;
283 double dpminusdpz = pz * (0.5 / p - c3 / c4);
286 dqminusdpz[0][0] += px * dpminusdpz /
p;
287 dqminusdpz[1][0] += py * dpminusdpz /
p;
288 dqminusdpz[2][0] += pz * dpminusdpz /
p;
291 return std::make_pair(dqplusdpz, dqminusdpz);
303 double pT2 = px * px + py *
py;
304 double p2 = pT2 + pz *
pz;
306 double sphi =
sin(phi);
307 double cphi =
cos(phi);
308 double stheta =
sin(theta);
309 double ctheta =
cos(theta);
313 double c2 =
sqrt(c1 * c1 - 1.);
314 double c3 = -0.5 * c2 * stheta /
c1;
322 dpplusdtheta[2][0] = c3 * c4;
329 dpminusdtheta[2][0] = -c3 * c4;
337 return std::make_pair(dqplusdtheta, dqminusdtheta);
348 double sphi =
sin(phi);
349 double cphi =
cos(phi);
350 double stheta =
sin(theta);
354 double c2 =
sqrt(c1 * c1 - 1.);
361 dpplusdphi[2][0] = 0.;
368 dpminusdphi[2][0] = 0.;
376 return std::make_pair(dqplusdphi, dqminusdphi);
387 double pT2 = px * px + py *
py;
388 double p2 = pT2 + pz *
pz;
390 double sphi =
sin(phi);
391 double cphi =
cos(phi);
392 double ctheta =
cos(theta);
393 double stheta =
sin(theta);
397 double c2 = 1. /
sqrt(c1 * c1 - 1.);
403 dpplusdm[0][0] = c2 * 0.5 * c1 * stheta * cphi;
404 dpplusdm[1][0] = c2 * 0.5 * c1 * stheta * sphi;
410 dpminusdm[0][0] = -dpplusdm[0][0];
411 dpminusdm[1][0] = -dpplusdm[1][0];
412 dpminusdm[2][0] = -dpplusdm[2][0];
420 return std::make_pair(dqplusdm, dqminusdm);
445 throw cms::Exception(
"BadConfig") <<
"@SUB=TwoBodyDecayDerivatives::dqsdzi" 446 <<
"no decay parameter related to selector (" << i <<
").";
const std::pair< AlgebraicMatrix, AlgebraicMatrix > dqsdpx(const TwoBodyDecayParameters ¶m) const
const std::pair< AlgebraicMatrix, AlgebraicMatrix > dqsdphi(const TwoBodyDecayParameters ¶m) const
Sin< T >::type sin(const T &t)
TwoBodyDecayDerivatives(double mPrimary=91.1876, double mSecondary=0.105658)
const std::pair< AlgebraicMatrix, AlgebraicMatrix > dqsdzi(const TwoBodyDecayParameters ¶m, const DerivativeParameterName &i) const
const std::pair< AlgebraicMatrix, AlgebraicMatrix > derivatives(const TwoBodyDecay &tbd) const
AlgebraicMatrix rotationMatrix(double px, double py, double pz)
CLHEP::HepMatrix AlgebraicMatrix
Cos< T >::type cos(const T &t)
const std::pair< AlgebraicMatrix, AlgebraicMatrix > dqsdm(const TwoBodyDecayParameters ¶m) const
const std::pair< AlgebraicMatrix, AlgebraicMatrix > dqsdpz(const TwoBodyDecayParameters ¶m) const
const std::pair< AlgebraicMatrix, AlgebraicMatrix > dqsdtheta(const TwoBodyDecayParameters ¶m) const
const std::pair< AlgebraicMatrix, AlgebraicMatrix > dqsdpy(const TwoBodyDecayParameters ¶m) const
const TwoBodyDecayParameters & decayParameters(void) const
const std::pair< AlgebraicMatrix, AlgebraicMatrix > selectedDerivatives(const TwoBodyDecay &tbd, const std::vector< bool > &selector) const
~TwoBodyDecayDerivatives()