FairRoot/PandaRoot
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
DecayTreeFitter::InternalParticle Class Reference

#include <InternalParticle.h>

Inheritance diagram for DecayTreeFitter::InternalParticle:
DecayTreeFitter::ParticleBase DecayTreeFitter::InteractionPoint DecayTreeFitter::Resonance

Public Types

enum  ParticleType {
  kInteractionPoint, kRecoComposite, kRecoResonance, kInternalParticle,
  kRecoTrack, kResonance, kRecoPhoton, kMissingParticle
}
 
typedef std::vector
< ParticleBase * > 
ParticleContainer
 
typedef std::vector
< ParticleBase * > 
daucontainer
 
typedef
daucontainer::const_iterator 
const_iterator
 
typedef std::vector< std::pair
< const ParticleBase *, int > > 
indexmap
 
typedef std::vector
< DecayTreeFitter::Constraint
constraintlist
 

Public Member Functions

 InternalParticle (RhoCandidate *bc, const ParticleBase *mother, const Configuration &config)
 
virtual int dim () const
 
virtual ErrCode initPar1 (FitParams *)
 
virtual ErrCode initPar2 (FitParams *)
 
virtual int type () const
 
virtual int posIndex () const
 
virtual int lenIndex () const
 
virtual int momIndex () const
 
virtual bool hasEnergy () const
 
virtual bool hasPosition () const
 
virtual std::string parname (int index) const
 
ErrCode projectKineConstraint (const FitParams *, Projection &) const
 
ErrCode projectLifeTimeConstraint (const FitParams *, Projection &) const
 
ErrCode projectConversionConstraint (const FitParams *, Projection &p) const
 
ErrCode projectMassConstraintTwoBody (const FitParams *fitparams, Projection &p) const
 
virtual ErrCode projectConstraint (Constraint::Type type, const FitParams *fitparams, Projection &p) const
 
virtual void addToConstraintList (constraintlist &alist, int depth) const
 
virtual void updateIndex (int &offset)
 
virtual ErrCode initCov (FitParams *) const
 
virtual void print (const FitParams *) const
 
const ParticleBaselocate (RhoCandidate *bc) const
 
RhoCandidateparticle () const
 
virtual int index () const
 
const ParticleBasemother () const
 
const std::string & name () const
 
virtual ErrCode projectGeoConstraint (const FitParams *, Projection &) const
 
virtual ErrCode projectMassConstraint (const FitParams *, Projection &) const
 
int eneIndex () const
 
virtual double chiSquareD (const FitParams *) const
 
double pdtMass () const
 
double pdtWidth () const
 
double pdtCLifeTime () const
 
double pdtTau () const
 
int charge () const
 
const daucontainerdaughters () const
 
const_iterator begin () const
 
const_iterator end () const
 
ParticleBaseaddDaughter (RhoCandidate *, const Configuration &config)
 
void removeDaughter (const ParticleBase *pb)
 
virtual void retrieveIndexMap (indexmap &anindexmap) const
 
void setMother (const ParticleBase *m)
 
virtual int nFinalChargedCandidates () const
 
void setParticle (RhoCandidate *bc)
 
void collectVertexDaughters (daucontainer &particles, int posindex)
 
bool setMassConstraint (bool add)
 
void setMassConstraint (double mass)
 
ChiSquare chiSquare (const FitParams *fitparams) const
 

Static Public Member Functions

static ParticleBasecreateParticle (RhoCandidate *bc, const ParticleBase *mother, const Configuration &config)
 

Protected Member Functions

ErrCode initMom (FitParams *fitparams) const
 
daucontainerdaughters ()
 
ErrCode initTau (FitParams *par) const
 
void makeName (RhoCandidate *bc)
 
bool hasMassConstraint () const
 
void setIndex (int i)
 
void setName (const std::string &n)
 

Static Protected Member Functions

static double pdtCLifeTime (RhoCandidate *bc)
 
static bool isAResonance (const TParticlePDG *bc)
 
static double bFieldOverC ()
 

Private Attributes

bool m_lifetimeconstraint
 
bool m_isconversion
 

Detailed Description

Definition at line 18 of file InternalParticle.h.

Member Typedef Documentation

typedef daucontainer::const_iterator DecayTreeFitter::ParticleBase::const_iterator
inherited

Definition at line 97 of file ParticleBase.h.

Definition at line 110 of file ParticleBase.h.

Definition at line 96 of file ParticleBase.h.

typedef std::vector< std::pair<const ParticleBase*,int> > DecayTreeFitter::ParticleBase::indexmap
inherited

Definition at line 105 of file ParticleBase.h.

Definition at line 33 of file ParticleBase.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

DecayTreeFitter::InternalParticle::InternalParticle ( RhoCandidate bc,
const ParticleBase mother,
const Configuration config 
)

Definition at line 30 of file InternalParticle.cxx.

References DecayTreeFitter::ParticleBase::addDaughter(), RhoCandidate::Daughter(), DecayTreeFitter::ParticleBase::daughters(), m_isconversion, m_lifetimeconstraint, RhoCandidate::NDaughters(), and RhoCandidate::PdgCode().

31 : ParticleBase(bc,aMother),m_lifetimeconstraint(false)
32 {
33  // BOOST_FOREACH( RhoCandidate* daughter, bc.daughters() )
34  // addDaughter(*daughter,config) ;
35  for( int iDau=0;iDau<bc->NDaughters();iDau++ ){
36  addDaughter(const_cast<RhoCandidate*>(bc->Daughter(iDau)),config) ;
37  }
38  // copy constraints
39  m_lifetimeconstraint = false ; //bc && bc->constraint(BtaConstraint::Life) ;
40  m_isconversion = daughters().size()==2 && bc->PdgCode() == 22 ;
41 }
RhoCandidate * Daughter(Int_t n)
ParticleBase(RhoCandidate *bc, const ParticleBase *mother)
ParticleBase * addDaughter(RhoCandidate *, const Configuration &config)
Int_t NDaughters() const
const daucontainer & daughters() const
Definition: ParticleBase.h:99

Member Function Documentation

ParticleBase * DecayTreeFitter::ParticleBase::addDaughter ( RhoCandidate cand,
const Configuration config 
)
inherited

Definition at line 94 of file ParticleBase.cxx.

References DecayTreeFitter::ParticleBase::createParticle().

Referenced by InternalParticle().

95 {
96  m_daughters.push_back( DecayTreeFitter::ParticleBase::createParticle(cand,this,config) ) ;
97  return m_daughters.back() ;
98 }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
static ParticleBase * createParticle(RhoCandidate *bc, const ParticleBase *mother, const Configuration &config)
void DecayTreeFitter::InternalParticle::addToConstraintList ( constraintlist alist,
int  depth 
) const
virtual

Implements DecayTreeFitter::ParticleBase.

Reimplemented in DecayTreeFitter::InteractionPoint.

Definition at line 509 of file InternalParticle.cxx.

References DecayTreeFitter::Constraint::conversion, DecayTreeFitter::Constraint::geometric, DecayTreeFitter::Constraint::kinematic, DecayTreeFitter::Constraint::lifetime, and DecayTreeFitter::Constraint::mass.

