 |
Belle II Software
release-05-02-19
|
12 #include <framework/datastore/RelationsObject.h>
13 #include <mdst/dataobjects/PIDLikelihood.h>
14 #include <analysis/VariableManager/Utility.h>
15 #include <analysis/dataobjects/Particle.h>
17 #include <framework/logging/Logger.h>
77 Mask(
const std::string& name =
"",
const std::string& origin =
"unknown"):
m_name(name),
80 B2DEBUG(10,
"Mask " << name <<
" is being initialized by " << origin);
103 B2INFO(
"Mask " +
m_name +
" originating from " +
m_origin +
" is valid, cannot write to it!");
106 for (
auto* particle : particles) {
132 for (
int& i : toErase) {
161 B2INFO(
"\tNot valid!");
163 std::string printout =
"\tIndices: ";
165 printout += std::to_string(index) +
", ";
180 explicit RestOfEvent(
int pdgCode = 0,
bool isNested =
false,
bool isFromMC =
false):
188 void addParticles(
const std::vector<const Particle*>& particle);
222 void initializeMask(
const std::string& name,
const std::string& origin =
"unknown");
231 void updateMaskWithCuts(
const std::string& name,
const std::shared_ptr<Variable::Cut>& trackCut =
nullptr,
232 const std::shared_ptr<Variable::Cut>& eclCut =
nullptr,
const std::shared_ptr<Variable::Cut>& klmCut =
nullptr,
233 bool updateExisting =
false);
248 bool hasMask(
const std::string& name)
const;
271 std::vector<const Particle*>
getParticles(
const std::string& maskName =
"",
bool unpackComposite =
true)
const;
279 std::vector<const Particle*>
getPhotons(
const std::string& maskName =
"",
bool unpackComposite =
true)
const;
287 std::vector<const Particle*>
getHadrons(
const std::string& maskName =
"",
bool unpackComposite =
true)
const;
296 std::vector<const Particle*>
getChargedParticles(
const std::string& maskName =
"",
unsigned int pdg = 0,
297 bool unpackComposite =
true)
const;
305 std::vector<const Track*>
getTracks(
const std::string& maskName =
"")
const;
313 std::vector<const ECLCluster*>
getECLClusters(
const std::string& maskName =
"")
const;
321 std::vector<const KLMCluster*>
getKLMClusters(
const std::string& maskName =
"")
const;
329 TLorentzVector
get4Vector(
const std::string& maskName =
"")
const;
354 int getNTracks(
const std::string& maskName =
"")
const;
RestOfEvent(int pdgCode=0, bool isNested=false, bool isFromMC=false)
Default constructor.
std::vector< Mask > m_masks
List of the ROE masks.
void printIndices(const std::set< int > &indices) const
Prints indices in the given set in a single line.
int getNTracks(const std::string &maskName="") const
Get number of all (no mask) or a subset (use mask) of all Tracks in ROE.
bool hasV0(const Particle *v0) const
Has selected particles associated to the mask.
void excludeParticlesFromMask(const std::string &maskName, const std::vector< const Particle * > &particles, Particle::EParticleSourceObject listType, bool discard)
Update mask by keeping or excluding particles.
TLorentzVector get4Vector(const std::string &maskName="") const
Get 4-momentum vector all (no mask) or a subset (use mask) of all Tracks and ECLClusters in ROE.
int getNECLClusters(const std::string &maskName="") const
Get number of all (no mask) or a subset (use mask) of all ECLclusters in ROE.
void updateMaskWithCuts(const std::string &name, const std::shared_ptr< Variable::Cut > &trackCut=nullptr, const std::shared_ptr< Variable::Cut > &eclCut=nullptr, const std::shared_ptr< Variable::Cut > &klmCut=nullptr, bool updateExisting=false)
Update mask with cuts.
std::vector< std::string > getMaskNames() const
Get vector of all mask names of the ROE object.
std::vector< const Particle * > getPhotons(const std::string &maskName="", bool unpackComposite=true) const
Get photons from ROE mask.
bool m_isValid
Check if mask has elements or correctly initialized.
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
bool m_isNested
Nested ROE indicator.
bool getIsNested() const
Returns true if the ROE is nested.
This is a general purpose class for collecting reconstructed MDST data objects that are not used in r...
double atcPIDBelleKpiFromPID(const PIDLikelihood *pid) const
OBSOLETE: Added helper function so creation of temporary particles and setting pid relations is not n...
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
bool hasParticle(const Particle *particle, const std::string &maskName="") const
Check if ROE has StoreArray index of given to the list of unused tracks in the event.
void print()
Print mask and selected particles associated to the mask.
TLorentzVector get4VectorTracks(const std::string &maskName="") const
OBSOLETE: Get 4-momentum vector all (no mask) or a subset (use mask) of all Tracks in ROE.
void setPDGCode(int pdgCode)
Sets the PDG code of the rest of event.
std::set< int > getParticles() const
Get selected particles associated to the mask.
Particle * convertToParticle(const std::string &maskName="", int pdgCode=0, bool isSelfConjugated=true)
Converts ROE to Particle and adds it to StoreArray.
std::vector< const Particle * > getHadrons(const std::string &maskName="", bool unpackComposite=true) const
Get hadrons from ROE mask.
void clearParticles()
Clear selected particles associated to the mask.
void addParticles(const std::vector< const Particle * > &particles)
Add selected particles to the mask.
int getPDGCode() const
Gets the PDG code of the rest of event.
Abstract base class for different kinds of events.
TLorentzVector get4VectorNeutralECLClusters(const std::string &maskName="") const
Get 4-momentum vector all (no mask) or a subset (use mask) of all ECLClusters in ROE.
std::vector< const Particle * > getParticles(const std::string &maskName="", bool unpackComposite=true) const
Get all Particles from ROE mask.
std::vector< const KLMCluster * > getKLMClusters(const std::string &maskName="") const
Get vector of all unused KLMClusters.
Mask(const std::string &name="", const std::string &origin="unknown")
Default constructor.
std::set< int > getV0s() const
Get selected particles associated to the V0 of mask.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
EParticleSourceObject
particle source enumerators
int m_pdgCode
PDG code of the 'ROE particle' if we are going to create one.
std::string m_name
Mask name.
std::set< int > m_maskedV0Indices
StoreArray indices for masked V0 ROE particles.
bool m_isFromMC
MC ROE indicator.
bool isValid() const
Get mask validity.
bool hasMask(const std::string &name) const
True if this ROE object has mask.
std::string getName() const
Get mask name.
bool checkCompatibilityOfMaskAndV0(const std::string &name, const Particle *particleV0)
Check if V0 can be added, maybe should be moved to private.
void initializeMask(const std::string &name, const std::string &origin="unknown")
Initialize new mask.
Class to store reconstructed particles.
std::vector< const Track * > getTracks(const std::string &maskName="") const
Get vector of all (no mask) or a subset (use mask) of all Tracks in ROE.
std::set< int > m_maskedParticleIndices
StoreArray indices for masked ROE particles.
bool isInParticleList(const Particle *roeParticle, const std::vector< const Particle * > &particlesToUpdate) const
Checks if a particle has its copy in the provided list.
std::vector< const ECLCluster * > getECLClusters(const std::string &maskName="") const
Get vector of all (no mask) or a subset (use mask) of all ECLClusters in ROE.
std::set< int > m_particleIndices
StoreArray indices to unused particles.
void print() const
Prints the contents of a RestOfEvent object to screen.
void addParticles(const std::vector< const Particle * > &particle)
Add StoreArray indices of given Particles to the list of unused particles in the event.
void addV0(const Particle *v0, std::vector< int > &toErase)
Get selected particles associated to the V0 of mask.
void updateMaskWithV0(const std::string &name, const Particle *particleV0)
Update mask with composite particle.
std::string m_origin
Mask origin for debug.
Mask * findMask(const std::string &name)
Helper method to find ROE mask.
std::vector< const Particle * > getChargedParticles(const std::string &maskName="", unsigned int pdg=0, bool unpackComposite=true) const
Get charged particles from ROE mask.
Defines interface for accessing relations of objects in StoreArray.
int getNKLMClusters(const std::string &maskName="") const
Get number of all remaining KLM clusters.
Structure of Rest of Event mask.