Belle II Software  release-08-01-10
RecoKlong Class Reference

representation of the Klong constraint More...

#include <RecoKlong.h>

Inheritance diagram for RecoKlong:
Collaboration diagram for RecoKlong:

Public Types

enum  TFParticleType {
  kInteractionPoint ,
  kOrigin ,
  kComposite ,
  kRecoResonance ,
  kInternalParticle ,
  kRecoTrack ,
  kResonance ,
  kRecoPhoton ,
  kRecoKlong ,
  kMissingParticle
}
 particle types

 
typedef std::vector< Constraintconstraintlist
 alias
 
typedef std::vector< std::pair< const ParticleBase *, int > > indexmap
 alias
 

Public Member Functions

 RecoKlong (Belle2::Particle *bc, const ParticleBase *mother)
 constructor
 
virtual ~RecoKlong ()
 destructor
 
virtual ErrCode initParticleWithMother (FitParams &fitparams) override
 init particle with mother
 
virtual ErrCode initMotherlessParticle (FitParams &fitparams) override
 init particle without mother
 
ErrCode initCovariance (FitParams &fitparams) const override
 init covariance
 
ErrCode initParams ()
 update or init params More...
 
ErrCode projectRecoConstraint (const FitParams &fitparams, Projection &p) const override
 project klong constraint
 
virtual int dimM () const override
 sets the size of the corresponding residual projection
 
virtual bool hasEnergy () const override
 how should the energy be calculated ? from momentum or from E ?

 
virtual int dim () const override
 set the size of the particle in the statevector
 
virtual int type () const override
 type
 
virtual void addToConstraintList (constraintlist &alist, int depth) const override
 add to list
 
virtual std::string parname (int index) const override
 name
 
virtual int momIndex () const override
 get momentum index
 
virtual ErrCode projectConstraint (Constraint::Type, const FitParams &, Projection &) const override
 abstract abstract projection
 
virtual void updateIndex (int &offset)
 this sets the index for momentum, position, etc. More...
 
const ParticleBaselocate (Belle2::Particle *particle) const
 get particle base from basf2 particle
 
Belle2::Particleparticle () const
 get basf2 particle

 
int index () const
 get index

 
const ParticleBasemother () const
 getMother() / hasMother()
 
virtual ErrCode projectGeoConstraint (const FitParams &, Projection &) const
 project geometrical constraint More...
 
virtual ErrCode projectMassConstraintParticle (const FitParams &, Projection &) const
 project mass constraint using the particles parameters More...
 
virtual ErrCode projectMassConstraintDaughters (const FitParams &, Projection &) const
 project mass constraint using the parameters of the daughters More...
 
virtual ErrCode projectMassConstraint (const FitParams &, Projection &) const
 project mass constraint abstract
 
virtual void forceP4Sum (FitParams &) const
 force p4 sum conservation all along the tree
 
virtual int posIndex () const
 get vertex index (in statevector!)
 
virtual int tauIndex () const
 get tau index
 
virtual bool hasPosition () const
 get false

 
int eneIndex () const
 get energy index

 
virtual double chiSquare (const FitParams &) const
 get chi2
 
int charge () const
 get charge
 
virtual ParticleBaseaddDaughter (Belle2::Particle *, const ConstraintConfiguration &config, bool forceFitAll=false)
 add daughter

 
virtual void removeDaughter (const ParticleBase *pb)
 remove daughter
 
virtual void retrieveIndexMap (indexmap &anindexmap) const
 get index map

 
void setMother (const ParticleBase *m)
 set mother

 
void collectVertexDaughters (std::vector< ParticleBase * > &particles, int posindex)
 get vertex daughters
 
virtual int nFinalChargedCandidates () const
 number of charged candidates
 

Static Public Member Functions

static bool useEnergy (Belle2::Particle &cand)
 has energy in fit params?
 
static ParticleBasecreateParticle (Belle2::Particle *particle, const ParticleBase *mother, const ConstraintConfiguration &config, bool forceFitAll=false)
 create the according treeFitter particle obj for a basf2 particle type

 
static ParticleBasecreateOrigin (Belle2::Particle *daughter, const ConstraintConfiguration &config, bool forceFitAll)
 create a custom origin particle or a beamspot
 

Protected Types

typedef std::vector< ParticleBase * > ParticleContainer
 just an alias
 

Protected Member Functions

ErrCode initTau (FitParams &par) const
 initialises tau as a length

 
void setIndex (int i)
 set Index (in statevector)
 

Static Protected Member Functions

static bool isAResonance (Belle2::Particle *particle)
 controls if a particle is treated as a resonance(lifetime=0) or a particle that has a finite lifetime. More...
 

Protected Attributes

Belle2::Particlem_particle
 pointer to framework type

 
const ParticleBasem_mother
 motherparticle
 
std::vector< ParticleBase * > m_daughters
 daughter container

 
bool m_isStronglyDecayingResonance
 decay length less than 1 micron

 
const ConstraintConfigurationm_config
 has all the constraint config
 

Private Attributes

const int m_dim
 dimension of residuals and 'width' of H
 
bool m_init
 was initialized*
 
bool m_useEnergy
 has energy ins statevector
 
Eigen::Matrix< double, 1, 4 > m_clusterPars
 constrains measured params (x_c, y_c, z_c, E_c)
 
Eigen::Matrix< double, 4, 4 > m_covariance
 covariance (x_c,y_c,z_c,E_c) of measured pars
 
int m_i1
 index with the highest momentum. More...
 
int m_i2
 random index
 
int m_i3
 another random index
 
