Belle II Software  release-06-00-14
ParticleBase.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * External Contributor: Wouter Hulsbergen *
5  * *
6  * See git log for contributors and copyright holders. *
7  * This file is licensed under LGPL-3.0, see LICENSE.md. *
8  **************************************************************************/
9 
10 //Creates a particle. Base class for all other particle classes.
11 
12 #include <TDatabasePDG.h>
13 
14 #include <analysis/VertexFitting/TreeFitter/ParticleBase.h>
15 #include <analysis/VertexFitting/TreeFitter/InternalParticle.h>
16 #include <analysis/VertexFitting/TreeFitter/RecoComposite.h>
17 #include <analysis/VertexFitting/TreeFitter/RecoResonance.h>
18 #include <analysis/VertexFitting/TreeFitter/RecoTrack.h>
19 
20 #include <analysis/VertexFitting/TreeFitter/RecoPhoton.h>
21 #include <analysis/VertexFitting/TreeFitter/RecoKlong.h>
22 #include <analysis/VertexFitting/TreeFitter/Resonance.h>
23 #include <analysis/VertexFitting/TreeFitter/Origin.h>
24 #include <analysis/VertexFitting/TreeFitter/FitParams.h>
25 
26 #include <framework/geometry/BFieldManager.h>
27 
28 namespace TreeFitter {
29 
31  m_particle(particle),
32  m_mother(mother),
33  m_isStronglyDecayingResonance(false),
34  m_config(config),
35  m_index(0),
36  m_pdgMass(particle->getPDGMass()),
37  m_pdgWidth(0),
38  m_pdgLifeTime(TDatabasePDG::Instance()->GetParticle(particle->getPDGCode())->Lifetime() * 1e9),
39  m_charge(0),
40  m_name("Unknown")
41  {
42  if (particle) {
44  const int pdgcode = particle->getPDGCode();
45  if (pdgcode) { // PDG code != 0
46 
47  double fltcharge = particle->getCharge();
48 
49  // round to nearest integer
50  m_charge = fltcharge < 0 ? int(fltcharge - 0.5) : int(fltcharge + 0.5);
51  m_name = particle->getName();
52  } else {// PDG code = 0
53  m_charge = particle->getCharge() > 0 ? 1 : (particle->getCharge() < 0 ? -1 : 0);
54  }
55  }
56  }
57 
59  m_particle(particle),
60  m_mother(mother),
61  m_isStronglyDecayingResonance(false),
62  m_config(nullptr),
63  m_index(0),
64  m_pdgMass(particle->getPDGMass()),
65  m_pdgWidth(0),
66  m_pdgLifeTime(TDatabasePDG::Instance()->GetParticle(particle->getPDGCode())->Lifetime() * 1e9),
67  m_charge(0),
68  m_name("Unknown")
69  {
70  if (particle) {
72  const int pdgcode = particle->getPDGCode();
73  if (pdgcode) { // PDG code != 0
74 
75  double fltcharge = particle->getCharge();
76 
77  // round to nearest integer
78  m_charge = fltcharge < 0 ? int(fltcharge - 0.5) : int(fltcharge + 0.5);
79  m_name = particle->getName();
80  } else {// PDG code = 0
81  m_charge = particle->getCharge() > 0 ? 1 : (particle->getCharge() < 0 ? -1 : 0);
82  }
83  }
84  }
85 
86  ParticleBase::ParticleBase(const std::string& name) :
87  m_particle(nullptr),
88  m_mother(nullptr),
89  m_isStronglyDecayingResonance(false),
90  m_config(nullptr),
91  m_index(0),
92  m_pdgMass(0),
93  m_pdgWidth(0),
94  m_pdgLifeTime(0),
95  m_charge(0),
96  m_name(name)
97  {}
98 
99 
101  {
102  for (auto daughter : m_daughters) {
103  delete daughter;
104  }
105  m_daughters.clear();
106  }
107 
109  {
110  auto newDaughter = ParticleBase::createParticle(cand, this, config, forceFitAll);
111  m_daughters.push_back(newDaughter);
112  return m_daughters.back();
113  }
114 
115 
117  {
118  auto iter = std::find(m_daughters.begin(), m_daughters.end(), pb);
119  if (iter != m_daughters.end()) {
120  delete *iter;
121  m_daughters.erase(iter);
122  } else {
123  B2ERROR("Cannot remove particle, because not found ...");
124  }
125  }
126 
127  void ParticleBase::updateIndex(int& offset)
128  {
129  for (auto* daughter : m_daughters) {
130  daughter->updateIndex(offset);
131  }
132  m_index = offset;
133  offset += dim();
134  }
135 
137  Belle2::Particle* daughter,
138  const ConstraintConfiguration& config,
139  bool forceFitAll
140  )
141  {
142  return new Origin(daughter, config, forceFitAll);
143  }
144 
146  const ConstraintConfiguration& config, bool forceFitAll)
147  {
148  ParticleBase* rc = nullptr;
149 
150  if (!mother) { // 'head of tree' particles
151  if (!particle->getMdstArrayIndex()) { //0 means it's a composite
152  rc = new InternalParticle(particle, nullptr, config, forceFitAll);
153 
154  } else {
155 
156  rc = new InternalParticle(particle, nullptr, config,
157  forceFitAll); //FIXME obsolete not touching it now god knows where this might be needed
158 
159  }
160  } else if (particle->hasExtraInfo("bremsCorrected")) { // Has Bremsstrahlungs-recovery
161  if (particle->getExtraInfo("bremsCorrected") == 0.) { // No gammas assigned -> simple track
162  rc = new RecoTrack(particle, mother);
163  } else { // Got gammas -> composite particle
164  rc = new RecoComposite(particle, mother, config, true);
165  }
166  } else if (particle->getMdstArrayIndex() ||
167  particle->getTrack() ||
168  particle->getECLCluster() ||
169  particle->getKLMCluster()) { // external particles and final states
170  if (particle->getTrack()) {
171  rc = new RecoTrack(particle, mother);
172  } else if (particle->getECLCluster()) {
173  rc = new RecoPhoton(particle, mother);
174 
175  } else if (particle->getKLMCluster()) {
176  rc = new RecoKlong(particle, mother);
177 
178  } else if (isAResonance(particle)) {
179  rc = new RecoResonance(particle, mother);
180 
181  } else {
182  rc = new InternalParticle(particle, mother, config, forceFitAll);
183 
184  }
185 
186  } else { // 'internal' particles
187 
188  if (false) { // fitted composites //JFK::eventually implement prefitting mechanic to prefit composites with other fitters
189  if (isAResonance(particle)) {
190 
191  rc = new RecoResonance(particle, mother);
192 
193  } else {
194  rc = new RecoComposite(particle, mother);
195  }
196 
197  } else { // unfitted composites
198 
199  if (isAResonance(particle)) {
200  rc = new Resonance(particle, mother, config, forceFitAll);
201 
202  } else {
203  rc = new InternalParticle(particle, mother, config, forceFitAll);
204  }
205  }
206  }
207  return rc;
208  }
209 
210 
212  {
213  int pdgcode = particle->getPDGCode();
214  double lifetime = 0;
215 
216  if (pdgcode) {
217  lifetime = TDatabasePDG::Instance()->GetParticle(pdgcode)->Lifetime() * 1e9;
218  }
219 
220  return lifetime ;
221  }
222 
223 
225  {
226  bool rc = false ;
227  const int pdgcode = std::abs(particle->getPDGCode());
228 
229  if (pdgcode && !(particle->getMdstArrayIndex())) {
230  switch (pdgcode) {
231  case 22: //photon conversion
232  rc = false;
233  break ;
234 
235  case -11: //bremsstrahlung
236  case 11:
237  rc = true ;
238  break ;
239  default: //everything with boosted flight length less than 1 micrometer
240  rc = (pdgcode && pdgLifeTime(particle) < 1e-5);
241  }
242  }
243  return rc ;
244  }
245 
246  void ParticleBase::collectVertexDaughters(std::vector<ParticleBase*>& particles, int posindex)
247  {
248  if (mother() && mother()->posIndex() == posindex) {
249  particles.push_back(this);
250  }
251 
252  for (auto* daughter : m_daughters) {
253  daughter->collectVertexDaughters(particles, posindex);
254  }
255  }
256 
258  {
259  // this is very sensitive and can heavily affect the efficiency of the fit
260  ErrCode status;
261 
262  const int posindex = posIndex();
263  if (posindex >= 0) {
264  for (int i = 0; i < 3; ++i) {
265  fitparams.getCovariance()(posindex + i, posindex + i) = 1;
266  }
267  }
268 
269  const int momindex = momIndex();
270  if (momindex >= 0) {
271  const int maxrow = hasEnergy() ? 4 : 3;
272  for (int i = 0; i < maxrow; ++i) {
273  fitparams.getCovariance()(momindex + i, momindex + i) = 10.;
274  }
275  }
276 
277  const int tauindex = tauIndex();
278  if (tauindex >= 0) {
279  fitparams.getCovariance()(tauindex, tauindex) = 1.;
280  }
281  return status;
282  }
283 
285  {
286  return m_mother;
287  }
288 
289  std::string ParticleBase::parname(int thisindex) const
290  {
291  std::string rc = name();
292  switch (thisindex) {
293  case 0: rc += "_x "; break;
294  case 1: rc += "_y "; break;
295  case 2: rc += "_z "; break;
296  case 3: rc += "_tau"; break;
297  case 4: rc += "_px "; break;
298  case 5: rc += "_py "; break;
299  case 6: rc += "_pz "; break;
300  case 7: rc += "_E "; break;
301  default:;
302  }
303  return rc;
304  }
305 
307  {
308  const ParticleBase* rc = (m_particle == particle) ? this : nullptr;
309  if (!rc) {
310  for (auto* daughter : m_daughters) {
311  rc = daughter->locate(particle);
312  if (rc) {break;}
313  }
314  }
315  return rc;
316  }
317 
319  {
320  map.push_back(std::pair<const ParticleBase*, int>(this, index()));
321  for (auto* daughter : m_daughters) {
322  daughter->retrieveIndexMap(map);
323  }
324  }
325 
326  double ParticleBase::chiSquare(const FitParams& fitparams) const
327  {
328  double rc = 0;
329  for (auto* daughter : m_daughters) {
330  rc += daughter->chiSquare(fitparams);
331  }
332  return rc;
333  }
334 
336  {
337  int rc = 0;
338  for (auto* daughter : m_daughters) {
339  rc += daughter->nFinalChargedCandidates();
340  }
341  return rc;
342  }
343 
345  {
346  assert(m_config);
347  // only allow 2d for head of tree particles that are beam constrained
348  const int dim = m_config->m_originDimension == 2 && std::abs(m_particle->getPDGCode()) == m_config->m_headOfTreePDG ? 2 : 3;
349  const int posindexmother = mother()->posIndex();
350  const int posindex = posIndex();
351  const int tauindex = tauIndex();
352  const int momindex = momIndex();
353 
354  const double tau = fitparams.getStateVector()(tauindex);
355  Eigen::Matrix < double, 1, -1, 1, 1, 3 > x_vec = fitparams.getStateVector().segment(posindex, dim);
356  Eigen::Matrix < double, 1, -1, 1, 1, 3 > x_m = fitparams.getStateVector().segment(posindexmother, dim);
357  Eigen::Matrix < double, 1, -1, 1, 1, 3 > p_vec = fitparams.getStateVector().segment(momindex, dim);
358  const double mom = p_vec.norm();
359  const double mom3 = mom * mom * mom;
360 
361  if (3 == dim) {
362  // we can already set these
363  //diagonal momentum
364  p.getH()(0, momindex) = tau * (p_vec(1) * p_vec(1) + p_vec(2) * p_vec(2)) / mom3 ;
365  p.getH()(1, momindex + 1) = tau * (p_vec(0) * p_vec(0) + p_vec(2) * p_vec(2)) / mom3 ;
366  p.getH()(2, momindex + 2) = tau * (p_vec(0) * p_vec(0) + p_vec(1) * p_vec(1)) / mom3 ;
367 
368  //offdiagonal momentum
369  p.getH()(0, momindex + 1) = - tau * p_vec(0) * p_vec(1) / mom3 ;
370  p.getH()(0, momindex + 2) = - tau * p_vec(0) * p_vec(2) / mom3 ;
371 
372  p.getH()(1, momindex + 0) = - tau * p_vec(1) * p_vec(0) / mom3 ;
373  p.getH()(1, momindex + 2) = - tau * p_vec(1) * p_vec(2) / mom3 ;
374 
375  p.getH()(2, momindex + 0) = - tau * p_vec(2) * p_vec(0) / mom3 ;
376  p.getH()(2, momindex + 1) = - tau * p_vec(2) * p_vec(1) / mom3 ;
377 
378  } else if (2 == dim) {
379 
380  // NOTE THAT THESE ARE DIFFERENT IN 2d
381  p.getH()(0, momindex) = tau * (p_vec(1) * p_vec(1)) / mom3 ;
382  p.getH()(1, momindex + 1) = tau * (p_vec(0) * p_vec(0)) / mom3 ;
383 
384  //offdiagonal momentum
385  p.getH()(0, momindex + 1) = - tau * p_vec(0) * p_vec(1) / mom3 ;
386  p.getH()(1, momindex + 0) = - tau * p_vec(1) * p_vec(0) / mom3 ;
387  } else {
388  B2FATAL("Dimension of Geometric constraint is not 2 or 3. This will crash many things. You should feel bad.");
389  }
390 
391  for (int row = 0; row < dim; ++row) {
392 
393  double posxmother = x_m(row);
394  double posx = x_vec(row);
395  double momx = p_vec(row);
396 
400  p.getResiduals()(row) = posxmother + tau * momx / mom - posx ;
401  p.getH()(row, posindexmother + row) = 1;
402  p.getH()(row, posindex + row) = -1;
403  p.getH()(row, tauindex) = momx / mom;
404  }
405 
406  return ErrCode(ErrCode::Status::success);
407  }
408 
409  void inline setExtraInfo(Belle2::Particle* part, const std::string& name, const double value)
410  {
411  if (part) {
412  if (part->hasExtraInfo(name)) {
413  part->setExtraInfo(name, value);
414  } else {
415  part->addExtraInfo(name, value);
416  }
417  }
418  }
419 
421  Projection& p) const
422  {
423  const double mass = pdgMass();
424  const double mass2 = mass * mass;
425  double px = 0;
426  double py = 0;
427  double pz = 0;
428  double E = 0;
429 
430  // the parameters of the daughters must be used otherwise the mass constraint does not have an effect on the extracted daughter momenta
431  for (const auto* daughter : m_daughters) {
432  const int momindex = daughter->momIndex();
433  // in most cases the daughters will be final states so we cache the value to use it in the energy column
434  const double px_daughter = fitparams.getStateVector()(momindex);
435  const double py_daughter = fitparams.getStateVector()(momindex + 1);
436  const double pz_daughter = fitparams.getStateVector()(momindex + 2);
437 
438  px += px_daughter;
439  py += py_daughter;
440  pz += pz_daughter;
441  if (daughter->hasEnergy()) {
442  E += fitparams.getStateVector()(momindex + 3);
443  } else {
444  // final states dont have an energy index
445  const double m = daughter->pdgMass();
446  E += std::sqrt(m * m + px_daughter * px_daughter + py_daughter * py_daughter + pz_daughter * pz_daughter);
447  }
448  }
449 
453  p.getResiduals()(0) = mass2 - E * E + px * px + py * py + pz * pz;
454 
455  for (const auto* daughter : m_daughters) {
456  //dr/dx = d/dx m2-{E1+E2+...}^2+{p1+p2+...}^2 = 2*x (x= E or p)
457  const int momindex = daughter->momIndex();
458  p.getH()(0, momindex) = 2.0 * px;
459  p.getH()(0, momindex + 1) = 2.0 * py;
460  p.getH()(0, momindex + 2) = 2.0 * pz;
461 
462  if (daughter->hasEnergy()) {
463  p.getH()(0, momindex + 3) = -2.0 * E;
464  } else {
465  const double px_daughter = fitparams.getStateVector()(momindex);
466  const double py_daughter = fitparams.getStateVector()(momindex + 1);
467  const double pz_daughter = fitparams.getStateVector()(momindex + 2);
468  const double m = daughter->pdgMass();
469 
470  const double E_daughter = std::sqrt(m * m + px_daughter * px_daughter + py_daughter * py_daughter + pz_daughter * pz_daughter);
471  const double E_by_E_daughter = E / E_daughter;
472  p.getH()(0, momindex) -= 2.0 * E_by_E_daughter * px_daughter;
473  p.getH()(0, momindex + 1) -= 2.0 * E_by_E_daughter * py_daughter;
474  p.getH()(0, momindex + 2) -= 2.0 * E_by_E_daughter * pz_daughter;
475  }
476 
477  }
478  return ErrCode(ErrCode::Status::success);
479  }
480 
482  Projection& p) const
483  {
484  const double mass = pdgMass();
485  const double mass2 = mass * mass;
486  const int momindex = momIndex();
487  const double px = fitparams.getStateVector()(momindex);
488  const double py = fitparams.getStateVector()(momindex + 1);
489  const double pz = fitparams.getStateVector()(momindex + 2);
490  const double E = fitparams.getStateVector()(momindex + 3);
491 
495  p.getResiduals()(0) = mass2 - E * E + px * px + py * py + pz * pz;
496 
497  p.getH()(0, momindex) = 2.0 * px;
498  p.getH()(0, momindex + 1) = 2.0 * py;
499  p.getH()(0, momindex + 2) = 2.0 * pz;
500  p.getH()(0, momindex + 3) = -2.0 * E;
501 
502  // TODO 0 in most cases -> needs special treatment if width=0 to not crash chi2 calculation
503  // const double width = TDatabasePDG::Instance()->GetParticle(particle()->getPDGCode())->Width();
504  // transport measurement uncertainty into residual system
505  // f' = sigma_x^2 * (df/dx)^2
506  // p.getV()(0) = width * width * 4 * mass2;
507 
508  return ErrCode(ErrCode::Status::success);
509  }
510 
512  Projection& p) const
513  {
514  assert(m_config);
515  if (m_config->m_massConstraintType == 0) {
516  return projectMassConstraintParticle(fitparams, p);
517  } else {
518  return projectMassConstraintDaughters(fitparams, p);
519  }
520  }
521 
523  {
524  if (type == Constraint::mass) {
525  return projectMassConstraint(fitparams, p);
526  } else {
527  B2FATAL("Trying to project constraint of ParticleBase type. This is undefined.");
528  }
529  return ErrCode(ErrCode::Status::badsetup);
530  }
531 
533  {
534  return (Belle2::BFieldManager::getField(TVector3(0, 0, 0)).Z() * Belle2::Const::speedOfLight);
535  }
536 
538  {
539  const int tauindex = tauIndex();
540  if (tauindex >= 0 && hasPosition()) {
541 
542  const int posindex = posIndex();
543  const int mother_ps_index = mother()->posIndex();
544  const int dim = m_config->m_originDimension; // TODO can we configure this to be particle specific?
545 
546  // tau has different meaning depending on the dimension of the constraint
547  // 2-> use x-y projection
548  const Eigen::Matrix < double, 1, -1, 1, 1, 3 > vertex_dist =
549  fitparams.getStateVector().segment(posindex, dim) - fitparams.getStateVector().segment(mother_ps_index, dim);
550  const Eigen::Matrix < double, 1, -1, 1, 1, 3 >
551  mom = fitparams.getStateVector().segment(posindex, dim) - fitparams.getStateVector().segment(mother_ps_index, dim);
552 
553  // if an intermediate vertex is not well defined by a track or so it will be initialised with 0
554  // same for the momentum of for example B0, it might be initialised with 0
555  // in those cases use pdg value
556  const double mom_norm = mom.norm();
557  const double dot = std::abs(vertex_dist.dot(mom));
558  const double tau = dot / mom_norm;
559  if (0 == mom_norm || 0 == dot) {
560  fitparams.getStateVector()(tauindex) = pdgTime() * Belle2::Const::speedOfLight / pdgMass();
561  } else {
562  fitparams.getStateVector()(tauindex) = tau;
563  }
564  }
565 
566  return ErrCode(ErrCode::Status::success);
567  }
568 } //end namespace TreeFitter
569 
static const double speedOfLight
[cm/ns]
Definition: Const.h:575
Class to store reconstructed particles.
Definition: Particle.h:74
const KLMCluster * getKLMCluster() const
Returns the pointer to the KLMCluster object that was used to create this Particle (ParticleType == c...
Definition: Particle.cc:895
const Track * getTrack() const
Returns the pointer to the Track object that was used to create this Particle (ParticleType == c_Trac...
Definition: Particle.cc:814
const ECLCluster * getECLCluster() const
Returns the pointer to the ECLCluster object that was used to create this Particle (if ParticleType =...
Definition: Particle.cc:860
std::string getName() const override
Return name of this particle.
Definition: Particle.cc:1121
float getExtraInfo(const std::string &name) const
Return given value if set.
Definition: Particle.cc:1242
bool hasExtraInfo(const std::string &name) const
Return whether the extra info with the given name is set.
Definition: Particle.cc:1219
unsigned getMdstArrayIndex(void) const
Returns 0-based index of MDST store array object (0 for composite particles)
Definition: Particle.h:425
int getPDGCode(void) const
Returns PDG code.
Definition: Particle.h:392
float getCharge(void) const
Returns particle charge.
Definition: Particle.cc:630
const int m_originDimension
dimension of the origin constraint and ALL geometric gcosntraints
int m_headOfTreePDG
PDG code of the head particle.
const bool m_massConstraintType
const flag for the type of the mass constraint
Type
type of constraints the order of these constraints is important: it is the order in which they are ap...
Definition: Constraint.h:27
abstract errorocode be aware that the default is success
Definition: ErrCode.h:14
Class to store and manage fitparams (statevector)
Definition: FitParams.h:20
Eigen::Matrix< double, -1, -1, 0, MAX_MATRIX_SIZE, MAX_MATRIX_SIZE > & getCovariance()
getter for the states covariance
Definition: FitParams.h:53
Eigen::Matrix< double, -1, 1, 0, MAX_MATRIX_SIZE, 1 > & getStateVector()
getter for the fit parameters/statevector
Definition: FitParams.h:65
another unnecessary layer of abstraction
representation of the beamspot as a particle
Definition: Origin.h:19
base class for all particles
Definition: ParticleBase.h:25
ParticleBase(Belle2::Particle *particle, const ParticleBase *mother, const ConstraintConfiguration *config)
default constructor
Definition: ParticleBase.cc:30
Belle2::Particle * particle() const
get basf2 particle
Definition: ParticleBase.h:96
virtual void updateIndex(int &offset)
this sets the index for momentum, position, etc.
virtual ErrCode projectMassConstraintParticle(const FitParams &, Projection &) const
project mass constraint using the particles parameters
ErrCode initTau(FitParams &par) const
initialises tau as a length
virtual ParticleBase * addDaughter(Belle2::Particle *, const ConstraintConfiguration &config, bool forceFitAll=false)
add daughter
static ParticleBase * createOrigin(Belle2::Particle *daughter, const ConstraintConfiguration &config, bool forceFitAll)
create a custom origin particle or a beamspot
static ParticleBase * createParticle(Belle2::Particle *particle, const ParticleBase *mother, const ConstraintConfiguration &config, bool forceFitAll=false)
create the according treeFitter particle obj for a basf2 particle type
virtual int dim() const =0
get dimension of constraint
virtual int nFinalChargedCandidates() const
number of charged candidates
virtual void retrieveIndexMap(indexmap &anindexmap) const
get index map
virtual ErrCode projectMassConstraint(const FitParams &, Projection &) const
project mass constraint abstract
const ConstraintConfiguration * m_config
has all the constraint config
Definition: ParticleBase.h:224
virtual std::string parname(int index) const
get name of parameter i
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...
virtual ErrCode projectConstraint(Constraint::Type, const FitParams &, Projection &) const
project constraint.
virtual ErrCode projectMassConstraintDaughters(const FitParams &, Projection &) const
project mass constraint using the parameters of the daughters
const ParticleBase * locate(Belle2::Particle *particle) const
get particle base from basf2 particle
virtual void removeDaughter(const ParticleBase *pb)
remove daughter
const ParticleBase * m_mother
motherparticle
Definition: ParticleBase.h:215
bool m_isStronglyDecayingResonance
decay length less than 1 micron
Definition: ParticleBase.h:221
virtual ErrCode initCovariance(FitParams &) const
init covariance matrix
virtual int type() const =0
get particle type
Belle2::Particle * m_particle
pointer to framework type
Definition: ParticleBase.h:212
virtual ErrCode projectGeoConstraint(const FitParams &, Projection &) const
project geometrical constraint
virtual double chiSquare(const FitParams &) const
get chi2
virtual int posIndex() const
get vertex index (in statevector!)
Definition: ParticleBase.h:129
std::vector< std::pair< const ParticleBase *, int > > indexmap
alias
Definition: ParticleBase.h:59
virtual int momIndex() const
get momentum index
Definition: ParticleBase.h:135
int index() const
get index
Definition: ParticleBase.h:99
virtual bool hasEnergy() const
get momentum dimension
Definition: ParticleBase.h:139
std::vector< ParticleBase * > m_daughters
daughter container
Definition: ParticleBase.h:218
const std::string & name() const
get name of the particle
Definition: ParticleBase.h:105
std::string m_name
name
Definition: ParticleBase.h:243
virtual ~ParticleBase()
destructor, actually does something
void collectVertexDaughters(std::vector< ParticleBase * > &particles, int posindex)
get vertex daughters
virtual int tauIndex() const
get tau index
Definition: ParticleBase.h:132
const ParticleBase * mother() const
getMother() / hasMother()
double pdgMass() const
get pdg mass
Definition: ParticleBase.h:151
virtual bool hasPosition() const
get false
Definition: ParticleBase.h:142
double pdgLifeTime() const
get pdg lifetime
Definition: ParticleBase.h:157
double pdgTime() const
get Tau
Definition: ParticleBase.h:160
static double bFieldOverC()
Bz/c
class to store the projected residuals and the corresponding jacobian as well as the covariance matri...
Definition: Projection.h:18
A class for composite particles.
Definition: RecoComposite.h:16
representation of the Klong constraint
Definition: RecoKlong.h:16
representation of the photon constraint
Definition: RecoPhoton.h:16
A class for resonances.
Definition: RecoResonance.h:17
representation of all charged final states FIXME rename since this name is taken in tracking
Definition: RecoTrack.h:18
class for resonances as internal particles
Definition: Resonance.h:17
static void getField(const double *pos, double *field)
return the magnetic field at a given position.