Belle II Software development
EventVariables.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/EventVariables.h>
11
12// include VariableManager
13#include <analysis/VariableManager/Manager.h>
14
15// framework - DataStore
16#include <framework/datastore/StoreArray.h>
17#include <framework/datastore/StoreObjPtr.h>
18#include <framework/dataobjects/EventMetaData.h>
19
20// dataobjects
21#include <analysis/dataobjects/Particle.h>
22#include <analysis/dataobjects/EventKinematics.h>
23
24#include <mdst/dataobjects/MCParticle.h>
25#include <mdst/dataobjects/Track.h>
26#include <mdst/dataobjects/ECLCluster.h>
27#include <mdst/dataobjects/KLMCluster.h>
28#include <mdst/dataobjects/V0.h>
29
30#include <framework/dataobjects/EventT0.h>
31#include <mdst/dataobjects/EventLevelTriggerTimeInfo.h>
32
33// database
34#include <framework/database/DBObjPtr.h>
35#include <mdst/dbobjects/BeamSpot.h>
36
37#include <analysis/utility/PCmsLabTransform.h>
38
39#include <framework/core/Environment.h>
40#include <framework/logging/Logger.h>
41
42
43namespace Belle2 {
48 namespace Variable {
49
50 // Event ------------------------------------------------
51 bool isMC(const Particle*)
52 {
53 return Environment::Instance().isMC();
54 }
55
56 bool eventType(const Particle*)
57 {
58 StoreArray<MCParticle> mcparticles;
59 return (mcparticles.getEntries()) > 0 ? 0 : 1;
60 }
61
62 bool isContinuumEvent(const Particle*)
63 {
64 return (isNotContinuumEvent(nullptr) == 1 ? 0 : 1);
65 }
66
67 bool isChargedBEvent(const Particle*)
68 {
69 StoreArray<MCParticle> mcParticles;
70 for (const auto& mcp : mcParticles) {
71 int pdg_no = mcp.getPDG();
72 if (abs(pdg_no) == 521) return 1.0;
73 }
74 return 0.0;
75 }
76
77 double isUnmixedBEvent(const Particle*)
78 {
79 StoreArray<MCParticle> mcParticles;
80 std::vector<int> bPDGs;
81 for (const auto& mcp : mcParticles) {
82 int pdg_no = mcp.getPDG();
83 if (abs(pdg_no) == 511) bPDGs.push_back(pdg_no);
84 }
85 if (bPDGs.size() == 2) {
86 return bPDGs[0] * bPDGs[1] < 0;
87 }
88 return Const::doubleNaN;
89 }
90
91 bool isNotContinuumEvent(const Particle*)
92 {
93 StoreArray<MCParticle> mcParticles;
94 for (const MCParticle& mcp : mcParticles) {
95 int pdg_no = mcp.getPDG();
96 if (mcp.getMother() == nullptr &&
97 ((pdg_no == 553) ||
98 (pdg_no == 100553) ||
99 (pdg_no == 200553) ||
100 (pdg_no == 300553) ||
101 (pdg_no == 9000553) ||
102 (pdg_no == 9010553)))
103 return 1;
104 }
105 return 0;
106 }
107
108 int nMCParticles(const Particle*)
109 {
110 StoreArray<MCParticle> mcps;
111 return mcps.getEntries();
112 }
113
114 int nPrimaryMCParticles(const Particle*)
115 {
116 int n = 0;
117 StoreArray<MCParticle> mcps;
118 for (const auto& mcp : mcps)
119 if (mcp.isPrimaryParticle())
120 n++;
121 return n;
122 }
123
124 int nInitialPrimaryMCParticles(const Particle*)
125 {
126 int n = 0;
127 StoreArray<MCParticle> mcps;
128 for (const auto& mcp : mcps)
129 if (mcp.isInitial() and mcp.isPrimaryParticle())
130 n++;
131 return n;
132 }
133
134 int nVirtualPrimaryMCParticles(const Particle*)
135 {
136 int n = 0;
137 StoreArray<MCParticle> mcps;
138 for (const auto& mcp : mcps)
139 if (mcp.isVirtual() and mcp.isPrimaryParticle())
140 n++;
141 return n;
142 }
143
144 int nTracks(const Particle*)
145 {
146 StoreArray<Track> tracks;
147 return tracks.getEntries();
148 }
149
150 int nV0s(const Particle*)
151 {
152 StoreArray<V0> v0s;
153 return v0s.getEntries();
154 }
155
156 int nValidV0s(const Particle*)
157 {
158 StoreArray<V0> v0s;
159
160 int n = 0;
161 for (int i = 0; i < v0s.getEntries(); i++) {
162 const V0* v0 = v0s[i];
163 if (v0->getTrackFitResults().first->getChargeSign() == v0->getTrackFitResults().second->getChargeSign())
164 continue;
165 n++;
166 }
167
168 return n;
169 }
170
171 int nNeutralECLClusters(const Particle*, const std::vector<double>& hypothesis)
172 {
173 if (hypothesis.size() != 1)
174 B2FATAL("Number of arguments of nNeutralECLClusters must be 1.");
175
176 int hypothesis_int = std::lround(hypothesis[0]);
177 if (hypothesis_int < 1 or hypothesis_int > 2) {
178 B2WARNING("nNeutralECLClusters:: Hypothesis must be 1 (nPhotons) or 2 (NeutralHadron)");
179 return 0;
180 }
181
182 StoreArray<ECLCluster> eclClusters;
183 int nClusters = 0;
184 for (int i = 0; i < eclClusters.getEntries(); i++) {
185 auto cluster = eclClusters[i];
186 if (!cluster->isNeutral())
187 continue;
188
189 if ((hypothesis_int == 1 and cluster->hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons)) or
190 (hypothesis_int == 2 and cluster->hasHypothesis(ECLCluster::EHypothesisBit::c_neutralHadron)))
191 nClusters++;
192 }
193 return nClusters;
194 }
195
196 int nChargeZeroTrackFits(const Particle*)
197 {
198 StoreArray<TrackFitResult> tfrs;
199 int out = 0;
200 for (const auto& t : tfrs)
201 if (t.getChargeSign() == 0) out++;
202 return out;
203 }
204
205 double belleECLEnergy(const Particle*)
206 {
207 StoreArray<ECLCluster> eclClusters;
208 double result = 0;
209 for (int i = 0; i < eclClusters.getEntries(); ++i) {
210 // sum only ECLClusters which have the N1 (n photons) hypothesis
211 if (!eclClusters[i]->hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons))
212 continue;
213
214 result += eclClusters[i]->getEnergy(ECLCluster::EHypothesisBit::c_nPhotons);
215 }
216 return result;
217 }
218
219 int nKLMClusters(const Particle*)
220 {
221 StoreArray<KLMCluster> klmClusters;
222 return klmClusters.getEntries();
223 }
224
225 int expNum(const Particle*)
226 {
227 StoreObjPtr<EventMetaData> evtMetaData;
228 int exp_no = evtMetaData->getExperiment();
229 return exp_no;
230 }
231
232 int productionIdentifier(const Particle*)
233 {
234 StoreObjPtr<EventMetaData> evtMetaData;
235 int eventProduction = evtMetaData->getProduction();
236 return eventProduction;
237 }
238
239 int evtNum(const Particle*)
240 {
241 StoreObjPtr<EventMetaData> evtMetaData;
242 int evt_no = evtMetaData->getEvent();
243 return evt_no;
244 }
245
246 int runNum(const Particle*)
247 {
248 StoreObjPtr<EventMetaData> evtMetaData;
249 int run_no = evtMetaData->getRun();
250 return run_no;
251 }
252
253 // Beam Energies
254 double getCMSEnergy(const Particle*)
255 {
256 PCmsLabTransform T;
257 return T.getCMSEnergy();
258 }
259
260 double getBeamPx(const Particle*)
261 {
262 PCmsLabTransform T;
263 return (T.getBeamFourMomentum()).Px();
264 }
265
266 double getBeamPy(const Particle*)
267 {
268 PCmsLabTransform T;
269 return (T.getBeamFourMomentum()).Py();
270 }
271
272 double getBeamPz(const Particle*)
273 {
274 PCmsLabTransform T;
275 return (T.getBeamFourMomentum()).Pz();
276 }
277
278 double getBeamE(const Particle*)
279 {
280 PCmsLabTransform T;
281 return (T.getBeamFourMomentum()).E();
282 }
283
284 // get total 4-momentum of all final-state particles in MC
285 static ROOT::Math::PxPyPzEVector getTotalMcFinalStateMomentum()
286 {
287 StoreArray<MCParticle> mcps;
288 ROOT::Math::PxPyPzEVector sum;
289 for (const auto& mcp : mcps) {
290 // only consider primary final-state particle generated by generator
291 if (mcp.isPrimaryParticle() and not(mcp.isInitial() or mcp.isVirtual())) {
292 const MCParticle* mother = mcp.getMother();
293 // only consider particles with no mother or particles whose mother is not initial or virtual
294 if (not mother or not(mother->isPrimaryParticle() and not(mother->isInitial() or mother->isVirtual())))
295 sum += mcp.get4Vector();
296 }
297 }
298 return sum;
299 }
300
301
302 // get 4-momentum of the incoming electron/positron in MC event
303 static ROOT::Math::PxPyPzEVector getMcBeamMomentum(int charge)
304 {
305 StoreArray<MCParticle> mcps;
306 for (const auto& mcp : mcps) {
307 if (mcp.isInitial() && mcp.getPDG() == -charge * 11) {
308 return mcp.get4Vector();
309 }
310 }
311
312 // if no initial electron/positron found
313 return ROOT::Math::PxPyPzEVector(Const::doubleNaN, Const::doubleNaN, Const::doubleNaN, Const::doubleNaN);
314 }
315
316 // get HER/LER 4-momentum based on the calibration payloads
317 static ROOT::Math::PxPyPzEVector getBeamMomentum(int charge)
318 {
319 PCmsLabTransform T;
320 double EbeamCM = T.getCMSEnergy() / 2;
321 double pBeamCM = sqrt(pow(EbeamCM, 2) - pow(Const::electronMass, 2));
322
323 ROOT::Math::PxPyPzEVector pCM(0, 0, -charge * pBeamCM, EbeamCM);
324
325 return T.cmsToLab(pCM);
326 }
327
328
329 double getMcPxHER(const Particle*) {return getMcBeamMomentum(-1).Px();}
330 double getMcPyHER(const Particle*) {return getMcBeamMomentum(-1).Py();}
331 double getMcPzHER(const Particle*) {return getMcBeamMomentum(-1).Pz();}
332
333 double getMcPxLER(const Particle*) {return getMcBeamMomentum(+1).Px();}
334 double getMcPyLER(const Particle*) {return getMcBeamMomentum(+1).Py();}
335 double getMcPzLER(const Particle*) {return getMcBeamMomentum(+1).Pz();}
336
337
338 double getPxHER(const Particle*) {return getBeamMomentum(-1).Px();}
339 double getPyHER(const Particle*) {return getBeamMomentum(-1).Py();}
340 double getPzHER(const Particle*) {return getBeamMomentum(-1).Pz();}
341
342 double getPxLER(const Particle*) {return getBeamMomentum(+1).Px();}
343 double getPyLER(const Particle*) {return getBeamMomentum(+1).Py();}
344 double getPzLER(const Particle*) {return getBeamMomentum(+1).Pz();}
345
346
347 double getCMSEnergyMC(const Particle*)
348 {
349 StoreArray<MCParticle> mcps;
350 if (!mcps) {
351 return Const::doubleNaN;
352 } else return getTotalMcFinalStateMomentum().M();
353 }
354
355 double getTotalEnergyMC(const Particle*)
356 {
357 StoreArray<MCParticle> mcps;
358 if (!mcps) {
359 return Const::doubleNaN;
360 } else return getTotalMcFinalStateMomentum().E();
361 }
362
363 double getGenIPX(const Particle*)
364 {
365 // generated IP corresponds to the generated vertex of the
366 // first not-initial and not-virtual MCParticle
367 StoreArray<MCParticle> mcps;
368 for (const auto& mcp : mcps)
369 if (not mcp.isInitial() and not mcp.isVirtual() and mcp.isPrimaryParticle())
370 return mcp.getVertex().X();
371 return Const::doubleNaN;
372 }
373
374 double getGenIPY(const Particle*)
375 {
376 StoreArray<MCParticle> mcps;
377 for (const auto& mcp : mcps)
378 if (not mcp.isInitial() and not mcp.isVirtual() and mcp.isPrimaryParticle())
379 return mcp.getVertex().Y();
380 return Const::doubleNaN;
381 }
382
383 double getGenIPZ(const Particle*)
384 {
385 StoreArray<MCParticle> mcps;
386 for (const auto& mcp : mcps)
387 if (not mcp.isInitial() and not mcp.isVirtual() and mcp.isPrimaryParticle())
388 return mcp.getVertex().Z();
389 return Const::doubleNaN;
390 }
391
392 double getIPX(const Particle*)
393 {
394 static DBObjPtr<BeamSpot> beamSpotDB;
395 return (beamSpotDB->getIPPosition()).X();
396 }
397
398 double getIPY(const Particle*)
399 {
400 static DBObjPtr<BeamSpot> beamSpotDB;
401 return (beamSpotDB->getIPPosition()).Y();
402 }
403
404 double getIPZ(const Particle*)
405 {
406 static DBObjPtr<BeamSpot> beamSpotDB;
407 return (beamSpotDB->getIPPosition()).Z();
408 }
409
410 double ipCovMatrixElement(const Particle*, const std::vector<double>& element)
411 {
412 int elementI = std::lround(element[0]);
413 int elementJ = std::lround(element[1]);
414
415 bool isOutOfRange = false;
416 if (elementI < 0 || elementI > 2) {
417 B2WARNING("Requested IP covariance matrix element is out of boundaries [0 - 2]:" << LogVar("i", elementI));
418 isOutOfRange = true;
419 }
420 if (elementJ < 0 || elementJ > 2) {
421 B2WARNING("Requested IP covariance matrix element is out of boundaries [0 - 2]:" << LogVar("j", elementJ));
422 isOutOfRange = true;
423 }
424
425 if (isOutOfRange) return Const::doubleNaN;
426
427 static DBObjPtr<BeamSpot> beamSpotDB;
428 return beamSpotDB->getCovVertex()(elementI, elementJ);
429 }
430
431 // Event kinematics -> missing momentum in lab and CMS, missing energy and mass2, visible energy
432 double missingMomentumOfEvent(const Particle*)
433 {
434 StoreObjPtr<EventKinematics> evtShape;
435 if (!evtShape) {
436 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
437 return Const::doubleNaN;
438 }
439 double missing = evtShape->getMissingMomentum().R();
440 return missing;
441 }
442
443 double missingMomentumOfEvent_Px(const Particle*)
444 {
445 StoreObjPtr<EventKinematics> evtShape;
446 if (!evtShape) {
447 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
448 return Const::doubleNaN;
449 }
450 double missing = evtShape->getMissingMomentum().X();
451 return missing;
452 }
453
454 double missingMomentumOfEvent_Py(const Particle*)
455 {
456 StoreObjPtr<EventKinematics> evtShape;
457 if (!evtShape) {
458 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
459 return Const::doubleNaN;
460 }
461 double missing = evtShape->getMissingMomentum().Y();
462 return missing;
463 }
464
465 double missingMomentumOfEvent_Pz(const Particle*)
466 {
467 StoreObjPtr<EventKinematics> evtShape;
468 if (!evtShape) {
469 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
470 return Const::doubleNaN;
471 }
472 double missing = evtShape->getMissingMomentum().Z();
473 return missing;
474 }
475
476 double missingMomentumOfEvent_theta(const Particle*)
477 {
478 StoreObjPtr<EventKinematics> evtShape;
479 if (!evtShape) {
480 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
481 return Const::doubleNaN;
482 }
483 double missing = evtShape->getMissingMomentum().Theta();
484 return missing;
485 }
486
487 double missingMomentumOfEventCMS(const Particle*)
488 {
489 StoreObjPtr<EventKinematics> evtShape;
490 if (!evtShape) {
491 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
492 return Const::doubleNaN;
493 }
494 double missing = evtShape->getMissingMomentumCMS().R();
495 return missing;
496 }
497
498 double genMissingMomentumOfEventCMS(const Particle*)
499 {
500 StoreObjPtr<EventKinematics> evtShape("EventKinematicsFromMC");
501 if (!evtShape) {
502 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule with usingMC parameter set to true?");
503 return Const::doubleNaN;
504 }
505 double missing = evtShape->getMissingMomentumCMS().R();
506 return missing;
507 }
508
509 double missingMomentumOfEventCMS_Px(const Particle*)
510 {
511 StoreObjPtr<EventKinematics> evtShape;
512 if (!evtShape) {
513 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
514 return Const::doubleNaN;
515 }
516 double missing = evtShape->getMissingMomentumCMS().X();
517 return missing;
518 }
519
520 double missingMomentumOfEventCMS_Py(const Particle*)
521 {
522 StoreObjPtr<EventKinematics> evtShape;
523 if (!evtShape) {
524 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
525 return Const::doubleNaN;
526 }
527 double missing = evtShape->getMissingMomentumCMS().Y();
528 return missing;
529 }
530
531 double missingMomentumOfEventCMS_Pz(const Particle*)
532 {
533 StoreObjPtr<EventKinematics> evtShape;
534 if (!evtShape) {
535 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
536 return Const::doubleNaN;
537 }
538 double missing = evtShape->getMissingMomentumCMS().Z();
539 return missing;
540 }
541
542 double missingMomentumOfEventCMS_theta(const Particle*)
543 {
544 StoreObjPtr<EventKinematics> evtShape;
545 if (!evtShape) {
546 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
547 return Const::doubleNaN;
548 }
549 double theta = evtShape->getMissingMomentumCMS().Theta();
550 return theta;
551 }
552
553 double missingEnergyOfEventCMS(const Particle*)
554 {
555 StoreObjPtr<EventKinematics> evtShape;
556 if (!evtShape) {
557 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
558 return Const::doubleNaN;
559 }
560 double missing = evtShape->getMissingEnergyCMS();
561 return missing;
562 }
563
564 double genMissingEnergyOfEventCMS(const Particle*)
565 {
566 StoreObjPtr<EventKinematics> evtShape("EventKinematicsFromMC");
567 if (!evtShape) {
568 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule with usingMC parameter set to true?");
569 return Const::doubleNaN;
570 }
571 double missing = evtShape->getMissingEnergyCMS();
572 return missing;
573 }
574
575
576 double missingMass2OfEvent(const Particle*)
577 {
578 StoreObjPtr<EventKinematics> evtShape;
579 if (!evtShape) {
580 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
581 return Const::doubleNaN;
582 }
583 double missing = evtShape->getMissingMass2();
584 return missing;
585 }
586
587 double genMissingMass2OfEvent(const Particle*)
588 {
589 StoreObjPtr<EventKinematics> evtShape("EventKinematicsFromMC");
590 if (!evtShape) {
591 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule with usingMC parameter set to true?");
592 return Const::doubleNaN;
593 }
594 double missing = evtShape->getMissingMass2();
595 return missing;
596 }
597
598 double visibleEnergyOfEventCMS(const Particle*)
599 {
600 StoreObjPtr<EventKinematics> evtShape;
601 if (!evtShape) {
602 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
603 return Const::doubleNaN;
604 }
605 double visible = evtShape->getVisibleEnergyCMS();
606 return visible;
607 }
608
609 double genVisibleEnergyOfEventCMS(const Particle*)
610 {
611 StoreObjPtr<EventKinematics> evtShape("EventKinematicsFromMC");
612 if (!evtShape) {
613 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule with usingMC parameter set to true?");
614 return Const::doubleNaN;
615 }
616 double visible = evtShape->getVisibleEnergyCMS();
617 return visible;
618 }
619
620
621 double totalPhotonsEnergyOfEvent(const Particle*)
622 {
623 StoreObjPtr<EventKinematics> evtShape;
624 if (!evtShape) {
625 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?");
626 return Const::doubleNaN;
627 }
628 double energyOfPhotons = evtShape->getTotalPhotonsEnergy();
629 return energyOfPhotons;
630 }
631
632 double genTotalPhotonsEnergyOfEvent(const Particle*)
633 {
634 StoreObjPtr<EventKinematics> evtShape("EventKinematicsFromMC");
635 if (!evtShape) {
636 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule with usingMC parameter set to true?");
637 return Const::doubleNaN;
638 }
639 double energyOfPhotons = evtShape->getTotalPhotonsEnergy();
640 return energyOfPhotons;
641 }
642
643 double eventYearMonthDay(const Particle*)
644 {
645 StoreObjPtr<EventMetaData> evtMetaData;
646 if (!evtMetaData) {
647 return Const::doubleNaN;
648 }
649 std::time_t rawtime = trunc(evtMetaData->getTime() / 1e9);
650 auto tt = std::gmtime(&rawtime); // GMT
651 int y = tt->tm_year + 1900; // years since 1900
652 int m = tt->tm_mon + 1; // months since January
653 int d = tt->tm_mday; // day of the month
654 return (y * 1e4) + (m * 1e2) + d;
655 }
656
657 double eventYear(const Particle*)
658 {
659 StoreObjPtr<EventMetaData> evtMetaData;
660 if (!evtMetaData) {
661 return Const::doubleNaN;
662 }
663 std::time_t rawtime = trunc(evtMetaData->getTime() / 1e9);
664 auto tt = std::gmtime(&rawtime);
665 return tt->tm_year + 1900;
666 }
667
668 double eventTimeSeconds(const Particle*)
669 {
670 StoreObjPtr<EventMetaData> evtMetaData;
671
672 if (!evtMetaData) {
673 return Const::doubleNaN;
674 }
675 double evtTime = trunc(evtMetaData->getTime() / 1e9);
676
677 return evtTime;
678 }
679
680 double eventTimeSecondsFractionRemainder(const Particle*)
681 {
682 StoreObjPtr<EventMetaData> evtMetaData;
683
684 if (!evtMetaData) {
685 return Const::doubleNaN;
686 }
687 double evtTime = trunc(evtMetaData->getTime() / 1e9);
688
689 double evtTimeFrac = (evtMetaData->getTime() - evtTime * 1e9) / 1e9;
690
691 return evtTimeFrac;
692 }
693
694 double eventT0(const Particle*)
695 {
696 StoreObjPtr<EventT0> evtT0;
697
698 if (!evtT0) {
699 B2WARNING("StoreObjPtr<EventT0> does not exist, are you running over cDST data?");
700 return Const::doubleNaN;
701 }
702
703 if (evtT0->hasEventT0()) {
704 return evtT0->getEventT0();
705 } else {
706 return Const::doubleNaN;
707 }
708 }
709
710 double timeSincePrevTriggerClockTicks(const Particle*)
711 {
712 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
713
714 // Check if the pointer is valid
715 if (!TTDInfo.isValid()) {
716 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
717 return Const::doubleNaN;
718 }
719
720 // And check if the stored data is valid
721 if (TTDInfo->isValid()) {
722 return TTDInfo->getTimeSincePrevTrigger();
723 } else {
724 return Const::doubleNaN;
725 }
726 }
727
728 double timeSincePrevTriggerMicroSeconds(const Particle*)
729 {
730 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
731
732 // Check if the pointer is valid
733 if (!TTDInfo.isValid()) {
734 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
735 return Const::doubleNaN;
736 }
737
738 // And check if the stored data is valid
739 if (TTDInfo->isValid()) {
740 return TTDInfo->getTimeSincePrevTriggerInMicroSeconds();
741 } else {
742 return Const::doubleNaN;
743 }
744 }
745
746 double triggeredBunchNumberTTD(const Particle*)
747 {
748 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
749
750 // Check if the pointer is valid
751 if (!TTDInfo.isValid()) {
752 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
753 return Const::doubleNaN;
754 }
755
756 // And check if the stored data is valid
757 if (TTDInfo->isValid()) {
758 return TTDInfo->getBunchNumber();
759 } else {
760 return Const::doubleNaN;
761 }
762 }
763
764 double triggeredBunchNumber(const Particle*)
765 {
766 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
767
768 // Check if the pointer is valid
769 if (!TTDInfo.isValid()) {
770 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
771 return Const::doubleNaN;
772 }
773
774 // And check if the stored data is valid
775 if (TTDInfo->isValid()) {
776 return TTDInfo->getTriggeredBunchNumberGlobal();
777 } else {
778 return Const::doubleNaN;
779 }
780 }
781
782 double hasRecentInjection(const Particle*)
783 {
784 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
785
786 // Check if the pointer is valid
787 if (!TTDInfo.isValid()) {
788 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
789 return Const::doubleNaN;
790 }
791
792 // And check if the stored data is valid
793 if (TTDInfo->isValid()) {
794 return TTDInfo->hasInjection();
795 } else {
796 return Const::doubleNaN;
797 }
798 }
799
800 double timeSinceLastInjectionSignalClockTicks(const Particle*)
801 {
802 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
803
804 // Check if the pointer is valid
805 if (!TTDInfo.isValid()) {
806 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
807 return Const::doubleNaN;
808 }
809
810 // And check if the stored data is valid and if an injection happened recently
811 if (TTDInfo->isValid() && TTDInfo->hasInjection()) {
812 return TTDInfo->getTimeSinceLastInjection();
813 } else {
814 return Const::doubleNaN;
815 }
816 }
817
818 double timeSinceLastInjectionSignalMicroSeconds(const Particle*)
819 {
820 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
821
822 // Check if the pointer is valid
823 if (!TTDInfo.isValid()) {
824 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
825 return Const::doubleNaN;
826 }
827
828 // And check if the stored data is valid and if an injection happened recently
829 if (TTDInfo->isValid() && TTDInfo->hasInjection()) {
830 return TTDInfo->getTimeSinceLastInjectionInMicroSeconds();
831 } else {
832 return Const::doubleNaN;
833 }
834 }
835
836 double timeSinceLastInjectionClockTicks(const Particle*)
837 {
838 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
839
840 // Check if the pointer is valid
841 if (!TTDInfo.isValid()) {
842 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
843 return Const::doubleNaN;
844 }
845
846 // And check if the stored data is valid and if an injection happened recently
847 if (TTDInfo->isValid() && TTDInfo->hasInjection()) {
848 return TTDInfo->getTimeSinceInjectedBunch();
849 } else {
850 return Const::doubleNaN;
851 }
852 }
853
854 double timeSinceLastInjectionMicroSeconds(const Particle*)
855 {
856 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
857
858 // Check if the pointer is valid
859 if (!TTDInfo.isValid()) {
860 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
861 return Const::doubleNaN;
862 }
863
864 // And check if the stored data is valid and if an injection happened recently
865 if (TTDInfo->isValid() && TTDInfo->hasInjection()) {
866 return TTDInfo->getTimeSinceInjectedBunchInMicroSeconds();
867 } else {
868 return Const::doubleNaN;
869 }
870 }
871
872 double injectionInHER(const Particle*)
873 {
874 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
875
876 // Check if the pointer is valid
877 if (!TTDInfo.isValid()) {
878 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
879 return Const::doubleNaN;
880 }
881
882 // And check if the stored data is valid and if an injection happened recently
883 if (TTDInfo->isValid() && TTDInfo->hasInjection()) {
884 return TTDInfo->isHER();
885 } else {
886 return Const::doubleNaN;
887 }
888 }
889
890 double revolutionCounter2(const Particle*)
891 {
892 StoreObjPtr<EventLevelTriggerTimeInfo> TTDInfo;
893
894 // Check if the pointer is valid
895 if (!TTDInfo.isValid()) {
896 B2WARNING("StoreObjPtr<EventLevelTriggerTimeInfo> does not exist, are you running over data reconstructed with release-05 or earlier?");
897 return Const::doubleNaN;
898 }
899
900 // And check if the stored data is valid
901 if (TTDInfo->isValid()) {
902 return TTDInfo->isRevo2();
903 } else {
904 return Const::doubleNaN;
905 }
906 }
907
908
909 VARIABLE_GROUP("Event");
910
911 REGISTER_VARIABLE("isMC", isMC,
912 "[Eventbased] Returns 1 if current basf2 process is running over simulated (Monte-Carlo) dataset and 0 in case of real experimental data.");
913 REGISTER_VARIABLE("isContinuumEvent", isContinuumEvent,
914 "[Eventbased] Returns 1.0 if event doesn't contain a :math:`\\Upsilon(4S)` particle on generator level, 0.0 otherwise.");
915 REGISTER_VARIABLE("isNotContinuumEvent", isNotContinuumEvent,
916 "[Eventbased] Returns 1.0 if event does contain an :math:`\\Upsilon(4S)` particle on generator level and therefore is not a continuum event, 0.0 otherwise.");
917
918 REGISTER_VARIABLE("isChargedBEvent", isChargedBEvent,
919 "[Eventbased] Returns 1.0 if event contains a charged B-meson on generator level.");
920 REGISTER_VARIABLE("isUnmixedBEvent", isUnmixedBEvent,
921 R"DOC([Eventbased] Returns 1.0 if the event contains opposite flavor neutral B-mesons on generator level,
9220.0 in case of same flavor B-mesons and NaN if the event has no generated neutral B.)DOC");
923
924 REGISTER_VARIABLE("nTracks", nTracks, R"DOC(
925[Eventbased] Returns the total number of tracks (unfiltered) in the event.
926
927.. warning:: This variable is exceedingly background-dependent and should not really be used in any selections (other than perhaps for monitoring purposes).
928.. seealso:: :b2:var:`nCleanedTracks` for a more useful variable for use in selections.
929)DOC");
930 REGISTER_VARIABLE("nChargeZeroTrackFits", nChargeZeroTrackFits, R"DOC(
931[Eventbased] Returns number of track fits with zero charge.
932
933.. note::
934 Sometimes, track fits can have zero charge, if background or non IP originating tracks, for example, are fit from the IP.
935 These tracks are excluded from particle lists, but a large amount of charge zero
936 fits may indicate problems with whole event constraints
937 or abnominally high beam backgrounds and/or noisy events.
938)DOC");
939
940 REGISTER_VARIABLE("belleECLEnergy", belleECLEnergy, R"DOC(
941[Eventbased][Legacy] Returns total energy in ECL in the event as used in Belle 1 analyses.
942
943.. warning::
944 For Belle II use cases use either ``totalEnergyOfParticlesInList(gamma:all)``,
945 or (probably better) fill a photon list with some minimal cleanup cuts and use that instead:
946
947 .. code-block:: python
948
949 from variables import variables as vm
950 fillParticleList("gamma:cleaned", "E > 0.05 and isFromECL==1", path=path)
951 fillParticleList("e+:cleaned", "clusterE > 0.05", path=path)
952 vm.addAlias("myNeutralECLEnergy", "totalEnergyOfParticlesInList(gamma:cleaned)")
953 vm.addAlias("myChargedECLEnergy", "totalEnergyOfParticlesInList(e+:cleaned)")
954 vm.addAlias("myECLEnergy", "formula(myNeutralECLEnergy+myChargedECLEnergy)")
955
956)DOC","GeV");
957 REGISTER_VARIABLE("nKLMClusters", nKLMClusters,
958 "[Eventbased] Returns number of KLM clusters in the event.");
959 REGISTER_VARIABLE("nNeutralECLClusters(hypothesis)", nNeutralECLClusters,
960 "[Eventbased] Returns number of neutral ECL clusters with a given hypothesis, 1:nPhotons, 2:NeutralHadron.");
961 REGISTER_VARIABLE("nV0s", nV0s,
962 "[Eventbased] Returns number of V0s in the event.");
963 REGISTER_VARIABLE("nValidV0s", nValidV0s,
964 "[Eventbased] Returns number of V0s consisting of pair of tracks with opposite charges.");
965 REGISTER_VARIABLE("nMCParticles", nMCParticles,
966 "[Eventbased] Returns number of MCParticles in the event.");
967 REGISTER_VARIABLE("nPrimaryMCParticles", nPrimaryMCParticles,
968 "[Eventbased] Returns number of primary MCParticles in the event.");
969 REGISTER_VARIABLE("nInitialPrimaryMCParticles", nInitialPrimaryMCParticles,
970 "[Eventbased] Returns number of initial primary MCParticles in the event.");
971 REGISTER_VARIABLE("nVirtualPrimaryMCParticles", nVirtualPrimaryMCParticles,
972 "[Eventbased] Returns number of virtual primary MCParticles in the event.");
973
974 REGISTER_VARIABLE("expNum", expNum, "[Eventbased] Returns the experiment number.");
975 REGISTER_VARIABLE("evtNum", evtNum, "[Eventbased] Returns the event number.");
976 REGISTER_VARIABLE("runNum", runNum, "[Eventbased] Returns the run number.");
977 REGISTER_VARIABLE("productionIdentifier", productionIdentifier, R"DOC(
978[Eventbased] Production identifier.
979Uniquely identifies an MC sample by the (grid-jargon) production ID.
980This is useful when analysing large MC samples split between more than one production or combining different MC samples (e.g. combining all continuum samples).
981In such cases the event numbers are sequential *only within a production*, so experiment/run/event will restart with every new sample analysed.
982
983.. tip:: Experiment/run/event/production is unique for all MC samples. Experiment/run/event is unique for data.
984
985.. seealso:: `Where can I rely on uniqueness of the ['__experiment__', '__run__', '__event__', '__candidate__'] combination? <https://questions.belle2.org/question/9704>`__
986)DOC");
987
988 REGISTER_VARIABLE("Ecms", getCMSEnergy, "[Eventbased] Returns center-of-mass energy.\n\n", "GeV");
989 REGISTER_VARIABLE("beamE", getBeamE, "[Eventbased] Returns total beam energy in the laboratory frame.\n\n","GeV");
990 REGISTER_VARIABLE("beamPx", getBeamPx, "[Eventbased] Returns x component of total beam momentum in the laboratory frame.\n\n","GeV/c");
991 REGISTER_VARIABLE("beamPy", getBeamPy, "[Eventbased] Returns y component of total beam momentum in the laboratory frame.\n\n","GeV/c");
992 REGISTER_VARIABLE("beamPz", getBeamPz, "[Eventbased] Returns z component of total beam momentum in the laboratory frame.\n\n","GeV/c");
993 REGISTER_VARIABLE("EcmsMC", getCMSEnergyMC, "[Eventbased] Truth value of sqrt(s)\n\n", "GeV");
994 REGISTER_VARIABLE("totalEnergyMC", getTotalEnergyMC, "[Eventbased] Truth value of sum of energies of all the generated particles\n\n", "GeV");
995
996
997 REGISTER_VARIABLE("PxHER", getPxHER, "[Eventbased] Returns truth value of the x component of the incoming electron momentum in the laboratory frame.\n\n","GeV/c");
998 REGISTER_VARIABLE("PyHER", getPyHER, "[Eventbased] Returns truth value of the y component of the incoming electron momentum in the laboratory frame.\n\n","GeV/c");
999 REGISTER_VARIABLE("PzHER", getPzHER, "[Eventbased] Returns truth value of the z component of the incoming electron momentum in the laboratory frame.\n\n","GeV/c");
1000 REGISTER_VARIABLE("PxLER", getPxLER, "[Eventbased] Returns truth value of the x component of the incoming positron momentum in the laboratory frame.\n\n","GeV/c");
1001 REGISTER_VARIABLE("PyLER", getPyLER, "[Eventbased] Returns truth value of the y component of the incoming positron momentum in the laboratory frame.\n\n","GeV/c");
1002 REGISTER_VARIABLE("PzLER", getPzLER, "[Eventbased] Returns truth value of the z component of the incoming positron momentum in the laboratory frame.\n\n","GeV/c");
1003
1004 REGISTER_VARIABLE("mcPxHER", getMcPxHER, "[Eventbased] Returns x component of the electron beam momentum in the laboratory frame.\n\n","GeV/c");
1005 REGISTER_VARIABLE("mcPyHER", getMcPyHER, "[Eventbased] Returns y component of the electron beam momentum in the laboratory frame.\n\n","GeV/c");
1006 REGISTER_VARIABLE("mcPzHER", getMcPzHER, "[Eventbased] Returns z component of the electron beam momentum in the laboratory frame.\n\n","GeV/c");
1007 REGISTER_VARIABLE("mcPxLER", getMcPxLER, "[Eventbased] Returns x component of the positron beam momentum in the laboratory frame.\n\n","GeV/c");
1008 REGISTER_VARIABLE("mcPyLER", getMcPyLER, "[Eventbased] Returns y component of the positron beam momentum in the laboratory frame.\n\n","GeV/c");
1009 REGISTER_VARIABLE("mcPzLER", getMcPzLER, "[Eventbased] Returns z component of the positron beam momentum in the laboratory frame.\n\n","GeV/c");
1010
1011
1012
1013 REGISTER_VARIABLE("IPX", getIPX, R"DOC(
1014[Eventbased] Returns x coordinate of the measured interaction point.
1015
1016.. note:: For old data and uncalibrated MC files this will return 0.0.
1017
1018.. note:: You might hear tracking and calibration people refer to this as the ``BeamSpot``.
1019
1020)DOC","cm");
1021 REGISTER_VARIABLE("IPY", getIPY, "[Eventbased] Returns y coordinate of the measured interaction point.\n\n","cm");
1022 REGISTER_VARIABLE("IPZ", getIPZ, "[Eventbased] Returns z coordinate of the measured interaction point.\n\n","cm");
1023 REGISTER_VARIABLE("IPCov(i,j)", ipCovMatrixElement, "[Eventbased] Returns (i,j)-th element of the covariance matrix of the measured interaction point.\n\n",":math:`\\text{cm}^2`");
1024
1025 REGISTER_VARIABLE("genIPX", getGenIPX, R"DOC(
1026[Eventbased] Returns x coordinate of the interaction point used for the underlying **MC generation**.
1027Returns NaN for data.
1028
1029.. note:: This is normally smeared from 0.0
1030
1031)DOC","cm");
1032 REGISTER_VARIABLE("genIPY", getGenIPY, "[Eventbased] Returns y coordinate of the interaction point used for the underlying **MC generation**. Returns NaN for data.\n\n","cm");
1033 REGISTER_VARIABLE("genIPZ", getGenIPZ, "[Eventbased] Returns z coordinate of the interaction point used for the underlying **MC generation**. Returns NaN for data.\n\n","cm");
1034
1035 REGISTER_VARIABLE("date", eventYearMonthDay, R"DOC(
1036[Eventbased] Returns the date when the event was recorded, a number of the form YYYYMMDD (in UTC).
1037
1038.. seealso:: :b2:var:`year`, :b2:var:`eventTimeSeconds`, :b2:var:`eventTimeSecondsFractionRemainder`, provided for convenience.
1039)DOC");
1040 REGISTER_VARIABLE("year", eventYear, R"DOC(
1041[Eventbased] Returns the year when the event was recorded (in UTC).
1042
1043.. tip::
1044 For more precise event time, see :b2:var:`eventTimeSeconds` and :b2:var:`eventTimeSecondsFractionRemainder`.
1045)DOC");
1046 REGISTER_VARIABLE("eventTimeSeconds", eventTimeSeconds,
1047 "[Eventbased] Time of the event (truncated down) since 1970/1/1 (Unix epoch).\n\n","s");
1048 REGISTER_VARIABLE("eventTimeSecondsFractionRemainder", eventTimeSecondsFractionRemainder, R"DOC(
1049[Eventbased] Remainder of the event time.
1050
1051.. tip:: Use eventTimeSeconds + eventTimeSecondsFractionRemainder to get the total event time in seconds.
1052
1053)DOC","s");
1054
1055 REGISTER_VARIABLE("timeSincePrevTriggerClockTicks", timeSincePrevTriggerClockTicks,
1056 "[Eventbased] Time since the previous trigger (127MHz=RF/4 clock).\n\n","clock ticks");
1057
1058 REGISTER_VARIABLE("timeSincePrevTriggerMicroSeconds", timeSincePrevTriggerMicroSeconds,
1059 "[Eventbased] Time since the previous trigger.\n\n",":math:`\\mathrm{\\mu s}`");
1060
1061 REGISTER_VARIABLE("triggeredBunchNumberTTD", triggeredBunchNumberTTD, R"DOC(
1062[Eventbased] Number of triggered bunch ranging from 0-1279.
1063
1064.. warning:: This is the bunch number as provided by the TTD, which does not necessarily correspond to the 'global' SKB bunch number.
1065.. note:: There are a maximum of 5120 buckets, which could each carry one bunch of e+/e-, but we only have 1280 clock ticks (=5120/4) to identify the bunches.
1066)DOC");
1067
1068 REGISTER_VARIABLE("triggeredBunchNumber", triggeredBunchNumber, R"DOC(
1069[Eventbased] Number of triggered bunch ranging from 0-1279.
1070
1071.. note:: There are a maximum of 5120 buckets, which could each carry one bunch of e+/e-, but we only have 1280 clock ticks (=5120/4) to identify the bunches
1072)DOC");
1073
1074 REGISTER_VARIABLE("hasRecentInjection", hasRecentInjection,
1075 "[Eventbased] Returns 1 if an injection happened recently, 0 otherwise.");
1076
1077 REGISTER_VARIABLE("timeSinceLastInjectionSignalClockTicks", timeSinceLastInjectionSignalClockTicks, R"DOC(
1078[Eventbased] Time since the last injection pre-kick signal (127MHz=RF/4 clock)
1079
1080.. warning:: this returns the time without the delay until the injected bunch reaches the detector (which differs for HER/LER)
1081
1082)DOC","clock ticks");
1083
1084 REGISTER_VARIABLE("timeSinceLastInjectionSignalMicroSeconds", timeSinceLastInjectionSignalMicroSeconds, R"DOC(
1085[Eventbased] Time since the last injection pre-kick signal
1086
1087.. warning:: this returns the time without the delay until the injected bunch reaches the detector (which differs for HER/LER)
1088
1089)DOC",":math:`\\mathrm{\\mu s}`");
1090
1091 REGISTER_VARIABLE("timeSinceLastInjectionClockTicks", timeSinceLastInjectionClockTicks,
1092 "[Eventbased] Time since the last injected bunch passed by the detector.\n\n","clock ticks")
1093
1094 REGISTER_VARIABLE("timeSinceLastInjectionMicroSeconds", timeSinceLastInjectionMicroSeconds,
1095 "[Eventbased] Time since the last injected bunch passed by the detector.\n\n",":math:`\\mathrm{\\mu s}`")
1096
1097 REGISTER_VARIABLE("injectionInHER", injectionInHER,
1098 "[Eventbased] Returns 1 if injection was in HER, 0 otherwise.");
1099
1100 REGISTER_VARIABLE("revolutionCounter2", revolutionCounter2, R"DOC(
1101[Eventbased] The lowest bit of revolution counter, i.e. return 0 or 1
1102
1103.. note:: related to PXD data acquisition; PXD needs ~2 revolutions to read out one frame
1104)DOC");
1105
1106 VARIABLE_GROUP("EventKinematics");
1107
1108 REGISTER_VARIABLE("missingMomentumOfEvent", missingMomentumOfEvent, R"DOC(
1109[Eventbased] The magnitude of the missing momentum in laboratory frame.
1110
1111.. warning:: You have to run the Event Kinematics builder module for this variable to be meaningful.
1112.. seealso:: `modularAnalysis.buildEventKinematics`.
1113
1114)DOC","GeV/c");
1115 REGISTER_VARIABLE("missingMomentumOfEvent_Px", missingMomentumOfEvent_Px, R"DOC(
1116[Eventbased] The x component of the missing momentum in laboratory frame.
1117
1118)DOC","GeV/c");
1119 REGISTER_VARIABLE("missingMomentumOfEvent_Py", missingMomentumOfEvent_Py, R"DOC(
1120[Eventbased] The y component of the missing momentum in laboratory frame.
1121
1122)DOC","GeV/c");
1123 REGISTER_VARIABLE("missingMomentumOfEvent_Pz", missingMomentumOfEvent_Pz, R"DOC(
1124[Eventbased] The z component of the missing momentum in laboratory frame.
1125
1126)DOC","GeV/c");
1127 REGISTER_VARIABLE("missingMomentumOfEvent_theta", missingMomentumOfEvent_theta, R"DOC(
1128[Eventbased] The theta angle of the missing momentum of the event in laboratory frame.
1129
1130)DOC","rad");
1131 REGISTER_VARIABLE("missingMomentumOfEventCMS", missingMomentumOfEventCMS, R"DOC(
1132[Eventbased] The magnitude of the missing momentum in center-of-mass frame.
1133
1134)DOC","GeV/c");
1135 REGISTER_VARIABLE("genMissingMomentumOfEventCMS", genMissingMomentumOfEventCMS, R"DOC(
1136[Eventbased] The magnitude of the missing momentum in center-of-mass frame from generator
1137
1138)DOC","GeV/c");
1139 REGISTER_VARIABLE("missingMomentumOfEventCMS_Px", missingMomentumOfEventCMS_Px, R"DOC(
1140[Eventbased] The x component of the missing momentum in center-of-mass frame.
1141
1142)DOC","GeV/c");
1143 REGISTER_VARIABLE("missingMomentumOfEventCMS_Py", missingMomentumOfEventCMS_Py, R"DOC(
1144[Eventbased] The y component of the missing momentum in center-of-mass frame.
1145
1146)DOC","GeV/c");
1147 REGISTER_VARIABLE("missingMomentumOfEventCMS_Pz", missingMomentumOfEventCMS_Pz, R"DOC(
1148[Eventbased] The z component of the missing momentum in center-of-mass frame.
1149
1150)DOC","GeV/c");
1151 REGISTER_VARIABLE("missingMomentumOfEventCMS_theta", missingMomentumOfEventCMS_theta, R"DOC(
1152[Eventbased] The theta angle of the missing momentum in center-of-mass frame.
1153
1154)DOC","rad");
1155 REGISTER_VARIABLE("missingEnergyOfEventCMS", missingEnergyOfEventCMS, R"DOC(
1156[Eventbased] The missing energy in center-of-mass frame.
1157
1158)DOC","GeV");
1159 REGISTER_VARIABLE("genMissingEnergyOfEventCMS", genMissingEnergyOfEventCMS, R"DOC(
1160[Eventbased] The missing energy in center-of-mass frame from generator.
1161
1162)DOC","GeV");
1163 REGISTER_VARIABLE("missingMass2OfEvent", missingMass2OfEvent, R"DOC(
1164[Eventbased] The missing mass squared.
1165
1166)DOC",":math:`[\\text{GeV}/\\text{c}^2]^2`");
1167 REGISTER_VARIABLE("genMissingMass2OfEvent", genMissingMass2OfEvent, R"DOC(
1168[Eventbased] The missing mass squared from generator
1169
1170)DOC",":math:`[\\text{GeV}/\\text{c}^2]^2`");
1171 REGISTER_VARIABLE("visibleEnergyOfEventCMS", visibleEnergyOfEventCMS, R"DOC(
1172[Eventbased] The visible energy in center-of-mass frame.
1173
1174)DOC","GeV");
1175 REGISTER_VARIABLE("genVisibleEnergyOfEventCMS", genVisibleEnergyOfEventCMS, R"DOC(
1176[Eventbased] The visible energy in center-of-mass frame from generator.
1177
1178)DOC","GeV");
1179 REGISTER_VARIABLE("totalPhotonsEnergyOfEvent", totalPhotonsEnergyOfEvent, R"DOC(
1180[Eventbased] The energy in laboratory frame of all the photons.
1181
1182)DOC","GeV");
1183 REGISTER_VARIABLE("genTotalPhotonsEnergyOfEvent", genTotalPhotonsEnergyOfEvent, R"DOC(
1184[Eventbased] The energy in laboratory frame of all the photons. from generator.
1185
1186)DOC","GeV");
1187
1188 VARIABLE_GROUP("Event (cDST only)");
1189 REGISTER_VARIABLE("eventT0", eventT0, R"DOC(
1190[Eventbased][Calibration] The Event t0, is the time of the event relative to the trigger time.
1191
1192.. note::
1193 The event time can be measured by several sub-detectors including the SVD, CDC, ECL, and TOP.
1194 This eventT0 variable is the final combined value of all the event time measurements.
1195 Currently, only the SVD and ECL are used in this combination.
1196
1197)DOC","ns");
1198 }
1200}
static const double electronMass
electron mass
Definition: Const.h:685
static const double doubleNaN
quiet_NaN
Definition: Const.h:703
@ c_nPhotons
CR is split into n photons (N1)
@ c_neutralHadron
CR is reconstructed as a neutral hadron (N2)
bool isMC() const
Do we have generated, not real data?
Definition: Environment.cc:54
static Environment & Instance()
Static method to get a reference to the Environment instance.
Definition: Environment.cc:28
Class to store variables with their name which were sent to the logging service.
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
Abstract base class for different kinds of events.