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