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. "
151 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.");
158 B2ERROR(
"ParticleLoaderModule::initialize Invalid input DecayString: " << decayString);
166 string listName = mother->
getName() +
":all";
172 else if (nProducts == 1)
173 listName = mother->
getName() +
":kink";
175 else if (nProducts > 1)
176 listName = mother->
getName() +
":V0";
179 bool isSelfConjugatedParticle = (listName == antiListName);
183 if (!particleList.isOptional()) {
185 particleList.registerInDataStore(flags);
192 B2WARNING(
"ParticleList " << listName <<
" already exists and will not be created again. " <<
193 "Please note that the given options (addDaughters, skipNonPrimaryDaughters, skipNonPrimary, skipInitial) do not apply to "
196 B2WARNING(
"ParticleList " << listName <<
" already exists and will not be created again. " <<
197 "Please note that the given option, useOnlyMostEnergeticECLCluster, does not apply to "
202 B2ERROR(
"Invalid particle type requested to be loaded. Set a valid decayString module parameter.");
205 bool mdstSourceIsV0 =
false;
209 mdstSourceIsV0 =
true;
213 bool mdstSourceIsKink =
false;
216 || abs(pdgCode) == abs(
Const::muon.getPDGCode()) || abs(pdgCode) == abs(3222) || abs(pdgCode) == abs(3112)))
217 mdstSourceIsKink =
true;
219 if (mdstSourceIsV0) {
220 if (nProducts == 2) {
223 B2ERROR(
"MDST source of the particle list is V0, the two daughters should have opposite charge");
225 B2ERROR(
"ParticleLoaderModule::initialize Invalid input DecayString " << decayString
226 <<
". MDST source of the particle list is V0, DecayString should contain exactly two daughters, as well as the mother particle.");
229 if (!mdstSourceIsKink && nProducts > 0) {
231 B2INFO(
"ParticleLoaderModule: Replacing the source particle list name by " <<
233 <<
" all other daughters will be ignored.");
236 B2ERROR(
"ParticleLoaderModule::initialize Invalid input DecayString " << decayString
237 <<
". DecayString should not contain any daughters, only the mother particle.");
243 B2ERROR(
"The sourceParticleListName is not given. The charged ParticleList is required for the chargedCluster loading.");
247 B2INFO(
" o) creating ParticleList with name: " << listName);
249 B2INFO(
" o) creating (anti-)ParticleList with name: " << listName <<
" (" << antiListName <<
")");
251 B2INFO(
" -> MDST source: RestOfEvents");
252 m_ROE2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
254 B2INFO(
" -> MDST source: No MDST source");
255 m_Dummies2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
257 B2INFO(
" -> MDST source: MCParticles");
263 B2INFO(
" -> MDST source: ECLClusters and KLMClusters being matched with Tracks");
265 B2ERROR(
"The Particle type must be gamma, K_L0, or (anti-)n0 for the loadChargedCluster option.");
270 if (!mdstSourceIsKink) {
271 B2INFO(
" -> MDST source: Tracks");
272 m_Tracks2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
274 B2INFO(
" -> MDST source: Kinks");
275 m_Kink2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
282 B2INFO(
" -> MDST source: ECLClusters and KLMClusters");
284 B2INFO(
" -> MDST source: V0");
285 m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
290 B2INFO(
" -> MDST source: V0");
291 m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
295 B2INFO(
" -> MDST source: exclusively KLMClusters or exclusively ECLClusters (matching between those not used)");
300 B2INFO(
" -> MDST source: V0");
301 m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
342 <<
" tracks skipped because of zero charge for "
343 << get<c_PListName>(track2Plist));
350 <<
" v0s skipped because of same charge daughters for "
351 << get<c_PListName>(v02Plist));
361 B2ERROR(
"ParticleLoaderModule::dummyToParticles Multiple particle lists are not supported!");
363 string dummyListName = get<c_PListName>(dummy2Plist);
364 string antiDummyListName = get<c_AntiPListName>(dummy2Plist);
365 int pdgCode = get<c_PListPDGCode>(dummy2Plist);
366 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(dummy2Plist);
370 plist->initialize(pdgCode, dummyListName);
372 if (!isSelfConjugatedParticle) {
375 antiPlist->initialize(-1 * pdgCode, antiDummyListName);
376 antiPlist->bindAntiParticleList(*(plist));
379 TMatrixFSym covariance(7);
380 for (
int row = 0; row < 7; ++row) {
389 ROOT::Math::PxPyPzEVector zero4Vector = {0., 0., 0., 0.};
391 newPart =
m_particles.appendNew(zero4Vector, pdgCode, isFlavored, Particle::EParticleSourceObject::c_NoMDSTSource,
395 plist->addParticle(newPart);
397 if (!isSelfConjugatedParticle) {
398 newAntiPart =
m_particles.appendNew(zero4Vector, -pdgCode, isFlavored, Particle::EParticleSourceObject::c_NoMDSTSource,
402 plist->addParticle(newAntiPart);
414 string listName = get<c_PListName>(roe2Plist);
415 string antiListName = get<c_AntiPListName>(roe2Plist);
416 int pdgCode = get<c_PListPDGCode>(roe2Plist);
417 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(roe2Plist);
425 plist->initialize(pdgCode, listName);
427 if (!isSelfConjugatedParticle) {
430 antiPlist->initialize(-1 * pdgCode, antiListName);
431 antiPlist->bindAntiParticleList(*(plist));
439 for (
unsigned int i = 0; i < pList->getListSize(); i++) {
445 if (isSelfConjugatedParticle)
447 else if (i < pList->getListSize(
false))
456 for (
int i = 0; i <
m_roes.getEntries(); i++) {
475 ROOT::Math::PxPyPzEVector signal4Vector = signalSideParticle->get4Vector();
477 ROOT::Math::PxPyPzEVector missing4Vector = boost4Vector - signal4Vector - roe4Vector;
479 newPart =
m_particles.appendNew(missing4Vector, pdgCode, isFlavored, Particle::EParticleSourceObject::c_Undefined, mdstIndex);
485 string listName = get<c_PListName>(roe2Plist);
487 plist->addParticle(newPart);
498 bool matchingDaughtersOrder =
true;
501 matchingDaughtersOrder =
false;
504 for (
size_t ilist = 0; ilist <
m_V02Plists.size(); ilist++) {
506 string listName = get<c_PListName>(v02Plist);
507 string antiListName = get<c_AntiPListName>(v02Plist);
508 int pdgCode = get<c_PListPDGCode>(v02Plist);
509 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(v02Plist);
517 plist->initialize(pdgCode, listName);
519 if (!isSelfConjugatedParticle) {
522 antiPlist->initialize(-1 * pdgCode, antiListName);
524 antiPlist->bindAntiParticleList(*(plist));
527 plist->setEditable(
true);
530 for (
int i = 0; i <
m_v0s.getEntries(); i++) {
539 B2DEBUG(19,
"V0 with same charge daughters skipped!");
563 B2WARNING(
"Unknown V0 hypothesis!");
569 bool correctOrder = matchingDaughtersOrder;
572 correctOrder = !correctOrder;
574 std::pair<Track*, Track*> v0Tracks = v0->
getTracks();
575 std::pair<TrackFitResult*, TrackFitResult*> v0TrackFitResults = v0->
getTrackFitResults();
577 Particle daugP((v0Tracks.first)->getArrayIndex(), v0TrackFitResults.first, pTypeP);
578 Particle daugM((v0Tracks.second)->getArrayIndex(), v0TrackFitResults.second, pTypeM);
580 const PIDLikelihood* pidP = (v0Tracks.first)->getRelated<PIDLikelihood>();
581 const PIDLikelihood* pidM = (v0Tracks.second)->getRelated<PIDLikelihood>();
583 const auto& mcParticlePWithWeight = (v0Tracks.first)->getRelatedToWithWeight<MCParticle>();
584 const auto& mcParticleMWithWeight = (v0Tracks.second)->getRelatedToWithWeight<MCParticle>();
601 if (mcParticlePWithWeight.first)
602 newDaugP->
addRelationTo(mcParticlePWithWeight.first, mcParticlePWithWeight.second);
607 if (mcParticleMWithWeight.first)
608 newDaugM->
addRelationTo(mcParticleMWithWeight.first, mcParticleMWithWeight.second);
629 plist->addParticle(newPart);
632 plist->setEditable(
false);
643 for (
size_t ilist = 0; ilist <
m_Kink2Plists.size(); ilist++) {
645 string listName = get<c_PListName>(kink2Plist);
646 string antiListName = get<c_AntiPListName>(kink2Plist);
647 int pdgCode = get<c_PListPDGCode>(kink2Plist);
648 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(kink2Plist);
656 plist->initialize(pdgCode, listName);
658 if (!isSelfConjugatedParticle) {
661 antiPlist->initialize(-1 * pdgCode, antiListName);
663 antiPlist->bindAntiParticleList(*(plist));
666 plist->setEditable(
true);
669 for (
int i = 0; i <
m_kinks.getEntries(); i++) {
677 if (motherCharge == 0) {
678 B2DEBUG(19,
"Kink track with charge = 0 skipped!");
693 if (motherMCParticleWithWeight.first)
694 newPart->
addRelationTo(motherMCParticleWithWeight.first, motherMCParticleWithWeight.second);
698 plist->addParticle(newPart);
701 plist->setEditable(
false);
713 string listName = get<c_PListName>(track2Plist);
714 string antiListName = get<c_AntiPListName>(track2Plist);
715 int pdgCode = get<c_PListPDGCode>(track2Plist);
716 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(track2Plist);
724 plist->initialize(pdgCode, listName);
727 if (!isSelfConjugatedParticle) {
730 antiPlist->initialize(-1 * pdgCode, antiListName);
732 antiPlist->bindAntiParticleList(*(plist));
735 plist->setEditable(
true);
739 for (
int i = 0; i <
m_tracks.getEntries(); i++) {
742 const auto& mcParticleWithWeight = track->getRelatedToWithWeight<
MCParticle>();
750 const TrackFitResult* trackFit = track->getTrackFitResultWithClosestMass(type);
753 B2WARNING(
"Track returned null TrackFitResult pointer for ChargedStable::getPDGCode() = " << type.getPDGCode());
766 B2DEBUG(19,
"Track with charge = 0 skipped!");
772 Particle particle(track->getArrayIndex(), trackFit, type);
779 if (mcParticleWithWeight.first)
780 newPart->
addRelationTo(mcParticleWithWeight.first, mcParticleWithWeight.second);
783 plist->addParticle(newPart);
788 plist->setEditable(
false);
799 string listName = get<c_PListName>(eclKLMCluster2Plist);
800 int pdgCode = get<c_PListPDGCode>(eclKLMCluster2Plist);
809 plist->initialize(pdgCode, listName);
811 plist->setEditable(
true);
821 Particle particle(cluster, thisType);
823 B2FATAL(
"Particle created from ECLCluster does not have ECLCluster type.");
831 plist->addParticle(newPart);
838 if (std::isnan(cluster->getMomentumMag())) {
839 B2DEBUG(19,
"Skipping KLMCluster because its momentum is NaN. "
840 "This can happen if the timing calibration is missing or wrong, so that the velocity is calculated to be negative.");
847 Particle particle(cluster, pdgCode);
848 if (particle.getParticleSource() != Particle::c_KLMCluster) {
849 B2FATAL(
"Particle created from KLMCluster does not have KLMCluster type.");
857 plist->addParticle(newPart);
860 plist->setEditable(
false);
872 if (!cluster->isNeutral() and onlyNeutral)
902 std::vector<std::pair<double, int>> weightsAndIndices;
903 for (
unsigned int iMCParticle = 0; iMCParticle < mcRelations.
size(); iMCParticle++) {
904 const MCParticle* relMCParticle = mcRelations[iMCParticle];
906 double weight = mcRelations.
weight(iMCParticle);
907 weightsAndIndices.emplace_back(weight, relMCParticle->
getArrayIndex());
912 std::sort(weightsAndIndices.begin(), weightsAndIndices.end(),
913 ValueIndexPairSorting::higherPair<
decltype(weightsAndIndices)::value_type>);
916 for (
auto& weightsAndIndex : weightsAndIndices) {
918 double weight = weightsAndIndex.first;
925 && weight / relMCParticle->
getEnergy() > 0.30)
939 string listName = get<c_PListName>(chargedCluster2Plist);
940 string antiListName = get<c_AntiPListName>(chargedCluster2Plist);
941 int pdgCode = get<c_PListPDGCode>(chargedCluster2Plist);
942 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(chargedCluster2Plist);
951 plist->initialize(pdgCode, listName);
954 if (!isSelfConjugatedParticle) {
957 antiPlist->initialize(-1 * pdgCode, antiListName);
959 antiPlist->bindAntiParticleList(*(plist));
966 for (
unsigned int iPart = 0; iPart < sourceList->getListSize(); iPart++) {
968 const Particle* sourcePart = sourceList->getParticle(iPart);
969 const Track* sourceTrack = sourceList->getParticle(iPart)->getTrack();
978 Particle particle(cluster, thisType);
980 B2FATAL(
"Particle created from ECLCluster does not have ECLCluster type.");
984 plist->addParticle(newPart);
990 for (
unsigned int iCluster = 0; iCluster < clusters.
size(); iCluster++) {
991 const ECLCluster* cluster = clusters[iCluster];
995 Particle particle(cluster, thisType);
997 B2FATAL(
"Particle created from ECLCluster does not have ECLCluster type.");
1001 plist->addParticle(newPart);
1007 if (!cluster)
continue;
1009 if (std::isnan(cluster->getMomentumMag())) {
1010 B2DEBUG(19,
"Skipping KLMCluster because its momentum is NaN. "
1011 "This can happen if the timing calibration is missing or wrong, so that the velocity is calculated to be negative.");
1016 Particle particle(cluster, pdgCode);
1018 B2FATAL(
"Particle created from KLMCluster does not have KLMCluster type.");
1025 plist->addParticle(newPart);
1038 string listName = get<c_PListName>(mcParticle2Plist);
1039 string antiListName = get<c_AntiPListName>(mcParticle2Plist);
1040 int pdgCode = get<c_PListPDGCode>(mcParticle2Plist);
1041 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(mcParticle2Plist);
1044 if (plist.isValid())
1047 plist->initialize(pdgCode, listName);
1049 if (!isSelfConjugatedParticle) {
1052 antiPlist->initialize(-1 * pdgCode, antiListName);
1054 antiPlist->bindAntiParticleList(*(plist));
1060 if (abs(pdgCode) != abs(mcParticle->
getPDG()))
1076 plist->addParticle(newPart);
1084 bool result =
false;
1115 vector<MCParticle*> mcdaughters = mcmother->
getDaughters();
1117 for (
auto& mcdaughter : mcdaughters) {
1121 daughter->addRelationTo(mcdaughter);
1124 if (mcdaughter->getNDaughters() > 0)
Provides a type-safe way to pass members of the chargedStableSet set.
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.
@ 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.
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.