StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
EEmcSectorFit Class Reference

Simultaneous fit of two smd planes to N gammas. More...

Inheritance diagram for EEmcSectorFit:

Public Member Functions

 EEmcSectorFit (Int_t maxGammas=10)
 
virtual ~EEmcSectorFit ()
 Destructor.
 
void print () const
 print summary
 
void SetHistograms (TH1F *u, TH1F *v)
 Set pointers to histograms which will be fit.
 
Double_t FitFunc (Double_t x, Int_t plane) const
 Evaluate the N gamma fit for the specified plane.
 
virtual Int_t Eval (Int_t np, Double_t *gr, Double_t &x2, Double_t *p, Int_t flg)
 
Double_t Residual (Int_t x, Int_t plane) const
 
Double_t Residual (Int_t x, Int_t plane, Int_t dx, Int_t side=0) const
 
Int_t MaxStrip (Int_t plane) const
 Find maximum residual strip in specified plane. Returns strip index.
 
void AddCandidate (Double_t yield, Double_t sigma, Double_t u, Double_t v)
 Add a candidate to the list of candidate gammas. More...
 
void Draw (Option_t *opts)
 Draws the current fit. More...
 
void InitParameters ()
 Initialize parameters.
 
void TryPermutations ()
 
void Clear (Option_t *opts="")
 Clear the array of photon candidates.
 
Int_t numberOfCandidates ()
 Returns the number of gamma candidates.
 
void GetCandidate (Int_t i, Double_t &nmips, Double_t &width, Double_t &u, Double_t &v)
 Returns the parameters of the fit to the ith gamma candidate.
 
void GetLastCandidate (Double_t &nmips, Double_t &width, Double_t &u, Double_t &v)
 Returns the parameters of the last candidate found.
 
TH1F * histo (Int_t plane)
 Return the histogram for the specified plane.
 
Double_t chi2 () const
 Return the chisquared of the fit.
 
Int_t ndf () const
 Return the number of degrees of freedom.
 
void AddFits (TH1F *u, TH1F *v)
 Adds TF1 to histogram. More...
 

Public Attributes

Bool_t doPermutations
 Flag to determine if we test all permutations or not.
 

Protected Member Functions

 ClassDef (EEmcSectorFit, 1)
 MAkes class available to root.
 

Protected Attributes

TH1F * mSMD [2]
 The histograms we fit.
 
std::vector< Double_t > yield
 Yield of N gammas.
 
std::vector< Double_t > sigma
 Width of N gammas.
 
std::vector< Double_t > umean
 Mean U position of N gammas.
 
std::vector< Double_t > vmean
 Mean V position of N gammas.
 
Double_t mChi2
 Chi^2 of the fit.
 
Int_t mNDF
 Degrees o' freedom.
 

Detailed Description

Simultaneous fit of two smd planes to N gammas.

This class implements a TMinuit-based fitting algorithm which performs a simultaneous fit of N gamma candidates in 2 SMD planes.

Author
Jason C. Webb
Date:
2010/08/26 22:49:26
Revision:
1.5

Definition at line 7 of file EEmcSectorFit.h.

Constructor & Destructor Documentation

EEmcSectorFit::EEmcSectorFit ( Int_t  maxGammas = 10)

Constructor

Parameters
maxGammas,:Maximum number of gammas which we will attempt to fit.

Definition at line 31 of file EEmcSectorFit.cxx.

References doPermutations, mChi2, mNDF, and mSMD.

Member Function Documentation

void EEmcSectorFit::AddCandidate ( Double_t  yield,
Double_t  sigma,
Double_t  u,
Double_t  v 
)

Add a candidate to the list of candidate gammas.

initialize parameters

Definition at line 177 of file EEmcSectorFit.cxx.

References InitParameters(), mSMD, sigma, umean, vmean, and yield.

void EEmcSectorFit::AddFits ( TH1F *  u,
TH1F *  v 
)

Adds TF1 to histogram.

add fits to histograms

Definition at line 370 of file EEmcSectorFit.cxx.

References sigma, umean, vmean, and yield.

void EEmcSectorFit::Draw ( Option_t *  opts)

Draws the current fit.

add fits to histograms

Definition at line 209 of file EEmcSectorFit.cxx.

References mSMD, sigma, umean, vmean, and yield.

Int_t EEmcSectorFit::Eval ( Int_t  np,
Double_t *  gr,
Double_t &  x2,
Double_t *  p,
Int_t  flg 
)
virtual

Overrides TMinuit's chi^2 function

Parameters
np= number of parameters
gr= array of derivitavies of chi^2 function
x2= the chi^2 value computed
p= array of parameters
flg= flag (not used)

Definition at line 65 of file EEmcSectorFit.cxx.

References FitFunc(), histo(), mChi2, mNDF, mSMD, sigma, umean, vmean, and yield.

Double_t EEmcSectorFit::Residual ( Int_t  x,
Int_t  plane 
) const

Returns the residual (data - fit) for the specified strip index.

Parameters
x,:strip index, [0,288)
plane,:smd plane, 0=u, 1=v

Definition at line 118 of file EEmcSectorFit.cxx.

References FitFunc(), histo(), mSMD, umean, vmean, and yield.

Referenced by StEEmcPointFitMaker::FitSector(), MaxStrip(), and Residual().

Double_t EEmcSectorFit::Residual ( Int_t  x,
Int_t  plane,
Int_t  dx,
Int_t  side = 0 
) const

Returns the residual (data - fit) for the specified strip index, summed over +/- dx strips.

Parameters
x,:strip index, [0,288)
plane,:smd plane, 0=u, 1=v
dx,:number of strips on either side to sum over
side,:0=both, 1=left, 2=right

Definition at line 132 of file EEmcSectorFit.cxx.

References Residual().

void EEmcSectorFit::TryPermutations ( )

Once the driving routine believes that all gammas have been found, we try all permutations of u,v pairs to find the true best fit.

Vectors of our fit parameters

Vector of resulting chi^2

Permute on old_vmean

Initialze params for this permutaion

Fix the widths

Now fit relative to this permutation

Save parameters and record chi2

restore to original yield, sigma, umean

find minimum chi^2, restore and fit

Refit to ensure minimum chi^2 is loaded into the fitter

Free the widths

Definition at line 282 of file EEmcSectorFit.cxx.

References doPermutations, InitParameters(), mChi2, sigma, umean, vmean, and yield.


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