9 #include <analysis/modules/HelixErrorScaler/HelixErrorScalerModule.h>
11 #include <analysis/DecayDescriptor/ParticleListName.h>
12 #include <mdst/dataobjects/HitPatternCDC.h>
13 #include <mdst/dataobjects/HitPatternVXD.h>
14 #include <framework/datastore/RelationArray.h>
15 #include <framework/gearbox/Const.h>
33 setDescription(R
"DOC("scale the error of helix parameters
35 Creates a new charged particle list whose helix errors are scaled by constant factors.
36 Parameters (a, b) can be set to define impact parameter resolution,
37 which limits d0 and z0 errors so that they do not shrink below the resolution.
41 addParam(
"inputListName", m_inputListName,
"The name of input charged particle list", std::string(
""));
42 addParam(
"outputListName", m_outputListName,
"The name of output charged particle list", std::string(
""));
43 addParam(
"scaleFactors", m_scaleFactors,
"vector of five scale factors for helix parameter errors", {1.0, 1.0, 1.0, 1.0, 1.0});
44 addParam(
"d0ResolutionParameters", m_d0ResolPars,
"d0 resolution parameters", {0.0, 0.0});
45 addParam(
"z0ResolutionParameters", m_z0ResolPars,
"z0 resolution parameters", {0.0, 0.0});
60 B2ERROR(
"Invalid input ParticleList PDG code (must be ChargedStable): " <<
m_pdgCode);
65 B2ERROR(
"Input and output particle list names are the same: " <<
m_inputListName);
93 for (
unsigned i = 0; i < nPar; i++) {
105 if (mcCharged !=
nullptr) newCharged->
addRelationTo(mcCharged);
115 const std::vector<float> helix = trkfit->
getTau();
116 const std::vector<float> cov5 = trkfit->
getCov();
118 const double pvalue = trkfit->
getPValue();
121 const int ndf = trkfit->
getNDF();
124 TVector3 p = particle->getMomentum();
125 double sinTheta = TMath::Sin(p.Theta());
126 double pD0 = p.Mag2() / (particle->getEnergy()) * TMath::Power(sinTheta, 1.5);
127 double pZ0 = pD0 * sinTheta;
133 double scaleFactors[5] = { TMath::Max(d0Resol / d0Err,
m_scaleFactors[0]),
140 std::vector<float> cov5_scaled;
141 unsigned int counter = 0;
142 for (
unsigned int j = 0; j < 5; j++) {
143 for (
unsigned int k = j; k < 5; k++) {
144 cov5_scaled.push_back(cov5[counter++] * scaleFactors[j] * scaleFactors[k]);
Provides a type-safe way to pass members of the chargedStableSet set.
The ParticleType class for identifying different particle types.
static const ParticleSet chargedStableSet
set of charged stable particles
static const ParticleType invalidParticle
Invalid particle, used internally.
Represents a particle in the DecayDescriptor.
bool init(const std::string &str)
Initialise the DecayDescriptor from given string.
const DecayDescriptorParticle * getMother() const
return mother.
scale the error of helix parameters
StoreArray< TrackFitResult > m_trackfitresults
StoreArray of TrackFitResult objects.
std::vector< double > m_d0ResolPars
parameters (a,b) to define d0 resolution = a (+) b / (p*beta*sinTheta**1.5)
StoreObjPtr< ParticleList > m_outputparticleList
StoreObjptr for output particlelist.
StoreArray< MCParticle > m_mcparticles
StoreArray of MCParticle objects.
StoreArray< Particle > m_particles
StoreArray of Particle objects.
virtual void event() override
loop over the input charged particles
StoreArray< PIDLikelihood > m_pidlikelihoods
StoreArray of PIDLikelihood objects.
virtual void initialize() override
Register input and output data.
TrackFitResult * getTrackFitResultWithScaledError(const Particle *particle)
create a TrackFitResult with scaled errors
std::vector< double > m_z0ResolPars
parameters (a,b) to define z0 resolution = a (+) b / (p*beta*sinTheta**2.5)
StoreObjPtr< ParticleList > m_inputparticleList
StoreObjptr for input charged particlelist.
StoreObjPtr< ParticleList > m_outputAntiparticleList
StoreObjptr for output antiparticlelist.
DecayDescriptor m_decaydescriptor
Decay descriptor of the charged particle.
int m_pdgCode
PDG code of the charged particle to be scaled.
std::vector< double > m_scaleFactors
vector of five scale factors for helix parameter errors
std::string m_outputAntiListName
output anti-particle list name
std::string m_inputListName
The name of input charged particle list.
std::string m_outputListName
The name of output charged particle list.
ULong64_t getInteger() const
Getter for underlying integer type.
unsigned int getInteger() const
Getter for the underlying integer.
A Class to store the Monte Carlo particle information.
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
Class to store reconstructed particles.
unsigned getMdstArrayIndex(void) const
Returns 0-based index of MDST store array object (0 for composite particles)
const PIDLikelihood * getPIDLikelihood() const
Returns the pointer to the PIDLikelihood object that is related to the Track, which was used to creat...
int getPDGCode(void) const
Returns PDG code.
Low-level class to create/modify relations between StoreArrays.
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).
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
Values of the result of a track fit with a given particle hypothesis.
std::vector< float > getTau() const
Getter for all perigee parameters.
TMatrixDSym getCovariance5() const
Getter for covariance matrix of perigee parameters in matrix form.
double getPValue() const
Getter for Chi2 Probability of the track fit.
int getNDF() const
Getter for number of degrees of freedom of the track fit.
std::vector< float > getCov() const
Getter for all covariance matrix elements of perigee parameters.
Const::ParticleType getParticleType() const
Getter for ParticleType of the mass hypothesis of the track fit.
HitPatternCDC getHitPatternCDC() const
Getter for the hit pattern in the CDC;.
HitPatternVXD getHitPatternVXD() const
Getter for the hit pattern in the VXD;.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
std::string antiParticleListName(const std::string &listName)
Returns name of anti-particle-list corresponding to listName.
Abstract base class for different kinds of events.