Belle II Software development
V0DaughterTrackVariables.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9// Own header.
10#include <analysis/variables/V0DaughterTrackVariables.h>
11
12// include VariableManager
13#include <analysis/VariableManager/Manager.h>
14
15#include <analysis/dataobjects/Particle.h>
16#include <analysis/variables/TrackVariables.h>
17
18// framework - DataStore
19#include <framework/dataobjects/Helix.h>
20
21// dataobjects from the MDST
22#include <mdst/dataobjects/Track.h>
23#include <mdst/dataobjects/MCParticle.h>
24#include <mdst/dataobjects/TrackFitResult.h>
25#include <mdst/dataobjects/HitPatternCDC.h>
26#include <mdst/dataobjects/HitPatternVXD.h>
27
28// framework aux
29#include <framework/logging/Logger.h>
30
31#include <algorithm>
32#include <TVector2.h>
33#include <cmath>
34
35using namespace std;
36
37namespace Belle2 {
42 namespace Variable {
43
44 // helper function to get the helix parameters of the V0 daughter tracks
45 // Not registered in variable manager
46 double getV0DaughterTrackDetNHits(const Particle* particle, const double daughterID, const Const::EDetector& det)
47 {
48 auto daughter = particle->getDaughter(daughterID);
49 return trackNHits(daughter, det);
50 }
51
52 double v0DaughterTrackNCDCHits(const Particle* part, const std::vector<double>& daughterID)
53 {
54 return getV0DaughterTrackDetNHits(part, daughterID[0], Const::EDetector::CDC);
55 }
56
57 double v0DaughterTrackNSVDHits(const Particle* part, const std::vector<double>& daughterID)
58 {
59 return getV0DaughterTrackDetNHits(part, daughterID[0], Const::EDetector::SVD);
60 }
61
62 double v0DaughterTrackNPXDHits(const Particle* part, const std::vector<double>& daughterID)
63 {
64 return getV0DaughterTrackDetNHits(part, daughterID[0], Const::EDetector::PXD);
65 }
66
67 double v0DaughterTrackNVXDHits(const Particle* part, const std::vector<double>& daughterID)
68 {
69 return v0DaughterTrackNPXDHits(part, daughterID) + v0DaughterTrackNSVDHits(part, daughterID);
70 }
71
72 double v0DaughterTrackNRemovedHits(const Particle* part, const std::vector<double>& daughterID)
73 {
74 // returns 0 if called for non-V0 particles
75 if (part->getParticleSource() != Particle::EParticleSourceObject::c_V0)
76 return 0;
77 auto daughter = part->getDaughter(daughterID[0]);
78 const Track* track = daughter->getTrack();
79 if (!track) return Const::doubleNaN;
80 const TrackFitResult* trackFit = track->getTrackFitResultWithClosestMass(Const::ChargedStable(abs(
81 daughter->getPDGCode())));
82 if (!trackFit) return Const::doubleNaN;
83 double nHitsBeforeRemoval = trackFit->getHitPatternCDC().getNHits()
84 + trackFit->getHitPatternVXD().getNSVDHits()
85 + trackFit->getHitPatternVXD().getNPXDHits();
86 double nHitsAfterRemoval = trackNVXDHits(daughter) + trackNCDCHits(daughter);
87 return nHitsBeforeRemoval - nHitsAfterRemoval;
88 }
89
90 double v0DaughterTrackFirstSVDLayer(const Particle* part, const std::vector<double>& daughterID)
91 {
92 auto daughter = part->getDaughter(daughterID[0]);
93 return trackFirstSVDLayer(daughter);
94 }
95
96 double v0DaughterTrackFirstPXDLayer(const Particle* part, const std::vector<double>& daughterID)
97 {
98 auto daughter = part->getDaughter(daughterID[0]);
99 return trackFirstPXDLayer(daughter);
100 }
101
102 double v0DaughterTrackFirstCDCLayer(const Particle* part, const std::vector<double>& daughterID)
103 {
104 auto daughter = part->getDaughter(daughterID[0]);
105 return trackFirstCDCLayer(daughter);
106 }
107
108 double v0DaughterTrackLastCDCLayer(const Particle* part, const std::vector<double>& daughterID)
109 {
110 auto daughter = part->getDaughter(daughterID[0]);
111 return trackLastCDCLayer(daughter);
112 }
113
114 double v0DaughterTrackPValue(const Particle* part, const std::vector<double>& daughterID)
115 {
116 auto daughter = part->getDaughter(daughterID[0]);
117 return trackPValue(daughter);
118 }
119
120 double v0DaughterTrackD0(const Particle* part, const std::vector<double>& daughterID)
121 {
122 auto daughter = part->getDaughter(daughterID[0]);
123 return trackD0(daughter);
124 }
125
126 double v0DaughterTrackPhi0(const Particle* part, const std::vector<double>& daughterID)
127 {
128 auto daughter = part->getDaughter(daughterID[0]);
129 return trackPhi0(daughter);
130 }
131
132 double v0DaughterTrackOmega(const Particle* part, const std::vector<double>& daughterID)
133 {
134 auto daughter = part->getDaughter(daughterID[0]);
135 return trackOmega(daughter);
136 }
137
138 double v0DaughterTrackZ0(const Particle* part, const std::vector<double>& daughterID)
139 {
140 auto daughter = part->getDaughter(daughterID[0]);
141 return trackZ0(daughter);
142 }
143
144 double v0DaughterTrackTanLambda(const Particle* part, const std::vector<double>& daughterID)
145 {
146 auto daughter = part->getDaughter(daughterID[0]);
147 return trackTanLambda(daughter);
148 }
149
150 double v0DaughterTrackD0Error(const Particle* part, const std::vector<double>& daughterID)
151 {
152 auto daughter = part->getDaughter(daughterID[0]);
153 return trackD0Error(daughter);
154 }
155
156 double v0DaughterTrackPhi0Error(const Particle* part, const std::vector<double>& daughterID)
157 {
158 auto daughter = part->getDaughter(daughterID[0]);
159 return trackPhi0Error(daughter);
160 }
161
162 double v0DaughterTrackOmegaError(const Particle* part, const std::vector<double>& daughterID)
163 {
164 auto daughter = part->getDaughter(daughterID[0]);
165 return trackOmegaError(daughter);
166 }
167
168 double v0DaughterTrackZ0Error(const Particle* part, const std::vector<double>& daughterID)
169 {
170 auto daughter = part->getDaughter(daughterID[0]);
171 return trackZ0Error(daughter);
172 }
173
174 double v0DaughterTrackTanLambdaError(const Particle* part, const std::vector<double>& daughterID)
175 {
176 auto daughter = part->getDaughter(daughterID[0]);
177 return trackTanLambdaError(daughter);
178 }
179
180 double v0DaughterD0(const Particle* particle, const std::vector<double>& daughterID)
181 {
182 if (!particle)
183 return Const::doubleNaN;
184
185 ROOT::Math::XYZVector v0Vertex = particle->getVertex();
186
187 const Particle* daug = particle->getDaughter(daughterID[0]);
188
189 const TrackFitResult* trackFit = daug->getTrackFitResult();
190 if (!trackFit) return Const::doubleNaN;
191
192 UncertainHelix helix = trackFit->getUncertainHelix();
193 helix.passiveMoveBy(v0Vertex);
194
195 return helix.getD0();
196 }
197
198 double v0DaughterD0Diff(const Particle* particle)
199 {
200 return v0DaughterD0(particle, {0}) - v0DaughterD0(particle, {1});
201 }
202
203 double v0DaughterZ0(const Particle* particle, const std::vector<double>& daughterID)
204 {
205 if (!particle)
206 return Const::doubleNaN;
207
208 ROOT::Math::XYZVector v0Vertex = particle->getVertex();
209
210 const Particle* daug = particle->getDaughter(daughterID[0]);
211
212 const TrackFitResult* trackFit = daug->getTrackFitResult();
213 if (!trackFit) return Const::doubleNaN;
214
215 UncertainHelix helix = trackFit->getUncertainHelix();
216 helix.passiveMoveBy(v0Vertex);
217
218 return helix.getZ0();
219 }
220
221 double v0DaughterZ0Diff(const Particle* particle)
222 {
223 return v0DaughterZ0(particle, {0}) - v0DaughterZ0(particle, {1});
224 }
225
226 // helper function to get pull of the helix parameters of the V0 daughter tracks with the true vertex as the pivot.
227 // Not registered in variable manager
228 double getHelixParameterPullOfV0DaughterWithTrueVertexAsPivotAtIndex(const Particle* particle, const double daughterID,
229 const int tauIndex)
230 {
231 if (!particle) { return Const::doubleNaN; }
232
233 const int dID = int(std::lround(daughterID));
234 if (not(dID == 0 || dID == 1)) { return Const::doubleNaN; }
235
236 const MCParticle* mcparticle_v0 = particle->getMCParticle();
237 if (!mcparticle_v0) { return Const::doubleNaN; }
238
239 if (!(particle->getDaughter(dID))) { return Const::doubleNaN; }
240
241 const MCParticle* mcparticle = particle->getDaughter(dID)->getMCParticle();
242 if (!mcparticle) { return Const::doubleNaN; }
243
244 const TrackFitResult* trackFit = particle->getDaughter(dID)->getTrackFitResult();
245 if (!trackFit) { return Const::doubleNaN; }
246
247 // MC information
248 const ROOT::Math::XYZVector mcProdVertex = mcparticle->getVertex();
249 const ROOT::Math::XYZVector mcMomentum = mcparticle->getMomentum();
250 const double mcParticleCharge = mcparticle->getCharge();
251 const double BzAtProdVertex = BFieldManager::getFieldInTesla(mcProdVertex).Z();
252 Helix mcHelix = Helix(mcProdVertex, mcMomentum, mcParticleCharge, BzAtProdVertex);
253 mcHelix.passiveMoveBy(mcProdVertex);
254 const std::vector<double> mcHelixPars = { mcHelix.getD0(), mcHelix.getPhi0(), mcHelix.getOmega(),
255 mcHelix.getZ0(), mcHelix.getTanLambda()
256 };
257
258 // measured information (from the reconstructed particle)
259 UncertainHelix measHelix = trackFit->getUncertainHelix();
260 measHelix.passiveMoveBy(mcProdVertex);
261 const TMatrixDSym measCovariance = measHelix.getCovariance();
262 const std::vector<double> measHelixPars = {measHelix.getD0(), measHelix.getPhi0(), measHelix.getOmega(),
263 measHelix.getZ0(), measHelix.getTanLambda()
264 };
265 const std::vector<double> measErrSquare = {measCovariance[0][0], measCovariance[1][1], measCovariance[2][2],
266 measCovariance[3][3], measCovariance[4][4]
267 };
268
269 if (measErrSquare.at(tauIndex) > 0)
270 return (mcHelixPars.at(tauIndex) - measHelixPars.at(tauIndex)) / std::sqrt(measErrSquare.at(tauIndex));
271 else
272 return Const::doubleNaN;
273 }
274
275 double v0DaughterHelixWithTrueVertexAsPivotD0Pull(const Particle* part, const std::vector<double>& daughterID)
276 {
277 return getHelixParameterPullOfV0DaughterWithTrueVertexAsPivotAtIndex(part, daughterID[0], 0);
278 }
279
280 double v0DaughterHelixWithTrueVertexAsPivotPhi0Pull(const Particle* part, const std::vector<double>& daughterID)
281 {
282 return getHelixParameterPullOfV0DaughterWithTrueVertexAsPivotAtIndex(part, daughterID[0], 1);
283 }
284
285 double v0DaughterHelixWithTrueVertexAsPivotOmegaPull(const Particle* part, const std::vector<double>& daughterID)
286 {
287 return getHelixParameterPullOfV0DaughterWithTrueVertexAsPivotAtIndex(part, daughterID[0], 2);
288 }
289
290 double v0DaughterHelixWithTrueVertexAsPivotZ0Pull(const Particle* part, const std::vector<double>& daughterID)
291 {
292 return getHelixParameterPullOfV0DaughterWithTrueVertexAsPivotAtIndex(part, daughterID[0], 3);
293 }
294
295 double v0DaughterHelixWithTrueVertexAsPivotTanLambdaPull(const Particle* part, const std::vector<double>& daughterID)
296 {
297 return getHelixParameterPullOfV0DaughterWithTrueVertexAsPivotAtIndex(part, daughterID[0], 4);
298 }
299
300 double v0DaughterHelixWithOriginAsPivotD0Pull(const Particle* part, const std::vector<double>& daughterID)
301 {
302 auto daughter = part->getDaughter(daughterID[0]);
303 return getHelixD0Pull(daughter);
304 }
305
306 double v0DaughterHelixWithOriginAsPivotPhi0Pull(const Particle* part, const std::vector<double>& daughterID)
307 {
308 auto daughter = part->getDaughter(daughterID[0]);
309 return getHelixPhi0Pull(daughter);
310 }
311
312 double v0DaughterHelixWithOriginAsPivotOmegaPull(const Particle* part, const std::vector<double>& daughterID)
313 {
314 auto daughter = part->getDaughter(daughterID[0]);
315 return getHelixOmegaPull(daughter);
316 }
317
318 double v0DaughterHelixWithOriginAsPivotZ0Pull(const Particle* part, const std::vector<double>& daughterID)
319 {
320 auto daughter = part->getDaughter(daughterID[0]);
321 return getHelixZ0Pull(daughter);
322 }
323
324 double v0DaughterHelixWithOriginAsPivotTanLambdaPull(const Particle* part, const std::vector<double>& daughterID)
325 {
326 auto daughter = part->getDaughter(daughterID[0]);
327 return getHelixTanLambdaPull(daughter);
328 }
329
330 double v0DaughterTrackParam5AtIPPerigee(const Particle* part, const std::vector<double>& params)
331 {
332 auto daughter = part->getDaughter(params[0]);
333 if (!daughter) {
334 return Const::doubleNaN;
335 }
336 auto trackFit = daughter->getTrackFitResult();
337 if (!trackFit) {
338 return Const::doubleNaN;
339 }
340
341 const int paramID = int(std::lround(params[1]));
342 if (not(0 <= paramID && paramID < 5))
343 return Const::doubleNaN;
344
345 std::vector<float> tau = trackFit->getTau();
346 return tau[paramID];
347 }
348
349 double v0DaughterTrackParamCov5x5AtIPPerigee(const Particle* part, const std::vector<double>& params)
350 {
351 auto daughter = part->getDaughter(params[0]);
352 if (!daughter) {
353 return Const::doubleNaN;
354 }
355 auto trackFit = daughter->getTrackFitResult();
356 if (!trackFit) {
357 return Const::doubleNaN;
358 }
359
360 const int paramID = int(std::lround(params[1]));
361 if (not(0 <= paramID && paramID < 15))
362 return Const::doubleNaN;
363
364 std::vector<float> cov = trackFit->getCov();
365 return cov[paramID];
366 }
367
368 int convertedPhotonErrorChecks(const Particle* gamma, const std::vector<double>& daughterIndices)
369 {
370 //Check that exactly two daughter indices are provided
371 if (daughterIndices.size() != 2) {
372 B2ERROR("Invalid number of daughter indices. Please specify exactly two valid daughter indices.");
373 return -1;
374 }
375
376 //Check that there are at least (r+1) daughters where r is the bigger of the two indices provided
377 int daughterIndex1 = int(daughterIndices[0]);
378 int daughterIndex2 = int(daughterIndices[1]);
379 if (int(gamma->getNDaughters()) <= std::max(daughterIndex1, daughterIndex2)) {
380 B2ERROR("Invalid daughter indices provided. Particle does not have that many daughters.");
381 return -1;
382 }
383
384 //Check that there exists tracks associated with the daughter indices provided
385 if (!gamma->getDaughter(daughterIndex1)->getTrack()) {
386 B2ERROR("There is no track associated with daughter index " << daughterIndex1);
387 return -1;
388 }
389 if (!gamma->getDaughter(daughterIndex2)->getTrack()) {
390 B2ERROR("There is no track associated with daughter index " << daughterIndex2);
391 return -1;
392 }
393
394 //Check whether tracks used to calculate variable has been reconstructed as electrons/positrons or not (INCONSEQUENTIAL)
395 if (fabs(gamma->getDaughter(daughterIndex1)->getPDGCode()) != 11) {
396 B2INFO("The first track provided has not been reconstructed as an electron/positron. It has PDG code " << gamma->getDaughter(
397 daughterIndex1)->getPDGCode() << ". However, this is still fully admissible.");
398 }
399 if (fabs(gamma->getDaughter(daughterIndex2)->getPDGCode()) != 11) {
400 B2INFO("The second track provided has not been reconstructed as an electron/positron. It has PDG code " << gamma->getDaughter(
401 daughterIndex1)->getPDGCode() << ".However, this is still fully admissible.");
402 }
403
404 return 0;
405 }
406
407
408 int convertedPhotonLoadHelixParams(const Particle* gamma, int daughterIndex1, int daughterIndex2, double& Phi01, double& D01,
409 double& Omega1, double& Z01, double& TanLambda1, double& Phi02, double& D02, double& Omega2, double& Z02,
410 double& TanLambda2)
411 {
412 //Get helix parameters
413 //Electron/track 1
414 const TrackFitResult* e1TrackFit = gamma->getDaughter(daughterIndex1)->getTrackFitResult();
415 if (!e1TrackFit) return -1;
416 Helix e1Helix = e1TrackFit->getHelix();
417
418 Phi01 = e1Helix.getPhi0();
419 D01 = e1Helix.getD0() ;
420 Omega1 = e1Helix.getOmega();
421 Z01 = e1Helix.getZ0();
422 TanLambda1 = e1Helix.getTanLambda();
423
424 //Electron/track 2
425 const TrackFitResult* e2TrackFit = gamma->getDaughter(daughterIndex2)->getTrackFitResult();
426 if (!e2TrackFit) return -2;
427 Helix e2Helix = e2TrackFit->getHelix();
428
429 Phi02 = e2Helix.getPhi0();
430 D02 = e2Helix.getD0() ;
431 Omega2 = e2Helix.getOmega();
432 Z02 = e2Helix.getZ0();
433 TanLambda2 = e2Helix.getTanLambda();
434
435 //Check if either track has zero curvature
436 if (Omega1 == 0) {return -1;}
437 else if (Omega2 == 0) {return -2;}
438 else {return 0;}
439
440 }
441
442 double convertedPhotonInvariantMass(const Particle* gamma, const std::vector<double>& daughterIndices)
443 {
444 //Do basic checks
445 int errFlag = convertedPhotonErrorChecks(gamma, daughterIndices);
446 if (errFlag == -1) {return Const::doubleNaN;}
447
448 //Load helix parameters
449 double Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02, Omega2, Z02, TanLambda2;
450 int daughterIndex1 = int(daughterIndices[0]);
451 int daughterIndex2 = int(daughterIndices[1]);
452 errFlag = convertedPhotonLoadHelixParams(gamma, daughterIndex1, daughterIndex2, Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02,
453 Omega2, Z02, TanLambda2);
454 if (errFlag != 0) return Const::doubleNaN;
455
456 //Calculating invariant mass
457 //Sine and cosine Lambda
458 double sinlam1 = TanLambda1 / sqrt(1 + (TanLambda1 * TanLambda1));
459 double coslam1 = 1 / sqrt(1 + (TanLambda1 * TanLambda1));
460 double sinlam2 = TanLambda2 / sqrt(1 + (TanLambda2 * TanLambda2));
461 double coslam2 = 1 / sqrt(1 + (TanLambda2 * TanLambda2));
462
463 //Transverse and longitudinal momentum components; energy with electron mass hypothesis
464 //electron 1
465 double p1 = gamma->getDaughter(daughterIndex1)->getMomentumMagnitude();
466 double pt1 = p1 * coslam1, pz1 = p1 * sinlam1;
467 double e1 = sqrt((p1 * p1) + (Const::electronMass * Const::electronMass));
468 //electron 2
469 double p2 = gamma->getDaughter(daughterIndex2)->getMomentumMagnitude();
470 double pt2 = p2 * coslam2, pz2 = p2 * sinlam2;
471 double e2 = sqrt((p2 * p2) + (Const::electronMass * Const::electronMass));
472
473 //Invariant mass of the two track system
474 double vtxMass = sqrt(pow(e1 + e2, 2.0) - pow(pt1 + pt2, 2.0) - pow(pz1 + pz2, 2.0));
475 return vtxMass;
476 }
477
478 double convertedPhotonDelTanLambda(const Particle* gamma, const std::vector<double>& daughterIndices)
479 {
480 //Do basic checks
481 int errFlag = convertedPhotonErrorChecks(gamma, daughterIndices);
482 if (errFlag == -1) {return Const::doubleNaN;}
483
484 //Load helix parameters
485 double Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02, Omega2, Z02, TanLambda2;
486 int daughterIndex1 = int(daughterIndices[0]);
487 int daughterIndex2 = int(daughterIndices[1]);
488 errFlag = convertedPhotonLoadHelixParams(gamma, daughterIndex1, daughterIndex2, Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02,
489 Omega2, Z02, TanLambda2);
490 if (errFlag != 0) return Const::doubleNaN;
491
492 //Delta-TanLambda
493 return (TanLambda2 - TanLambda1);
494 }
495
496 double convertedPhotonDelR(const Particle* gamma, const std::vector<double>& daughterIndices)
497 {
498 //Do basic checks
499 int errFlag = convertedPhotonErrorChecks(gamma, daughterIndices);
500 if (errFlag == -1) {return Const::doubleNaN;}
501
502 //Load helix parameters
503 double Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02, Omega2, Z02, TanLambda2;
504 int daughterIndex1 = int(daughterIndices[0]);
505 int daughterIndex2 = int(daughterIndices[1]);
506 errFlag = convertedPhotonLoadHelixParams(gamma, daughterIndex1, daughterIndex2, Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02,
507 Omega2, Z02, TanLambda2);
508 if (errFlag == -1) {
509 B2ERROR("First track provided has curvature zero. Calculation of convertedPhotonDelR failed.");
510 return Const::doubleNaN;
511 }
512 if (errFlag == -2) {
513 B2ERROR("Second track provided has curvature zero. Calculation of convertedPhotonDelR failed.");
514 return Const::doubleNaN;
515 }
516
517 //Delta-R
518 double radius1 = 1 / Omega1;
519 double radius2 = 1 / Omega2;
520
521 TVector2 center1((radius1 + D01) * sin(Phi01), -1 * (radius1 + D01) * cos(Phi01));
522 TVector2 center2((radius2 + D02) * sin(Phi02), -1 * (radius2 + D02) * cos(Phi02));
523 TVector2 cenDiff = center1 - center2;
524
525 double delR = fabs(radius1) + fabs(radius2) - cenDiff.Mod();
526 return delR;
527 }
528
529 std::pair<double, double> convertedPhotonZ1Z2(const Particle* gamma, const std::vector<double>& daughterIndices)
530 {
531 //Do basic checks
532 int errFlag = convertedPhotonErrorChecks(gamma, daughterIndices);
533 if (errFlag == -1) {return std::pair<double, double>(Const::doubleNaN, Const::doubleNaN);}
534
535 //Load helix parameters
536 double Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02, Omega2, Z02, TanLambda2;
537 int daughterIndex1 = int(daughterIndices[0]);
538 int daughterIndex2 = int(daughterIndices[1]);
539 errFlag = convertedPhotonLoadHelixParams(gamma, daughterIndex1, daughterIndex2, Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02,
540 Omega2, Z02, TanLambda2);
541 if (errFlag == -1) {
542 B2ERROR("First track provided has curvature zero. Calculation of convertedPhotonZ1Z2 failed.");
543 return std::pair<double, double>(Const::doubleNaN, Const::doubleNaN);
544 }
545 if (errFlag == -2) {
546 B2ERROR("Second track provided has curvature zero. Calculation of convertedPhotonZ1Z2 failed.");
547 return std::pair<double, double>(Const::doubleNaN, Const::doubleNaN);
548 }
549
550 //Delta-Z
551 //Radial unit vectors
552 double radius1 = 1 / Omega1;
553 double radius2 = 1 / Omega2;
554
555 TVector2 center1((radius1 + D01) * sin(Phi01), -1 * (radius1 + D01) * cos(Phi01));
556 TVector2 center2((radius2 + D02) * sin(Phi02), -1 * (radius2 + D02) * cos(Phi02));
557
558 TVector2 n1 = center1 - center2; n1 = n1.Unit();
559 TVector2 n2 = -1 * n1;
560 n1 = copysign(1.0, Omega1) * n1;
561 n2 = copysign(1.0, Omega2) * n2;
562
563 //Getting running parameter phi at nominal vertex
564 double phiN1 = atan2(n1.X(), -n1.Y());
565 double phiN2 = atan2(n2.X(), -n2.Y());
566 double Phi01Intersect = phiN1 - Phi01;
567 double Phi02Intersect = phiN2 - Phi02;
568
569 double z1 = Z01 - (radius1 * TanLambda1 * Phi01Intersect);
570 double z2 = Z02 - (radius2 * TanLambda2 * Phi02Intersect);
571 std::pair<double, double> z1z2(z1, z2);
572 return z1z2;
573 }
574
575 double convertedPhotonDelZ(const Particle* gamma, const std::vector<double>& daughterIndices)
576 {
577 std::pair<double, double> z1z2 = convertedPhotonZ1Z2(gamma, daughterIndices);
578 double z1 = z1z2.first; double z2 = z1z2.second;
579 return (z1 - z2);
580 }
581
582 double convertedPhotonZ(const Particle* gamma, const std::vector<double>& daughterIndices)
583 {
584 std::pair<double, double> z1z2 = convertedPhotonZ1Z2(gamma, daughterIndices);
585 double z1 = z1z2.first; double z2 = z1z2.second;
586 return (z1 + z2) * 0.5;
587 }
588
589 TVector2 convertedPhotonXY(const Particle* gamma, const std::vector<double>& daughterIndices)
590 {
591 //Do basic checks
592 int errFlag = convertedPhotonErrorChecks(gamma, daughterIndices);
593 if (errFlag == -1) {return TVector2(Const::doubleNaN, Const::doubleNaN);}
594
595 //Load helix parameters
596 double Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02, Omega2, Z02, TanLambda2;
597 int daughterIndex1 = int(daughterIndices[0]);
598 int daughterIndex2 = int(daughterIndices[1]);
599 errFlag = convertedPhotonLoadHelixParams(gamma, daughterIndex1, daughterIndex2, Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02,
600 Omega2, Z02, TanLambda2);
601 if (errFlag == -1) {
602 B2ERROR("First track provided has curvature zero. Calculation of convertedPhotonXY failed.");
603 return TVector2(Const::doubleNaN, Const::doubleNaN);
604 }
605 if (errFlag == -2) {
606 B2ERROR("Second track provided has curvature zero. Calculation of convertedPhotonXY failed.");
607 return TVector2(Const::doubleNaN, Const::doubleNaN);
608 }
609
610 //Radial unit vectors
611 double radius1 = 1 / Omega1;
612 double radius2 = 1 / Omega2;
613
614 TVector2 center1((radius1 + D01) * sin(Phi01), -1 * (radius1 + D01) * cos(Phi01));
615 TVector2 center2((radius2 + D02) * sin(Phi02), -1 * (radius2 + D02) * cos(Phi02));
616 TVector2 cenDiff = center2 - center1;
617 double delR = fabs(radius1) + fabs(radius2) - cenDiff.Mod();
618
619 //Calculate transverse vertex
620 TVector2 n1 = cenDiff.Unit();
621 TVector2 vtxXY = center1 + ((fabs(radius1) - (delR / 2)) * n1);
622 return vtxXY;
623 }
624
625 double convertedPhotonX(const Particle* gamma, const std::vector<double>& daughterIndices)
626 {
627 auto vtxXY = convertedPhotonXY(gamma, daughterIndices);
628 return vtxXY.X();
629 }
630
631 double convertedPhotonY(const Particle* gamma, const std::vector<double>& daughterIndices)
632 {
633 auto vtxXY = convertedPhotonXY(gamma, daughterIndices);
634 return vtxXY.Y();
635 }
636
637 double convertedPhotonRho(const Particle* gamma, const std::vector<double>& daughterIndices)
638 {
639 auto vtxXY = convertedPhotonXY(gamma, daughterIndices);
640 return vtxXY.Mod();
641 }
642
643 B2Vector3D convertedPhoton3Momentum(const Particle* gamma, const std::vector<double>& daughterIndices)
644 {
645 //Do basic checks
646 int errFlag = convertedPhotonErrorChecks(gamma, daughterIndices);
647 if (errFlag == -1) {return B2Vector3D(Const::doubleNaN, Const::doubleNaN, Const::doubleNaN);}
648
649 //Load helix parameters
650 double Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02, Omega2, Z02, TanLambda2;
651 int daughterIndex1 = int(daughterIndices[0]);
652 int daughterIndex2 = int(daughterIndices[1]);
653 errFlag = convertedPhotonLoadHelixParams(gamma, daughterIndex1, daughterIndex2, Phi01, D01, Omega1, Z01, TanLambda1, Phi02, D02,
654 Omega2, Z02,
655 TanLambda2);
656 if (errFlag == -1) {
657 B2ERROR("First track provided has curvature zero. Calculation of convertedPhoton3Momentum failed.");
659 }
660 if (errFlag == -2) {
661 B2ERROR("Second track provided has curvature zero. Calculation of convertedPhoton3Momentum failed.");
663 }
664
665 //Delta-Z
666 //Radial unit vectors
667 double radius1 = 1 / Omega1;
668 double radius2 = 1 / Omega2;
669
670 TVector2 center1((radius1 + D01) * sin(Phi01), -1 * (radius1 + D01) * cos(Phi01));
671 TVector2 center2((radius2 + D02) * sin(Phi02), -1 * (radius2 + D02) * cos(Phi02));
672 TVector2 n1 = center1 - center2; n1 = n1.Unit();
673 TVector2 n2 = -1 * n1;
674 n1 = copysign(1.0, Omega1) * n1;
675 n2 = copysign(1.0, Omega2) * n2;
676
677 //Getting running parameter phi at nominal vertex
678 double phiN1 = atan2(n1.X(), -n1.Y());
679 double phiN2 = atan2(n2.X(), -n2.Y());
680
681 //Sine and cosine Lambda
682 double sinlam1 = TanLambda1 / sqrt(1 + (TanLambda1 * TanLambda1));
683 double coslam1 = 1 / sqrt(1 + (TanLambda1 * TanLambda1));
684 double sinlam2 = TanLambda2 / sqrt(1 + (TanLambda2 * TanLambda2));
685 double coslam2 = 1 / sqrt(1 + (TanLambda2 * TanLambda2));
686
687 //Photon 3-momentum
688 double p1 = gamma->getDaughter(daughterIndex1)->getMomentumMagnitude();
689 B2Vector3D e1Momentum(coslam1 * cos(phiN1), coslam1 * sin(phiN1), sinlam1);
690 double p2 = gamma->getDaughter(daughterIndex2)->getMomentumMagnitude();
691 B2Vector3D e2Momentum(coslam2 * cos(phiN2), coslam2 * sin(phiN2), sinlam2);
692 B2Vector3D gammaMomentum = (e1Momentum * p1) + (e2Momentum * p2);
693
694 return gammaMomentum;
695 }
696
697 double convertedPhotonPx(const Particle* gamma, const std::vector<double>& daughterIndices)
698 {
699 auto gammaMomentum = convertedPhoton3Momentum(gamma, daughterIndices);
700 return gammaMomentum.Px();
701 }
702
703 double convertedPhotonPy(const Particle* gamma, const std::vector<double>& daughterIndices)
704 {
705 auto gammaMomentum = convertedPhoton3Momentum(gamma, daughterIndices);
706 return gammaMomentum.Py();
707 }
708
709 double convertedPhotonPz(const Particle* gamma, const std::vector<double>& daughterIndices)
710 {
711 auto gammaMomentum = convertedPhoton3Momentum(gamma, daughterIndices);
712 return gammaMomentum.Pz();
713 }
714
715 int v0DaughtersShareInnermostHit(const Particle* part)
716 {
717 if (!part)
718 return -1;
719 auto daughterPlus = part->getDaughter(0);
720 auto daughterMinus = part->getDaughter(1);
721 if (!daughterPlus || !daughterMinus)
722 return -1;
723 auto trackFitPlus = daughterPlus->getTrackFitResult();
724 auto trackFitMinus = daughterMinus->getTrackFitResult();
725 if (!trackFitPlus || !trackFitMinus)
726 return -1;
727 int flagPlus = trackFitPlus->getHitPatternVXD().getInnermostHitShareStatus();
728 int flagMinus = trackFitMinus->getHitPatternVXD().getInnermostHitShareStatus();
729 if (flagPlus != flagMinus)
730 return -1;
731 return flagPlus;
732 }
733
734 bool v0DaughtersShareInnermostUHit(const Particle* part)
735 {
736 return ((v0DaughtersShareInnermostHit(part) / 2) == 1);
737 }
738
739 bool v0DaughtersShareInnermostVHit(const Particle* part)
740 {
741 return ((v0DaughtersShareInnermostHit(part) % 2) == 1);
742 }
743
744 VARIABLE_GROUP("V0Daughter");
745
746 REGISTER_VARIABLE("v0DaughterNCDCHits(i)", v0DaughterTrackNCDCHits, "Number of CDC hits associated to the i-th daughter track");
747 MAKE_DEPRECATED("v0DaughterNCDCHits", true, "light-2104-poseidon", R"DOC(
748 The same value can be calculated with the more generic variable `nCDCHits`,
749 so replace the current call with ``daughter(i, nCDCHits)``.)DOC");
750 REGISTER_VARIABLE("v0DaughterNSVDHits(i)", v0DaughterTrackNSVDHits, "Number of SVD hits associated to the i-th daughter track");
751 MAKE_DEPRECATED("v0DaughterNSVDHits", true, "light-2104-poseidon", R"DOC(
752 The same value can be calculated with the more generic variable `nSVDHits`,
753 so replace the current call with ``daughter(i, nSVDHits)``.)DOC");
754 REGISTER_VARIABLE("v0DaughterNPXDHits(i)", v0DaughterTrackNPXDHits, "Number of PXD hits associated to the i-th daughter track");
755 MAKE_DEPRECATED("v0DaughterNPXDHits", true, "light-2104-poseidon", R"DOC(
756 The same value can be calculated with the more generic variable `nPXDHits`,
757 so replace the current call with ``daughter(i, nPXDHits)``.)DOC");
758 REGISTER_VARIABLE("v0DaughterNVXDHits(i)", v0DaughterTrackNVXDHits, "Number of PXD+SVD hits associated to the i-th daughter track");
759 MAKE_DEPRECATED("v0DaughterNVXDHits", true, "light-2104-poseidon", R"DOC(
760 The same value can be calculated with the more generic variable `nVXDHits`,
761 so replace the current call with ``daughter(i, nVXDHits)``.)DOC");
762 REGISTER_VARIABLE("v0DaughterNRemovedHits(i)", v0DaughterTrackNRemovedHits,
763 "The number of the i-th daughter track hits removed in V0Finder. Returns 0 if called for something other than V0 daughters.");
764 REGISTER_VARIABLE("v0DaughterFirstSVDLayer(i)", v0DaughterTrackFirstSVDLayer,
765 "First activated SVD layer associated to the i-th daughter track");
766 MAKE_DEPRECATED("v0DaughterFirstSVDLayer", true, "light-2104-poseidon", R"DOC(
767 The same value can be calculated with the more generic variable `firstSVDLayer`,
768 so replace the current call with ``daughter(i, firstSVDLayer)``.)DOC");
769 REGISTER_VARIABLE("v0DaughterFirstPXDLayer(i)", v0DaughterTrackFirstPXDLayer,
770 "First activated PXD layer associated to the i-th daughter track");
771 MAKE_DEPRECATED("v0DaughterFirstPXDLayer", true, "light-2104-poseidon", R"DOC(
772 The same value can be calculated with the more generic variable `firstPXDLayer`,
773 so replace the current call with ``daughter(i, firstPXDLayer)``.)DOC");
774 REGISTER_VARIABLE("v0DaughterFirstCDCLayer(i)", v0DaughterTrackFirstCDCLayer,
775 "First activated CDC layer associated to the i-th daughter track");
776 MAKE_DEPRECATED("v0DaughterFirstCDCLayer", true, "light-2104-poseidon", R"DOC(
777 The same value can be calculated with the more generic variable `firstCDCLayer`,
778 so replace the current call with ``daughter(i, firstCDCLayer)``.)DOC");
779 REGISTER_VARIABLE("v0DaughterLastCDCLayer(i)", v0DaughterTrackLastCDCLayer,
780 "Last CDC layer associated to the i-th daughter track");
781 MAKE_DEPRECATED("v0DaughterLastCDCLayer", true, "light-2104-poseidon", R"DOC(
782 The same value can be calculated with the more generic variable `lastCDCLayer`,
783 so replace the current call with ``daughter(i, lastCDCLayer)``.)DOC");
784 REGISTER_VARIABLE("v0DaughterPValue(i)", v0DaughterTrackPValue,
785 "chi2 probalility of the i-th daughter track fit");
786 MAKE_DEPRECATED("v0DaughterPValue", true, "light-2104-poseidon", R"DOC(
787 The same value can be calculated with the more generic variable `pValue`,
788 so replace the current call with ``daughter(i, pValue)``.)DOC");
790 REGISTER_VARIABLE("v0DaughterD0(i)", v0DaughterTrackD0, "d0 of the i-th daughter track fit\n\n", "cm");
791 MAKE_DEPRECATED("v0DaughterD0", true, "light-2104-poseidon", R"DOC(
792 The same value can be calculated with the more generic variable `d0`,
793 so replace the current call with ``daughter(i, d0)``.)DOC");
794 REGISTER_VARIABLE("v0DaughterPhi0(i)", v0DaughterTrackPhi0, "phi0 of the i-th daughter track fit\n\n", "rad");
795 MAKE_DEPRECATED("v0DaughterPhi0", true, "light-2104-poseidon", R"DOC(
796 The same value can be calculated with the more generic variable `phi0`,
797 so replace the current call with ``daughter(i, phi0)``.)DOC");
798 REGISTER_VARIABLE("v0DaughterOmega(i)", v0DaughterTrackOmega, "omega of the i-th daughter track fit\n\n",
799 ":math:`\\text{cm}^{-1}`");
800 MAKE_DEPRECATED("v0DaughterOmega", true, "light-2104-poseidon", R"DOC(
801 The same value can be calculated with the more generic variable `omega`,
802 so replace the current call with ``daughter(i, omega)``.)DOC");
803 REGISTER_VARIABLE("v0DaughterZ0(i)", v0DaughterTrackZ0, "z0 of the i-th daughter track fit\n\n", "cm");
804 MAKE_DEPRECATED("v0DaughterZ0", true, "light-2104-poseidon", R"DOC(
805 The same value can be calculated with the more generic variable `z0`,
806 so replace the current call with ``daughter(i, z0)``.)DOC");
807 REGISTER_VARIABLE("v0DaughterTanLambda(i)", v0DaughterTrackTanLambda, "tan(lambda) of the i-th daughter track fit");
808 MAKE_DEPRECATED("v0DaughterTanLambda", true, "light-2104-poseidon", R"DOC(
809 The same value can be calculated with the more generic variable `tanLambda`,
810 so replace the current call with ``daughter(i, tanLambda)``.)DOC");
812 REGISTER_VARIABLE("v0DaughterD0Error(i)", v0DaughterTrackD0Error, "d0 error of the i-th daughter track fit\n\n", "cm");
813 MAKE_DEPRECATED("v0DaughterD0Error", true, "light-2104-poseidon", R"DOC(
814 The same value can be calculated with the more generic variable `d0Err`,
815 so replace the current call with ``daughter(i, d0Err)``.)DOC");
816 REGISTER_VARIABLE("v0DaughterPhi0Error(i)", v0DaughterTrackPhi0Error, "phi0 error of the i-th daughter track fit\n\n", "rad");
817 MAKE_DEPRECATED("v0DaughterPhi0Error", true, "light-2104-poseidon", R"DOC(
818 The same value can be calculated with the more generic variable `phi0Err`,
819 so replace the current call with ``daughter(i, phi0Err)``.)DOC");
820 REGISTER_VARIABLE("v0DaughterOmegaError(i)", v0DaughterTrackOmegaError, "omega error of the i-th daughter track fit\n\n",
821 ":math:`\\text{cm}^{-1}`");
822 MAKE_DEPRECATED("v0DaughterOmegaError", true, "light-2104-poseidon", R"DOC(
823 The same value can be calculated with the more generic variable `omegaErr`,
824 so replace the current call with ``daughter(i, omegaErr)``.)DOC");
825 REGISTER_VARIABLE("v0DaughterZ0Error(i)", v0DaughterTrackZ0Error, "z0 error of the i-th daughter track fit\n\n", "cm");
826 MAKE_DEPRECATED("v0DaughterZ0Error", true, "light-2104-poseidon", R"DOC(
827 The same value can be calculated with the more generic variable `z0Err`,
828 so replace the current call with ``daughter(i, z0Err)``.)DOC");
829 REGISTER_VARIABLE("v0DaughterTanLambdaError(i)", v0DaughterTrackTanLambdaError, "tan(lambda) error of the i-th daughter track fit");
830 MAKE_DEPRECATED("v0DaughterTanLambdaError", true, "light-2104-poseidon", R"DOC(
831 The same value can be calculated with the more generic variable `tanLambdaErr`,
832 so replace the current call with ``daughter(i, tanLambdaErr)``.)DOC");
833
835 REGISTER_VARIABLE("V0d0(id)", v0DaughterD0,
836 "Return the d0 impact parameter of a V0's daughter with daughterID index with the V0 vertex point as a pivot for the track.\n\n",
837 "cm");
838 REGISTER_VARIABLE("V0Deltad0", v0DaughterD0Diff,
839 "Return the difference between d0 impact parameters of V0's daughters with the V0 vertex point as a pivot for the track.\n\n",
840 "cm");
841 REGISTER_VARIABLE("V0z0(id)", v0DaughterZ0,
842 "Return the z0 impact parameter of a V0's daughter with daughterID index with the V0 vertex point as a pivot for the track.\n\n",
843 "cm");
844 REGISTER_VARIABLE("V0Deltaz0", v0DaughterZ0Diff,
845 "Return the difference between z0 impact parameters of V0's daughters with the V0 vertex point as a pivot for the track.\n\n",
846 "cm");
847
849 REGISTER_VARIABLE("v0DaughterD0PullWithTrueVertexAsPivot(i)", v0DaughterHelixWithTrueVertexAsPivotD0Pull,
850 "d0 pull of the i-th daughter track with the true V0 vertex as the track pivot");
851 REGISTER_VARIABLE("v0DaughterPhi0PullWithTrueVertexAsPivot(i)", v0DaughterHelixWithTrueVertexAsPivotPhi0Pull,
852 "phi0 pull of the i-th daughter track with the true V0 vertex as the track pivot");
853 REGISTER_VARIABLE("v0DaughterOmegaPullWithTrueVertexAsPivot(i)", v0DaughterHelixWithTrueVertexAsPivotOmegaPull,
854 "omega pull of the i-th daughter track with the true V0 vertex as the track pivot");
855 REGISTER_VARIABLE("v0DaughterZ0PullWithTrueVertexAsPivot(i)", v0DaughterHelixWithTrueVertexAsPivotZ0Pull,
856 "z0 pull of the i-th daughter track with the true V0 vertex as the track pivot");
857 REGISTER_VARIABLE("v0DaughterTanLambdaPullWithTrueVertexAsPivot(i)", v0DaughterHelixWithTrueVertexAsPivotTanLambdaPull,
858 "tan(lambda) pull of the i-th daughter track with the true V0 vertex as the track pivot");
860 REGISTER_VARIABLE("v0DaughterD0PullWithOriginAsPivot(i)", v0DaughterHelixWithOriginAsPivotD0Pull,
861 "d0 pull of the i-th daughter track with the origin as the track pivot");
862 MAKE_DEPRECATED("v0DaughterD0PullWithOriginAsPivot", true, "light-2104-poseidon", R"DOC(
863 The same value can be calculated with the more generic variable `d0Pull`,
864 so replace the current call with ``daughter(i, d0Pull)``.)DOC");
865 REGISTER_VARIABLE("v0DaughterPhi0PullWithOriginAsPivot(i)", v0DaughterHelixWithOriginAsPivotPhi0Pull,
866 "phi0 pull of the i-th daughter track with the origin as the track pivot");
867 MAKE_DEPRECATED("v0DaughterPhi0PullWithOriginAsPivot", true, "light-2104-poseidon", R"DOC(
868 The same value can be calculated with the more generic variable `phi0Pull`,
869 so replace the current call with ``daughter(i, phi0Pull)``.)DOC");
870 REGISTER_VARIABLE("v0DaughterOmegaPullWithOriginAsPivot(i)", v0DaughterHelixWithOriginAsPivotOmegaPull,
871 "omega pull of the i-th daughter track with the origin as the track pivot");
872 MAKE_DEPRECATED("v0DaughterOmegaPullWithOriginAsPivot", true, "light-2104-poseidon", R"DOC(
873 The same value can be calculated with the more generic variable `omegaPull`,
874 so replace the current call with ``daughter(i, omegaPull)``.)DOC");
875 REGISTER_VARIABLE("v0DaughterZ0PullWithOriginAsPivot(i)", v0DaughterHelixWithOriginAsPivotZ0Pull,
876 "z0 pull of the i-th daughter track with the origin as the track pivot");
877 MAKE_DEPRECATED("v0DaughterZ0PullWithOriginAsPivot", true, "light-2104-poseidon", R"DOC(
878 The same value can be calculated with the more generic variable `z0Pull`,
879 so replace the current call with ``daughter(i, z0Pull)``.)DOC");
880 REGISTER_VARIABLE("v0DaughterTanLambdaPullWithOriginAsPivot(i)", v0DaughterHelixWithOriginAsPivotTanLambdaPull,
881 "tan(lambda) pull of the i-th daughter track with the origin as the track pivot");
882 MAKE_DEPRECATED("v0DaughterTanLambdaPullWithOriginAsPivot", true, "light-2104-poseidon", R"DOC(
883 The same value can be calculated with the more generic variable `tanLambdaPull`,
884 so replace the current call with ``daughter(i, tanLambdaPull)``.)DOC");
886 REGISTER_VARIABLE("v0DaughterTau(i,j)", v0DaughterTrackParam5AtIPPerigee,
887 "j-th track parameter (at IP perigee) of the i-th daughter track. "
888 "j: 0:d0, 1:phi0, 2:omega, 3:z0, 4:tanLambda\n\n", "cm, rad, :math:`\\text{cm}^{-1}`, cm, unitless");
889 REGISTER_VARIABLE("v0DaughterCov(i,j)", v0DaughterTrackParamCov5x5AtIPPerigee,
890 "j-th element of the 15 covariance matrix elements (at IP perigee) of the i-th daughter track. "
891 "(0,0), (0,1) ... (1,1), (1,2) ... (2,2) ..."
892 "index order is: 0:d0, 1:phi0, 2:omega, 3:z0, 4:tanLambda\n\n", "cm, rad, :math:`\\text{cm}^{-1}`, cm, unitless");
894 REGISTER_VARIABLE("convertedPhotonInvariantMass(i,j)", convertedPhotonInvariantMass,
895 "Invariant mass of the i-j daughter system as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon\n\n",
896 "GeV/:math:`\\text{c}^2`");
897 REGISTER_VARIABLE("convertedPhotonDelTanLambda(i,j)", convertedPhotonDelTanLambda,
898 "Discriminating variable Delta-TanLambda calculated for daughters (i,j) as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon");
899 REGISTER_VARIABLE("convertedPhotonDelR(i,j)", convertedPhotonDelR,
900 "Discriminating variable Delta-R calculated for daughters (i,j) as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon\n\n",
901 "cm");
902 REGISTER_VARIABLE("convertedPhotonDelZ(i,j)", convertedPhotonDelZ,
903 "Discriminating variable Delta-Z calculated for daughters (i,j) as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon\n\n",
904 "cm");
905 REGISTER_VARIABLE("convertedPhotonX(i,j)", convertedPhotonX,
906 "Estimate of vertex X coordinate calculated for daughters (i,j) as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon\n\n",
907 "cm");
908 REGISTER_VARIABLE("convertedPhotonY(i,j)", convertedPhotonY,
909 "Estimate of vertex Y coordinate calculated for daughters (i,j) as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon\n\n",
910 "cm");
911 REGISTER_VARIABLE("convertedPhotonZ(i,j)", convertedPhotonZ,
912 "Estimate of vertex Z coordinate calculated for daughters (i,j) as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon\n\n",
913 "cm");
914 REGISTER_VARIABLE("convertedPhotonRho(i,j)", convertedPhotonRho,
915 "Estimate of vertex Rho calculated for daughters (i,j) as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon\n\n",
916 "cm");
917 REGISTER_VARIABLE("convertedPhotonPx(i,j)", convertedPhotonPx,
918 "Estimate of x-component of photon momentum calculated for daughters (i,j) as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon\n\n",
919 "GeV/c");
920 REGISTER_VARIABLE("convertedPhotonPy(i,j)", convertedPhotonPy,
921 "Estimate of y-component of photon momentum calculated for daughters (i,j) as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon\n\n",
922 "GeV/c");
923 REGISTER_VARIABLE("convertedPhotonPz(i,j)", convertedPhotonPz,
924 "Estimate of z-component of photon momentum calculated for daughters (i,j) as defined in https://indico.belle2.org/event/3644/contributions/18622/attachments/9401/14443/Photon_vertexin_B2GM.pdf, assuming it's a converted photon\n\n",
925 "GeV/c");
927 REGISTER_VARIABLE("v0DaughtersShare1stHit", v0DaughtersShareInnermostHit,
928 "flag for V0 daughters sharing the first(innermost) VXD hit. 0x1(0x2) bit represents V/z(U/r-phi)-hit share.");
929 REGISTER_VARIABLE("v0DaughtersShare1stUHit", v0DaughtersShareInnermostUHit,
930 "flag for V0 daughters sharing the first(innermost) VXD U-side hit.");
931 REGISTER_VARIABLE("v0DaughtersShare1stVHit", v0DaughtersShareInnermostVHit,
932 "flag for V0 daughters sharing the first(innermost) VXD V-side hit.");
933 }
935}
static ROOT::Math::XYZVector getFieldInTesla(const ROOT::Math::XYZVector &pos)
return the magnetic field at a given position in Tesla.
Definition: BFieldManager.h:60
EDetector
Enum for identifying the detector components (detector and subdetector).
Definition: Const.h:42
static const double electronMass
electron mass
Definition: Const.h:685
static const double doubleNaN
quiet_NaN
Definition: Const.h:703
#define MAKE_DEPRECATED(name, make_fatal, version, description)
Registers a variable as deprecated.
Definition: Manager.h:448
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition: B2Vector3.h:516
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
Abstract base class for different kinds of events.
STL namespace.