Referenced by DecayTreeFitter::InteractionPoint::addToConstraintList().

511 {
512  // first the daughters
513  for(daucontainer::const_iterator it = daughters().begin() ;
514  it != daughters().end() ; ++it)
515  (*it)->addToConstraintList(alist,depth-1) ;
516 
517  //double geoprecision = 1e-5 ; // 1mu
518  //double massprecision = 4*pdtMass()*pdtMass()*1e-5 ; // 0.01 MeV
519 
520  // the lifetime constraint
521  if(lenIndex()>=0 && m_lifetimeconstraint)
522  alist.push_back(Constraint(this,Constraint::lifetime,depth,1)) ;
523  // the kinematic constraint
524  if(momIndex()>=0)
525  alist.push_back(Constraint(this,Constraint::kinematic,depth,4)) ;
526  // the geometric constraint
527  if(mother() && lenIndex()>=0)
528  alist.push_back(Constraint(this,Constraint::geometric,depth,3,3)) ;
529  // the mass constraint. FIXME: move to ParticleBase
530  if(hasMassConstraint()) {
531  if( !m_isconversion )
532  alist.push_back(Constraint(this,Constraint::mass,depth,1,10)) ;
533  else
534  alist.push_back(Constraint(this,Constraint::conversion,depth,1,3)) ;
535  }
536 }
const_iterator begin() const
Definition: ParticleBase.h:100
const daucontainer & daughters() const
Definition: ParticleBase.h:99
const ParticleBase * mother() const
Definition: ParticleBase.h:60
const_iterator DecayTreeFitter::ParticleBase::begin ( ) const
inlineinherited

Definition at line 100 of file ParticleBase.h.

References DecayTreeFitter::ParticleBase::m_daughters.

100 { return m_daughters.begin() ; }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
double DecayTreeFitter::ParticleBase::bFieldOverC ( )
staticprotectedinherited

Definition at line 582 of file ParticleBase.cxx.

References C(), RhoCalculationTools::GetBz(), and pos.

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 }
TVector3 pos
int Pic_FED Eff_lEE C()
static Double_t GetBz(const TVector3 &position)
Return the magnetic field along the z-axis in kGs
int DecayTreeFitter::ParticleBase::charge ( ) const
inlineinherited

Definition at line 90 of file ParticleBase.h.

References DecayTreeFitter::ParticleBase::m_charge.

90 { return m_charge ; }
ChiSquare DecayTreeFitter::ParticleBase::chiSquare ( const FitParams fitparams) const
inherited

Definition at line 568 of file ParticleBase.cxx.

References DecayTreeFitter::FitParams::chiSquare().

Referenced by DecayTreeFitter::DecayChain::chiSquare().

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 }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
virtual int dim() const =0
double chiSquare() const
Definition: FitParams.h:51
double DecayTreeFitter::ParticleBase::chiSquareD ( const FitParams fitparams) const
virtualinherited

Definition at line 551 of file ParticleBase.cxx.

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 }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
void DecayTreeFitter::ParticleBase::collectVertexDaughters ( daucontainer particles,
int  posindex 
)
inherited

Definition at line 227 of file ParticleBase.cxx.

References name, and vtxverbose.

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 }
int vtxverbose
const_iterator begin() const
Definition: ParticleBase.h:100
const std::string & name() const
Definition: ParticleBase.h:61
virtual int posIndex() const
Definition: ParticleBase.h:69
virtual int type() const =0
const daucontainer & daughters() const
Definition: ParticleBase.h:99
const ParticleBase * mother() const
Definition: ParticleBase.h:60
ParticleBase * DecayTreeFitter::ParticleBase::createParticle ( RhoCandidate bc,
const ParticleBase mother,
const Configuration config 
)
staticinherited

Definition at line 113 of file ParticleBase.cxx.

References RhoCandidate::Charge(), fabs(), RhoCandidate::GetRecoCandidate(), DecayTreeFitter::ParticleBase::index(), RhoCandidate::IsLocked(), DecayTreeFitter::ParticleBase::name(), RhoCandidate::NDaughters(), RhoCandidate::PdgCode(), RhoCandidate::PdtEntry(), DecayTreeFitter::ParticleBase::type(), RhoCandidate::Uid(), and vtxverbose.

Referenced by DecayTreeFitter::ParticleBase::addDaughter().

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 }
RhoCandidate * particle() const
Definition: ParticleBase.h:57
PndPidCandidate * GetRecoCandidate() const
Definition: RhoCandidate.h:376
static bool isAResonance(const TParticlePDG *bc)
Int_t Uid() const
Definition: RhoCandidate.h:419
int vtxverbose
const std::string & name() const
Definition: ParticleBase.h:61
virtual int index() const
Definition: ParticleBase.h:59
Bool_t IsLocked()
Definition: RhoCandidate.h:330
const TParticlePDG * PdtEntry() const
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
virtual int type() const =0
Int_t NDaughters() const
Double_t Charge() const
Definition: RhoCandidate.h:184
const daucontainer& DecayTreeFitter::ParticleBase::daughters ( ) const
inlineinherited
daucontainer& DecayTreeFitter::ParticleBase::daughters ( )
inlineprotectedinherited

Definition at line 138 of file ParticleBase.h.

References DecayTreeFitter::ParticleBase::m_daughters.

138 { return m_daughters ; }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
virtual int DecayTreeFitter::InternalParticle::dim ( ) const
inlinevirtual

Implements DecayTreeFitter::ParticleBase.

Reimplemented in DecayTreeFitter::InteractionPoint, and DecayTreeFitter::Resonance.

Definition at line 24 of file InternalParticle.h.

References DecayTreeFitter::ParticleBase::mother().

24 { return mother() ? 8 : 7 ; }
const ParticleBase * mother() const
Definition: ParticleBase.h:60
const_iterator DecayTreeFitter::ParticleBase::end ( ) const
inlineinherited

Definition at line 101 of file ParticleBase.h.

References DecayTreeFitter::ParticleBase::m_daughters.

Referenced by DecayTreeFitter::ParticleBase::locate().

101 { return m_daughters.end() ; }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
int DecayTreeFitter::ParticleBase::eneIndex ( ) const
inlineinherited

Definition at line 80 of file ParticleBase.h.

References DecayTreeFitter::ParticleBase::hasEnergy(), and DecayTreeFitter::ParticleBase::momIndex().

80 { return hasEnergy() ? momIndex()+3 : -1 ; }
virtual int momIndex() const
Definition: ParticleBase.h:71
virtual bool hasEnergy() const
Definition: ParticleBase.h:74
virtual bool DecayTreeFitter::InternalParticle::hasEnergy ( ) const
inlinevirtual

Reimplemented from DecayTreeFitter::ParticleBase.

Definition at line 34 of file InternalParticle.h.

34 { return true ; }
bool DecayTreeFitter::ParticleBase::hasMassConstraint ( ) const
inlineprotectedinherited
virtual bool DecayTreeFitter::InternalParticle::hasPosition ( ) const
inlinevirtual

Reimplemented from DecayTreeFitter::ParticleBase.

Reimplemented in DecayTreeFitter::Resonance.

Definition at line 35 of file InternalParticle.h.

