10#include <analysis/modules/ParticleLoader/ParticleLoaderModule.h>
13#include <framework/logging/Logger.h>
14#include <framework/core/ModuleParam.templateDetails.h>
17#include <analysis/dataobjects/ParticleList.h>
18#include <analysis/DecayDescriptor/ParticleListName.h>
19#include <analysis/utility/PCmsLabTransform.h>
20#include <analysis/utility/ValueIndexPairSorting.h>
40 setDescription(
"Loads MDST dataobjects as Particle objects to the StoreArray<Particle> and collects them in specified ParticleList.");
45 "List of decay strings (see :ref:`DecayString` for syntax) that specify all output ParticleLists to be created by the module.",
49 "Use MCParticles instead of reconstructed MDST dataobjects (tracks, ECL, KLM, clusters, V0s, ...)",
false);
52 "Use ROE instead of reconstructed MDST dataobjects (tracks, ECL, KLM, clusters, V0s, ...)",
false);
58 "Particle list name from which we need to get ROEs", std::string(
""));
61 "If true, the Particle List will be filled with missing momentum from the ROE and signal particle.",
false);
64 "If true, the output ParticleList will be saved by RootOutput. If false, it will be ignored when writing the file.",
false);
67 "If true, initial MCParticles will be skipped (default). If false, initial MCParticles will be included.",
true);
70 "If true, the secondary MC particle will be skipped, default is false",
74 "If true, the particles from the bottom part of the selected particle's decay chain will also be created in the datastore and mother-daughter relations are recursively set",
78 "If true, the secondary MC daughters will be skipped, default is false",
82 "Track hypothesis to use when loading the particle. By default, use the particle's own hypothesis.",
86 "If true, a Particle is only created if a track fit with the particle hypothesis passed to the ParticleLoader is available.",
90 "Use Dummy instead of reconstructed MDST dataobjects (tracks, ECL, KLM, clusters, V0s, ...)",
false);
93 "mdst index to use for dummy particle", 0);
96 "Diagonal value of covariance matrix to use for dummy particle", 10000.);
99 "Should treeFitter treat the particle as invisible?",
true);
102 "Load neutral Particles from the clusters being matched with the track of the sourceParticleList",
105 "If true, the most energetic ECLCluster among ones matching with the Track is used. "
106 "If false, all matched ECLCluster are used. "
107 "This option is checked only when loadChargedCluster=True.",
114 B2INFO(
"ParticleLoader's Summary of Actions:");
117 B2FATAL(
"The options on how to load the Particle are not valid. The incompatible combination of options is selected. "
148 B2WARNING(
"Obsolete usage of the ParticleLoader module (load all MDST objects as all possible Particle object types). Specify the particle type via decayStrings module parameter instead.");
155 B2ERROR(
"ParticleLoaderModule::initialize Invalid input DecayString: " << decayString);
163 string listName = mother->
getName() +
":all";
169 else if (nProducts == 1)
170 listName = mother->
getName() +
":kink";
172 else if (nProducts > 1)
173 listName = mother->
getName() +
":V0";
176 bool isSelfConjugatedParticle = (listName == antiListName);
180 if (!particleList.isOptional()) {
182 particleList.registerInDataStore(flags);
183 if (!isSelfConjugatedParticle) {
188 B2WARNING(
"ParticleList " << listName <<
" already exists and will not be created again. " <<
189 "Please note that the given options (addDaughters, skipNonPrimaryDaughters, skipNonPrimary, skipInitial) do not apply to "
192 B2WARNING(
"ParticleList " << listName <<
" already exists and will not be created again. " <<
193 "Please note that the given option, useOnlyMostEnergeticECLCluster, does not apply to "
198 B2ERROR(
"Invalid particle type requested to be loaded. Set a valid decayString module parameter.");
201 bool mdstSourceIsV0 =
false;
205 mdstSourceIsV0 =
true;
209 bool mdstSourceIsKink =
false;
212 || abs(pdgCode) == abs(
Const::muon.getPDGCode()) || abs(pdgCode) == abs(3222) || abs(pdgCode) == abs(3112)))
213 mdstSourceIsKink =
true;
215 if (mdstSourceIsV0) {
216 if (nProducts == 2) {
219 B2ERROR(
"MDST source of the particle list is V0, the two daughters should have opposite charge");
221 B2ERROR(
"ParticleLoaderModule::initialize Invalid input DecayString " << decayString
222 <<
". MDST source of the particle list is V0, DecayString should contain exactly two daughters, as well as the mother particle.");
225 if (!mdstSourceIsKink && nProducts > 0) {
227 B2INFO(
"ParticleLoaderModule: Replacing the source particle list name by " <<
229 <<
" all other daughters will be ignored.");
232 B2ERROR(
"ParticleLoaderModule::initialize Invalid input DecayString " << decayString
233 <<
". DecayString should not contain any daughters, only the mother particle.");
239 B2ERROR(
"The sourceParticleListName is not given. The charged ParticleList is required for the chargedCluster loading.");
242 B2INFO(
" o) creating (anti-)ParticleList with name: " << listName <<
" (" << antiListName <<
")");
244 B2INFO(
" -> MDST source: RestOfEvents");
245 m_ROE2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
247 B2INFO(
" -> MDST source: No MDST source");
248 m_Dummies2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
250 B2INFO(
" -> MDST source: MCParticles");
256 B2INFO(
" -> MDST source: ECLClusters and KLMClusters being matched with Tracks");
258 B2ERROR(
"The Particle type must be gamma, K_L0, or (anti-)n0 for the loadChargedCluster option.");
263 if (!mdstSourceIsKink) {
264 B2INFO(
" -> MDST source: Tracks");
265 m_Tracks2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
267 B2INFO(
" -> MDST source: Kinks");
268 m_Kink2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
275 B2INFO(
" -> MDST source: ECLClusters and KLMClusters");
277 B2INFO(
" -> MDST source: V0");
278 m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
283 B2INFO(
" -> MDST source: V0");
284 m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
288 B2INFO(
" -> MDST source: exclusively KLMClusters or exclusively ECLClusters (matching between those not used)");
293 B2INFO(
" -> MDST source: V0");
294 m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
335 <<
" tracks skipped because of zero charge for "
336 << get<c_PListName>(track2Plist));
343 <<
" v0s skipped because of same charge daughters for "
344 << get<c_PListName>(v02Plist));
354 B2ERROR(
"ParticleLoaderModule::dummyToParticles Multiple particle lists are not supported!");
356 string dummyListName = get<c_PListName>(dummy2Plist);
357 string antiDummyListName = get<c_AntiPListName>(dummy2Plist);
358 int pdgCode = get<c_PListPDGCode>(dummy2Plist);
359 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(dummy2Plist);
363 plist->initialize(pdgCode, dummyListName);
365 if (!isSelfConjugatedParticle) {
368 antiPlist->initialize(-1 * pdgCode, antiDummyListName);
369 antiPlist->bindAntiParticleList(*(plist));
372 TMatrixFSym covariance(7);
373 for (
int row = 0; row < 7; ++row) {
382 ROOT::Math::PxPyPzEVector zero4Vector = {0., 0., 0., 0.};
384 newPart =
m_particles.
appendNew(zero4Vector, pdgCode, isFlavored, Particle::EParticleSourceObject::c_NoMDSTSource,
388 plist->addParticle(newPart);
390 if (!isSelfConjugatedParticle) {
391 newAntiPart =
m_particles.
appendNew(zero4Vector, -pdgCode, isFlavored, Particle::EParticleSourceObject::c_NoMDSTSource,
395 plist->addParticle(newAntiPart);
407 string listName = get<c_PListName>(roe2Plist);
408 string antiListName = get<c_AntiPListName>(roe2Plist);
409 int pdgCode = get<c_PListPDGCode>(roe2Plist);
410 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(roe2Plist);
418 plist->initialize(pdgCode, listName);
420 if (!isSelfConjugatedParticle) {
423 antiPlist->initialize(-1 * pdgCode, antiListName);
424 antiPlist->bindAntiParticleList(*(plist));
432 for (
unsigned int i = 0; i < pList->getListSize(); i++) {
438 if (isSelfConjugatedParticle)
440 else if (i < pList->getListSize(
false))
449 for (
int i = 0; i <
m_roes.getEntries(); i++) {
468 ROOT::Math::PxPyPzEVector signal4Vector = signalSideParticle->get4Vector();
470 ROOT::Math::PxPyPzEVector missing4Vector = boost4Vector - signal4Vector - roe4Vector;
472 newPart =
m_particles.
appendNew(missing4Vector, pdgCode, isFlavored, Particle::EParticleSourceObject::c_Undefined, mdstIndex);
478 string listName = get<c_PListName>(roe2Plist);
480 plist->addParticle(newPart);
491 bool matchingDaughtersOrder =
true;
494 matchingDaughtersOrder =
false;
497 for (
size_t ilist = 0; ilist <
m_V02Plists.size(); ilist++) {
499 string listName = get<c_PListName>(v02Plist);
500 string antiListName = get<c_AntiPListName>(v02Plist);
501 int pdgCode = get<c_PListPDGCode>(v02Plist);
502 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(v02Plist);
510 plist->initialize(pdgCode, listName);
512 if (!isSelfConjugatedParticle) {
515 antiPlist->initialize(-1 * pdgCode, antiListName);
517 antiPlist->bindAntiParticleList(*(plist));
520 plist->setEditable(
true);
523 for (
int i = 0; i <
m_v0s.getEntries(); i++) {
532 B2DEBUG(19,
"V0 with same charge daughters skipped!");
556 B2WARNING(
"Unknown V0 hypothesis!");
562 bool correctOrder = matchingDaughtersOrder;
565 correctOrder = !correctOrder;
567 std::pair<Track*, Track*> v0Tracks = v0->
getTracks();
568 std::pair<TrackFitResult*, TrackFitResult*> v0TrackFitResults = v0->
getTrackFitResults();
570 Particle daugP((v0Tracks.first)->getArrayIndex(), v0TrackFitResults.first, pTypeP);
571 Particle daugM((v0Tracks.second)->getArrayIndex(), v0TrackFitResults.second, pTypeM);
573 const PIDLikelihood* pidP = (v0Tracks.first)->getRelated<PIDLikelihood>();
574 const PIDLikelihood* pidM = (v0Tracks.second)->getRelated<PIDLikelihood>();
576 const auto& mcParticlePWithWeight = (v0Tracks.first)->getRelatedToWithWeight<MCParticle>();
577 const auto& mcParticleMWithWeight = (v0Tracks.second)->getRelatedToWithWeight<MCParticle>();
594 if (mcParticlePWithWeight.first)
595 newDaugP->
addRelationTo(mcParticlePWithWeight.first, mcParticlePWithWeight.second);
600 if (mcParticleMWithWeight.first)
601 newDaugM->
addRelationTo(mcParticleMWithWeight.first, mcParticleMWithWeight.second);
622 plist->addParticle(newPart);
625 plist->setEditable(
false);
636 for (
size_t ilist = 0; ilist <
m_Kink2Plists.size(); ilist++) {
638 string listName = get<c_PListName>(kink2Plist);
639 string antiListName = get<c_AntiPListName>(kink2Plist);
640 int pdgCode = get<c_PListPDGCode>(kink2Plist);
641 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(kink2Plist);
649 plist->initialize(pdgCode, listName);
651 if (!isSelfConjugatedParticle) {
654 antiPlist->initialize(-1 * pdgCode, antiListName);
656 antiPlist->bindAntiParticleList(*(plist));
659 plist->setEditable(
true);
662 for (
int i = 0; i <
m_kinks.getEntries(); i++) {
670 if (motherCharge == 0) {
671 B2DEBUG(19,
"Kink track with charge = 0 skipped!");
686 if (motherMCParticleWithWeight.first)
687 newPart->
addRelationTo(motherMCParticleWithWeight.first, motherMCParticleWithWeight.second);
691 plist->addParticle(newPart);
694 plist->setEditable(
false);
706 string listName = get<c_PListName>(track2Plist);
707 string antiListName = get<c_AntiPListName>(track2Plist);
708 int pdgCode = get<c_PListPDGCode>(track2Plist);
709 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(track2Plist);
717 plist->initialize(pdgCode, listName);
720 if (!isSelfConjugatedParticle) {
723 antiPlist->initialize(-1 * pdgCode, antiListName);
725 antiPlist->bindAntiParticleList(*(plist));
728 plist->setEditable(
true);
732 for (
int i = 0; i <
m_tracks.getEntries(); i++) {
735 const auto& mcParticleWithWeight = track->getRelatedToWithWeight<
MCParticle>();
743 const TrackFitResult* trackFit = track->getTrackFitResultWithClosestMass(type);
746 B2WARNING(
"Track returned null TrackFitResult pointer for ChargedStable::getPDGCode() = " << type.getPDGCode());
759 B2DEBUG(19,
"Track with charge = 0 skipped!");
765 Particle particle(track->getArrayIndex(), trackFit, type);
772 if (mcParticleWithWeight.first)
773 newPart->
addRelationTo(mcParticleWithWeight.first, mcParticleWithWeight.second);
776 plist->addParticle(newPart);
781 plist->setEditable(
false);
792 string listName = get<c_PListName>(eclKLMCluster2Plist);
793 string antiListName = get<c_AntiPListName>(eclKLMCluster2Plist);
794 int pdgCode = get<c_PListPDGCode>(eclKLMCluster2Plist);
795 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(eclKLMCluster2Plist);
804 plist->initialize(pdgCode, listName);
807 if (!isSelfConjugatedParticle) {
810 antiPlist->initialize(-1 * pdgCode, antiListName);
812 antiPlist->bindAntiParticleList(*(plist));
815 plist->setEditable(
true);
825 Particle particle(cluster, thisType);
827 B2FATAL(
"Particle created from ECLCluster does not have ECLCluster type.");
835 plist->addParticle(newPart);
842 if (std::isnan(cluster->getMomentumMag())) {
843 B2DEBUG(19,
"Skipping KLMCluster because its momentum is NaN. "
844 "This can happen if the timing calibration is missing or wrong, so that the velocity is calculated to be negative.");
851 Particle particle(cluster, pdgCode);
852 if (particle.getParticleSource() != Particle::c_KLMCluster) {
853 B2FATAL(
"Particle created from KLMCluster does not have KLMCluster type.");
861 plist->addParticle(newPart);
864 plist->setEditable(
false);
876 if (!cluster->isNeutral() and onlyNeutral)
906 std::vector<std::pair<double, int>> weightsAndIndices;
907 for (
unsigned int iMCParticle = 0; iMCParticle < mcRelations.
size(); iMCParticle++) {
908 const MCParticle* relMCParticle = mcRelations[iMCParticle];
910 double weight = mcRelations.
weight(iMCParticle);
911 weightsAndIndices.emplace_back(weight, relMCParticle->
getArrayIndex());
916 std::sort(weightsAndIndices.begin(), weightsAndIndices.end(),
917 ValueIndexPairSorting::higherPair<
decltype(weightsAndIndices)::value_type>);
920 for (
auto& weightsAndIndex : weightsAndIndices) {
922 double weight = weightsAndIndex.first;
929 && weight / relMCParticle->
getEnergy() > 0.30)
943 string listName = get<c_PListName>(chargedCluster2Plist);
944 string antiListName = get<c_AntiPListName>(chargedCluster2Plist);
945 int pdgCode = get<c_PListPDGCode>(chargedCluster2Plist);
946 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(chargedCluster2Plist);
955 plist->initialize(pdgCode, listName);
958 if (!isSelfConjugatedParticle) {
961 antiPlist->initialize(-1 * pdgCode, antiListName);
963 antiPlist->bindAntiParticleList(*(plist));
970 for (
unsigned int iPart = 0; iPart < sourceList->getListSize(); iPart++) {
972 const Particle* sourcePart = sourceList->getParticle(iPart);
973 const Track* sourceTrack = sourceList->getParticle(iPart)->getTrack();
982 Particle particle(cluster, thisType);
984 B2FATAL(
"Particle created from ECLCluster does not have ECLCluster type.");
988 plist->addParticle(newPart);
994 for (
unsigned int iCluster = 0; iCluster < clusters.
size(); iCluster++) {
995 const ECLCluster* cluster = clusters[iCluster];
999 Particle particle(cluster, thisType);
1001 B2FATAL(
"Particle created from ECLCluster does not have ECLCluster type.");
1005 plist->addParticle(newPart);
1011 if (!cluster)
continue;
1013 if (std::isnan(cluster->getMomentumMag())) {
1014 B2DEBUG(19,
"Skipping KLMCluster because its momentum is NaN. "
1015 "This can happen if the timing calibration is missing or wrong, so that the velocity is calculated to be negative.");
1020 Particle particle(cluster, pdgCode);
1022 B2FATAL(
"Particle created from KLMCluster does not have KLMCluster type.");
1029 plist->addParticle(newPart);
1042 string listName = get<c_PListName>(mcParticle2Plist);
1043 string antiListName = get<c_AntiPListName>(mcParticle2Plist);
1044 int pdgCode = get<c_PListPDGCode>(mcParticle2Plist);
1045 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(mcParticle2Plist);
1048 if (plist.isValid())
1051 plist->initialize(pdgCode, listName);
1053 if (!isSelfConjugatedParticle) {
1056 antiPlist->initialize(-1 * pdgCode, antiListName);
1058 antiPlist->bindAntiParticleList(*(plist));
1064 if (abs(pdgCode) != abs(mcParticle->
getPDG()))
1080 plist->addParticle(newPart);
1088 bool result =
false;
1119 vector<MCParticle*> mcdaughters = mcmother->
getDaughters();
1121 for (
auto& mcdaughter : mcdaughters) {
1125 daughter->addRelationTo(mcdaughter);
1128 if (mcdaughter->getNDaughters() > 0)
Provides a type-safe way to pass members of the chargedStableSet set.
bool contains(const ParticleType &p) const
Returns true if and only if the set contains 'p'.
The ParticleType class for identifying different particle types.
int getPDGCode() const
PDG code.
static const ParticleType neutron
neutron particle
static const ParticleType Lambda
Lambda particle.
static const ChargedStable muon
muon particle
static const ParticleSet chargedStableSet
set of charged stable particles
static const ChargedStable pion
charged pion particle
static const ParticleType Klong
K^0_L particle.
static const ParticleType antiLambda
Anti-Lambda particle.
static const ChargedStable proton
proton particle
static const ParticleType invalidParticle
Invalid particle, used internally.
static const ParticleType Kshort
K^0_S particle.
static const ChargedStable kaon
charged kaon particle
static const ParticleType photon
photon particle
static const ChargedStable electron
electron particle
EStoreFlags
Flags describing behaviours of objects etc.
@ c_WriteOut
Object/array should be saved by output modules.
@ c_DontWriteOut
Object/array should be NOT saved by output modules.
Represents a particle in the DecayDescriptor.
int getPDGCode() const
Return PDG code.
std::string getFullName() const
returns the full name of the particle full_name = name:label
std::string getName() const
evt.pdl name of the particle.
int getProperty() const
return property of the particle.
bool init(const std::string &str)
Initialise the DecayDescriptor from given string.
const DecayDescriptor * getDaughter(int i) const
return i-th daughter (0 based index).
int getNDaughters() const
return number of direct daughters.
int getProperty() const
return property of the particle.
const DecayDescriptorParticle * getMother() const
return mother.
@ c_nPhotons
CR is split into n photons (N1)
@ c_neutralHadron
CR is reconstructed as a neutral hadron (N2)
Object holding information for Kinks.
short getTrackFitResultIndexMotherStart() const
Get index of the TrackFitResult of mother at the starting point.
Track * getMotherTrack() const
Get mother Track.
TrackFitResult * getMotherTrackFitResultStart() const
Get the TrackFitResult of mother at the starting point.
A Class to store the Monte Carlo particle information.
float getEnergy() const
Return particle energy in GeV.
@ c_PrimaryParticle
bit 0: Particle is primary particle.
std::vector< Belle2::MCParticle * > getDaughters() const
Get vector of all daughter particles, empty vector if none.
bool hasStatus(unsigned short int bitmask) const
Return if specific status bit is set.
int getArrayIndex() const
Get 0-based index of the particle in the corresponding MCParticle list.
int getPDG() const
Return PDG code of particle.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
std::vector< PList > m_ECLKLMClusters2Plists
Collection of PLists that will collect Particles created from ECLClusters and KLMClusters.
ParticleLoaderModule()
Constructor.
void mcParticlesToParticles()
Loads specified MCParticles as Particle to StoreArray<Particle>
void v0sToParticles()
Loads V0 object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleList...
StoreArray< TrackFitResult > m_trackfitresults
StoreArray of TrackFitResults.
std::vector< PList > m_Dummies2Plists
Collection of PLists that will collect Particles created from Dummies.
void kinksToParticles()
Loads Kink object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleLi...
StoreArray< Kink > m_kinks
StoreArray of Kinks.
std::vector< std::string > m_decayStrings
Input decay strings specifying the particles being created/loaded.
void roeToParticles()
Loads ROE object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleLis...
bool m_dummyTreatAsInvisible
should treeFitter treat the particle as invisible?
virtual void initialize() override
Initialize the Module.
int m_trackHypothesis
pdg code for track hypothesis that should be used to create the particle
StoreArray< KLMCluster > m_klmclusters
StoreArray of KLMCluster.
std::vector< int > m_sameChargeDaughtersV0Counts
internally used to count the number of V0s with same charge daughters
StoreArray< V0 > m_v0s
StoreArray of V0s.
void addROEToParticleList(RestOfEvent *roe, int mdstIndex, int pdgCode=0, bool isSelfConjugatedParticle=true)
Helper method to load ROE object as Particle.
virtual void event() override
Event processor.
std::string m_sourceParticleListName
Particle list name from which we need to get related ROEs.
bool isValidPDGCode(const int pdgCode)
returns true if the PDG code determined from the decayString is valid
StoreArray< MCParticle > m_mcparticles
StoreArray of MCParticles.
bool m_skipInitial
toggle skip of initial MC particles
StoreArray< Particle > m_particles
StoreArray of Particles.
int m_dummyMDSTIndex
mdst index for dummy particles
std::string m_roeMaskName
ROE mask name to load.
virtual void terminate() override
Terminate the Module.
void tracksToParticles()
Loads Track object as Particle to StoreArray<Particle> and adds it to the ParticleList.
std::vector< PList > m_Kink2Plists
Collection of PLists that will collect Particles created from Kink.
StoreObjPtr< ParticleExtraInfoMap > m_particleExtraInfoMap
object pointer to extra info map
double m_dummyCovMatrix
diag value of cov matrix for dummy particles
bool m_addDaughters
toggle addition of the bottom part of the particle's decay chain
StoreArray< PIDLikelihood > m_pidlikelihoods
StoreArray of PIDLikelihoods.
bool m_skipNonPrimaryDaughters
toggle skip of secondary MC daughters
StoreArray< Track > m_tracks
StoreArray of Tracks.
bool m_enforceFitHypothesis
If true, a Particle is only created if a track fit with the particle hypothesis passed to the Particl...
std::vector< PList > m_ROE2Plists
Collection of PLists that will collect Particles created from V0.
StoreArray< RestOfEvent > m_roes
StoreArray of ROEs.
bool isValidECLCluster(const ECLCluster *cluster, const int pdgCode, bool onlyNeutral) const
Checks if the given ECLCluster is valid for the pdgCode.
std::vector< PList > m_ChargedCluster2Plists
Collection of PLists that will collect Particles created from charged-cluster.
void appendDaughtersRecursive(Particle *mother)
recursively append bottom of a particle's decay chain (daughters of mother, granddaughters of daughte...
std::vector< PList > m_MCParticles2Plists
Collection of PLists that will collect Particles created from MCParticles.
void dummyToParticles()
Loads dummy object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleL...
std::vector< PList > m_V02Plists
Collection of PLists that will collect Particles created from V0.
DecayDescriptor m_decaydescriptor
Decay descriptor for parsing the user specified DecayString.
bool m_useDummy
Switch to load dummy as Particle.
bool m_writeOut
toggle particle list btw.
std::vector< int > m_chargeZeroTrackCounts
internally used to count number of tracks with charge zero
bool m_useOnlyMostEnergeticECLCluster
If true, only the most energetic ECLCluster is used.
std::vector< PList > m_Tracks2Plists
Collection of PLists that will collect Particles created from Tracks.
StoreArray< ECLCluster > m_eclclusters
StoreArray of ECLCluster.
bool m_skipNonPrimary
toggle skip of secondary MC particle
int m_properties
Particle property to be assigned only on V0s.
void chargedClustersToParticles()
Loads ECLCluster and KLMCluster objects that are being matched with Track as Particle to StoreArray<P...
void assignMCParticleFromECLCluster(Particle *newPart, const ECLCluster *cluster) const
Assigns the MCParticle relation to the newPart.
bool m_useROEs
Switch to load ROE as Particle.
bool m_loadChargedCluster
Switch to load charged-cluster
bool m_useMissing
Use missing momentum to build a particle.
void eclAndKLMClustersToParticles()
Loads ECLCluster and KLMCluster object as Particle to StoreArray<Particle> and adds it to the Particl...
bool m_useMCParticles
Load MCParticle as Particle instead of the corresponding MDST dataobject.
Class to store reconstructed particles.
void setProperty(const int properties)
sets m_properties
const KLMCluster * getKLMCluster() const
Returns the pointer to the KLMCluster object that was used to create this Particle (ParticleType == c...
void appendDaughter(const Particle *daughter, const bool updateType=true, const int daughterProperty=c_Ordinary)
Appends index of daughter to daughters index array.
const ECLCluster * getECLCluster() const
Returns the pointer to the ECLCluster object that was used to create this Particle (if ParticleType =...
void writeExtraInfo(const std::string &name, const double value)
Sets the user defined extraInfo.
ROOT::Math::PxPyPzEVector get4Vector() const
Returns Lorentz vector.
void setMomentumVertexErrorMatrix(const TMatrixFSym &errMatrix)
Sets 7x7 error matrix.
EParticleSourceObject getParticleSource() const
Returns particle source as defined with enum EParticleSourceObject.
EFlavorType
describes flavor type, see getFlavorType().
@ c_Unflavored
Is its own antiparticle or we don't know whether it is a particle/antiparticle.
@ c_Flavored
Is either particle or antiparticle.
double getECLClusterEnergy() const
Returns the energy of the ECLCluster for the particle.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
float weight(int index) const
Get weight with index.
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
std::pair< TO *, float > getRelatedToWithWeight(const std::string &name="", const std::string &namedRelation="") const
Get first related object & weight of relation pointing to an array.
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
FROM * getRelatedFrom(const std::string &name="", const std::string &namedRelation="") const
Get the object from which this object has a relation.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
This is a general purpose class for collecting reconstructed MDST data objects that are not used in r...
ROOT::Math::PxPyPzEVector get4Vector(const std::string &maskName=c_defaultMaskName) const
Get 4-momentum vector all (no mask) or a subset (use mask) of all Tracks and ECLClusters in ROE.
static constexpr const char * c_defaultMaskName
Default mask name.
Particle * convertToParticle(const std::string &maskName=c_defaultMaskName, int pdgCode=0, bool isSelfConjugated=true)
Converts ROE to Particle and adds it to StoreArray.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
bool create(bool replace=false)
Create a default object in the data store.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
Values of the result of a track fit with a given particle hypothesis.
short getChargeSign() const
Return track charge (1 or -1).
Const::ParticleType getParticleType() const
Getter for ParticleType of the mass hypothesis of the track fit.
Class that bundles various TrackFitResults.
Object holding information for V0s.
std::pair< Track *, Track * > getTracks() const
Get pair of the Tracks, that are part of the V0 particle.
std::pair< TrackFitResult *, TrackFitResult * > getTrackFitResults() const
Get pair of the TrackFitResults, that are part of the V0 particle.
Const::ParticleType getV0Hypothesis() const
Get the hypothesis under which the V0 particle was created.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
bool isInitial() const
Check if particle is an initial particle such as ISR.
std::string antiParticleListName(const std::string &listName)
Returns name of anti-particle-list corresponding to listName.
Abstract base class for different kinds of events.