PandaRoot
RhoFitterBase.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef RHOFITTERBASE_H
14 #define RHOFITTERBASE_H
15 // //
17 // RhoFitterBase //
18 // //
19 // Abstract class for composite particle fitting //
20 // //
21 // Author: Marcel Kunze, RUB, Feb. 99 //
22 // Copyright (C) 1999-2001, Ruhr-University Bochum. //
23 // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) //
24 // //
26 
27 #include <map>
28 #include "TObject.h"
29 #include "TVectorD.h"
30 #include "TMath.h"
31 #include "RhoCandidate.h"
32 
33 class RhoFitterBase : public TObject // TOperatorBase
34 {
35  public:
40  RhoFitterBase(RhoCandidate *decayTree);
41  // copy constructor
43 
44  // destructor
46 
50  Bool_t Fit(); // fit only the head composite (node)
51  Bool_t FitAll(); // fit composites and refitted daughters. FMV, 07/21/99.
52 
56  // const RhoCandidate* FittedCand ( const RhoCandidate& ) const;
57  // RhoCandidate GetFitted ( const RhoCandidate& ) const;
58  double Chi2Contribution(const RhoCandidate *);
59  double GetChi2() const { return fChiSquare; };
60  int GetNdf() const { return fNDegreesOfFreedom; };
61  double GetProb() const { return TMath::Prob(fChiSquare, fNDegreesOfFreedom); };
62 
63  inline void SetVerbose(Bool_t v = kTRUE) { fVerbose = v; }
64 
65  protected:
66  // the decay tree
67  RhoCandidate &HeadOfTree() const { return *fHeadOfTree; }
68  Bool_t fVerbose;
69  virtual Bool_t FitNode(RhoCandidate *b); // fit one decay in the tree.
70 
71  // the clone of the tree.
74  // Bool_t CopyDaughters ( RhoCandidate* );
76  void InsertChi2(const RhoCandidate *bc, const double chi2) { fChi2Map[bc->Uid()] = chi2; }
77 
78  // Helpers for final state fitting
79  std::vector<RhoCandidate *> fDaughters;
83  void SetDecayVertex(RhoCandidate *composite, const TVector3 &vtx, const TMatrixD &CovVV);
84  double fChiSquare; // global chi^2 value
85  int fNDegreesOfFreedom; // degrees of freedom
86 
87  private:
88  // helper function
89  std::map<Int_t, Double_t> fChi2Map;
90  Bool_t IterateAndFit(RhoCandidate *b); // iterate the decay tree and fit each node recoursively
91 
92  public:
93  ClassDef(RhoFitterBase, 1) // Base class for fitters
94 };
95 
96 #endif
Bool_t FitAll()
Int_t Uid() const
Definition: RhoCandidate.h:428
double GetChi2() const
Definition: RhoFitterBase.h:59
double Chi2Contribution(const RhoCandidate *)
void FindAndAddFinalStateDaughters(RhoCandidate *cand)
RhoCandidate * CopyTree(RhoCandidate *)
__m128 v
Definition: P4_F32vec4.h:15
void SetFourMomentumByDaughters(RhoCandidate *composite)
double GetProb() const
Definition: RhoFitterBase.h:61
RhoCandidate * CopyCand(RhoCandidate *)
uppermost particle composite in tree
void SetVerbose(Bool_t v=kTRUE)
Definition: RhoFitterBase.h:63
std::vector< RhoCandidate * > fDaughters
Definition: RhoFitterBase.h:79
RhoCandidate * fHeadOfTree
Definition: RhoFitterBase.h:72
virtual Bool_t FitNode(RhoCandidate *b)
double fChiSquare
Definition: RhoFitterBase.h:84
int GetNdf() const
Definition: RhoFitterBase.h:60
RhoCandidate & HeadOfTree() const
Definition: RhoFitterBase.h:67
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:76
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:64
int fNDegreesOfFreedom
Definition: RhoFitterBase.h:85