35 { return true ; }
virtual int DecayTreeFitter::ParticleBase::index ( ) const
inlinevirtualinherited
ErrCode DecayTreeFitter::ParticleBase::initCov ( FitParams fitparams) const
virtualinherited

Reimplemented in DecayTreeFitter::InteractionPoint, and DecayTreeFitter::RecoPhoton.

Definition at line 248 of file ParticleBase.cxx.

References DecayTreeFitter::FitParams::cov(), name, row, status, and vtxverbose.

Referenced by DecayTreeFitter::Fitter::add(), and DecayTreeFitter::InteractionPoint::initCov().

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 }
int row
Definition: anaLmdDigi.C:67
ParticleContainer m_daughters
Definition: ParticleBase.h:146
virtual int momIndex() const
Definition: ParticleBase.h:71
virtual int lenIndex() const
Definition: ParticleBase.h:70
virtual bool hasEnergy() const
Definition: ParticleBase.h:74
int vtxverbose
const std::string & name() const
Definition: ParticleBase.h:61
virtual int posIndex() const
Definition: ParticleBase.h:69
TMatrixDSym & cov()
Definition: FitParams.h:34
int status[10]
Definition: f_Init.h:28
ErrCode DecayTreeFitter::InternalParticle::initMom ( FitParams fitparams) const
protected

Definition at line 275 of file InternalParticle.cxx.

References DecayTreeFitter::FitParams::par(), sqrt(), DecayTreeFitter::ErrCode::success, and vtxverbose.

276 {
277  int momindex = momIndex() ;
278  // reset
279  for( int irow=0; irow<4; irow++)
280  fitparams->par(momindex+irow) = 0 ;
281 
282  // now add daughter momenta
283  for(daucontainer::const_iterator it = begin() ; it != end() ; ++it) {
284  int daumomindex = (*it)->momIndex() ;
285  double e2(0) ;
286  int maxrow = (*it)->hasEnergy() && !hasMassConstraint() ? 4 : 3 ;
287  for(int irow=0; irow<maxrow; irow++) {
288  double px = fitparams->par()(daumomindex+irow) ;
289  e2 += px*px ;
290  fitparams->par(momindex+irow) += px ;
291  }
292  if(maxrow==3) {
293  double mass = (*it)->pdtMass() ;
294  fitparams->par(momindex+3) += sqrt(e2+mass*mass) ;
295  if(vtxverbose>6){std::cout<<"InternalParticle::initMom: mass="<<mass<<", p^2="<<e2<<", E="<<sqrt(e2+mass*mass)<<" from daughter momindex "<<daumomindex<<" p=("<<fitparams->par()(daumomindex+0)<<","<<fitparams->par()(daumomindex+1)<<","<<fitparams->par()(daumomindex+2)<<")"<<std::endl;}
296  }
297  }
298  return ErrCode::success ;
299 }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
int vtxverbose
const_iterator begin() const
Definition: ParticleBase.h:100
const_iterator end() const
Definition: ParticleBase.h:101
ErrCode DecayTreeFitter::InternalParticle::initPar1 ( FitParams fitparams)
virtual

Implements DecayTreeFitter::ParticleBase.

Reimplemented in DecayTreeFitter::InteractionPoint, and DecayTreeFitter::Resonance.

Definition at line 44 of file InternalParticle.cxx.

References DecayTreeFitter::ErrCode::badsetup, DecayTreeFitter::closestPointParams(), DecayTreeFitter::compTrkTransverseMomentum(), fabs(), DecayTreeFitter::ParticleBase::kRecoTrack, mu1, name, p1, p2, DecayTreeFitter::FitParams::par(), particle, point, DecayTreeFitter::State::position(), row, DecayTreeFitter::RecoTrack::setFlightLength(), DecayTreeFitter::State::slopes(), DecayTreeFitter::RecoTrack::state(), status, and vtxverbose.

Referenced by DecayTreeFitter::InteractionPoint::initPar1().

