10#include <analysis/variables/ROEVariables.h>
12#include <analysis/variables/Variables.h>
15#include <framework/datastore/StoreArray.h>
16#include <framework/datastore/StoreObjPtr.h>
19#include <analysis/dataobjects/Particle.h>
20#include <analysis/dataobjects/ParticleList.h>
21#include <mdst/dataobjects/MCParticle.h>
22#include <mdst/dataobjects/ECLCluster.h>
25#include <framework/logging/Logger.h>
26#include <framework/utilities/Conversion.h>
27#include <framework/gearbox/Const.h>
30#include <analysis/utility/PCmsLabTransform.h>
31#include <analysis/utility/ReferenceFrame.h>
35#include <Math/AxisAngle.h>
36#include <Math/VectorUtil.h>
49 bool isInRestOfEvent(
const Particle* particle)
52 StoreObjPtr<RestOfEvent> roeobjptr;
53 if (not roeobjptr.isValid())
56 const RestOfEvent* roe = &(*roeobjptr);
58 return isInThisRestOfEvent(particle, roe);
61 bool isCloneOfSignalSide(
const Particle* particle)
64 StoreObjPtr<RestOfEvent> roe;
65 if (not roe.isValid()) {
66 B2ERROR(
"Please use isCloneOfSignalSide variable in for_each ROE loop!");
69 auto* particleMC = particle->getMCParticle();
73 auto* signal = roe->getRelatedFrom<Particle>();
74 auto signalFSPs = signal->getFinalStateDaughters();
75 for (
auto* daughter : signalFSPs) {
76 auto* daughterMC = daughter->getMCParticle();
77 if (daughterMC == particleMC) {
84 bool hasAncestorFromSignalSide(
const Particle* particle)
86 StoreObjPtr<RestOfEvent> roe;
88 B2ERROR(
"Please use hasAncestorFromSignalSide variable in for_each ROE loop!");
91 auto* particleMC = particle->getMCParticle();
95 auto* signalReco = roe->getRelatedFrom<Particle>();
96 auto* signalMC = signalReco->getMCParticle();
97 MCParticle* ancestorMC = particleMC->getMother();
99 if (ancestorMC == signalMC) {
102 ancestorMC = ancestorMC->getMother();
109 if (arguments.size() != 1)
110 B2FATAL(
"Wrong number of arguments (1 required) for meta function currentROEIsInList");
112 std::string listName = arguments[0];
114 auto func = [listName](
const Particle*) ->
bool {
116 StoreObjPtr<ParticleList> particleList(listName);
117 if (!(particleList.isValid()))
119 B2FATAL(
"Invalid Listname " << listName <<
" given to currentROEIsInList!");
121 StoreObjPtr<RestOfEvent> roe(
"RestOfEvent");
123 if (not roe.isValid())
126 auto* particle = roe->getRelatedFrom<Particle>();
127 if (particle ==
nullptr)
129 B2ERROR(
"Relation between particle and ROE doesn't exist! currentROEIsInList variable has to be called from ROE loop");
132 return particleList->contains(particle) ? 1 : 0;
140 if (arguments.size() != 1)
141 B2FATAL(
"Wrong number of arguments (1 required) for meta function particleRelatedToCurrentROE");
144 auto func = [var](
const Particle*) ->
double {
146 StoreObjPtr<RestOfEvent> roe(
"RestOfEvent");
148 if (not roe.isValid())
151 auto* particle = roe->getRelatedFrom<Particle>();
152 if (particle ==
nullptr)
154 B2ERROR(
"Relation between particle and ROE doesn't exist! particleRelatedToCurrentROE variable has to be called from ROE loop");
157 if (std::holds_alternative<double>(var->function(particle)))
159 return std::get<double>(var->function(particle));
160 }
else if (std::holds_alternative<int>(var->function(particle)))
162 return std::get<int>(var->function(particle));
163 }
else if (std::holds_alternative<bool>(var->function(particle)))
165 return std::get<bool>(var->function(particle));
174 if (arguments.size() == 1) {
176 auto func = [var](
const Particle * particle) ->
double {
178 const RestOfEvent* roe = particle->getRelatedTo<RestOfEvent>();
182 StoreObjPtr<RestOfEvent> roeObjPtr(
"RestOfEvent");
183 if (roeObjPtr.isValid()) {
189 B2ERROR(
"Neither relation between particle and ROE exists nor ROE object has been found!");
193 ROOT::Math::PxPyPzEVector pRecoil = T.getBeamFourMomentum() - roe->get4Vector();
194 Particle tmp(pRecoil, 0);
195 UseReferenceFrame<RestFrame> frame(&tmp);
196 if (std::holds_alternative<double>(var->function(particle)))
198 return std::get<double>(var->function(particle));
199 }
else if (std::holds_alternative<int>(var->function(particle)))
201 return std::get<int>(var->function(particle));
202 }
else if (std::holds_alternative<bool>(var->function(particle)))
204 return std::get<bool>(var->function(particle));
209 B2FATAL(
"Wrong number of arguments for meta function useROERecoilFrame");
215 int nRemainingTracksInROE(
const Particle* particle,
const std::string& maskName)
217 StoreObjPtr<RestOfEvent> roe(
"RestOfEvent");
218 if (not roe.isValid())
220 int n_roe_tracks = roe->getNTracks(maskName);
221 int n_par_tracks = 0;
222 const auto& daughters = particle->getFinalStateDaughters();
223 for (
const auto& daughter : daughters) {
224 if (daughter->getParticleSource() == Particle::EParticleSourceObject::c_Track && roe->hasParticle(daughter, maskName)) {
228 return n_roe_tracks - n_par_tracks;
235 if (arguments.size() == 1)
236 maskName = arguments[0];
237 else if (arguments.size() > 1)
238 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function nROE_RemainingTracks");
240 auto func = [maskName](
const Particle * particle) ->
int {
241 return nRemainingTracksInROE(particle, maskName);
246 int nROE_RemainingTracks(
const Particle* particle)
248 return nRemainingTracksInROE(particle);
251 int nROE_KLMClusters(
const Particle* particle)
254 const RestOfEvent* roe = getRelatedROEObject(particle);
257 B2ERROR(
"Relation between particle and ROE doesn't exist!");
261 return roe->getNKLMClusters();
264 double ROE_MC_E(
const Particle* particle)
266 const MCParticle* mcp = particle->getMCParticle();
272 ROOT::Math::PxPyPzEVector boostvec = T.getBeamFourMomentum();
273 auto mcroe4vector = boostvec - mcp->get4Vector();
275 auto frameMCRoe4Vector = frame.getMomentum(mcroe4vector);
276 return frameMCRoe4Vector.energy();
279 double ROE_MC_P(
const Particle* particle)
281 const MCParticle* mcp = particle->getMCParticle();
287 ROOT::Math::PxPyPzEVector boostvec = T.getBeamFourMomentum();
288 auto mcroe4vector = boostvec - mcp->get4Vector();
290 auto frameMCRoe4Vector = frame.getMomentum(mcroe4vector);
291 return frameMCRoe4Vector.P();
294 double ROE_MC_Px(
const Particle* particle)
296 const MCParticle* mcp = particle->getMCParticle();
302 ROOT::Math::PxPyPzEVector boostvec = T.getBeamFourMomentum();
303 auto mcroe4vector = boostvec - mcp->get4Vector();
305 auto frameMCRoe4Vector = frame.getMomentum(mcroe4vector);
307 return frameMCRoe4Vector.px();
310 double ROE_MC_Py(
const Particle* particle)
312 const MCParticle* mcp = particle->getMCParticle();
318 ROOT::Math::PxPyPzEVector boostvec = T.getBeamFourMomentum();
319 auto mcroe4vector = boostvec - mcp->get4Vector();
321 auto frameMCRoe4Vector = frame.getMomentum(mcroe4vector);
323 return frameMCRoe4Vector.py();
326 double ROE_MC_Pz(
const Particle* particle)
328 const MCParticle* mcp = particle->getMCParticle();
334 ROOT::Math::PxPyPzEVector boostvec = T.getBeamFourMomentum();
335 auto mcroe4vector = boostvec - mcp->get4Vector();
337 auto frameMCRoe4Vector = frame.getMomentum(mcroe4vector);
339 return frameMCRoe4Vector.pz();
342 double ROE_MC_Pt(
const Particle* particle)
344 const MCParticle* mcp = particle->getMCParticle();
350 ROOT::Math::PxPyPzEVector boostvec = T.getBeamFourMomentum();
351 auto mcroe4vector = boostvec - mcp->get4Vector();
353 auto frameMCRoe4Vector = frame.getMomentum(mcroe4vector);
355 return frameMCRoe4Vector.pt();
358 double ROE_MC_PTheta(
const Particle* particle)
360 const MCParticle* mcp = particle->getMCParticle();
366 ROOT::Math::PxPyPzEVector boostvec = T.getBeamFourMomentum();
367 auto mcroe4vector = boostvec - mcp->get4Vector();
369 auto frameMCRoe4Vector = frame.getMomentum(mcroe4vector);
371 return frameMCRoe4Vector.Theta();
374 double ROE_MC_M(
const Particle* particle)
376 const MCParticle* mcp = particle->getMCParticle();
382 ROOT::Math::PxPyPzEVector boostvec = T.getBeamFourMomentum();
384 return (boostvec - mcp->get4Vector()).M();
391 if (arguments.size() == 1)
392 maskName = arguments[0];
393 else if (arguments.size() > 1)
394 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roeMC_MissFlags");
396 auto func = [maskName](
const Particle * particle) ->
double {
398 StoreArray<Particle> particles;
401 const MCParticle* mcParticle = particle->getMCParticle();
407 const MCParticle* mcMother = mcParticle->getMother();
413 std::vector<MCParticle*> mcDaughters = mcMother->getDaughters();
415 if (mcDaughters.size() != 2)
419 MCParticle* mcROE =
nullptr;
420 if (mcDaughters[0]->getArrayIndex() == mcParticle->getArrayIndex())
421 mcROE = mcDaughters[1];
423 mcROE = mcDaughters[0];
426 const RestOfEvent* roe = getRelatedROEObject(particle);
428 std::set<const MCParticle*> mcROEObjects;
430 auto roeParticles = roe->getParticles(maskName);
431 for (
auto* roeParticle : roeParticles)
433 auto* mcroeParticle = roeParticle->getMCParticle();
434 if (mcroeParticle !=
nullptr) {
435 mcROEObjects.insert(mcroeParticle);
439 checkMCParticleMissingFlags(mcROE, mcROEObjects, flags);
450 if (arguments.size() == 1)
451 maskName = arguments[0];
452 else if (arguments.size() > 1)
453 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function nROE_Tracks");
455 auto func = [maskName](
const Particle * particle) ->
int {
458 const RestOfEvent* roe = getRelatedROEObject(particle);
462 B2ERROR(
"Relation between particle and ROE doesn't exist!");
466 return roe->getNTracks(maskName);
475 if (arguments.size() == 1)
476 maskName = arguments[0];
477 else if (arguments.size() > 1)
478 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function nROE_ECLClusters");
480 auto func = [maskName](
const Particle * particle) ->
int {
483 const RestOfEvent* roe = getRelatedROEObject(particle);
487 B2ERROR(
"Relation between particle and ROE doesn't exist!");
491 return roe->getNECLClusters(maskName);
500 if (arguments.size() == 1)
501 maskName = arguments[0];
502 else if (arguments.size() > 1)
503 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function nROE_NeutralECLClusters");
505 auto func = [maskName](
const Particle * particle) ->
int {
508 const RestOfEvent* roe = getRelatedROEObject(particle);
512 B2ERROR(
"Relation between particle and ROE doesn't exist!");
516 return roe->getPhotons(maskName).size();
525 if (arguments.size() == 1) {
526 maskName = arguments[0];
527 }
else if (arguments.size() > 1) {
528 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function nROE_Photons");
530 auto func = [maskName](
const Particle * particle) ->
int {
533 const RestOfEvent* roe = getRelatedROEObject(particle);
537 B2ERROR(
"Relation between particle and ROE doesn't exist!");
542 auto roeClusters = roe->getPhotons(maskName);
546 for (
auto& roeCluster : roeClusters)
558 if (arguments.size() == 1) {
559 maskName = arguments[0];
560 }
else if (arguments.size() > 1) {
561 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function nROE_NeutralHadrons");
563 auto func = [maskName](
const Particle * particle) ->
int {
566 const RestOfEvent* roe = getRelatedROEObject(particle);
570 B2ERROR(
"Relation between particle and ROE doesn't exist!");
574 return roe->getHadrons(maskName).size();
583 if (arguments.size() == 1) {
584 maskName = arguments[0];
585 }
else if (arguments.size() == 2) {
586 maskName = arguments[0];
589 }
catch (std::invalid_argument&) {
590 B2ERROR(
"First argument of nROE_Charged must be a PDG code");
593 }
else if (arguments.size() > 2) {
594 B2FATAL(
"Wrong number of arguments (2 optional) for meta function nROE_Charged");
596 auto func = [maskName, pdgCode](
const Particle * particle) ->
int {
599 const RestOfEvent* roe = getRelatedROEObject(particle);
603 B2ERROR(
"Relation between particle and ROE doesn't exist!");
607 return roe->getChargedParticles(maskName, abs(pdgCode)).size();
616 if (arguments.size() == 1) {
617 maskName = arguments[0];
618 }
else if (arguments.size() > 1) {
619 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function nROE_Composites");
621 auto func = [maskName](
const Particle * particle) ->
int {
624 const RestOfEvent* roe = getRelatedROEObject(particle);
628 B2ERROR(
"Relation between particle and ROE doesn't exist!");
632 auto particles = roe->getParticles(maskName,
false);
634 for (
auto roeParticle : particles)
636 if (roeParticle->getParticleSource() == Particle::c_Composite or
637 roeParticle->getParticleSource() == Particle::c_V0) {
648 std::string pListName;
651 if (arguments.size() == 1) {
652 pListName = arguments[0];
653 }
else if (arguments.size() == 2) {
654 pListName = arguments[0];
655 maskName = arguments[1];
657 B2FATAL(
"Wrong number of arguments (1 or 2 required) for meta function nROE_ParticlesInList");
659 auto func = [pListName, maskName](
const Particle * particle) ->
int {
662 const RestOfEvent* roe = getRelatedROEObject(particle);
666 B2ERROR(
"Relation between particle and ROE doesn't exist!");
673 StoreObjPtr<ParticleList> pList(pListName);
674 if (!pList.isValid())
675 B2FATAL(
"ParticleList " << pListName <<
" could not be found or is not valid!");
677 for (
unsigned int i = 0; i < pList->getListSize(); i++)
679 const Particle* part = pList->getParticle(i);
680 if (isInThisRestOfEvent(part, roe, maskName))
693 if (arguments.size() == 1)
694 maskName = arguments[0];
695 else if (arguments.size() > 1)
696 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roeCharge");
698 auto func = [maskName](
const Particle * particle) ->
double {
701 const RestOfEvent* roe = getRelatedROEObject(particle);
705 B2ERROR(
"Relation between particle and ROE doesn't exist!");
710 auto roeParticles = roe->getParticles(maskName);
713 for (
auto* roeParticle : roeParticles)
715 roeCharge += roeParticle->getCharge();
727 if (arguments.size() == 1)
728 maskName = arguments[0];
729 else if (arguments.size() > 1)
730 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roeEextra");
732 auto func = [maskName](
const Particle * particle) ->
double {
735 const RestOfEvent* roe = getRelatedROEObject(particle);
739 B2ERROR(
"Relation between particle and ROE doesn't exist!");
745 auto roeClusters = roe->getPhotons(maskName);
747 for (
auto& roeCluster : roeClusters)
749 extraE += roeCluster->getECLClusterEnergy();
751 auto roeChargedParticles = roe->getChargedParticles(maskName);
753 for (
auto& roeChargedParticle : roeChargedParticles)
755 if (roeChargedParticle->getECLCluster())
756 extraE += roeChargedParticle->getECLClusterEnergy();
768 if (arguments.size() == 1)
769 maskName = arguments[0];
770 else if (arguments.size() > 1)
771 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roeNeextra");
773 auto func = [maskName](
const Particle * particle) ->
double {
776 const RestOfEvent* roe = getRelatedROEObject(particle);
780 B2ERROR(
"Relation between particle and ROE doesn't exist!");
783 auto roephotons = roe->getPhotons(maskName);
784 ROOT::Math::PxPyPzEVector total4vector;
785 for (
auto* photon : roephotons)
787 total4vector += photon->get4Vector();
790 auto frameRoe4Vector = frame.getMomentum(total4vector);
791 return frameRoe4Vector.energy();
800 if (arguments.size() == 1)
801 maskName = arguments[0];
802 else if (arguments.size() > 1)
803 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roeE");
805 auto func = [maskName](
const Particle * particle) ->
double {
806 const RestOfEvent* roe = particle->getRelatedTo<RestOfEvent>();
809 B2ERROR(
"Relation between particle and ROE doesn't exist!");
813 auto frameRoe4Vector = frame.getMomentum(roe->get4Vector(maskName));
814 return frameRoe4Vector.energy();
823 if (arguments.size() == 1)
824 maskName = arguments[0];
825 else if (arguments.size() > 1)
826 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roeM");
828 auto func = [maskName](
const Particle * particle) ->
double {
831 const RestOfEvent* roe = getRelatedROEObject(particle);
835 B2ERROR(
"Relation between particle and ROE doesn't exist!");
839 return roe->get4Vector(maskName).M();
848 if (arguments.size() == 1)
849 maskName = arguments[0];
850 else if (arguments.size() > 1)
851 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roeP");
853 auto func = [maskName](
const Particle * particle) ->
double {
856 const RestOfEvent* roe = getRelatedROEObject(particle);
860 B2ERROR(
"Relation between particle and ROE doesn't exist!");
865 auto frameRoe4Vector = frame.getMomentum(roe->get4Vector(maskName));
866 return frameRoe4Vector.P();
875 if (arguments.size() == 1)
876 maskName = arguments[0];
877 else if (arguments.size() > 1)
878 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roePx");
880 auto func = [maskName](
const Particle * particle) ->
double {
883 const RestOfEvent* roe = getRelatedROEObject(particle);
887 B2ERROR(
"Relation between particle and ROE doesn't exist!");
892 auto frameRoe4Vector = frame.getMomentum(roe->get4Vector(maskName));
893 return frameRoe4Vector.px();
902 if (arguments.size() == 1)
903 maskName = arguments[0];
904 else if (arguments.size() > 1)
905 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roePy");
907 auto func = [maskName](
const Particle * particle) ->
double {
910 const RestOfEvent* roe = getRelatedROEObject(particle);
914 B2ERROR(
"Relation between particle and ROE doesn't exist!");
919 auto frameRoe4Vector = frame.getMomentum(roe->get4Vector(maskName));
920 return frameRoe4Vector.py();
929 if (arguments.size() == 1)
930 maskName = arguments[0];
931 else if (arguments.size() > 1)
932 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roePt");
934 auto func = [maskName](
const Particle * particle) ->
double {
937 const RestOfEvent* roe = getRelatedROEObject(particle);
941 B2ERROR(
"Relation between particle and ROE doesn't exist!");
946 auto frameRoe4Vector = frame.getMomentum(roe->get4Vector(maskName));
947 return frameRoe4Vector.pt();
956 if (arguments.size() == 1)
957 maskName = arguments[0];
958 else if (arguments.size() > 1)
959 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roePz");
961 auto func = [maskName](
const Particle * particle) ->
double {
964 const RestOfEvent* roe = getRelatedROEObject(particle);
968 B2ERROR(
"Relation between particle and ROE doesn't exist!");
973 auto frameRoe4Vector = frame.getMomentum(roe->get4Vector(maskName));
974 return frameRoe4Vector.pz();
983 if (arguments.size() == 1)
984 maskName = arguments[0];
985 else if (arguments.size() > 1)
986 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roePTheta");
988 auto func = [maskName](
const Particle * particle) ->
double {
991 const RestOfEvent* roe = getRelatedROEObject(particle);
995 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1000 auto frameRoe4Vector = frame.getMomentum(roe->get4Vector(maskName));
1001 return frameRoe4Vector.Theta();
1010 if (arguments.size() == 1)
1011 maskName = arguments[0];
1012 else if (arguments.size() > 1)
1013 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roeDeltae");
1015 auto func = [maskName](
const Particle * particle) ->
double {
1018 const RestOfEvent* roe = getRelatedROEObject(particle);
1022 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1027 ROOT::Math::PxPyPzEVector vec = T.rotateLabToCms() * roe->get4Vector(maskName);
1028 return vec.E() - T.getCMSEnergy() / 2;
1037 if (arguments.size() == 1)
1038 maskName = arguments[0];
1039 else if (arguments.size() > 1)
1040 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function roeMbc");
1042 auto func = [maskName](
const Particle * particle) ->
double {
1045 const RestOfEvent* roe = getRelatedROEObject(particle);
1049 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1054 ROOT::Math::PxPyPzEVector vec = T.rotateLabToCms() * roe->get4Vector(maskName);
1056 double E = T.getCMSEnergy() / 2;
1057 double m2 =
E *
E - vec.P2();
1058 double mbc = m2 > 0 ?
sqrt(m2) : 0;
1069 if (arguments.size() == 1)
1070 maskName = arguments[0];
1071 else if (arguments.size() > 1)
1072 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function bssMassDifference");
1074 auto func = [maskName](
const Particle * particle) ->
double {
1078 ROOT::Math::PxPyPzEVector neutrino4vec = missing4Vector(particle->getDaughter(0), maskName,
"1");
1079 ROOT::Math::PxPyPzEVector sig4vec = frame.getMomentum(particle->getDaughter(0)->get4Vector());
1081 ROOT::Math::PxPyPzEVector bsMom = neutrino4vec + sig4vec;
1082 ROOT::Math::PxPyPzEVector bssMom = bsMom + frame.getMomentum(particle->getDaughter(1)->get4Vector());
1084 return bssMom.M() - bsMom.M();
1093 if (arguments.size() == 1)
1094 maskName = arguments[0];
1095 else if (arguments.size() > 1)
1096 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function weDeltae.");
1098 auto func = [maskName](
const Particle * particle) ->
double {
1102 ROOT::Math::PxPyPzEVector boostvec = frame.getMomentum(T.getBeamFourMomentum());
1103 ROOT::Math::PxPyPzEVector sig4vec = frame.getMomentum(particle->get4Vector());
1104 ROOT::Math::PxPyPzEVector neutrino4vec = missing4Vector(particle, maskName,
"1");
1106 double E = T.getCMSEnergy();
1107 double deltaE = (sig4vec + neutrino4vec).Dot(boostvec) /
E -
E / 2.0;
1118 if (arguments.size() == 1) {
1119 maskName = arguments[0];
1120 }
else if (arguments.size() > 1)
1121 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function weMbc");
1123 auto func = [maskName](
const Particle * particle) ->
double {
1127 ROOT::Math::PxPyPzEVector boostvec = frame.getMomentum(T.getBeamFourMomentum());
1128 ROOT::Math::PxPyPzEVector sig4vec = frame.getMomentum(particle->get4Vector());
1129 ROOT::Math::PxPyPzEVector neutrino4vec = missing4Vector(particle, maskName,
"1");
1131 ROOT::Math::PxPyPzEVector bmom = sig4vec + neutrino4vec;
1132 double Ecms = T.getCMSEnergy();
1133 double m2 = pow((Ecms* Ecms / 2.0 + bmom.Vect().Dot(boostvec.Vect())) / boostvec.energy(), 2.0) - bmom.P2();
1134 double mbc = m2 > 0 ?
sqrt(m2) : 0;
1145 if (arguments.size() == 1) {
1146 maskName = arguments[0];
1147 }
else if (arguments.size() > 1)
1148 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function weMbc");
1150 auto func = [maskName](
const Particle * particle) ->
double {
1153 ROOT::Math::PxPyPzEVector sig4vec = T.rotateLabToCms() * particle->get4Vector();
1154 ROOT::Math::PxPyPzEVector neutrino4vec = missing4Vector(particle, maskName,
"7");
1156 ROOT::Math::PxPyPzEVector bmom = sig4vec + neutrino4vec;
1157 double E = T.getCMSEnergy() / 2;
1158 double m2 =
E *
E - bmom.P2();
1159 double mbc = m2 > 0 ?
sqrt(m2) : 0;
1168 std::string maskName;
1171 if (arguments.size() == 1) {
1174 }
else if (arguments.size() == 2) {
1175 maskName = arguments[0];
1178 B2FATAL(
"Wrong number of arguments (2 required) for meta function weMissM2");
1180 auto func = [maskName, opt](
const Particle * particle) ->
double {
1182 return missing4Vector(particle, maskName, opt).M2();
1189 std::string maskName;
1192 if (arguments.size() == 1) {
1195 }
else if (arguments.size() == 2) {
1196 maskName = arguments[0];
1199 B2FATAL(
"Wrong number of arguments (2 required) for meta function weMissPTheta");
1201 auto func = [maskName, opt](
const Particle * particle) ->
double {
1204 const RestOfEvent* roe = getRelatedROEObject(particle);
1208 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1212 return missing4Vector(particle, maskName, opt).Theta();
1219 std::string maskName;
1222 if (arguments.size() == 1) {
1225 }
else if (arguments.size() == 2) {
1226 maskName = arguments[0];
1229 B2FATAL(
"Wrong number of arguments (2 required) for meta function weMissP");
1231 auto func = [maskName, opt](
const Particle * particle) ->
double {
1234 const RestOfEvent* roe = getRelatedROEObject(particle);
1238 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1242 return missing4Vector(particle, maskName, opt).P();
1249 std::string maskName;
1252 if (arguments.size() == 1) {
1255 }
else if (arguments.size() == 2) {
1256 maskName = arguments[0];
1259 B2FATAL(
"Wrong number of arguments (2 required) for meta function weMissPx");
1261 auto func = [maskName, opt](
const Particle * particle) ->
double {
1264 const RestOfEvent* roe = getRelatedROEObject(particle);
1268 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1272 return missing4Vector(particle, maskName, opt).Px();
1279 std::string maskName;
1282 if (arguments.size() == 1) {
1285 }
else if (arguments.size() == 2) {
1286 maskName = arguments[0];
1289 B2FATAL(
"Wrong number of arguments (2 required) for meta function weMissPy");
1291 auto func = [maskName, opt](
const Particle * particle) ->
double {
1294 const RestOfEvent* roe = getRelatedROEObject(particle);
1298 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1302 return missing4Vector(particle, maskName, opt).Py();
1309 std::string maskName;
1312 if (arguments.size() == 1) {
1315 }
else if (arguments.size() == 2) {
1316 maskName = arguments[0];
1319 B2FATAL(
"Wrong number of arguments (2 required) for meta function weMissPz");
1321 auto func = [maskName, opt](
const Particle * particle) ->
double {
1324 const RestOfEvent* roe = getRelatedROEObject(particle);
1328 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1332 return missing4Vector(particle, maskName, opt).Pz();
1339 std::string maskName;
1342 if (arguments.size() == 1) {
1345 }
else if (arguments.size() == 2) {
1346 maskName = arguments[0];
1349 B2FATAL(
"Wrong number of arguments (2 required) for meta function weMissE");
1351 auto func = [maskName, opt](
const Particle * particle) ->
double {
1354 const RestOfEvent* roe = getRelatedROEObject(particle);
1358 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1362 return missing4Vector(particle, maskName, opt).energy();
1371 if (arguments.size() == 1)
1372 maskName = arguments[0];
1373 else if (arguments.size() > 1)
1374 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function weXiZ");
1376 auto func = [maskName](
const Particle * particle) ->
double {
1379 const RestOfEvent* roe = getRelatedROEObject(particle);
1383 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1392 std::vector<const Particle*> recTrackParticles = particle->getFinalStateDaughters();
1395 for (
auto& recTrackParticle : recTrackParticles)
1397 pz += frame.getMomentum(recTrackParticle->get4Vector()).Pz();
1398 energy += frame.getMomentum(recTrackParticle->get4Vector()).E();
1402 auto roeParticles = roe->getChargedParticles(maskName);
1403 for (
auto* roeParticle : roeParticles)
1405 pz += frame.getMomentum(roeParticle->get4Vector()).Pz();
1406 energy += frame.getMomentum(roeParticle->get4Vector()).E();
1418 if (arguments.size() == 1)
1419 maskName = arguments[0];
1420 else if (arguments.size() > 1)
1421 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function weMissM2OverMissE");
1423 auto func = [maskName](
const Particle * particle) ->
double {
1426 const RestOfEvent* roe = getRelatedROEObject(particle);
1430 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1434 ROOT::Math::PxPyPzEVector neutrino4vec = missing4Vector(particle, maskName,
"0");
1435 return neutrino4vec.M2() / (2.0 * neutrino4vec.energy());
1443 std::string option(
"1");
1445 if (arguments.size() == 1) {
1446 maskName = arguments[0];
1447 }
else if (arguments.size() == 2) {
1448 maskName = arguments[0];
1449 option = arguments[1];
1450 }
else if (arguments.size() > 2) {
1451 B2FATAL(
"Too many arguments. At most two arguments are allowed for meta function weQ2lnuSimple");
1454 auto func = [maskName, option](
const Particle * particle) ->
double {
1457 const RestOfEvent* roe = getRelatedROEObject(particle);
1461 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1465 int n = particle->getNDaughters();
1471 const Particle* lep = particle->getDaughter(n - 1);
1472 bool enforceCMSFrame = (option ==
"4" or option ==
"7");
1473 ROOT::Math::PxPyPzEVector lep4vec = transformVector(lep->get4Vector(), enforceCMSFrame);
1474 ROOT::Math::PxPyPzEVector nu4vec = missing4Vector(particle, maskName, option);
1476 return (lep4vec + nu4vec).M2();
1484 std::string option(
"7");
1486 if (arguments.size() == 1) {
1487 maskName = arguments[0];
1488 }
else if (arguments.size() == 2) {
1489 maskName = arguments[0];
1490 option = arguments[1];
1491 }
else if (arguments.size() > 2) {
1492 B2FATAL(
"Too many arguments. At most two arguments are allowed for meta function weQ2lnu");
1495 auto func = [maskName, option](
const Particle * particle) ->
double {
1498 const RestOfEvent* roe = getRelatedROEObject(particle);
1502 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1506 int n = particle->getNDaughters();
1512 const Particle* lep = particle->getDaughter(n - 1);
1513 ROOT::Math::PxPyPzEVector lep_cm = T.rotateLabToCms() * lep->get4Vector();
1515 ROOT::Math::PxPyPzEVector Y_cm = T.rotateLabToCms() * particle->get4Vector();
1516 ROOT::Math::PxPyPzEVector neu_cm = missing4Vector(particle, maskName, option);
1518 double e_beam = T.getCMSEnergy() / 2.0;
1521 double bmass = particle->getPDGMass();
1522 double pB2 = e_beam * e_beam - bmass * bmass;
1525 double cos_angle_nu = (pB2 - Y_cm.P2() - neu_cm.P2()) / (2.0 * Y_cm.P() * neu_cm.P());
1526 if (abs(cos_angle_nu) > 1)
1528 return (lep_cm + neu_cm).M2();
1531 double angle_nu = TMath::ACos(cos_angle_nu);
1533 ROOT::Math::PtEtaPhiEVector rotated_neu(-Y_cm);
1534 rotated_neu.SetE(Y_cm.E());
1536 double nu_eta = -log(tan((rotated_neu.Theta() + (TMath::Pi() - angle_nu)) / 2.));
1537 rotated_neu.SetEta(nu_eta);
1538 rotated_neu.SetPt(neu_cm.pt());
1539 rotated_neu.SetE(neu_cm.E());
1541 ROOT::Math::XYZVector Yneu_norm = Y_cm.Vect().Cross(neu_cm.Vect());
1542 ROOT::Math::XYZVector Yrot_norm = Y_cm.Vect().Cross(rotated_neu.Vect());
1546 double rot_angle = ROOT::Math::VectorUtil::Angle(Yneu_norm, Yrot_norm);
1548 ROOT::Math::PxPyPzEVector rotated_neu2(rotated_neu);
1554 ROOT::Math::AxisAngle rotation(Y_cm.Vect(), rot_angle);
1555 rotation(rotated_neu);
1557 rotation(rotated_neu2);
1559 double dot1 = rotated_neu.Vect().Dot(Yneu_norm);
1560 double dot2 = rotated_neu2.Vect().Dot(Yneu_norm);
1562 if (abs(dot2) < abs(dot1)) rotated_neu = rotated_neu2;
1564 return (lep_cm + rotated_neu).M2();
1573 if (arguments.size() == 1)
1574 maskName = arguments[0];
1575 else if (arguments.size() > 1)
1576 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function weCosThetaEll");
1578 auto func = [maskName](
const Particle * particle) ->
double {
1580 ROOT::Math::PxPyPzEVector pNu = missing4Vector(particle, maskName,
"1");
1583 ROOT::Math::PxPyPzEVector pLep;
1584 for (
unsigned i = 0; i < particle->getNDaughters(); i++)
1586 int absPDG = abs(particle->getDaughter(i)->getPDGCode());
1588 pLep = frame.getMomentum(particle->getDaughter(i)->get4Vector());
1593 ROOT::Math::PxPyPzEVector pW = pNu + pLep;
1594 ROOT::Math::PxPyPzEVector pB = frame.getMomentum(particle->get4Vector()) + pNu;
1597 ROOT::Math::XYZVector boost2W = pW.BoostToCM();
1598 pLep = ROOT::Math::Boost(boost2W) * pLep;
1599 pB = ROOT::Math::Boost(boost2W) * pB;
1601 return ROOT::Math::VectorUtil::CosTheta(pLep, pB);
1610 if (arguments.size() == 1)
1611 maskName = arguments[0];
1612 else if (arguments.size() > 1)
1613 B2FATAL(
"At most 1 argument (name of mask) accepted for meta function passesROEMask");
1615 auto func = [maskName](
const Particle * particle) ->
bool {
1617 StoreObjPtr<RestOfEvent> roeObjPtr(
"RestOfEvent");
1618 if (not roeObjPtr.isValid())
1621 const RestOfEvent* roe = &(*roeObjPtr);
1623 return isInThisRestOfEvent(particle, roe, maskName);
1628 double printROE(
const Particle* particle)
1630 const RestOfEvent* roe = getRelatedROEObject(particle);
1633 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1634 }
else roe->print();
1638 bool hasCorrectROECombination(
const Particle* particle)
1640 unsigned nDaughters = particle->getNDaughters();
1641 if (nDaughters < 2) {
1642 B2ERROR(
"The particle must have at least two daughters.");
1646 for (
unsigned i = 0; i < particle->getNDaughters(); i++) {
1649 auto daughter = particle->getDaughter(i);
1650 auto roe = daughter->getRelatedFrom<RestOfEvent>();
1654 auto sourceParticle = roe->getRelatedFrom<Particle>();
1655 for (
unsigned j = 0; j < particle->getNDaughters(); j++) {
1656 if (i == j)
continue;
1657 const auto anotherDaughter = particle->getDaughter(j);
1659 if (anotherDaughter == sourceParticle)
1665 B2ERROR(
"There is no daughter particle loaded from the ROE object.");
1671 if (arguments.size() != 1)
1672 B2ERROR(
"Wrong number of arguments (1 required) for pi0Prob");
1675 mode = arguments[0];
1677 if (mode !=
"standard" and mode !=
"tight" and mode !=
"cluster" and mode !=
"both" and mode !=
"standardMC15rd"
1678 and mode !=
"tightMC15rd" and mode !=
"standardMC16rd" and mode !=
"tightMC16rd")
1679 B2ERROR(
"the given argument is not supported in pi0Prob!");
1681 auto func = [mode](
const Particle * particle) ->
double {
1682 if (mode ==
"standard")
1684 if (particle->hasExtraInfo(
"Pi0ProbOrigin")) {
1685 return particle->getExtraInfo(
"Pi0ProbOrigin");
1687 B2WARNING(
"Pi0ProbOrigin is not registered in extraInfo! \n"
1688 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1691 }
else if (mode ==
"tight")
1693 if (particle->hasExtraInfo(
"Pi0ProbTightEnergyThreshold")) {
1694 return particle->getExtraInfo(
"Pi0ProbTightEnergyThreshold");
1696 B2WARNING(
"Pi0ProbTightEnergyThreshold is not registered in extraInfo! \n"
1697 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1700 }
else if (mode ==
"cluster")
1702 if (particle->hasExtraInfo(
"Pi0ProbLargeClusterSize")) {
1703 return particle->getExtraInfo(
"Pi0ProbLargeClusterSize");
1705 B2WARNING(
"Pi0ProbLargeClusterSize is not registered in extraInfo! \n"
1706 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1709 }
else if (mode ==
"both")
1711 if (particle->hasExtraInfo(
"Pi0ProbTightEnergyThresholdAndLargeClusterSize")) {
1712 return particle->getExtraInfo(
"Pi0ProbTightEnergyThresholdAndLargeClusterSize");
1714 B2WARNING(
"Pi0ProbTightEnergyThresholdAndLargeClusterSize is not registered in extraInfo! \n"
1715 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1718 }
else if (mode ==
"standardMC15rd")
1720 if (particle->hasExtraInfo(
"Pi0ProbOriginMC15rd")) {
1721 return particle->getExtraInfo(
"Pi0ProbOriginMC15rd");
1723 B2WARNING(
"Pi0ProbOriginMC15rd is not registered in extraInfo! \n"
1724 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1727 }
else if (mode ==
"tightMC15rd")
1729 if (particle->hasExtraInfo(
"Pi0ProbTightEnergyThresholdMC15rd")) {
1730 return particle->getExtraInfo(
"Pi0ProbTightEnergyThresholdMC15rd");
1732 B2WARNING(
"Pi0ProbTightEnergyThresholdMC15rd is not registered in extraInfo! \n"
1733 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1736 }
else if (mode ==
"standardMC16rd")
1738 if (particle->hasExtraInfo(
"Pi0ProbOriginMC16rd")) {
1739 return particle->getExtraInfo(
"Pi0ProbOriginMC16rd");
1741 B2WARNING(
"Pi0ProbOriginMC16rd is not registered in extraInfo! \n"
1742 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1745 }
else if (mode ==
"tightMC16rd")
1747 if (particle->hasExtraInfo(
"Pi0ProbTightEnergyThresholdMC16rd")) {
1748 return particle->getExtraInfo(
"Pi0ProbTightEnergyThresholdMC16rd");
1750 B2WARNING(
"Pi0ProbTightEnergyThresholdMC16rd is not registered in extraInfo! \n"
1751 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1764 if (arguments.size() != 1)
1765 B2ERROR(
"Wrong number of arguments (1 required) for etaProb");
1768 mode = arguments[0];
1770 if (mode !=
"standard" and mode !=
"tight" and mode !=
"cluster" and mode !=
"both" and mode !=
"standardMC15rd"
1771 and mode !=
"tightMC15rd" and mode !=
"standardMC16rd" and mode !=
"tightMC16rd")
1772 B2ERROR(
"the given argument is not supported in etaProb!");
1774 auto func = [mode](
const Particle * particle) ->
double {
1775 if (mode ==
"standard")
1777 if (particle->hasExtraInfo(
"EtaProbOrigin")) {
1778 return particle->getExtraInfo(
"EtaProbOrigin");
1780 B2WARNING(
"EtaProbOrigin is not registered in extraInfo! \n"
1781 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1784 }
else if (mode ==
"tight")
1786 if (particle->hasExtraInfo(
"EtaProbTightEnergyThreshold")) {
1787 return particle->getExtraInfo(
"EtaProbTightEnergyThreshold");
1789 B2WARNING(
"EtaProbTightEnergyThreshold is not registered in extraInfo! \n"
1790 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1793 }
else if (mode ==
"cluster")
1795 if (particle->hasExtraInfo(
"EtaProbLargeClusterSize")) {
1796 return particle->getExtraInfo(
"EtaProbLargeClusterSize");
1798 B2WARNING(
"EtaProbLargeClusterSize is not registered in extraInfo! \n"
1799 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1802 }
else if (mode ==
"both")
1804 if (particle->hasExtraInfo(
"EtaProbTightEnergyThresholdAndLargeClusterSize")) {
1805 return particle->getExtraInfo(
"EtaProbTightEnergyThresholdAndLargeClusterSize");
1807 B2WARNING(
"EtaProbTightEnergyThresholdAndLargeClusterSize is not registered in extraInfo! \n"
1808 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1811 }
else if (mode ==
"standardMC15rd")
1813 if (particle->hasExtraInfo(
"EtaProbOriginMC15rd")) {
1814 return particle->getExtraInfo(
"EtaProbOriginMC15rd");
1816 B2WARNING(
"EtaProbOriginMC15rd is not registered in extraInfo! \n"
1817 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1820 }
else if (mode ==
"tightMC15rd")
1822 if (particle->hasExtraInfo(
"EtaProbTightEnergyThresholdMC15rd")) {
1823 return particle->getExtraInfo(
"EtaProbTightEnergyThresholdMC15rd");
1825 B2WARNING(
"EtaProbTightEnergyThresholdMC15rd is not registered in extraInfo! \n"
1826 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1829 }
else if (mode ==
"standardMC16rd")
1831 if (particle->hasExtraInfo(
"EtaProbOriginMC16rd")) {
1832 return particle->getExtraInfo(
"EtaProbOriginMC16rd");
1834 B2WARNING(
"EtaProbOriginMC16rd is not registered in extraInfo! \n"
1835 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1838 }
else if (mode ==
"tightMC16rd")
1840 if (particle->hasExtraInfo(
"EtaProbTightEnergyThresholdMC16rd")) {
1841 return particle->getExtraInfo(
"EtaProbTightEnergyThresholdMC16rd");
1843 B2WARNING(
"EtaProbTightEnergyThresholdMC16rd is not registered in extraInfo! \n"
1844 "the function writePi0EtaVeto has to be executed to register this extraInfo.");
1859 ROOT::Math::PxPyPzEVector transformVector(
const ROOT::Math::PxPyPzEVector& vec,
bool enforceCMSFrame)
1861 if (enforceCMSFrame) {
1862 UseReferenceFrame<CMSFrame> cmsFrame;
1864 return frame.getMomentum(vec);
1867 return frame.getMomentum(vec);
1871 ROOT::Math::PxPyPzEVector missing4Vector(
const Particle* particle,
const std::string& maskName,
const std::string& opt)
1874 const RestOfEvent* roe = getRelatedROEObject(particle);
1877 B2ERROR(
"Relation between particle and ROE doesn't exist!");
1878 ROOT::Math::PxPyPzEVector empty;
1882 bool enforceCMSFrame = (opt ==
"4" or opt ==
"7");
1884 ROOT::Math::PxPyPzEVector boostvec = transformVector(T.getBeamFourMomentum(), enforceCMSFrame);
1885 ROOT::Math::PxPyPzEVector rec4vec = transformVector(particle->get4Vector(), enforceCMSFrame);
1886 ROOT::Math::PxPyPzEVector roe4vec = transformVector(roe->get4Vector(maskName), enforceCMSFrame);
1888 ROOT::Math::PxPyPzEVector miss4vec;
1889 double E_beam_cms = T.getCMSEnergy() / 2.0;
1892 if (opt ==
"0" or opt ==
"5") {
1893 miss4vec = boostvec - (rec4vec + roe4vec);
1897 else if (opt ==
"1" or opt ==
"6") {
1898 miss4vec = boostvec - (rec4vec + roe4vec);
1899 miss4vec.SetE(miss4vec.P());
1903 else if (opt ==
"2") {
1904 miss4vec = boostvec - (rec4vec + roe4vec);
1905 miss4vec.SetE(boostvec.E() / 2. - rec4vec.E());
1909 else if (opt ==
"3") {
1910 miss4vec = boostvec - rec4vec;
1911 miss4vec.SetE(boostvec.E() / 2. - rec4vec.E());
1915 else if (opt ==
"4") {
1916 ROOT::Math::XYZVector pB = - roe4vec.Vect();
1917 pB = 0.340 * pB.Unit();
1918 pB -= rec4vec.Vect();
1919 miss4vec.SetPxPyPzE(pB.X(), pB.Y(), pB.Z(), E_beam_cms - rec4vec.E());
1923 else if (opt ==
"7") {
1924 miss4vec = - (rec4vec + roe4vec);
1925 miss4vec.SetE(miss4vec.P());
1926 double factorAlpha = (E_beam_cms - rec4vec.E()) / miss4vec.E();
1927 miss4vec *= factorAlpha;
1928 miss4vec.SetE(miss4vec.P());
1934 void checkMCParticleMissingFlags(
const MCParticle* mcp, std::set<const MCParticle*> mcROEObjects,
int& missingFlags)
1936 std::vector<MCParticle*> daughters = mcp->getDaughters();
1937 for (
auto& daughter : daughters) {
1942 if (mcROEObjects.find(daughter) == mcROEObjects.end()) {
1944 int pdg = abs(daughter->getPDG());
1947 if (pdg ==
Const::photon.getPDGCode() and (missingFlags & 1) == 0)
1951 else if (pdg ==
Const::electron.getPDGCode() and (missingFlags & 2) == 0)
1955 else if (pdg ==
Const::muon.getPDGCode() and (missingFlags & 4) == 0)
1959 else if (pdg ==
Const::pion.getPDGCode() and (missingFlags & 8) == 0)
1963 else if (pdg ==
Const::kaon.getPDGCode() and (missingFlags & 16) == 0)
1967 else if (pdg ==
Const::proton.getPDGCode() and (missingFlags & 32) == 0)
1971 else if (pdg ==
Const::neutron.getPDGCode() and (missingFlags & 64) == 0)
1975 else if (pdg ==
Const::Kshort.getPDGCode() and ((missingFlags & 128) == 0 or (missingFlags & 256) == 0)) {
1976 std::vector<MCParticle*> ksDaug = daughter->getDaughters();
1977 if (ksDaug.size() == 2) {
1979 if (abs(ksDaug[0]->getPDG()) ==
Const::pion.getPDGCode() and abs(ksDaug[1]->getPDG()) ==
Const::pion.getPDGCode()
1980 and (missingFlags & 128) == 0) {
1981 if (mcROEObjects.find(ksDaug[0]) == mcROEObjects.end() or mcROEObjects.find(ksDaug[1]) == mcROEObjects.end())
1982 missingFlags += 128;
1985 else if (abs(ksDaug[0]->getPDG()) ==
Const::pi0.getPDGCode() and abs(ksDaug[1]->getPDG()) ==
Const::pi0.getPDGCode()
1986 and (missingFlags & 256) == 0) {
1987 std::vector<MCParticle*> pi0Daug0 = ksDaug[0]->getDaughters();
1988 std::vector<MCParticle*> pi0Daug1 = ksDaug[1]->getDaughters();
1989 if (mcROEObjects.find(pi0Daug0[0]) == mcROEObjects.end() or
1990 mcROEObjects.find(pi0Daug0[1]) == mcROEObjects.end() or
1991 mcROEObjects.find(pi0Daug1[0]) == mcROEObjects.end() or
1992 mcROEObjects.find(pi0Daug1[1]) == mcROEObjects.end())
1993 missingFlags += 256;
1999 else if (pdg ==
Const::Klong.getPDGCode() and (missingFlags & 512) == 0)
2000 missingFlags += 512;
2003 else if ((pdg == 12 or pdg == 14 or pdg == 16) and (missingFlags & 1024) == 0)
2004 missingFlags += 1024;
2006 checkMCParticleMissingFlags(daughter, mcROEObjects, missingFlags);
2010 bool isInThisRestOfEvent(
const Particle* particle,
const RestOfEvent* roe,
const std::string& maskName)
2012 if (particle->getParticleSource() == Particle::c_Composite or
2013 particle->getParticleSource() == Particle::c_V0) {
2014 std::vector<const Particle*> fspDaug = particle->getFinalStateDaughters();
2015 for (
auto& i : fspDaug) {
2016 if (isInThisRestOfEvent(i, roe, maskName) == 0)
2021 return roe->hasParticle(particle, maskName);
2024 const RestOfEvent* getRelatedROEObject(
const Particle* particle,
bool returnHostOnly)
2027 const RestOfEvent* roe = particle->getRelatedTo<RestOfEvent>();
2028 if (!roe && !returnHostOnly) {
2029 roe = particle->getRelatedTo<RestOfEvent>(
"NestedRestOfEvents");
2035 VARIABLE_GROUP(
"Rest Of Event");
2037 REGISTER_METAVARIABLE(
"useROERecoilFrame(variable)", useROERecoilFrame,
2038 "Returns the value of the variable using the rest frame of the ROE recoil as current reference frame.\n"
2039 "Can be used inside for_each loop or outside of it if the particle has associated Rest of Event.\n"
2040 "E.g. ``useROERecoilFrame(E)`` returns the energy of a particle in the ROE recoil frame.", Manager::VariableDataType::c_double);
2042 REGISTER_VARIABLE(
"isInRestOfEvent", isInRestOfEvent,
2043 "Returns 1 if a track, ecl or klmCluster associated to particle is in the current RestOfEvent object, 0 otherwise."
2044 "One can use this variable only in a for_each loop over the RestOfEvent StoreArray.");
2046 REGISTER_VARIABLE(
"isCloneOfSignalSide", isCloneOfSignalSide,
2047 "Returns 1 if a particle is a clone of signal side final state particles, 0 otherwise. "
2048 "Requires generator information and truth-matching. "
2049 "One can use this variable only in a ``for_each`` loop over the RestOfEvent StoreArray.");
2051 REGISTER_VARIABLE(
"hasAncestorFromSignalSide", hasAncestorFromSignalSide,
2052 "Returns 1 if a particle has ancestor from signal side, 0 otherwise. "
2053 "Requires generator information and truth-matching. "
2054 "One can use this variable only in a ``for_each`` loop over the RestOfEvent StoreArray.");
2056 REGISTER_METAVARIABLE(
"currentROEIsInList(particleList)", currentROEIsInList,
2057 "[Eventbased] Returns 1 the associated particle of the current ROE is contained in the given list or its charge-conjugated."
2058 "Useful to restrict the for_each loop over ROEs to ROEs of a certain ParticleList.", Manager::VariableDataType::c_bool);
2060 REGISTER_VARIABLE(
"nROE_RemainingTracks", nROE_RemainingTracks,
2061 "Returns number of tracks in ROE - number of tracks of given particle"
2062 "One can use this variable only in a for_each loop over the RestOfEvent StoreArray.");
2064 REGISTER_METAVARIABLE(
"nROE_RemainingTracks(maskName)", nROE_RemainingTracksWithMask,
2065 "Returns number of remaining tracks between the ROE (specified via a mask) and the given particle. For the given particle only tracks are counted which are in the RoE."
2066 "One can use this variable only in a for_each loop over the RestOfEvent StoreArray."
2067 "Is required for the specific FEI. :noindex:", Manager::VariableDataType::c_int);
2072 REGISTER_VARIABLE(
"nROE_KLMClusters", nROE_KLMClusters,
2073 "Returns number of all remaining KLM clusters in the related RestOfEvent object.");
2075 REGISTER_METAVARIABLE(
"nROE_Charged(maskName, PDGcode = 0)", nROE_ChargedParticles,
2076 "Returns number of all charged particles in the related RestOfEvent object. First optional argument is ROE mask name. "
2077 "Second argument is a PDG code to count only one charged particle species, independently of charge. "
2078 "For example: ``nROE_Charged(cleanMask, 321)`` will output number of kaons in Rest Of Event with ``cleanMask``. "
2079 "PDG code 0 is used to count all charged particles", Manager::VariableDataType::c_int);
2081 REGISTER_METAVARIABLE(
"nROE_Photons(maskName)", nROE_Photons,
2082 "Returns number of all photons in the related RestOfEvent object, accepts 1 optional argument of ROE mask name. ",
2083 Manager::VariableDataType::c_int);
2085 REGISTER_METAVARIABLE(
"nROE_NeutralHadrons(maskName)", nROE_NeutralHadrons,
2086 "Returns number of all neutral hadrons in the related RestOfEvent object, accepts 1 optional argument of ROE mask name. ",
2087 Manager::VariableDataType::c_int);
2089 REGISTER_METAVARIABLE(
"particleRelatedToCurrentROE(var)", particleRelatedToCurrentROE,
2090 "[Eventbased] Returns variable applied to the particle which is related to the current RestOfEvent object"
2091 "One can use this variable only in a for_each loop over the RestOfEvent StoreArray.", Manager::VariableDataType::c_double);
2093 REGISTER_VARIABLE(
"roeMC_E", ROE_MC_E,
2094 "Returns true energy of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function.\n\n",
"GeV");
2096 REGISTER_VARIABLE(
"roeMC_M", ROE_MC_M,
2097 "Returns true invariant mass of unused tracks and clusters in ROE\n\n",
"GeV/:math:`\\text{c}^2`");
2099 REGISTER_VARIABLE(
"roeMC_P", ROE_MC_P,
2100 "Returns true momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function.\n\n",
"GeV/c");
2102 REGISTER_VARIABLE(
"roeMC_Px", ROE_MC_Px,
2103 "Returns x component of true momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function.\n\n",
2106 REGISTER_VARIABLE(
"roeMC_Py", ROE_MC_Py,
2107 "Returns y component of true momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function.\n\n",
2110 REGISTER_VARIABLE(
"roeMC_Pz", ROE_MC_Pz,
2111 "Returns z component of true momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function.\n\n",
2114 REGISTER_VARIABLE(
"roeMC_Pt", ROE_MC_Pt,
2115 "Returns transverse component of true momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function.\n\n",
2118 REGISTER_VARIABLE(
"roeMC_PTheta", ROE_MC_PTheta,
2119 "Returns polar angle of true momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function.\n\n",
2122 REGISTER_METAVARIABLE(
"roeMC_MissFlags(maskName)", ROE_MC_MissingFlags,
2123 "Returns flags corresponding to missing particles on ROE side.", Manager::VariableDataType::c_double);
2125 REGISTER_METAVARIABLE(
"nROE_Tracks(maskName)", nROE_Tracks,
2126 "Returns number of tracks in the related RestOfEvent object that pass the selection criteria.",
2127 Manager::VariableDataType::c_int);
2129 REGISTER_METAVARIABLE(
"nROE_ECLClusters(maskName)", nROE_ECLClusters,
2130 "Returns number of ECL clusters in the related RestOfEvent object that pass the selection criteria.",
2131 Manager::VariableDataType::c_int);
2133 REGISTER_METAVARIABLE(
"nROE_NeutralECLClusters(maskName)", nROE_NeutralECLClusters,
2134 "Returns number of neutral ECL clusters in the related RestOfEvent object that pass the selection criteria.",
2135 Manager::VariableDataType::c_int);
2137 REGISTER_METAVARIABLE(
"nROE_Composites(maskName)", nROE_Composites,
2138 "Returns number of composite particles or V0s in the related RestOfEvent object that pass the selection criteria.",
2139 Manager::VariableDataType::c_int);
2141 REGISTER_METAVARIABLE(
"nROE_ParticlesInList(pListName[, maskName])", nROE_ParticlesInList,
2142 "Returns the number of particles in ROE from the given particle list. If a mask name is provided the selection criteria are applied.\n"
2143 "Use of variable aliases is advised.", Manager::VariableDataType::c_int);
2145 REGISTER_METAVARIABLE(
"roeCharge(maskName)", ROE_Charge,
2146 "Returns total charge of the related RestOfEvent object. The unit of the charge is ``e`` ", Manager::VariableDataType::c_double);
2148 REGISTER_METAVARIABLE(
"roeEextra(maskName)", ROE_ExtraEnergy,
2149 "Returns extra energy from ECLClusters in the calorimeter that is not associated to the given Particle. The unit of the energy is ``GeV`` ",
2150 Manager::VariableDataType::c_double);
2152 REGISTER_METAVARIABLE(
"roeNeextra(maskName)", ROE_NeutralExtraEnergy,
2153 "Returns extra energy from neutral ECLClusters in the calorimeter that is not associated to the given Particle, can be used with ``use***Frame()`` function. The unit of the energy is ``GeV`` ",
2154 Manager::VariableDataType::c_double);
2156 REGISTER_METAVARIABLE(
"roeE(maskName)", ROE_E,
2157 "Returns energy of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function. The unit of the energy is ``GeV`` ",
2158 Manager::VariableDataType::c_double);
2160 REGISTER_METAVARIABLE(
"roeM(maskName)", ROE_M,
2161 "Returns invariant mass of unused tracks and clusters in ROE. The unit of the invariant mass is :math:`\\text{GeV/c}^2`",
2162 Manager::VariableDataType::c_double);
2164 REGISTER_METAVARIABLE(
"roeP(maskName)", ROE_P,
2165 "Returns momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function. The unit of the momentum is ``GeV/c`` ",
2166 Manager::VariableDataType::c_double);
2168 REGISTER_METAVARIABLE(
"roePt(maskName)", ROE_Pt,
2169 "Returns transverse component of momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function. The unit of the momentum is ``GeV/c`` ",
2170 Manager::VariableDataType::c_double);
2172 REGISTER_METAVARIABLE(
"roePx(maskName)", ROE_Px,
2173 "Returns x component of momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function. The unit of the momentum is ``GeV/c`` ",
2174 Manager::VariableDataType::c_double);
2176 REGISTER_METAVARIABLE(
"roePy(maskName)", ROE_Py,
2177 "Returns y component of momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function. The unit of the momentum is ``GeV/c`` ",
2178 Manager::VariableDataType::c_double);
2180 REGISTER_METAVARIABLE(
"roePz(maskName)", ROE_Pz,
2181 "Returns z component of momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function. The unit of the momentum is ``GeV/c`` ",
2182 Manager::VariableDataType::c_double);
2184 REGISTER_METAVARIABLE(
"roePTheta(maskName)", ROE_PTheta,
2185 "Returns theta angle of momentum of unused tracks and clusters in ROE, can be used with ``use***Frame()`` function. The unit of the angle is ``rad`` ",
2186 Manager::VariableDataType::c_double);
2188 REGISTER_METAVARIABLE(
"roeDeltae(maskName)", ROE_DeltaE,
2189 "Returns energy difference of the related RestOfEvent object with respect to :math:`E_\\mathrm{cms}/2`. The unit of the energy is ``GeV`` ",
2190 Manager::VariableDataType::c_double);
2192 REGISTER_METAVARIABLE(
"roeMbc(maskName)", ROE_Mbc,
2193 "Returns beam constrained mass of the related RestOfEvent object with respect to :math:`E_\\mathrm{cms}/2`. The unit of the beam constrained mass is :math:`\\text{GeV/c}^2`.",
2194 Manager::VariableDataType::c_double);
2196 REGISTER_METAVARIABLE(
"weDeltae(maskName)", WE_DeltaE, R
"DOC(
2197 Returns the energy difference of the B meson, corrected with the missing neutrino momentum (reconstructed side + neutrino) with respect to :math:`E_{\mathrm{cms}}/2`.
2198 The variable can be used with the ``use***Frame()`` function. The unit of the energy is ``GeV``.)DOC",
2199 Manager::VariableDataType::c_double);
2201 REGISTER_METAVARIABLE("weMbc(maskName)", WE_Mbc, R
"DOC(
2202 Returns beam constrained mass of B meson, corrected with the missing neutrino momentum (reconstructed side + neutrino) with respect to :math:`E_{\mathrm{cms}}/2`.
2203 The variable can be used with the ``use***Frame()`` function. The unit of the beam constrained mass is :math:`\text{GeV/c}^2`.)DOC",
2204 Manager::VariableDataType::c_double);
2206 REGISTER_METAVARIABLE("weMbcWithdEZero(maskName)", WE_MbcWithdEZero, R
"DOC(
2207 Returns beam constrained mass of B meson, corrected with the missing neutrino momentum (reconstructed side + neutrino) with respect to :math:`E_{\mathrm{cms}}/2`.
2208 The missing neutrino momentum is scaled so that the energy difference :math:`d_E = 0`. The unit of the beam constrained mass is :math:`\text{GeV/c}^2`.)DOC",
2209 Manager::VariableDataType::c_double);
2211 REGISTER_METAVARIABLE("weMissM2(maskName, opt)", WE_MissM2, R
"DOC(
2212 Returns the invariant mass squared of the missing momentum (see :b2:var:`weMissE` possible options).
2213 The variable can be used with the ``use***Frame()`` function.
2214 The unit of the invariant mass squared is :math:`[\text{GeV}/\text{c}^2]^2`.)DOC",
2215 Manager::VariableDataType::c_double);
2217 REGISTER_METAVARIABLE("weMissPTheta(maskName, opt)", WE_MissPTheta, R
"DOC(
2218 Returns the polar angle of the missing momentum (see possible :b2:var:`weMissE` options).
2219 The variable can be used with the ``use***Frame()`` function.
2220 The unit of the polar angle is ``rad``.)DOC",
2221 Manager::VariableDataType::c_double);
2223 REGISTER_METAVARIABLE("weMissP(maskName, opt)", WE_MissP, R
"DOC(
2224 Returns the magnitude of the missing momentum (see possible :b2:var:`weMissE` options).
2225 The variable can be used with the ``use***Frame()`` function.
2226 The unit of the magnitude of missing momentum is ``GeV/c``.)DOC",
2227 Manager::VariableDataType::c_double);
2229 REGISTER_METAVARIABLE("weMissPx(maskName, opt)", WE_MissPx, R
"DOC(
2230 Returns the x component of the missing momentum (see :b2:var:`weMissE` possible options).
2231 The variable can be used with the ``use***Frame()`` function.
2232 The unit of the missing momentum is ``GeV/c``.)DOC",
2233 Manager::VariableDataType::c_double);
2235 REGISTER_METAVARIABLE("weMissPy(maskName, opt)", WE_MissPy, R
"DOC(
2236 Returns the y component of the missing momentum (see :b2:var:`weMissE` possible options).
2237 The variable can be used with the ``use***Frame()`` function.
2238 The unit of the missing momentum is ``GeV/c``.)DOC",
2239 Manager::VariableDataType::c_double);
2241 REGISTER_METAVARIABLE("weMissPz(maskName, opt)", WE_MissPz, R
"DOC(
2242 Returns the z component of the missing momentum (see :b2:var:`weMissE` possible options).
2243 The variable can be used with the ``use***Frame()`` function.
2244 The unit of the missing momentum is ``GeV/c``.)DOC",
2245 Manager::VariableDataType::c_double);
2247 REGISTER_METAVARIABLE("weMissE(maskName, opt)", WE_MissE,
2248 R
"DOC(Returns the energy of the missing momentum. The variable can be used with the ``use***Frame()`` function. The unit of the Energy is ``GeV`` . Possible options ``opt`` are the following:
2250- ``0``: use energy and momentum of charged particles and photons
2251- ``1``: same as ``0``, fix :math:`E_\mathrm{miss} = p_\mathrm{miss}`
2252- ``2``: same as ``0``, fix :math:`E_\mathrm{roe} = E_\mathrm{cms}/2`
2253- ``3``: use only energy and momentum of signal side
2254- ``4``: same as ``3``, update with direction of ROE momentum. Only works in CMS frame.
2255- ``7``: correct pmiss 3-momentum vector with factor alpha so that :math:`d_E = 0` (used for :math:`M_\mathrm{bc}` calculation). Only works in CMS frame.)DOC",
2256 Manager::VariableDataType::c_double);
2258 REGISTER_METAVARIABLE("weXiZ(maskName)", WE_xiZ,
2259 "Returns Xi_z in event (for Bhabha suppression and two-photon scattering). The unit of this variable is ``1/c`` ",
2260 Manager::VariableDataType::c_double);
2262 REGISTER_METAVARIABLE(
"bssMassDifference(maskName)", bssMassDifference,
2263 "Bs* - Bs mass difference. The unit of the mass is :math:`\\text{GeV/c}^2`.", Manager::VariableDataType::c_double);
2265 REGISTER_METAVARIABLE(
"weCosThetaEll(maskName)", WE_cosThetaEll, R
"DOC(
2267Returns the cosine of the angle between :math:`M` and lepton in :math:`W` rest frame in the decays of the type:
2268:math:`M \to h_1 ... h_n \ell`, where W 4-momentum is given as
2271 p_W = p_\ell + p_\nu.
2273The neutrino momentum is calculated from ROE taking into account the specified mask, and setting
2276 E_{\nu} = |p_{miss}|.
2278)DOC", Manager::VariableDataType::c_double);
2280 REGISTER_METAVARIABLE("weQ2lnuSimple(maskName,option)", WE_q2lnuSimple,
2281 "Returns the momentum transfer squared, :math:`q^2`, calculated in CMS as :math:`q^2 = (p_l + p_\\nu)^2`, \n"
2282 "where :math:`B \\to H_1\\dots H_n \\ell \\nu_\\ell`. Lepton is assumed to be the last reconstructed daughter. \n"
2283 "By default, option is set to ``1`` (see :b2:var:`weMissE`). Unless you know what you are doing, keep this default value. The unit of the momentum transfer squared is :math:`[\\text{GeV}/\\text{c}]^2`.", Manager::VariableDataType::c_double);
2285 REGISTER_METAVARIABLE(
"weQ2lnu(maskName,option)", WE_q2lnu,
2286 "Returns the momentum transfer squared, :math:`q^2`, calculated in CMS as :math:`q^2 = (p_l + p_\\nu)^2`, \n"
2287 "where :math:`B \\to H_1\\dots H_n \\ell \\nu_\\ell`. Lepton is assumed to be the last reconstructed daughter. \n"
2288 "This calculation uses constraints from dE = 0 and Mbc = Mb to correct the neutrino direction. \n"
2289 "By default, option is set to ``7`` (see :b2:var:`weMissE`). Unless you know what you are doing, keep this default value. The unit of the momentum transfer squared is :math:`[\\text{GeV}/\\text{c}]^2`.", Manager::VariableDataType::c_double);
2291 REGISTER_METAVARIABLE(
"weMissM2OverMissE(maskName)", WE_MissM2OverMissE,
2292 "Returns missing mass squared over missing energy. The unit of the missing mass squared is :math:`\\text{GeV/c}^4`.", Manager::VariableDataType::c_double);
2294 REGISTER_METAVARIABLE(
"passesROEMask(maskName)", passesROEMask,
2295 "Returns boolean value if a particle passes a certain mask or not. Only to be used in for_each path.", Manager::VariableDataType::c_bool);
2297 REGISTER_VARIABLE(
"printROE", printROE,
2298 "For debugging, prints indices of all particles in the ROE and all masks. Returns 0.");
2300 REGISTER_VARIABLE(
"hasCorrectROECombination", hasCorrectROECombination,
2301 "Returns 1 if there is correct combination of daughter particles between the particle that is the basis of the ROE and the particle loaded from the ROE. "
2302 "Returns 0 if there is not correct combination or if there is no daughter particle loaded from the ROE.");
2304 REGISTER_METAVARIABLE(
"pi0Prob(mode)", pi0Prob,
2305 "Returns pi0 probability, where mode is used to specify the selection criteria for soft photon. \n"
2306 "The following strings are available. \n\n"
2307 "- ``standard``: loose energy cut and no clusterNHits cut are applied to soft photon \n"
2308 "- ``tight``: tight energy cut and no clusterNHits cut are applied to soft photon \n"
2309 "- ``cluster``: loose energy cut and clusterNHits cut are applied to soft photon \n"
2310 "- ``both``: tight energy cut and clusterNHits cut are applied to soft photon \n"
2311 "- ``standardMC15rd``: loose energy cut is applied to soft photon and the weight files are trained using MC15rd \n"
2312 "- ``tightMC15rd``: tight energy cut is applied to soft photon and the weight files are trained using MC15rd \n"
2313 "- ``standardMC16rd``: loose energy cut is applied to soft photon and the weight files are trained using MC16rd \n"
2314 "- ``tightMC16rd``: tight energy cut is applied to soft photon and the weight files are trained using MC16rd \n\n"
2315 "You can find more details in `writePi0EtaVeto` function in modularAnalysis.py.", Manager::VariableDataType::c_double);
2317 REGISTER_METAVARIABLE(
"etaProb(mode)", etaProb,
2318 "Returns eta probability, where mode is used to specify the selection criteria for soft photon. \n"
2319 "The following strings are available. \n\n"
2320 "- ``standard``: loose energy cut and no clusterNHits cut are applied to soft photon \n"
2321 "- ``tight``: tight energy cut and no clusterNHits cut are applied to soft photon \n"
2322 "- ``cluster``: loose energy cut and clusterNHits cut are applied to soft photon \n"
2323 "- ``both``: tight energy cut and clusterNHits cut are applied to soft photon \n"
2324 "- ``standardMC15rd``: loose energy cut is applied to soft photon and the weight files are trained using MC15rd \n"
2325 "- ``tightMC15rd``: tight energy cut is applied to soft photon and the weight files are trained using MC15rd \n"
2326 "- ``standardMC16rd``: loose energy cut is applied to soft photon and the weight files are trained using MC16rd \n"
2327 "- ``tightMC16rd``: tight energy cut is applied to soft photon and the weight files are trained using MC16rd \n\n"
2328 "You can find more details in `writePi0EtaVeto` function in modularAnalysis.py.", Manager::VariableDataType::c_double);
static const ParticleType neutron
neutron particle
static const ParticleType pi0
neutral pion particle
static const ChargedStable muon
muon particle
static const ChargedStable pion
charged pion particle
static const ParticleType Klong
K^0_L particle.
static const ChargedStable proton
proton particle
static const ParticleType Kshort
K^0_S particle.
static const double doubleNaN
quiet_NaN
static const ChargedStable kaon
charged kaon particle
static const ParticleType photon
photon particle
static const ChargedStable electron
electron particle
@ c_nPhotons
CR is split into n photons (N1)
@ c_PrimaryParticle
bit 0: Particle is primary particle.
static const ReferenceFrame & GetCurrent()
Get current rest frame.
static constexpr const char * c_defaultMaskName
Default mask name.
std::function< VarVariant(const Particle *)> FunctionPtr
functions stored take a const Particle* and return VarVariant.
const Var * getVariable(std::string name)
Get the variable belonging to the given key.
static Manager & Instance()
get singleton instance.
T convertString(const std::string &str)
Converts a string to type T (one of float, double, long double, int, long int, unsigned long int).
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.