FairRoot/PandaRoot
ParticleBase.cxx
Go to the documentation of this file.
1 // ******************************************************
2 // DecayTreeFitter Package
3 // We thank the original author Wouter Hulsbergen
4 // (BaBar, LHCb) for providing the sources.
5 // http://arxiv.org/abs/physics/0503191v1 (2005)
6 // Adaptation & Development for PANDA: Ralf Kliemt (2015)
7 // ******************************************************
8 #include <iomanip>
9 #include <float.h>
10 
11 //#include "Event/Particle.h"
12 //#include "LoKi/ParticleProperties.h"
13 
14 #include "ParticleBase.h"
15 #include "InternalParticle.h"
16 #include "RecoComposite.h"
17 #include "RecoResonance.h"
18 #include "RecoTrack.h"
19 #include "RecoPhoton.h"
20 #include "Resonance.h"
21 #include "MissingParticle.h"
22 #include "FitParams.h"
23 #include "Configuration.h"
24 
25 #include "TParticlePDG.h"
26 #include "TVectorD.h"
27 #include "TMatrixDSym.h"
28 #include "TMath.h"
29 
30 #include "RhoCalculationTools.h"
31 
32 #include "PndPidCandidate.h"
33 
34 //#include "Kernel/IParticlePropertySvc.h"
35 //#include "Kernel/ParticleProperty.h"
36 //#include "GaudiKernel/Service.h"
37 
38 using namespace DecayTreeFitter;
39 
41 
42 //template<class T>
43 //inline T sqr(T x) { return x*x ; }
44 
45 int vtxverbose=0 ;
46 
48 : m_particle(aParticle),m_mother(aMother),
49 m_prop(aParticle->PdtEntry()),
50 m_index(0),m_pdtMass(0),m_pdtWidth(0),m_pdtCLifeTime(0),m_charge(0),
51 m_name("Unknown"), m_hasMassConstraint(false)
52 {
53  if( m_prop ) {
54  m_pdtMass = m_prop->Mass() ;
55  m_pdtWidth = m_prop->Width() ;
56  m_pdtCLifeTime = TMath::C() * m_prop->Lifetime() * 100; // Units: ctau[cm] = C[m/s] * tau[s]
57  double fltcharge = m_prop->Charge()/3. ;// TParticlePDG holds charg in |e|/3
58  m_charge = fltcharge < 0 ? int(fltcharge-0.5) : int(fltcharge+0.5) ;
59  //m_charge = aParticle->Charge()>0 ? 1 : (aParticle->Charge()<0 ? -1 : 0) ;
60  m_name = m_prop->GetName() ;//FIXME Does root object name do the job?
61  } else {
62  m_charge = aParticle->Charge()>0 ? 1 : (aParticle->Charge()<0 ? -1 : 0) ;
63  }
64 }
65 
66 
68 : m_particle(0),m_mother(0),
69 m_prop(0),
70 m_index(0),m_pdtMass(0),m_pdtWidth(0),m_pdtCLifeTime(0),m_charge(0),
71 m_name(aname), m_hasMassConstraint(false)
72 {
73 }
74 
76 {
77  for(daucontainer::iterator it = m_daughters.begin() ;
78  it != m_daughters.end() ; ++it)
79  if(*it) delete *it ;
80  m_daughters.clear() ;
81 }
82 
84 {
85  if(vtxverbose>=5){std::cout<<"ParticleBase::updateIndex() start"<<std::endl;}
86  // first the daughters
87  for(const_iterator it = begin(); it!= end(); ++it) (*it)->updateIndex(offset) ;
88  // now the real work
89  m_index = offset ;
90  offset += dim() ;
91  if(vtxverbose>=5){std::cout<<"ParticleBase::updateIndex() end"<<std::endl;}
92 }
93 
95 {
96  m_daughters.push_back( DecayTreeFitter::ParticleBase::createParticle(cand,this,config) ) ;
97  return m_daughters.back() ;
98 }
99 
101 {
102  daucontainer::iterator it = std::find(m_daughters.begin(),m_daughters.end(),pb) ;
103  if(it != m_daughters.end() ) {
104  ParticleBase* _dp = *it ;
105  m_daughters.erase(it) ;
106  if(_dp) delete _dp ;
107  } else {
108  std::cout << "ERROR: cannot remove particle, because not found ..." << std::endl ;
109  }
110 }
111 
114  const ParticleBase* mother,
115  const Configuration& config)
116 {
117  // This routine interpretes a beta candidate as one of the
118  // 'Particles' used by the fitter.
119 
120  const TParticlePDG* prop = particle->PdtEntry();
121 
122  if(vtxverbose>=5)
123  std::cout << "DecayTreeFitter::ParticleBase::createParticle from " <<particle->PdgCode() << " | " << particle->Uid() << std::endl ;
124  ParticleBase* rc=0 ;
125  //bool bsconstraint = false ;
126 
127  // We refit invalid fits, kinematic fits and composites with beamspot
128  // constraint if not at head of tree.
129  bool validfit = particle->IsLocked();//TODO needed? && particle.endVertex() != 0 ;
130  bool iscomposite = (particle->NDaughters()>0) ;
131  bool isresonance = iscomposite && prop && isAResonance(prop) ;
132 
133  if(!mother) { // 'head of tree' particles
134  //if ( bsconstraint )
135  //rc = new InteractionPoint(particle) ;
136  //else
137 
138  if( iscomposite )
139  { if(vtxverbose>=2) std::cout<<" H "; if(vtxverbose>=5) std::cout<<std::endl;
140  rc = new InternalParticle(particle,0,config) ; // still need proper head-of-tree class
141  }
142  else {
143  std::cout << "DecayTreeFitter::ParticleBase::createParticle: You are fitting a decay tree that exists of "
144  << "a single, non-composite particle and which does not have a beamconstraint."
145  << "I do not understand what you want me to do with this." << std::endl ;
146  std::cout<<" X ";
147  rc = new InternalParticle(particle,0,config) ; // still need proper head-of-tree class
148  }
149  } else if( !iscomposite ) { // external particles (i.e. tracks/neutrals)
150  bool hasrecocand = ( NULL !=particle->GetRecoCandidate() );
151  bool ischarged = ( fabs(particle->Charge())>0 );
152  //bool hastrack = proto && (proto->GetTrackIndex() >= 0) ;
153  //bool hascalo = proto && (proto->GetEmcNumberOfCrystals() > 0) ;
154  //std::cout<<" particle="<<particle<<" proto="<<proto<<" ntrk="<<proto->GetTrackIndex()<<" ncry"<<proto->GetEmcNumberOfCrystals()<<std::endl;
155  if( hasrecocand )
156  {
157  if( ischarged )
158  { if(vtxverbose>=2) std::cout<<" T "; if(vtxverbose>=5) std::cout<<std::endl;
159  rc = new RecoTrack(particle,mother,config) ; // reconstructed track
160  } else
161  { if(vtxverbose>=2) std::cout<<" P "; if(vtxverbose>=5) std::cout<<std::endl;
162  rc = new RecoPhoton(particle,mother) ; // reconstructed photon
163  }
164  } else if( validfit ) { // fitted composites w/o daughters?
165  if( isresonance )
166  { if(vtxverbose>=2) std::cout<<" RF "; if(vtxverbose>=5) std::cout<<std::endl;
167  rc = new RecoResonance(particle,mother) ;
168  } else
169  { if(vtxverbose>=2) std::cout<<" CF "; if(vtxverbose>=5) std::cout<<std::endl;
170  rc = new RecoComposite(particle,mother) ;
171  }
172  } else { // missing particle!
173  if(vtxverbose>=2) std::cout<<" M "; if(vtxverbose>=5) std::cout<<std::endl;
174  rc = new MissingParticle(particle,mother) ;
175  }
176  } else { // 'internal' particles
177  if( validfit /*|| isconversion*/ ) { // fitted composites
178  if( isresonance ) {
179  if(vtxverbose>=2) std::cout<<" Rf "; if(vtxverbose>=5) std::cout<<std::endl;
180  rc = new RecoResonance(particle,mother) ;
181  } else {
182  if(vtxverbose>=2) std::cout<<" Cf "; if(vtxverbose>=5) std::cout<<std::endl;
183  rc = new RecoComposite(particle,mother) ;
184  }
185  } else { // unfited composites
186  if( isresonance ) {
187  if(vtxverbose>=2) std::cout<<" R "; if(vtxverbose>=5) std::cout<<std::endl;
188  rc = new Resonance(particle,mother,config) ;
189  } else {
190  if(vtxverbose>=2) std::cout<<" I "; if(vtxverbose>=5) std::cout<<std::endl;
191  rc = new InternalParticle(particle,mother,config) ;
192  }
193  }
194  }
195  if(vtxverbose>=5)
196  std::cout << "DecayTreeFitter::ParticleBase::createParticle finished " <<particle->PdgCode() << " | " << particle->Uid() << std::endl ;
197 
198  if(vtxverbose>=2)
199  std::cout << "DecayTreeFitter::ParticleBase::createParticle returns type=" << rc->type()
200  << " index=" << rc->index() << " with name \""<< rc->name() << "\""<<std::endl ;
201  return rc ;
202 }
203 
204 bool
206  bool rc = false ;
207  switch(prop->PdgCode()) {
208  case 11: // bremstrahlung is treated as a resonance
209  case -11:
210  rc = true ;
211  break ;
212  //case 22: // conversions are not treated as a resonance
213  //case 310: // K shorts count as "stable" in PDT Table
214  //rc = false;
215  //break ;
216  default: // this should take care of the pi0
217  rc = (prop->Lifetime()>0) && (100.*TMath::C()*prop->Lifetime() < 0.0001); //[cm]
218  if(rc) break;
219  if(vtxverbose>4)std::cout<<"ParticleBase::isAResonance l."<<__LINE__<<": ctau="<<100.*TMath::C()*prop->Lifetime()<<" cm"<<std::endl;
220  if(prop->Stable()) return false;
221  //rc = prop.ctau() < 0.001*Gaudi::Units::mm ;
222  break;
223  }
224  return rc ;
225 }
226 
228 {
229  // collect all particles emitted from vertex with position posindex
230  if(vtxverbose>=3) {
231  std::cout << "DecayTreeFitter::ParticleBase::collectVertexDaughters " << posindex << std::endl ;
232  }
233  //skip: head of tree, particles from different vertex, resonances
234  if( mother() && mother()->posIndex() == posindex && type()!=kRecoResonance && type()!=kResonance )
235  {
236  particles.push_back( this ) ;
237  if(vtxverbose>=3) {
238  std::cout << "DecayTreeFitter::ParticleBase::collectVertexDaughters - added a particle "<<name()<<" to vertex " << posindex << std::endl ;
239  }
240  }
241  for( daucontainer::const_iterator idau = daughters().begin() ;
242  idau != daughters().end() ; ++idau )
243  (*idau)->collectVertexDaughters(particles,posindex ) ; //FIXME: RK Caution here!!
244  //collectVertexDaughters(particles,posindex ) ;
245 }
246 
247 ErrCode
249 {
250  ErrCode status ;
251 
252  if(vtxverbose>=2) {
253  std::cout << "DecayTreeFitter::ParticleBase::initCov for " << name() << std::endl ;
254  }
255 
256  // position
257  int posindex = posIndex() ;
258  if( posindex>=0 ) {
259  const double sigx = 10; // * Gaudi::Units::cm ;
260  const double sigy = 10; // * Gaudi::Units::cm ;
261  const double sigz = 50; // * Gaudi::Units::cm ;
262  fitparams->cov()(posindex+0,posindex+0) = sigx*sigx ;
263  fitparams->cov()(posindex+1,posindex+1) = sigy*sigy ;
264  fitparams->cov()(posindex+2,posindex+2) = sigz*sigz ;
265  }
266 
267  // momentum
268  int momindex = momIndex() ;
269  if(momindex>=0) {
270  // TODO: calo at high energy?
271  const double sigmom = 10; // * Gaudi::Units::GeV ; // GeV
272  int maxrow = hasEnergy() ? 4 : 3 ;
273  for(int row=momindex; row<momindex+maxrow; row++)
274  fitparams->cov()(row,row) = sigmom*sigmom ;
275  }
276 
277  // lifetime
278  int lenindex = lenIndex() ;
279  if(lenindex>=0) {
280  const double sigz = 50; // * Gaudi::Units::cm ;
281  fitparams->cov()(lenindex,lenindex) = sigz*sigz ;
282  }
283 
284  for(daucontainer::const_iterator it = m_daughters.begin() ;
285  it != m_daughters.end() ; ++it)
286  status |= (*it)->initCov(fitparams) ;
287  return status ;
288 }
289 
290 
291 std::string DecayTreeFitter::ParticleBase::parname(int thisindex) const
292 {
293  std::string rc = name() ;
294  switch(thisindex) {
295  case 0: rc += " x " ; break ;
296  case 1: rc += " y " ; break ;
297  case 2: rc += " z " ; break ;
298  case 3: rc += " len" ; break ;
299  case 4: rc += " px " ; break ;
300  case 5: rc += " py " ; break ;
301  case 6: rc += " pz " ; break ;
302  case 7: rc += " E " ; break ;
303  default: ;
304  }
305  return rc ;
306 }
307 
308 void
310 {
311  std::cout << std::setw(5) << "[" << type() << "]" << std::setw(15) << std::flush << name().c_str()
312  << std::setw(15)<< " val" << std::setw(15)<< "err" << std::setw(15) << "sigma^2"<< std::endl ;
313  std::cout << std::setprecision(5) ;
314  for(int i=0; i<dim(); i++) {
315  int theindex = index()+i ;
316  std::cout << std::setw(2) << theindex << " "
317  << std::setw(20) << parname(i).c_str()
318  << std::setw(15) << fitpar->par()(theindex)
319  << std::setw(15) << sqrt(fitpar->cov()(theindex,theindex))
320  << std::setw(15) << fitpar->cov()(theindex,theindex) <<std::endl ;
321  }
322  if( hasEnergy() ) {
323  int momindex = momIndex() ;
324  double E = fitpar->par()(momindex+3) ;
325  double px = fitpar->par()(momindex+0) ;
326  double py = fitpar->par()(momindex+1) ;
327  double pz = fitpar->par()(momindex+2) ;
328  double mass2 = E*E-px*px-py*py-pz*pz ;
329  double mass = mass2>0 ? sqrt(mass2) : -sqrt(-mass2) ;
330 
331  // TODO this does not work? fitpar->cov()).GetSub(momindex+0,momindex+3)
332  TMatrixDSym cov = fitpar->cov().GetSub(momindex+0,momindex+3,momindex+0,momindex+3);
333  //HepSymMatrix cov = fitpar->cov().sub(momindex+0,momindex+3) ;
334  TVectorD G(4) ; //was at G(4,0) .. ??why
335  G(0) = -px/mass ;
336  G(1) = -py/mass ;
337  G(2) = -pz/mass ;
338  G(3) = E/mass ;
339  double massvar = cov.Similarity(G) ;
340  std::cout << std::setw(2)<< "-"<<" " << std::setw(20) << "mass: "
341  << std::setw(15) << mass
342  << std::setw(15) << sqrt(massvar)
343  << std::setw(15) << massvar << std::endl ;
344  }
345 
346  for(daucontainer::const_iterator it = m_daughters.begin() ;
347  it != m_daughters.end() ; ++it)
348  (*it)->print(fitpar) ;
349 
350 }
351 
352 const
354 {
355  // does there exist an 'iscloneof' in lhcb?
356  const ParticleBase* rc = m_particle == abc ? this : 0 ;
357  for(daucontainer::const_iterator it = m_daughters.begin() ;
358  !rc && it != m_daughters.end(); ++it)
359  rc = (*it)->locate(abc) ;
360  return rc ;
361 }
362 
363 // void DecayTreeFitter::ParticleBase::locate( RhoCandidateID& pid,
364 // ParticleContainer& result )
365 // {
366 // /// @attention Comparison by ABSPID!
367 // if ( m_particle &&
368 // m_particle->particleID().abspid() ==pid.abspid() )
369 // { result.push_back(this) ; } ;
370 // //
371 // for( daucontainer::iterator it = m_daughters.begin() ;
372 // it != m_daughters.end(); ++it)
373 // { (*it)-> locate( pid, result ) ; }
374 // //
375 // }
376 
378 {
379 
380  anindexmap.push_back(std::pair<const ParticleBase*,int>(this,index())) ;
381  for(daucontainer::const_iterator it = m_daughters.begin() ;
382  it != m_daughters.end() ; ++it)
383  (*it)->retrieveIndexMap(anindexmap) ;
384 }
385 
386 
388  Projection& p) const
389 {
390  // implements the constraint
391 
392  // vec{x}_decay = vec{x}_production + decaylength * vec{p} / p
393  int posindexmother = mother()->posIndex() ;
394  int posindex = posIndex();
395  int lenindex = lenIndex() ;
396  int momindex = momIndex() ;
397  assert(posindexmother>=0 && posindex>=0 && lenindex>=0 && momindex>=0) ;
398 
399 
400  // size of momentum
401  double px = fitparams->par()(momindex+0) ;
402  double py = fitparams->par()(momindex+1) ;
403  double pz = fitparams->par()(momindex+2) ;
404  double p2 = px*px+py*py+pz*pz ;
405  double mom = std::sqrt(p2) ;
406 
407  double dvx = fitparams->par()(posindexmother+0) - fitparams->par()(posindex+0);
408  double dvy = fitparams->par()(posindexmother+1) - fitparams->par()(posindex+1);
409  double dvz = fitparams->par()(posindexmother+2) - fitparams->par()(posindex+2);
410  double len=dvx*dvx+dvy*dvy+dvz*dvz;
411  len=std::sqrt(len);
412 
413  // lineair approximation is fine for now
414  for(int row=0; row<3; row++) {
415  double posxmother = fitparams->par()(posindexmother+row) ;
416  double posx = fitparams->par()(posindex+row) ;
417  double momx = fitparams->par()(momindex+row) ;
418  p.r(row) = posxmother - posx + len*momx/mom ;
419  p.H(row,posindexmother+row) = 1 ;
420  p.H(row,posindex+row) = -1 ;
421  p.H(row,lenindex) = momx/mom ;
422  }
423  // still need these as well
424  p.H(0,momindex+0) = len/mom*( 1 - px*px/p2 ) ;
425  p.H(0,momindex+1) = len/mom*( 0 - px*py/p2 ) ;
426  p.H(0,momindex+2) = len/mom*( 0 - px*pz/p2 ) ;
427  p.H(1,momindex+0) = len/mom*( 0 - py*px/p2 ) ;
428  p.H(1,momindex+1) = len/mom*( 1 - py*py/p2 ) ;
429  p.H(1,momindex+2) = len/mom*( 0 - py*pz/p2 ) ;
430  p.H(2,momindex+0) = len/mom*( 0 - pz*px/p2 ) ;
431  p.H(2,momindex+1) = len/mom*( 0 - pz*py/p2 ) ;
432  p.H(2,momindex+2) = len/mom*( 1 - pz*pz/p2 ) ;
434  //if( charge()!=0 )
435  //{
436  //double lambda = bFieldOverC() * charge() ;
437  //double tau = fitparams->par(lenIndex());
438  //double pt = sqrt(px*px+py*py) ;
439  //const double posprecision = 1e-4 ; // 1mu
440  //if( fabs(pt*lambda*tau*tau) > posprecision )
441  //{
443  //double sinlt = sin(lambda*tau) ;
444  //double coslt = cos(lambda*tau) ;
445  //double px1 = px*coslt - py*sinlt ;
446  //double py1 = py*coslt + px*sinlt ;
447 
448  //p.r(0) += -tau*px + (py1-py)/lambda ;
449  //p.r(1) += -tau*py - (px1-px)/lambda ;
450 
451  //p.H(0,lenindex+0) += -px + px1 ;
452  //p.H(0,momindex+0) += -tau + sinlt/lambda ;
453  //p.H(0,momindex+1) += (coslt-1)/lambda ;
454  //p.H(1,lenindex+0) += -py + py1 ;
455  //p.H(1,momindex+0) += - (coslt-1)/lambda ;
456  //p.H(1,momindex+1) += -tau + sinlt/lambda ;
457 
459  //std::cout << "Using helix for position of particle: " << name().c_str() << " "
460  //<< lambda << " " << lambda*tau
461  //<< " delta-x,y: " << -tau*px + (py1-py)/lambda << " "
462  //<< -tau*py - (px1-px)/lambda << std::endl ;
463  //}
464  //}
466 
467  //p.setParticle( *mother() ) ; // adds geoconstraint chi2 to the balance of the mother particle. Why?
468  if(vtxverbose>6){
469  std::cout<<"ParticleBase::projectConstraint(): projection is:"<<std::endl;
470  std::cout<<"r "; p.r().Print();
471  std::cout<<"V "; p.V().Print();
472  std::cout<<"H "; RhoCalculationTools::PrintMatrix(p.H());
473  }
474  return ErrCode::success ;
475 }
476 
478  Projection& p) const
479 {
480  if(vtxverbose>6){std::cout<<"ParticleBase::projectMassConstraint():"<<std::endl;}
481  double mass = pdtMass() ;
482  double mass2 = mass*mass ;
483  int momindex = momIndex() ;
484 
485  // initialize the value
486  double px = fitparams->par()(momindex+0) ;
487  double py = fitparams->par()(momindex+1) ;
488  double pz = fitparams->par()(momindex+2) ;
489  double E = fitparams->par()(momindex+3) ;
490  if(vtxverbose>6){std::cout<<"px="<<px<<", py="<<py<<", pz="<<pz<<", E="<<E<<", pdtmass="<<mass<<std::endl;}
491  p.r(0) = E*E-px*px-py*py-pz*pz-mass2 ;
492 
493  // calculate the projection matrix
494  p.H(0,momindex+0) = -2.0*px ;
495  p.H(0,momindex+1) = -2.0*py ;
496  p.H(0,momindex+2) = -2.0*pz ;
497  p.H(0,momindex+3) = 2.0*E ;
498 
499  // set the variance in the residual
500  double width = pdtWidth() ;
501  p.Vfast(0,0) = 4*mass*mass*width*width ;
502 
503  return ErrCode::success ;
504 }
505 
506 ErrCode
508 {
509  std::cout << "ParticleBase::projectConstraint(): no method to project this constaint: "
510  << name() << " " << type() << " " << atype << std::endl ;
511  return ErrCode::badsetup ;
512 }
513 
514 // double DecayTreeFitter::ParticleBase::bFieldOverC()
515 // {
516 // static const BField* bfield = gblEnv->getTrk()->magneticField();
517 // static const double Bz = BField::cmTeslaToGeVc*bfield->bFieldNominal() ;
518 // return Bz ;
519 // }
520 
521 ErrCode
523 {
524  int lenindex = lenIndex() ;
525  if(lenindex>=0 && hasPosition() ) {
526  const ParticleBase* amother = mother() ;
527  int momposindex = amother ? amother->posIndex() : -1 ;
528  int posindex = posIndex() ;
529  int momindex = momIndex() ;
530  assert(momposindex>=0) ; // check code logic: no mother -> no tau
531  //assert(fitparams->par(momposindex+0)!=0 ||fitparams->par(momposindex+1)!=0
532  // ||fitparams->par(momposindex+2)!=0) ; // mother must be initialized
533 
534  TVector3 dX,mom ;
535  double mom2(0) ;
536  for(int irow=0; irow<3; irow++) {
537  dX(irow) = fitparams->par(posindex+irow) - fitparams->par(momposindex+irow) ;
538  double px = fitparams->par(momindex+irow) ;
539  mom(irow) = px ;
540  mom2 += px*px ;
541  }
542  double tau = dX.Dot(mom)/mom2 ;
543  // we don't like 0 and we don't like very negative values
544  if( tau==0 ) tau=pdtTau() ;
545  //tau = tau==0 ? pdtTau() : std::max(tau,-pdtTau()) ;
546  fitparams->par(lenindex) = tau ;
547  }
548  return ErrCode::success ;
549 }
550 
552 {
553  double rc = 0;
554  for(daucontainer::const_iterator it = m_daughters.begin() ;
555  it != m_daughters.end(); ++it)
556  rc += (*it)->chiSquareD(fitparams) ;
557  return rc ;
558 }
559 
561  int rc=0;
562  for(daucontainer::const_iterator it = m_daughters.begin() ;
563  it != m_daughters.end() ; ++it)
564  rc +=(*it)->nFinalChargedCandidates() ;
565  return rc ;
566 }
567 
569 {
570  ChiSquare chi2 ;
571  // add contribution from daughters
572  for(daucontainer::const_iterator it = m_daughters.begin() ;
573  it != m_daughters.end() ; ++it) {
574  chi2 += (*it)->chiSquare(fitparams) ;
575  }
576  // add own chisquare, adjust for number of parameters
577  chi2 += fitparams->chiSquare( *this ) ;
578  chi2 += ChiSquare( 0, -dim() ) ;
579  return chi2 ;
580 }
581 
583 {
584  TVector3 pos(0.,0.,0.); //TODO get a sensible position, but let's assume zero first...
585  return RhoCalculationTools::GetBz ( pos ) / TMath::C() ;
586 }
587 
588 
589 //backup "old" representation
594 
601 
604 
611 
646 
649 
656 
665 
int row
Definition: anaLmdDigi.C:67
TVector3 pos
Double_t p
Definition: anasim.C:58
const TVectorD & r() const
Definition: Projection.h:37
const ParticleBase * locate(RhoCandidate *bc) const
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
PndPidCandidate * GetRecoCandidate() const
Definition: RhoCandidate.h:376
static bool isAResonance(const TParticlePDG *bc)
Double_t mom
Definition: plot_dirc.C:14
TVector3 offset(2, 0, 0)
virtual ErrCode initCov(FitParams *) const
Int_t Uid() const
Definition: RhoCandidate.h:419
const TMatrixD & H() const
Definition: Projection.h:28
virtual double chiSquareD(const FitParams *) const
std::vector< std::pair< const ParticleBase *, int > > indexmap
Definition: ParticleBase.h:105
virtual ErrCode projectGeoConstraint(const FitParams *, Projection &) const
const int particle
const TMatrixDSym & V() const
Definition: Projection.h:47
int Pic_FED Eff_lEE C()
int vtxverbose
daucontainer::const_iterator const_iterator
Definition: ParticleBase.h:97
void collectVertexDaughters(daucontainer &particles, int posindex)
const std::string & name() const
Definition: ParticleBase.h:61
virtual int index() const
Definition: ParticleBase.h:59
virtual int posIndex() const
Definition: ParticleBase.h:69
const_iterator end() const
Definition: ParticleBase.h:101
double chiSquare() const
Definition: FitParams.h:51
virtual void updateIndex(int &offset)
Bool_t IsLocked()
Definition: RhoCandidate.h:330
const TParticlePDG * PdtEntry() const
ParticleBase(RhoCandidate *bc, const ParticleBase *mother)
virtual int nFinalChargedCandidates() const
static void PrintMatrix(TMatrixT< double > m)
void removeDaughter(const ParticleBase *pb)
ChiSquare chiSquare(const FitParams *fitparams) const
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
virtual ErrCode projectConstraint(Constraint::Type, const FitParams *, Projection &) const
virtual std::string parname(int index) const
TString name
const TParticlePDG * m_prop
Definition: ParticleBase.h:147
virtual int type() const =0
TPad * p2
Definition: hist-t7.C:117
std::vector< ParticleBase * > daucontainer
Definition: ParticleBase.h:96
ParticleBase * addDaughter(RhoCandidate *, const Configuration &config)
Int_t NDaughters() const
static Double_t GetBz(const TVector3 &position)
Return the magnetic field along the z-axis in kGs
ClassImp(PndAnaContFact)
Double_t Charge() const
Definition: RhoCandidate.h:184
ErrCode initTau(FitParams *par) const
virtual ErrCode projectMassConstraint(const FitParams *, Projection &) const
static ParticleBase * createParticle(RhoCandidate *bc, const ParticleBase *mother, const Configuration &config)
virtual void print(const FitParams *) const
virtual void retrieveIndexMap(indexmap &anindexmap) const
double pz[39]
Definition: pipisigmas.h:14
TMatrixDSym & cov()
Definition: FitParams.h:34
int status[10]
Definition: f_Init.h:28
double & Vfast(int row, int col)
Definition: Projection.h:50