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);
189 B2WARNING(
"ParticleList " << listName <<
" already exists and will not be created again. " <<
190 "Please note that the given options (addDaughters, skipNonPrimaryDaughters, skipNonPrimary, skipInitial) do not apply to "
193 B2WARNING(
"ParticleList " << listName <<
" already exists and will not be created again. " <<
194 "Please note that the given option, useOnlyMostEnergeticECLCluster, does not apply to "
199 B2ERROR(
"Invalid particle type requested to be loaded. Set a valid decayString module parameter.");
202 bool mdstSourceIsV0 =
false;
206 mdstSourceIsV0 =
true;
210 bool mdstSourceIsKink =
false;
213 || abs(pdgCode) == abs(
Const::muon.getPDGCode()) || abs(pdgCode) == abs(3222) || abs(pdgCode) == abs(3112)))
214 mdstSourceIsKink =
true;
216 if (mdstSourceIsV0) {
217 if (nProducts == 2) {
220 B2ERROR(
"MDST source of the particle list is V0, the two daughters should have opposite charge");
222 B2ERROR(
"ParticleLoaderModule::initialize Invalid input DecayString " << decayString
223 <<
". MDST source of the particle list is V0, DecayString should contain exactly two daughters, as well as the mother particle.");
226 if (!mdstSourceIsKink && nProducts > 0) {
228 B2INFO(
"ParticleLoaderModule: Replacing the source particle list name by " <<
230 <<
" all other daughters will be ignored.");
233 B2ERROR(
"ParticleLoaderModule::initialize Invalid input DecayString " << decayString
234 <<
". DecayString should not contain any daughters, only the mother particle.");
240 B2ERROR(
"The sourceParticleListName is not given. The charged ParticleList is required for the chargedCluster loading.");
244 B2INFO(
" o) creating ParticleList with name: " << listName);
246 B2INFO(
" o) creating (anti-)ParticleList with name: " << listName <<
" (" << antiListName <<
")");
248 B2INFO(
" -> MDST source: RestOfEvents");
249 m_ROE2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
251 B2INFO(
" -> MDST source: No MDST source");
252 m_Dummies2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
254 B2INFO(
" -> MDST source: MCParticles");
260 B2INFO(
" -> MDST source: ECLClusters and KLMClusters being matched with Tracks");
262 B2ERROR(
"The Particle type must be gamma, K_L0, or (anti-)n0 for the loadChargedCluster option.");
267 if (!mdstSourceIsKink) {
268 B2INFO(
" -> MDST source: Tracks");
269 m_Tracks2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
271 B2INFO(
" -> MDST source: Kinks");
272 m_Kink2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
279 B2INFO(
" -> MDST source: ECLClusters and KLMClusters");
281 B2INFO(
" -> MDST source: V0");
282 m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
287 B2INFO(
" -> MDST source: V0");
288 m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
292 B2INFO(
" -> MDST source: exclusively KLMClusters or exclusively ECLClusters (matching between those not used)");
297 B2INFO(
" -> MDST source: V0");
298 m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
339 <<
" tracks skipped because of zero charge for "
340 << get<c_PListName>(track2Plist));
347 <<
" v0s skipped because of same charge daughters for "
348 << get<c_PListName>(v02Plist));
358 B2ERROR(
"ParticleLoaderModule::dummyToParticles Multiple particle lists are not supported!");
360 string dummyListName = get<c_PListName>(dummy2Plist);
361 string antiDummyListName = get<c_AntiPListName>(dummy2Plist);
362 int pdgCode = get<c_PListPDGCode>(dummy2Plist);
363 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(dummy2Plist);
367 plist->initialize(pdgCode, dummyListName);
369 if (!isSelfConjugatedParticle) {
372 antiPlist->initialize(-1 * pdgCode, antiDummyListName);
373 antiPlist->bindAntiParticleList(*(plist));
376 TMatrixFSym covariance(7);
377 for (
int row = 0; row < 7; ++row) {
386 ROOT::Math::PxPyPzEVector zero4Vector = {0., 0., 0., 0.};
388 newPart =
m_particles.
appendNew(zero4Vector, pdgCode, isFlavored, Particle::EParticleSourceObject::c_NoMDSTSource,
392 plist->addParticle(newPart);
394 if (!isSelfConjugatedParticle) {
395 newAntiPart =
m_particles.
appendNew(zero4Vector, -pdgCode, isFlavored, Particle::EParticleSourceObject::c_NoMDSTSource,
399 plist->addParticle(newAntiPart);
411 string listName = get<c_PListName>(roe2Plist);
412 string antiListName = get<c_AntiPListName>(roe2Plist);
413 int pdgCode = get<c_PListPDGCode>(roe2Plist);
414 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(roe2Plist);
422 plist->initialize(pdgCode, listName);
424 if (!isSelfConjugatedParticle) {
427 antiPlist->initialize(-1 * pdgCode, antiListName);
428 antiPlist->bindAntiParticleList(*(plist));
436 for (
unsigned int i = 0; i < pList->getListSize(); i++) {
442 if (isSelfConjugatedParticle)
444 else if (i < pList->getListSize(
false))
453 for (
int i = 0; i <
m_roes.getEntries(); i++) {
472 ROOT::Math::PxPyPzEVector signal4Vector = signalSideParticle->get4Vector();
474 ROOT::Math::PxPyPzEVector missing4Vector = boost4Vector - signal4Vector - roe4Vector;
476 newPart =
m_particles.
appendNew(missing4Vector, pdgCode, isFlavored, Particle::EParticleSourceObject::c_Undefined, mdstIndex);
482 string listName = get<c_PListName>(roe2Plist);
484 plist->addParticle(newPart);
495 bool matchingDaughtersOrder =
true;
498 matchingDaughtersOrder =
false;
501 for (
size_t ilist = 0; ilist <
m_V02Plists.size(); ilist++) {
503 string listName = get<c_PListName>(v02Plist);
504 string antiListName = get<c_AntiPListName>(v02Plist);
505 int pdgCode = get<c_PListPDGCode>(v02Plist);
506 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(v02Plist);
514 plist->initialize(pdgCode, listName);
516 if (!isSelfConjugatedParticle) {
519 antiPlist->initialize(-1 * pdgCode, antiListName);
521 antiPlist->bindAntiParticleList(*(plist));
524 plist->setEditable(
true);
527 for (
int i = 0; i <
m_v0s.getEntries(); i++) {
536 B2DEBUG(19,
"V0 with same charge daughters skipped!");
560 B2WARNING(
"Unknown V0 hypothesis!");
566 bool correctOrder = matchingDaughtersOrder;
569 correctOrder = !correctOrder;
571 std::pair<Track*, Track*> v0Tracks = v0->
getTracks();
572 std::pair<TrackFitResult*, TrackFitResult*> v0TrackFitResults = v0->
getTrackFitResults();
574 Particle daugP((v0Tracks.first)->getArrayIndex(), v0TrackFitResults.first, pTypeP);
575 Particle daugM((v0Tracks.second)->getArrayIndex(), v0TrackFitResults.second, pTypeM);
577 const PIDLikelihood* pidP = (v0Tracks.first)->getRelated<PIDLikelihood>();
578 const PIDLikelihood* pidM = (v0Tracks.second)->getRelated<PIDLikelihood>();
580 const auto& mcParticlePWithWeight = (v0Tracks.first)->getRelatedToWithWeight<MCParticle>();
581 const auto& mcParticleMWithWeight = (v0Tracks.second)->getRelatedToWithWeight<MCParticle>();
598 if (mcParticlePWithWeight.first)
599 newDaugP->
addRelationTo(mcParticlePWithWeight.first, mcParticlePWithWeight.second);
604 if (mcParticleMWithWeight.first)
605 newDaugM->
addRelationTo(mcParticleMWithWeight.first, mcParticleMWithWeight.second);
626 plist->addParticle(newPart);
629 plist->setEditable(
false);
640 for (
size_t ilist = 0; ilist <
m_Kink2Plists.size(); ilist++) {
642 string listName = get<c_PListName>(kink2Plist);
643 string antiListName = get<c_AntiPListName>(kink2Plist);
644 int pdgCode = get<c_PListPDGCode>(kink2Plist);
645 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(kink2Plist);
653 plist->initialize(pdgCode, listName);
655 if (!isSelfConjugatedParticle) {
658 antiPlist->initialize(-1 * pdgCode, antiListName);
660 antiPlist->bindAntiParticleList(*(plist));
663 plist->setEditable(
true);
666 for (
int i = 0; i <
m_kinks.getEntries(); i++) {
674 if (motherCharge == 0) {
675 B2DEBUG(19,
"Kink track with charge = 0 skipped!");
690 if (motherMCParticleWithWeight.first)
691 newPart->
addRelationTo(motherMCParticleWithWeight.first, motherMCParticleWithWeight.second);
695 plist->addParticle(newPart);
698 plist->setEditable(
false);
710 string listName = get<c_PListName>(track2Plist);
711 string antiListName = get<c_AntiPListName>(track2Plist);
712 int pdgCode = get<c_PListPDGCode>(track2Plist);
713 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(track2Plist);
721 plist->initialize(pdgCode, listName);
724 if (!isSelfConjugatedParticle) {
727 antiPlist->initialize(-1 * pdgCode, antiListName);
729 antiPlist->bindAntiParticleList(*(plist));
732 plist->setEditable(
true);
736 for (
int i = 0; i <
m_tracks.getEntries(); i++) {
739 const auto& mcParticleWithWeight = track->getRelatedToWithWeight<
MCParticle>();
747 const TrackFitResult* trackFit = track->getTrackFitResultWithClosestMass(type);
750 B2WARNING(
"Track returned null TrackFitResult pointer for ChargedStable::getPDGCode() = " << type.getPDGCode());
763 B2DEBUG(19,
"Track with charge = 0 skipped!");
769 Particle particle(track->getArrayIndex(), trackFit, type);
771 if (particle.getParticleSource() == Particle::c_Track) {
776 if (mcParticleWithWeight.first)
777 newPart->
addRelationTo(mcParticleWithWeight.first, mcParticleWithWeight.second);
780 plist->addParticle(newPart);
785 plist->setEditable(
false);
796 string listName = get<c_PListName>(eclKLMCluster2Plist);
797 int pdgCode = get<c_PListPDGCode>(eclKLMCluster2Plist);
806 plist->initialize(pdgCode, listName);
808 plist->setEditable(
true);
818 Particle particle(cluster, thisType);
819 if (particle.getParticleSource() != Particle::c_ECLCluster) {
820 B2FATAL(
"Particle created from ECLCluster does not have ECLCluster type.");
828 plist->addParticle(newPart);
835 if (std::isnan(cluster->getMomentumMag())) {
836 B2DEBUG(19,
"Skipping KLMCluster because its momentum is NaN. "
837 "This can happen if the timing calibration is missing or wrong, so that the velocity is calculated to be negative.");
844 Particle particle(cluster, pdgCode);
845 if (particle.getParticleSource() != Particle::c_KLMCluster) {
846 B2FATAL(
"Particle created from KLMCluster does not have KLMCluster type.");
854 plist->addParticle(newPart);
857 plist->setEditable(
false);
869 if (!cluster->isNeutral() and onlyNeutral)
899 std::vector<std::pair<double, int>> weightsAndIndices;
900 for (
unsigned int iMCParticle = 0; iMCParticle < mcRelations.
size(); iMCParticle++) {
901 const MCParticle* relMCParticle = mcRelations[iMCParticle];
903 double weight = mcRelations.
weight(iMCParticle);
904 weightsAndIndices.emplace_back(weight, relMCParticle->
getArrayIndex());
909 std::sort(weightsAndIndices.begin(), weightsAndIndices.end(),
910 ValueIndexPairSorting::higherPair<
decltype(weightsAndIndices)::value_type>);
913 for (
auto& weightsAndIndex : weightsAndIndices) {
915 double weight = weightsAndIndex.first;
922 && weight / relMCParticle->
getEnergy() > 0.30)
936 string listName = get<c_PListName>(chargedCluster2Plist);
937 string antiListName = get<c_AntiPListName>(chargedCluster2Plist);
938 int pdgCode = get<c_PListPDGCode>(chargedCluster2Plist);
939 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(chargedCluster2Plist);
948 plist->initialize(pdgCode, listName);
951 if (!isSelfConjugatedParticle) {
954 antiPlist->initialize(-1 * pdgCode, antiListName);
956 antiPlist->bindAntiParticleList(*(plist));
963 for (
unsigned int iPart = 0; iPart < sourceList->getListSize(); iPart++) {
965 const Particle* sourcePart = sourceList->getParticle(iPart);
966 const Track* sourceTrack = sourceList->getParticle(iPart)->getTrack();
975 Particle particle(cluster, thisType);
976 if (particle.getParticleSource() != Particle::c_ECLCluster) {
977 B2FATAL(
"Particle created from ECLCluster does not have ECLCluster type.");
981 plist->addParticle(newPart);
987 for (
unsigned int iCluster = 0; iCluster < clusters.
size(); iCluster++) {
988 const ECLCluster* cluster = clusters[iCluster];
992 Particle particle(cluster, thisType);
993 if (particle.getParticleSource() != Particle::c_ECLCluster) {
994 B2FATAL(
"Particle created from ECLCluster does not have ECLCluster type.");
998 plist->addParticle(newPart);
1004 if (!cluster)
continue;
1006 if (std::isnan(cluster->getMomentumMag())) {
1007 B2DEBUG(19,
"Skipping KLMCluster because its momentum is NaN. "
1008 "This can happen if the timing calibration is missing or wrong, so that the velocity is calculated to be negative.");
1013 Particle particle(cluster, pdgCode);
1014 if (particle.getParticleSource() != Particle::c_KLMCluster) {
1015 B2FATAL(
"Particle created from KLMCluster does not have KLMCluster type.");
1022 plist->addParticle(newPart);
1035 string listName = get<c_PListName>(mcParticle2Plist);
1036 string antiListName = get<c_AntiPListName>(mcParticle2Plist);
1037 int pdgCode = get<c_PListPDGCode>(mcParticle2Plist);
1038 bool isSelfConjugatedParticle = get<c_IsPListSelfConjugated>(mcParticle2Plist);
1041 if (plist.isValid())
1044 plist->initialize(pdgCode, listName);
1046 if (!isSelfConjugatedParticle) {
1049 antiPlist->initialize(-1 * pdgCode, antiListName);
1051 antiPlist->bindAntiParticleList(*(plist));
1057 if (abs(pdgCode) != abs(mcParticle->
getPDG()))
1073 plist->addParticle(newPart);
1081 bool result =
false;
1112 vector<MCParticle*> mcdaughters = mcmother->
getDaughters();
1114 for (
auto& mcdaughter : mcdaughters) {
1118 daughter->addRelationTo(mcdaughter);
1121 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.
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 isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
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.
int getEntries() const
Get the number of objects in 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.