FairRoot/PandaRoot
RhoFitterBase.h
Go to the documentation of this file.
1 #ifndef RHOFITTERBASE_H
2 #define RHOFITTERBASE_H
3 // //
5 // RhoFitterBase //
6 // //
7 // Abstract class for composite particle fitting //
8 // //
9 // Author: Marcel Kunze, RUB, Feb. 99 //
10 // Copyright (C) 1999-2001, Ruhr-University Bochum. //
11 // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) //
12 // //
14 
15 #include<map>
16 #include "TObject.h"
17 #include "TVectorD.h"
18 #include "TMath.h"
19 #include "RhoCandidate.h"
20 
21 class RhoFitterBase: public TObject // TOperatorBase
22 {
23  public:
24 
29  RhoFitterBase ( RhoCandidate* decayTree );
30  // copy constructor
31  RhoFitterBase ( const RhoFitterBase& );
32 
33  // destructor
35 
39  Bool_t Fit(); // fit only the head composite (node)
40  Bool_t FitAll(); // fit composites and refitted daughters. FMV, 07/21/99.
41 
45 // const RhoCandidate* FittedCand ( const RhoCandidate& ) const;
46 // RhoCandidate GetFitted ( const RhoCandidate& ) const;
47  double Chi2Contribution ( const RhoCandidate* ) ;
48  double GetChi2() const {return fChiSquare;};
49  int GetNdf() const {return fNDegreesOfFreedom;};
50  double GetProb() const {return TMath::Prob(fChiSquare,fNDegreesOfFreedom);};
51 
52  inline void SetVerbose(Bool_t v=kTRUE) {fVerbose=v;}
53 
54  protected:
55 
56  // the decay tree
57  RhoCandidate& HeadOfTree() const { return *fHeadOfTree; }
59  virtual Bool_t FitNode(RhoCandidate* b); // fit one decay in the tree.
60 
61  // the clone of the tree.
64  //Bool_t CopyDaughters ( RhoCandidate* );
66  void InsertChi2 ( const RhoCandidate* bc,const double chi2 ) {fChi2Map[ bc->Uid()] = chi2;}
67 
68  //Helpers for final state fitting
69  std::vector<RhoCandidate*> fDaughters;
73  void SetDecayVertex(RhoCandidate* composite, const TVector3& vtx, const TMatrixD& CovVV);
74  double fChiSquare; //global chi^2 value
75  int fNDegreesOfFreedom; //degrees of freedom
76 
77 
78  private:
79  // helper function
80  std::map<Int_t,Double_t> fChi2Map;
81  Bool_t IterateAndFit(RhoCandidate* b); // iterate the decay tree and fit each node recoursively
82 
83 
84  public:
85  ClassDef ( RhoFitterBase,1 ) //Base class for fitters
86 };
87 
88 #endif
virtual Bool_t FitNode(RhoCandidate *b)
TTree * b
void FindAndAddFinalStateDaughters(RhoCandidate *cand)
Int_t Uid() const
Definition: RhoCandidate.h:419
RhoCandidate & HeadOfTree() const
Definition: RhoFitterBase.h:57
__m128 v
Definition: P4_F32vec4.h:4
void SetFourMomentumByDaughters(RhoCandidate *composite)
std::map< Int_t, Double_t > fChi2Map
! each particle&#39;s contribution to the chi^2
Definition: RhoFitterBase.h:80
double Chi2Contribution(const RhoCandidate *)
double GetProb() const
Definition: RhoFitterBase.h:50
std::vector< RhoCandidate * > fDaughters
Definition: RhoFitterBase.h:69
void SetVerbose(Bool_t v=kTRUE)
Definition: RhoFitterBase.h:52
RhoCandidate * fHeadOfTree
Definition: RhoFitterBase.h:62
double fChiSquare
Definition: RhoFitterBase.h:74
Bool_t IterateAndFit(RhoCandidate *b)
double GetChi2() const
Definition: RhoFitterBase.h:48
RhoCandidate * CopyTree(RhoCandidate *)
RhoCandidate * CopyCand(RhoCandidate *)
uppermost particle composite in tree
void SetDaugthersFromComposite(RhoCandidate *cand)
void SetDecayVertex(RhoCandidate *composite, const TVector3 &vtx, const TMatrixD &CovVV)
void InsertChi2(const RhoCandidate *bc, const double chi2)
Definition: RhoFitterBase.h:66
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
int GetNdf() const
Definition: RhoFitterBase.h:49
int fNDegreesOfFreedom
Definition: RhoFitterBase.h:75