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:
28  RhoFitterBase(RhoCandidate *decayTree);
29  // copy constructor
31 
32  // destructor
34 
38  Bool_t Fit(); // fit only the head composite (node)
39  Bool_t FitAll(); // fit composites and refitted daughters. FMV, 07/21/99.
40 
44  // const RhoCandidate* FittedCand ( const RhoCandidate& ) const;
45  // RhoCandidate GetFitted ( const RhoCandidate& ) const;
46  double Chi2Contribution(const RhoCandidate *);
47  double GetChi2() const { return fChiSquare; };
48  int GetNdf() const { return fNDegreesOfFreedom; };
49  double GetProb() const { return TMath::Prob(fChiSquare, fNDegreesOfFreedom); };
50 
51  inline void SetVerbose(Bool_t v = kTRUE) { fVerbose = v; }
52 
53  protected:
54  // the decay tree
55  RhoCandidate &HeadOfTree() const { return *fHeadOfTree; }
56  Bool_t fVerbose;
57  virtual Bool_t FitNode(RhoCandidate *b); // fit one decay in the tree.
58 
59  // the clone of the tree.
62  // Bool_t CopyDaughters ( RhoCandidate* );
64  void InsertChi2(const RhoCandidate *bc, const double chi2) { fChi2Map[bc->Uid()] = chi2; }
65 
66  // Helpers for final state fitting
67  std::vector<RhoCandidate *> fDaughters;
71  void SetDecayVertex(RhoCandidate *composite, const TVector3 &vtx, const TMatrixD &CovVV);
72  double fChiSquare; // global chi^2 value
73  int fNDegreesOfFreedom; // degrees of freedom
74 
75  private:
76  // helper function
77  std::map<Int_t, Double_t> fChi2Map;
78  Bool_t IterateAndFit(RhoCandidate *b); // iterate the decay tree and fit each node recoursively
79 
80  public:
81  ClassDef(RhoFitterBase, 1) // Base class for fitters
82 };
83 
84 #endif
Bool_t FitAll()
Int_t Uid() const
Definition: RhoCandidate.h:416
double GetChi2() const
Definition: RhoFitterBase.h:47
double Chi2Contribution(const RhoCandidate *)
void FindAndAddFinalStateDaughters(RhoCandidate *cand)
RhoCandidate * CopyTree(RhoCandidate *)
__m128 v
Definition: P4_F32vec4.h:3
void SetFourMomentumByDaughters(RhoCandidate *composite)
double GetProb() const
Definition: RhoFitterBase.h:49
RhoCandidate * CopyCand(RhoCandidate *)
uppermost particle composite in tree
void SetVerbose(Bool_t v=kTRUE)
Definition: RhoFitterBase.h:51
std::vector< RhoCandidate * > fDaughters
Definition: RhoFitterBase.h:67
RhoCandidate * fHeadOfTree
Definition: RhoFitterBase.h:60
virtual Bool_t FitNode(RhoCandidate *b)
double fChiSquare
Definition: RhoFitterBase.h:72
int GetNdf() const
Definition: RhoFitterBase.h:48
RhoCandidate & HeadOfTree() const
Definition: RhoFitterBase.h:55
void SetDaugthersFromComposite(RhoCandidate *cand)
void SetDecayVertex(RhoCandidate *composite, const TVector3 &vtx, const TMatrixD &CovVV)
Bool_t Fit()
void InsertChi2(const RhoCandidate *bc, const double chi2)
Definition: RhoFitterBase.h:64
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
int fNDegreesOfFreedom
Definition: RhoFitterBase.h:73