45 {
46  // This is the most complicated part of the vertexer: an
47  // initialization that always works.
48 
49  // There are two ways out: If the RhoCandidate was vertexed
50  // before, we can rely on the existing vertex (case A). If not, we
51  // need to estimate the vertex position from the daughters; that
52  // is very complicated (case B). The momentum is always
53  // initialized from the sum of the daughter four-vectors. In the
54  // end, it doesn't really matter.
55 
56  // FIXME: Currently, this scheme does not work for B->K*D0, with
57  // D0->pi0Ks, because the D0 is initialized before there is a B
58  // vertex.
59 
60  if(vtxverbose>5){std::cout<<"InternalParticle::initPar1(): - "<<std::endl;}
61  if(vtxverbose>=3)
62  std::cout << "InternalParticle::initPar1(): "
63  << particle() << " "
64  << hasPosition() << " " << posIndex() << std::endl ;
65 
66  ErrCode status ;
67  int posindex = posIndex() ;
68 
69  // logic check: we do not want to call this routine for resonances.
70  assert( hasPosition() ) ;
71  if(vtxverbose>=3)
72  std::cout << "InternalParticle::initPar1(): assertion passed"<<std::endl;
73 
74  // Start with origin
75  for(int row=0; row<3; row++) fitparams->par()(row+posindex) = 0 ;
76 
77  // Step 1: pre-initialization of all daughters
78  for(daucontainer::const_iterator it = begin() ; it != end() ; ++it)
79  status |= (*it)->initPar1(fitparams) ;
80 
81  // Step 2: initialize the vertex. if we are lucky, we had a
82  // 'resonant' daughter, and we are already done.
83  if( fitparams->par()(posindex+0)==0 && fitparams->par()(posindex+1)==0 &&
84  fitparams->par()(posindex+2)==0 ) {
85 
86  //const RhoVector3Err* vtx(0) ;
87  RhoVector3Err vtx = particle()->DecayVtx();
88  if(vtx.Mag()>0){
89  if(vtxverbose>=3) std::cout << "InternalParticle::initPar1(): A"<<std::endl;
90  // we found an existing valid vertex. that's fine as well ...
91  //TVector3 point = vtx->position() ;
92  fitparams->par(posindex+0) = vtx.x() ;
93  fitparams->par(posindex+1) = vtx.y() ;
94  fitparams->par(posindex+2) = vtx.z() ;
95  if(vtxverbose>=2)
96  std::cout << "using existing vertex: " << vtx << std::endl ;
97 
98  } else {
99  if(vtxverbose>=3) std::cout << "InternalParticle::initPar1: B"<<std::endl;
100  // Case B: the hard way ... use the daughters to estimate the
101  // vertex. First we check if there are sufficient tracks
102  // attached to this vertex. If so, estimate the poca of the
103  // two tracks with the highest momentum. This will work for
104  // the majority of the cases. If there are not sufficient
105  // tracks, add the composites and take the two with the best
106  // doca.
107 
108  // create a vector with all daughters that constitute a
109  // 'trajectory' (ie tracks, composites and daughters of
110  // resonances.)
111  daucontainer alldaughters ;
112  collectVertexDaughters( alldaughters, posindex ) ;
113  if(vtxverbose>=3) std::cout << "InternalParticle::initPar1(): number of daughters for initializing vertex: "
114  << name() << " " << alldaughters.size() << std::endl ;
115 
116  if(vtxverbose>=3) std::cout << "InternalParticle::initPar1(): B - r?"<<std::endl;
117  // select daughters that are either charged, or have an initialized vertex
118  daucontainer vtxdaughters ;
119  std::vector<RecoTrack*> trkdaughters ;
120  for(daucontainer::const_iterator it = alldaughters.begin() ;
121  it != alldaughters.end() ; ++it) {
122  if( (*it)->type()==ParticleBase::kRecoTrack ) {
123  trkdaughters.push_back( static_cast<RecoTrack*>(*it) ) ;
124  } else if( (*it)->hasPosition() && fitparams->par((*it)->posIndex()+0)!=0 ) {
125  vtxdaughters.push_back( *it ) ;
126  }
127  }
128  if(vtxverbose>=3) std::cout << "InternalParticle::initPar1(): B -daughters?"<<std::endl;
129 
130  if( trkdaughters.size() >=2 ) {
131  if(vtxverbose>=3) std::cout << "InternalParticle::initPar1(): B -a?"<<std::endl;
132  // sort in pT. not very efficient, but it works.
133  if( trkdaughters.size()>2 )
134  std::sort(trkdaughters.begin(),trkdaughters.end(),compTrkTransverseMomentum) ;
135  // now, just take the first two ...
136  RecoTrack* dau1 = trkdaughters[0] ;
137  RecoTrack* dau2 = trkdaughters[1] ;
138 
139  //FIXME [R.K.03/2017] We at Panda don't have so many hard tracks.
140  // We
141  // get the poca of the two statevectors
142  const DecayTreeFitter::State& state1 = dau1->state() ;
143  const DecayTreeFitter::State& state2 = dau2->state() ;
144  DecayTreeFitter::Line line1(state1.position(),state1.slopes()) ;
145  DecayTreeFitter::Line line2(state2.position(),state2.slopes()) ;
146  double mu1(0),mu2(0) ;
147  DecayTreeFitter::closestPointParams(line1,line2,mu1,mu2) ;
148  TVector3 p1 = line1.position(mu1) ;
149  TVector3 p2 = line2.position(mu2) ;
150  fitparams->par()(posindex+0) = 0.5*(p1.x()+p2.x()) ;
151  fitparams->par()(posindex+1) = 0.5*(p1.y()+p2.y()) ;
152  fitparams->par()(posindex+2) = 0.5*(p1.z()+p2.z()) ;
153  dau1->setFlightLength( mu1 ) ;
154  dau2->setFlightLength( mu2 ) ;
155 
156  } else if(trkdaughters.size()+vtxdaughters.size()>=2) {
157  if(vtxverbose>=3) std::cout << "InternalParticle::initPar1(): B -b?"<<std::endl;
158  std::cout << "InternalParticle::initPar1(): InternalParticle: Trying new code!"<< std::endl ;
159  // ###################
160 
161  // that's unfortunate: no enough charged tracks from this
162  // vertex. need all daughters. create trajectories and use
163  // normal TrkPoca.
164 
165  //std::vector<LHCb::StateZTraj> trajectories ;
166  std::vector<DecayTreeFitter::Line> trajectories ;
167  for(std::vector<RecoTrack*>::const_iterator it = trkdaughters.begin() ; it != trkdaughters.end() ; ++it)
168  {
169  const DecayTreeFitter::State& state1 = (*it)->state() ;
170  trajectories.push_back( DecayTreeFitter::Line(state1.position(),state1.slopes()) );
171  //trajectories.push_back( (*it)->traj() ) ;
172  }
173 
174  //trajectories.push_back(&((*it)->particle().trkAbsFit()->traj())) ;
175 
176  //std::vector<DecayTreeFitter::Line> linetrajectories ; // store trajectories of composites
177  //linetrajectories.reserve( vtxdaughters.size() ) ;
178  for(daucontainer::const_iterator it = vtxdaughters.begin() ; it != vtxdaughters.end() ; ++it)
179  {
180  //std::cout << (*it)->particle().pdtEntry()->name() << std::endl ;
181  int dauposindex = (*it)->posIndex() ;
182  int daumomindex = (*it)->momIndex() ;
183  TVector3 point(fitparams->par()(dauposindex+0), fitparams->par()(dauposindex+1), fitparams->par()(dauposindex+2)) ;
184  TVector3 direction(fitparams->par()(daumomindex+0), fitparams->par()(daumomindex+1), fitparams->par()(daumomindex+2)) ;
185  trajectories.push_back(DecayTreeFitter::Line(point,direction) ) ;
186  //linetrajectories.push_back(DecayTreeFitter::Line(point,direction,1) ) ;
187  //trajectories.push_back(&(linetrajectories.back())) ;
188  //daupoint = point ;
189  }
190 
191  // we select the two trajectories with the best poca
192  double docabest(99999);
193  for( std::vector<DecayTreeFitter::Line>::iterator it1 = trajectories.begin() ; it1 != trajectories.end(); ++it1 )
194  {
195  for( std::vector<DecayTreeFitter::Line>::iterator it2 = trajectories.begin() ; it2 != it1; ++it2 )
196  {
197  double mu1(0),mu2(0) ;
199  TVector3 p1 = (*it1).position(mu1) ;
200  TVector3 p2 = (*it2).position(mu2) ;
201  double doca = (p1-p2).Mag();
202  if(fabs(doca)<fabs(docabest))
203  {
204  fitparams->par()(posindex+0) = 0.5*(p1.x()+p2.x()) ;
205  fitparams->par()(posindex+1) = 0.5*(p1.y()+p2.y()) ;
206  fitparams->par()(posindex+2) = 0.5*(p1.z()+p2.z()) ;
207  docabest = doca ;
208  }
209  }
210  }
211  // ###########################33
212  } else if( mother() && mother()->posIndex()>=0 ) {
213  if(vtxverbose>=3) std::cout << "InternalParticle::initPar1(): B -c?"<<std::endl;
214 
215  // let's hope the mother was initialized
216  int posindexmother = mother()->posIndex() ;
217  for(int ipos=0; ipos<3; ipos++) {
218  fitparams->par()(posindex+ipos) =
219  fitparams->par()(posindexmother+ipos) ;
220  }
221  } else {
222  if(vtxverbose>=3) std::cout << "InternalParticle::initPar1(): B -d?"<<std::endl;
223  // something is wrong!
224  std::cout << "InternalParticle::initPar1(): There are not sufficient geometric constraints to fit "
225  << "this decay tree. Perhaps you should add a beam constraint. "
226  << std::endl ;
227  //<< particle().constraint(BtaConstraint::Beam)
228  // << std::endl
229  // << treeprinter.print(*bc()) << endmsg ;
230  status |= ErrCode::badsetup ;
231  }
232  if(vtxverbose>=3) std::cout << "InternalParticle::initPar1(): C ?"<<std::endl;
233  }
234  }
235  if(vtxverbose>=3)
236  std::cout << "InternalParticle::initPar1(): big code chunk passed"<<std::endl;
237 
238  // step 3: do the post initialization step of all daughters
239  if(vtxverbose>5){std::cout<<"InternalParticle::initPar1(): - calling all initPar2()"<<std::endl;}
240  for(daucontainer::const_iterator it = daughters().begin() ;
241  it != daughters().end() ; ++it)
242  (*it)->initPar2(fitparams) ;
243 
244  // step 4: initialize the momentum by adding up the daughter 4-vectors
245  initMom(fitparams) ;
246 
247  if(vtxverbose>=3)
248  std::cout << "InternalParticle::initPar1(): End of initpar: "
249  << name() << " fitpar pos("
250  << fitparams->par()(posindex+0) << ","
251  << fitparams->par()(posindex+1) << ","
252  << fitparams->par()(posindex+2) << ")" << std::endl ;
253 
254  return status ;
255 }
int row
Definition: anaLmdDigi.C:67
RhoCandidate * particle() const
Definition: ParticleBase.h:57
TVector3 position() const
Definition: State.h:82
double mu1
Definition: reco_analys2.C:56
int vtxverbose
const_iterator begin() const
Definition: ParticleBase.h:100
void collectVertexDaughters(daucontainer &particles, int posindex)
const std::string & name() const
Definition: ParticleBase.h:61
virtual int posIndex() const
Definition: ParticleBase.h:69
const_iterator end() const
Definition: ParticleBase.h:101
void setFlightLength(double flt)
Definition: RecoTrack.h:53
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
TPad * p2
Definition: hist-t7.C:117
ErrCode initMom(FitParams *fitparams) const
std::vector< ParticleBase * > daucontainer
Definition: ParticleBase.h:96
bool compTrkTransverseMomentum(const RecoTrack *lhs, const RecoTrack *rhs)
Definition: SortTool.h:37
const daucontainer & daughters() const
Definition: ParticleBase.h:99
TPad * p1
Definition: hist-t7.C:116
virtual bool hasPosition() const
RhoVector3Err DecayVtx()
Definition: RhoCandidate.h:288
bool closestPointParams(const Line &line0, const Line &line1, double &mu0, double &mu1)
Definition: LineTool.h:67
const ParticleBase * mother() const
Definition: ParticleBase.h:60
const DecayTreeFitter::State & state() const
Definition: RecoTrack.h:56
int status[10]
Definition: f_Init.h:28
TVector3 slopes() const
Definition: State.h:88
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72
ErrCode DecayTreeFitter::InternalParticle::initPar2 ( FitParams fitparams)
virtual

Implements DecayTreeFitter::ParticleBase.

Reimplemented in DecayTreeFitter::Resonance.

Definition at line 258 of file InternalParticle.cxx.

References DecayTreeFitter::FitParams::par(), and vtxverbose.

259 {
260  if(vtxverbose>5){std::cout<<"InternalParticle::initPar2: - "<<std::endl;}
261  // FIXME: in the unfortunate case (the B-->D0K*- above) that our
262  // vertex is still the origin, we copy the mother vertex.
263  int posindex = posIndex() ;
264  if( hasPosition() && mother() && fitparams->par(posindex+0)==0 &&
265  fitparams->par(posindex+1)==0 && fitparams->par(posindex+2)==0 ) {
266  int posindexmom = mother()->posIndex() ;
267  for(int irow=0; irow<3; irow++)
268  fitparams->par(posindex+irow) = fitparams->par(posindexmom+irow) ;
269  }
270  // step 5: initialize the lifetime
271  return initTau(fitparams) ;
272 }
int vtxverbose
virtual int posIndex() const
Definition: ParticleBase.h:69
ErrCode initTau(FitParams *par) const
virtual bool hasPosition() const
const ParticleBase * mother() const
Definition: ParticleBase.h:60
ErrCode DecayTreeFitter::ParticleBase::initTau ( FitParams par) const
protectedinherited

Definition at line 522 of file ParticleBase.cxx.

References mom, DecayTreeFitter::FitParams::par(), DecayTreeFitter::ParticleBase::posIndex(), and DecayTreeFitter::ErrCode::success.

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 }
virtual int momIndex() const
Definition: ParticleBase.h:71
virtual int lenIndex() const
Definition: ParticleBase.h:70
Double_t mom
Definition: plot_dirc.C:14
virtual int posIndex() const
Definition: ParticleBase.h:69
virtual bool hasPosition() const
Definition: ParticleBase.h:78
const ParticleBase * mother() const
Definition: ParticleBase.h:60
bool DecayTreeFitter::ParticleBase::isAResonance ( const TParticlePDG *  bc)
staticprotectedinherited

Definition at line 205 of file ParticleBase.cxx.

References C(), and vtxverbose.

205  {
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 }
int Pic_FED Eff_lEE C()
int vtxverbose
virtual int DecayTreeFitter::InternalParticle::lenIndex ( ) const
inlinevirtual

Reimplemented from DecayTreeFitter::ParticleBase.

Reimplemented in DecayTreeFitter::Resonance.

Definition at line 32 of file InternalParticle.h.

References DecayTreeFitter::ParticleBase::index(), and DecayTreeFitter::ParticleBase::mother().

32 { return mother() ? index()+3 : -1 ; }
virtual int index() const
Definition: ParticleBase.h:59
const ParticleBase * mother() const
Definition: ParticleBase.h:60
const ParticleBase * DecayTreeFitter::ParticleBase::locate ( RhoCandidate bc) const
inherited

Definition at line 353 of file ParticleBase.cxx.

References DecayTreeFitter::ParticleBase::end(), and DecayTreeFitter::ParticleBase::locate().

Referenced by DecayTreeFitter::Fitter::decayLengthSum(), DecayTreeFitter::DecayChain::locate(), DecayTreeFitter::ParticleBase::locate(), DecayTreeFitter::Fitter::name(), and DecayTreeFitter::Fitter::updateCand().

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 }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
const ParticleBase * locate(RhoCandidate *bc) const
void DecayTreeFitter::ParticleBase::makeName ( RhoCandidate bc)
protectedinherited
virtual int DecayTreeFitter::InternalParticle::momIndex ( ) const
inlinevirtual

Reimplemented from DecayTreeFitter::ParticleBase.

Reimplemented in DecayTreeFitter::Resonance.

Definition at line 33 of file InternalParticle.h.

References DecayTreeFitter::ParticleBase::index(), and DecayTreeFitter::ParticleBase::mother().

33 { return mother() ? index()+4 : index() + 3 ; }
virtual int index() const
Definition: ParticleBase.h:59
const ParticleBase * mother() const
Definition: ParticleBase.h:60
const ParticleBase* DecayTreeFitter::ParticleBase::mother ( ) const
inlineinherited
const std::string& DecayTreeFitter::ParticleBase::name ( ) const
inlineinherited
int DecayTreeFitter::ParticleBase::nFinalChargedCandidates ( ) const
virtualinherited

Reimplemented in DecayTreeFitter::RecoTrack.

Definition at line 560 of file ParticleBase.cxx.

Referenced by DecayTreeFitter::sortByType().

560  {
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 }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
std::string DecayTreeFitter::InternalParticle::parname ( int  index) const
virtual

Reimplemented from DecayTreeFitter::ParticleBase.

Reimplemented in DecayTreeFitter::Resonance.

Definition at line 539 of file InternalParticle.cxx.

References DecayTreeFitter::ParticleBase::parname().

540 {
541  int id = thisindex ;
542  // skip the lifetime parameter if there is no mother
543  if(!mother() && id>=3) ++id ;
544  return ParticleBase::parname(id) ;
545 }
virtual std::string parname(int index) const
const ParticleBase * mother() const
Definition: ParticleBase.h:60
RhoCandidate* DecayTreeFitter::ParticleBase::particle ( ) const
inlineinherited
double DecayTreeFitter::ParticleBase::pdtCLifeTime ( ) const
inlineinherited

Definition at line 88 of file ParticleBase.h.

References DecayTreeFitter::ParticleBase::m_pdtCLifeTime.

88 { return m_pdtCLifeTime ; }
static double DecayTreeFitter::ParticleBase::pdtCLifeTime ( RhoCandidate bc)
staticprotectedinherited
double DecayTreeFitter::ParticleBase::pdtMass ( ) const
inlineinherited
double DecayTreeFitter::ParticleBase::pdtTau ( ) const
inlineinherited
double DecayTreeFitter::ParticleBase::pdtWidth ( ) const
inlineinherited

Definition at line 87 of file ParticleBase.h.

References DecayTreeFitter::ParticleBase::m_pdtWidth.

87 { return m_pdtWidth ; }
virtual int DecayTreeFitter::InternalParticle::posIndex ( ) const
inlinevirtual

Reimplemented from DecayTreeFitter::ParticleBase.

Reimplemented in DecayTreeFitter::Resonance.

Definition at line 31 of file InternalParticle.h.

References DecayTreeFitter::ParticleBase::index().

31 { return index() ; }
virtual int index() const
Definition: ParticleBase.h:59
void DecayTreeFitter::ParticleBase::print ( const FitParams fitpar) const
virtualinherited

Definition at line 309 of file ParticleBase.cxx.

References DecayTreeFitter::FitParams::cov(), i, name, DecayTreeFitter::FitParams::par(), pz, and sqrt().

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 }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
virtual int dim() const =0
virtual int momIndex() const
Definition: ParticleBase.h:71
virtual bool hasEnergy() const
Definition: ParticleBase.h:74
const std::string & name() const
Definition: ParticleBase.h:61
virtual int index() const
Definition: ParticleBase.h:59
virtual std::string parname(int index) const
virtual int type() const =0
double pz[39]
Definition: pipisigmas.h:14
TMatrixDSym & cov()
Definition: FitParams.h:34
ErrCode DecayTreeFitter::InternalParticle::projectConstraint ( Constraint::Type  type,
const FitParams fitparams,
Projection p 
) const
virtual

else

Reimplemented from DecayTreeFitter::ParticleBase.

Reimplemented in DecayTreeFitter::InteractionPoint.

Definition at line 419 of file InternalParticle.cxx.

References DecayTreeFitter::Constraint::conversion, DecayTreeFitter::Constraint::geometric, DecayTreeFitter::Projection::H(), DecayTreeFitter::Constraint::kinematic, DecayTreeFitter::Constraint::lifetime, DecayTreeFitter::Constraint::mass, DecayTreeFitter::Constraint::massEnergy, RhoCalculationTools::PrintMatrix(), DecayTreeFitter::ParticleBase::projectConstraint(), DecayTreeFitter::Projection::r(), DecayTreeFitter::Projection::V(), and vtxverbose.

Referenced by DecayTreeFitter::InteractionPoint::projectConstraint().

422 {
423  ErrCode aStatus ;
424  switch(aType) {
425  case Constraint::mass:
427  // if( m_daughters.size()==2 &&
428  // !m_daughters.front()->hasEnergy() &&
429  // !m_daughters.back()->hasEnergy() )
430  // aStatus |= projectMassConstraintTwoBody(fitparams,p) ;
432  aStatus |= projectMassConstraint(fitparams,p) ;
433  //chisq = filterMassConstraintOnDaughters(fitpar) ;
434  break ;
436  aStatus |= projectGeoConstraint(fitparams,p) ;
437  break ;
439  aStatus |= projectKineConstraint(fitparams,p) ;
440  break ;
442  aStatus |= projectLifeTimeConstraint(fitparams,p) ;
443  break ;
445  aStatus |= projectConversionConstraint(fitparams,p) ;
446  break ;
447  default:
448  aStatus |= ParticleBase::projectConstraint(aType,fitparams,p) ;
449  }
450  if(vtxverbose>6){
451  std::cout<<"InternalParticle::projectConstraint(): projection is:"<<std::endl;
452  std::cout<<"r "; p.r().Print();
453  std::cout<<"V "; p.V().Print();
454  std::cout<<"H "; RhoCalculationTools::PrintMatrix(p.H());
455  }
456  return aStatus ;
457 }
const TVectorD & r() const
Definition: Projection.h:37
ErrCode projectConversionConstraint(const FitParams *, Projection &p) const
ErrCode projectLifeTimeConstraint(const FitParams *, Projection &) const
const TMatrixD & H() const
Definition: Projection.h:28
virtual ErrCode projectGeoConstraint(const FitParams *, Projection &) const
const TMatrixDSym & V() const
Definition: Projection.h:47
int vtxverbose
ErrCode projectKineConstraint(const FitParams *, Projection &) const
static void PrintMatrix(TMatrixT< double > m)
virtual ErrCode projectConstraint(Constraint::Type, const FitParams *, Projection &) const
virtual ErrCode projectMassConstraint(const FitParams *, Projection &) const
ErrCode DecayTreeFitter::InternalParticle::projectConversionConstraint ( const FitParams fitparams,
Projection p 
) const

Definition at line 383 of file InternalParticle.cxx.

References DecayTreeFitter::Projection::H(), DecayTreeFitter::ParticleBase::momIndex(), DecayTreeFitter::FitParams::par(), DecayTreeFitter::Projection::r(), sqrt(), DecayTreeFitter::ErrCode::success, and vtxverbose.

385 {
386  if(vtxverbose>6){std::cout<<"InternalParticle::projectConversionConstraint():"<<std::endl;}
387  // only works if there are two daughters. constraint those to be parallel:
388  // p1.in(p2) - |p1||p2|=0
389  assert(m_isconversion) ;
390  const ParticleBase* dauA = daughters()[0] ;
391  const ParticleBase* dauB = daughters()[1] ;
392  int daumomindexA = dauA->momIndex() ;
393  int daumomindexB = dauB->momIndex() ;
394 
395  // first calculate the total momenta
396  double momA2(0),momB2(0) ;
397  for(int irow=0; irow<3; irow++) {
398  double pxA = fitparams->par(daumomindexA+irow) ;
399  momA2 += pxA*pxA ;
400  double pxB = fitparams->par(daumomindexB+irow) ;
401  momB2 += pxB*pxB ;
402  }
403  double momA(sqrt(momA2)), momB(sqrt(momB2)) ;
404 
405  // now fill r and H
406  p.r(1) = -momA*momB ;
407  for(int irow=0; irow<3; irow++) {
408  double pxA = fitparams->par(daumomindexA+irow) ;
409  double pxB = fitparams->par(daumomindexB+irow) ;
410  p.r(1) += pxA*pxB ;
411  p.H(1,daumomindexA+irow) = pxB - pxA/momA * momB ;
412  p.H(1,daumomindexB+irow) = pxA - pxB/momB * momA ;
413  }
414 
415  return ErrCode::success ;
416 }
const TVectorD & r() const
Definition: Projection.h:37
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
virtual int momIndex() const
Definition: ParticleBase.h:71
const TMatrixD & H() const
Definition: Projection.h:28
int vtxverbose
const daucontainer & daughters() const
Definition: ParticleBase.h:99
ErrCode DecayTreeFitter::ParticleBase::projectGeoConstraint ( const FitParams fitparams,
Projection p 
) const
virtualinherited

Definition at line 387 of file ParticleBase.cxx.

References DecayTreeFitter::Projection::H(), mom, p2, DecayTreeFitter::FitParams::par(), RhoCalculationTools::PrintMatrix(), pz, DecayTreeFitter::Projection::r(), row, sqrt(), DecayTreeFitter::ErrCode::success, DecayTreeFitter::Projection::V(), and vtxverbose.

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 }
int row
Definition: anaLmdDigi.C:67
const TVectorD & r() const
Definition: Projection.h:37
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
virtual int momIndex() const
Definition: ParticleBase.h:71
virtual int lenIndex() const
Definition: ParticleBase.h:70
Double_t mom
Definition: plot_dirc.C:14
const TMatrixD & H() const
Definition: Projection.h:28
const TMatrixDSym & V() const
Definition: Projection.h:47
int vtxverbose
virtual int posIndex() const
Definition: ParticleBase.h:69
static void PrintMatrix(TMatrixT< double > m)
TPad * p2
Definition: hist-t7.C:117
const ParticleBase * mother() const
Definition: ParticleBase.h:60
double pz[39]
Definition: pipisigmas.h:14
ErrCode DecayTreeFitter::InternalParticle::projectKineConstraint ( const FitParams fitparams,
Projection p 
) const

Definition at line 302 of file InternalParticle.cxx.

References cos(), energy, fabs(), DecayTreeFitter::Projection::H(), lambda(), DecayTreeFitter::FitParams::par(), DecayTreeFitter::Projection::r(), sin(), sqrt(), DecayTreeFitter::ErrCode::success, and vtxverbose.

304 {
305  if(vtxverbose>6){std::cout<<"InternalParticle::projectKineConstraint():"<<std::endl;}
306  // these are in fact four independent constraints. i'll filter
307  // them as one, making the code simpler at the expense of a bit of
308  // CPU.
309 
310  // first add the mother
311  int momindex = momIndex() ;
312  for(int imom=0; imom<4; imom++) {
313  p.r(imom) = fitparams->par()(momindex+imom) ;
314  p.H(imom,momindex+imom) = 1 ;
315  }
316 
317  // now add the daughters
318  for(daucontainer::const_iterator it = daughters().begin() ;
319  it != daughters().end() ; ++it) {
320  int daulenindex = (*it)->lenIndex() ;
321  int daumomindex = (*it)->momIndex() ;
322  double mass = (*it)->pdtMass() ;
323  double e2=mass*mass ;
324  int maxrow = (*it)->hasEnergy() ? 4 : 3 ;
325  for(int imom=0; imom<maxrow; ++imom) {
326  double px = fitparams->par()(daumomindex+imom) ;
327  e2 += px*px ;
328  p.r(imom) += -px ;
329  p.H(imom,daumomindex+imom) = -1 ;
330  }
331 
332  if(maxrow==3) {
333  // treat the energy for particles that are parameterized with p3
334  double energy = sqrt(e2) ;
335  p.r(3) += -energy ;
336  for(int jmom=0; jmom<3; ++jmom) {
337  double px = fitparams->par()(daumomindex+jmom) ;
338  p.H(3,daumomindex+jmom) = -px/energy ;
339  }
340  } else if(false && daulenindex>=0 && (*it)->charge()!=0) {
341 //FIXME: test and reactivate decay length!
342  double tau = fitparams->par()(daulenindex) ;
343  double lambda = bFieldOverC() * (*it)->charge() ;
344  double px0 = fitparams->par()(daumomindex) ;
345  double py0 = fitparams->par()(daumomindex+1) ;
346  double pt0 = sqrt(px0*px0+py0*py0) ;
347  const double posprecision = 1e-4 ; // 1mu
348  if( fabs(pt0*lambda*tau*tau) > posprecision ) {
349  double sinlt = sin(lambda*tau) ;
350  double coslt = cos(lambda*tau) ;
351  double px = px0*coslt - py0*sinlt ;
352  double py = py0*coslt + px0*sinlt ;
353  p.r(0) += px0 - px ;
354  p.r(1) += py0 - py ;
355  p.H(0,daumomindex+0) += 1 - coslt ;
356  p.H(0,daumomindex+1) += sinlt ;
357  p.H(0,daulenindex+0) += lambda*py ;
358  p.H(1,daumomindex+0) += -sinlt ;
359  p.H(1,daumomindex+1) += 1 - coslt ;
360  p.H(1,daulenindex+0) += -lambda*px ;
361  }
362  }
363  }
364  return ErrCode::success ;
365 }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
const TVectorD & r() const
Definition: Projection.h:37
Double_t lambda(Double_t x, Double_t y, Double_t z)
Definition: drawdal.C:48
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
const TMatrixD & H() const
Definition: Projection.h:28
int vtxverbose
const_iterator begin() const
Definition: ParticleBase.h:100
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
const daucontainer & daughters() const
Definition: ParticleBase.h:99
Double_t energy
Definition: plot_dirc.C:15
ErrCode DecayTreeFitter::InternalParticle::projectLifeTimeConstraint ( const FitParams ,
Projection  
) const

Definition at line 368 of file InternalParticle.cxx.

References DecayTreeFitter::ErrCode::success, and vtxverbose.

370 {
371  if(vtxverbose>6){std::cout<<"InternalParticle::projectLifeTimeConstraint():"<<std::endl;}
372  std::cout << "Not yet implemented lifetime constraint!" << std::endl ;
373  // int lenindex = lenIndex() ;
374  // assert(lenindex>=0) ;
375  // double tau = pdtTau() ;
376  // p.r(0) = fitparams->par()(lenindex) - tau ;
377  // p.Vfast(0,0) = tau*tau ;
378  // p.H(0,lenindex) = 1 ;
379  return ErrCode::success ;
380 }
int vtxverbose
ErrCode DecayTreeFitter::ParticleBase::projectMassConstraint ( const FitParams fitparams,
Projection p 
) const
virtualinherited

Definition at line 477 of file ParticleBase.cxx.

References DecayTreeFitter::Projection::H(), DecayTreeFitter::FitParams::par(), pz, DecayTreeFitter::Projection::r(), DecayTreeFitter::ErrCode::success, DecayTreeFitter::Projection::Vfast(), and vtxverbose.

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 }
const TVectorD & r() const
Definition: Projection.h:37
virtual int momIndex() const
Definition: ParticleBase.h:71
const TMatrixD & H() const
Definition: Projection.h:28
int vtxverbose
double pz[39]
Definition: pipisigmas.h:14
double & Vfast(int row, int col)
Definition: Projection.h:50
ErrCode DecayTreeFitter::InternalParticle::projectMassConstraintTwoBody ( const FitParams fitparams,
Projection p 
) const