int m_index
 index
 
std::string m_name
 name

 

Detailed Description

representation of the Klong constraint

Definition at line 16 of file RecoKlong.h.

Member Function Documentation

◆ initParams()

ErrCode initParams ( )

update or init params

currently the energy in KLM is calculated as n2dHits in cluster times 0.214 GeV at time of writing - 8.3.18 - the KLMCluster returns 0 for the E covariance

Definition at line 79 of file RecoKlong.cc.

80  {
81  const Belle2::KLMCluster* cluster = particle()->getKLMCluster();
82 
83  const Belle2::B2Vector3D cluster_pos = cluster->getClusterPosition();
84 
85  m_init = true;
86  m_covariance = Eigen::Matrix<double, 4, 4>::Zero(4, 4);
87 
88  TMatrixDSym cov7 = cluster->getError7x7();
89 
90  for (int row = 0; row < 3; ++row) {
91  for (int col = 0; col < 3; ++col) {
92  m_covariance(row, col) = cov7[row + 4][col + 4] ;
93  }
94  }
95 
99  if (0 == m_covariance(3, 3)) {m_covariance(3, 3) = .214;}
100 
101  m_clusterPars(0) = cluster_pos.X();
102  m_clusterPars(1) = cluster_pos.Y();
103  m_clusterPars(2) = cluster_pos.Z();
104  m_clusterPars(3) = sqrt(particle()->getPDGMass() * particle()->getPDGMass() +
105  cluster->getMomentumMag() * cluster->getMomentumMag());
106 
107  auto p_vec = particle()->getMomentum();
108  // find highest momentum, eliminate dim with highest mom
109  if ((std::abs(p_vec.X()) >= std::abs(p_vec.Y())) && (std::abs(p_vec.X()) >= std::abs(p_vec.Z()))) {
110  m_i1 = 0; m_i2 = 1; m_i3 = 2;
111  } else if ((std::abs(p_vec.Y()) >= std::abs(p_vec.X())) && (std::abs(p_vec.Y()) >= std::abs(p_vec.Z()))) {
112  m_i1 = 1; m_i2 = 0; m_i3 = 2;
113  } else if ((std::abs(p_vec.Z()) >= std::abs(p_vec.Y())) && (std::abs(p_vec.Z()) >= std::abs(p_vec.X()))) {
114  m_i1 = 2; m_i2 = 1; m_i3 = 0;
115  } else {
116  B2ERROR("Could not estimate highest momentum for Klong constraint. Aborting this fit.\n px: "
117  << p_vec.X() << " py: " << p_vec.Y() << " pz: " << p_vec.Z() << " calculated from Ec: " << m_clusterPars(3));
118  return ErrCode(ErrCode::Status::photondimerror);
119  }
120 
121  return ErrCode(ErrCode::Status::success);
122  }
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:435
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:431
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:433
KLM cluster data.
Definition: KLMCluster.h:28
const KLMCluster * getKLMCluster() const
Returns the pointer to the KLMCluster object that was used to create this Particle (ParticleType == c...
Definition: Particle.cc:930
ROOT::Math::XYZVector getMomentum() const
Returns momentum vector.
Definition: Particle.h:526
Belle2::Particle * particle() const
get basf2 particle
Definition: ParticleBase.h:92
Eigen::Matrix< double, 4, 4 > m_covariance
covariance (x_c,y_c,z_c,E_c) of measured pars
Definition: RecoKlong.h:76
int m_i3
another random index
Definition: RecoKlong.h:83
int m_i1
index with the highest momentum.
Definition: RecoKlong.h:79
int m_i2
random index
Definition: RecoKlong.h:81
bool m_init
was initialized*
Definition: RecoKlong.h:67
Eigen::Matrix< double, 1, 4 > m_clusterPars
constrains measured params (x_c, y_c, z_c, E_c)
Definition: RecoKlong.h:73
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ isAResonance()

bool isAResonance ( Belle2::Particle particle)
staticprotectedinherited

controls if a particle is treated as a resonance(lifetime=0) or a particle that has a finite lifetime.

A finite life time means it will register a geo constraint for this particle

Definition at line 134 of file ParticleBase.cc.

◆ projectGeoConstraint()

ErrCode projectGeoConstraint ( const FitParams fitparams,
Projection p 
) const
virtualinherited

project geometrical constraint

the direction of the momentum is very well known from the kinematic constraints that is why we do not extract the distance as a vector here

Definition at line 249 of file ParticleBase.cc.

◆ projectMassConstraintDaughters()

ErrCode projectMassConstraintDaughters ( const FitParams fitparams,
Projection p 
) const
virtualinherited

project mass constraint using the parameters of the daughters

be aware that the signs here are important E-|p|-m extracts a negative mass and messes with the momentum !

Definition at line 314 of file ParticleBase.cc.

◆ projectMassConstraintParticle()

ErrCode projectMassConstraintParticle ( const FitParams fitparams,
Projection p 
) const
virtualinherited

project mass constraint using the particles parameters

be aware that the signs here are important E-|p|-m extracts a negative mass and messes with the momentum !

Definition at line 375 of file ParticleBase.cc.

◆ updateIndex()

void updateIndex ( int &  offset)
virtualinherited

this sets the index for momentum, position, etc.

in the statevector

Definition at line 84 of file ParticleBase.cc.

Member Data Documentation

◆ m_i1

int m_i1
private

index with the highest momentum.

We have to make sure this does not change during the fit.

Definition at line 79 of file RecoKlong.h.


The documentation for this class was generated from the following files: