9 #include <analysis/utility/ParticleCopy.h>
10 #include <analysis/dataobjects/Particle.h>
12 #include <framework/datastore/StoreArray.h>
24 copy->copyRelations(original);
25 copy->writeExtraInfo(
"original_index", original->
getArrayIndex());
37 bool updateType =
true;
38 if (copy->hasExtraInfo(
"bremsCorrected") ||
39 copy->getParticleSource() == Particle::EParticleSourceObject::c_V0)
42 for (
unsigned iOld = 0; iOld < nDaughters; iOld++) {
48 copy->removeDaughter(originalDaughter, updateType);
50 copy->appendDaughter(daughterCopy, updateType);
62 bool updateType =
true;
63 if (mother->hasExtraInfo(
"bremsCorrected") ||
64 mother->getParticleSource() == Particle::EParticleSourceObject::c_V0)
67 unsigned nDaughters = mother->getNDaughters();
68 for (
unsigned iOld_neverUsed = 0; iOld_neverUsed < nDaughters; iOld_neverUsed++) {
70 const Particle* originalDaughter = mother->getDaughter(0);
74 mother->removeDaughter(originalDaughter, updateType);
76 mother->appendDaughter(daughterCopy, updateType);
Class to store reconstructed particles.
unsigned getNDaughters(void) const
Returns number of daughter particles.
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
std::string getArrayName() const
Get name of array this object is stored in, or "" if not found.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
void copyDaughters(Particle *mother)
Function copies all (grand-)^n-daughter particles of the argument mother Particle.
Particle * copyParticle(const Particle *original)
Function takes argument Particle and creates a copy of it and copies of all its (grand-)^n-daughters.
Abstract base class for different kinds of events.