Definition at line 459 of file InternalParticle.cxx.

References DecayTreeFitter::Projection::H(), DecayTreeFitter::ParticleBase::hasEnergy(), m2(), DecayTreeFitter::ParticleBase::momIndex(), DecayTreeFitter::FitParams::par(), DecayTreeFitter::ParticleBase::pdtMass(), DecayTreeFitter::Projection::r(), sqrt(), DecayTreeFitter::ErrCode::success, DecayTreeFitter::Projection::Vfast(), and vtxverbose.

461 {
462  if(vtxverbose>6){std::cout<<"InternalParticle::projectMassConstraintTwoBody():"<<std::endl;}
463  // we can also apply the constraint to the daughters. that may
464  // work better if the opening angle is small.
465 
466  // m^2 = ma^1 + mb^2 + 2 * (Ea*Eb - pxa*pxb - pya*pyb - pza*pzb )
467 
468  ParticleBase* d1 = daughters()[0] ;
469  ParticleBase* d2 = daughters()[1] ;
470 
471  assert(d1->hasEnergy()==false && d2->hasEnergy()==false ) ;
472 
473  double mass = pdtMass() ;
474  double m1 = d1->pdtMass() ;
475  double m2 = d2->pdtMass() ;
476 
477  int momindex1 = d1->momIndex() ;
478  int momindex2 = d2->momIndex() ;
479 
480  // initialize the value
481  double px1 = fitparams->par()(momindex1+0) ;
482  double py1 = fitparams->par()(momindex1+1) ;
483  double pz1 = fitparams->par()(momindex1+2) ;
484 
485  double px2 = fitparams->par()(momindex2+0) ;
486  double py2 = fitparams->par()(momindex2+1) ;
487  double pz2 = fitparams->par()(momindex2+2) ;
488 
489  double E1 = std::sqrt( m1*m1 + px1*px1 + py1*py1 + pz1*pz1 ) ;
490  double E2 = std::sqrt( m2*m2 + px2*px2 + py2*py2 + pz2*pz2 ) ;
491 
492  p.r(0) = m1*m1 + m2*m2 + 2 * (E1*E2 - px1*px2 - py1*py2 - pz1*pz2 ) - mass* mass ;
493 
494  // calculate the projection matrix
495  p.H(0,momindex1+0) = 2 * (E2 * px1/E1 - px2 ) ;
496  p.H(0,momindex1+1) = 2 * (E2 * py1/E1 - py2 ) ;
497  p.H(0,momindex1+2) = 2 * (E2 * pz1/E1 - pz2 ) ;
498  p.H(0,momindex2+0) = 2 * (E1 * px2/E2 - px1 ) ;
499  p.H(0,momindex2+1) = 2 * (E1 * py2/E2 - py1 ) ;
500  p.H(0,momindex2+2) = 2 * (E1 * pz2/E2 - pz1 ) ;
501 
502  // set the variance in the residual
503  double width = pdtWidth() ;
504  p.Vfast(0,0) = 4*mass*mass*width*width ;
505 
506  return ErrCode::success ;
507 }
const TVectorD & r() const
Definition: Projection.h:37
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
virtual int momIndex() const
Definition: ParticleBase.h:71
virtual bool hasEnergy() const
Definition: ParticleBase.h:74
const TMatrixD & H() const
Definition: Projection.h:28
int vtxverbose
TString m2(TString pts, TString exts="e px py pz")
Definition: invexp.C:117
const daucontainer & daughters() const
Definition: ParticleBase.h:99
double & Vfast(int row, int col)
Definition: Projection.h:50
void DecayTreeFitter::ParticleBase::removeDaughter ( const ParticleBase pb)
inherited

Definition at line 100 of file ParticleBase.cxx.

Referenced by DecayTreeFitter::Fitter::remove().

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 }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
void DecayTreeFitter::ParticleBase::retrieveIndexMap ( indexmap anindexmap) const
virtualinherited

Definition at line 377 of file ParticleBase.cxx.

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 }
ParticleContainer m_daughters
Definition: ParticleBase.h:146
virtual int index() const
Definition: ParticleBase.h:59
void DecayTreeFitter::ParticleBase::setIndex ( int  i)
inlineprotectedinherited

Definition at line 141 of file ParticleBase.h.

References i, and DecayTreeFitter::ParticleBase::m_index.

141 { m_index = i ; }
Int_t i
Definition: run_full.C:25
bool DecayTreeFitter::ParticleBase::setMassConstraint ( bool  add)
inlineinherited

Definition at line 118 of file ParticleBase.h.

References DecayTreeFitter::ParticleBase::m_hasMassConstraint.

Referenced by DecayTreeFitter::DecayChain::setMassConstraint().

118  {
119  std::swap(add,m_hasMassConstraint) ;
120  return add != m_hasMassConstraint ;
121  }
void DecayTreeFitter::ParticleBase::setMassConstraint ( double  mass)
inlineinherited
void DecayTreeFitter::ParticleBase::setMother ( const ParticleBase m)
inlineinherited

Definition at line 108 of file ParticleBase.h.

References m, and DecayTreeFitter::ParticleBase::m_mother.

108 { m_mother = m ; }
__m128 m
Definition: P4_F32vec4.h:28
const ParticleBase * m_mother
Definition: ParticleBase.h:145
void DecayTreeFitter::ParticleBase::setName ( const std::string &  n)
inlineprotectedinherited

Definition at line 142 of file ParticleBase.h.

References DecayTreeFitter::ParticleBase::m_name, and n.

142 { m_name = n ; }
int n
void DecayTreeFitter::ParticleBase::setParticle ( RhoCandidate bc)
inlineinherited

Definition at line 113 of file ParticleBase.h.

References DecayTreeFitter::ParticleBase::m_particle.

113 { m_particle = bc ; }
virtual int DecayTreeFitter::InternalParticle::type ( ) const
inlinevirtual
void DecayTreeFitter::ParticleBase::updateIndex ( int &  offset)
virtualinherited

Definition at line 83 of file ParticleBase.cxx.

References offset(), and vtxverbose.

Referenced by DecayTreeFitter::Fitter::add(), and DecayTreeFitter::DecayChain::DecayChain().

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 }
virtual int dim() const =0
TVector3 offset(2, 0, 0)
int vtxverbose
const_iterator begin() const
Definition: ParticleBase.h:100
daucontainer::const_iterator const_iterator
Definition: ParticleBase.h:97
const_iterator end() const
Definition: ParticleBase.h:101

Member Data Documentation

bool DecayTreeFitter::InternalParticle::m_isconversion
private

Definition at line 54 of file InternalParticle.h.

Referenced by InternalParticle().

bool DecayTreeFitter::InternalParticle::m_lifetimeconstraint
private

Definition at line 53 of file InternalParticle.h.

Referenced by InternalParticle().


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