StFms  0.0.0
FMS software in the STAR framework
FMSCluster::StFmsClusterFitter Class Reference

#include <StFmsClusterFitter.h>

Inheritance diagram for FMSCluster::StFmsClusterFitter:
Collaboration diagram for FMSCluster::StFmsClusterFitter:

Public Member Functions

 StFmsClusterFitter (const StFmsGeometry *geometry, Int_t detectorId)
 
 StFmsClusterFitter ()
 
 ~StFmsClusterFitter ()
 
TF2 * showerShapeFunction ()
 
void setTowers (StFmsTowerCluster::Towers *towers)
 
Double_t fit (const Double_t *par, const Double_t *step, const Double_t *low, const Double_t *up, PhotonList *photons)
 
Int_t fit2PhotonCluster (const Double_t *para, const Double_t *step, const Double_t *low, const Double_t *up, PhotonList *photons)
 

Static Public Member Functions

static Double_t energyDepositionInTower (Double_t *x, Double_t *par)
 
static int maxNFittedPhotons ()
 

Private Member Functions

 StFmsClusterFitter (const StFmsClusterFitter &)
 
StFmsClusterFitteroperator= (const StFmsClusterFitter &)
 

Static Private Member Functions

static Double_t energyDepositionDistribution (Double_t *x, Double_t *par)
 
static void minimizationFunctionNPhoton (Int_t &npar, Double_t *grad, Double_t &fval, Double_t *par, Int_t iflag)
 
static void minimizationFunction2Photon (Int_t &nparam, Double_t *grad, Double_t &fval, Double_t *param, Int_t iflag)
 

Private Attributes

Double_t mSteps [3 *kMaxNPhotons+1]
 Step size in each fit variable. More...
 
Double_t mTowerWidth
 width of one lead glass module More...
 
TMinuit mMinuit
 Minuit fitting interface. More...
 

Static Private Attributes

static const Int_t kMaxNPhotons = 7
 Maximum number that can be fitted. More...
 
static StFmsTowerCluster::TowersmTowers
 List of towers to fit. More...
 
static Float_t mTowerWidthXY [2]
 glass width X, Y in cm More...
 

Detailed Description

Photon shower-shape fitting routine for FMS clusters.

Fits tower clusters with the photon energy-deposition shower-shape distribution function i.e. how a photon hitting the FMS distributes its energy over towers. This serves to:

  • find the best-fit photon properties for a cluster.
  • distinguish clusters made by a single photon from those made by two nearby photons merging into a single cluster, which can frequently happen at the far-forward rapidity of the FMS.
Todo:
It may be safer to make StFmsClusterFitter a singleton class, or something like that. The shower shape fit function is shared across all objects (by necessity, in order to interface with TMinuit), but each object updates the function itself with different parameters. Therefore bad things would happen if there were more than one object in existence at any time. There isn't ever more than one instance created in this code, but I think it would be good to enforce that.

Definition at line 50 of file StFmsClusterFitter.h.

Constructor & Destructor Documentation

FMSCluster::StFmsClusterFitter::StFmsClusterFitter ( const StFmsGeometry geometry,
Int_t  detectorId 
)

Constructor using detector geometry for a single sub-detector

Definition at line 38 of file StFmsClusterFitter.cxx.

Here is the call graph for this function:

FMSCluster::StFmsClusterFitter::StFmsClusterFitter ( )
inline

Default constructor.

Todo:
Actually initialize things!

Definition at line 59 of file StFmsClusterFitter.h.

FMSCluster::StFmsClusterFitter::~StFmsClusterFitter ( )

Destructor

Definition at line 69 of file StFmsClusterFitter.cxx.

FMSCluster::StFmsClusterFitter::StFmsClusterFitter ( const StFmsClusterFitter )
private

Disallow copy construction.

Member Function Documentation

Double_t FMSCluster::StFmsClusterFitter::energyDepositionDistribution ( Double_t *  x,
Double_t *  par 
)
staticprivate

Shower shape helper function.

Evaluates F(x,y) as defined here: https://drupal.star.bnl.gov/STAR/blog/leun/2010/aug/02/fms-meeting-20100802

Used by energyDepositionInTower() to integrate F(x,y) over a tower.

Todo:
Provide LaTeX math function in documentation

Definition at line 282 of file StFmsClusterFitter.cxx.

Here is the caller graph for this function:

Double_t FMSCluster::StFmsClusterFitter::energyDepositionInTower ( Double_t *  x,
Double_t *  par 
)
static

Energy-deposition shower-shape function, for use with a TF2.

Yields the fraction of energy deposited in a tower by a photon, as a function of the distance from the photon to the tower center. Arguments:

  • x: array with x[0] = x distance from tower center, x[1] = y distance.
  • par: array of fit parameters (fixed, derived from FMS studies).

Integrates F(x, y) over a tower, with F(x, y) defined as here: https://drupal.star.bnl.gov/STAR/blog/leun/2010/aug/02/fms-meeting-20100802

Todo:
Provide LaTeX math function in documentation

Definition at line 258 of file StFmsClusterFitter.cxx.

Here is the call graph for this function:

Double_t FMSCluster::StFmsClusterFitter::fit ( const Double_t *  par,
const Double_t *  step,
const Double_t *  low,
const Double_t *  up,
PhotonList photons 
)

Fit photons to the list of towers.

All array arguments are of size 3N+1 for an N-photon fit:

  • par: initial guess values for each fit variable.
  • step: step size when fitting (if NULL use default values).
  • low: lower bound on each fit variable.
  • up: upper bound on each fit variable.

In each 3N+1D array, the first element is the number of photons to fit. Each subsequent triplet is the x position, y position and energy of a photon. e.g.

  • for a 1-photon fit: [1, x0, y0, E0]
  • for a 2-photon fit: [2, x0, y0, E0, x1, y1, E1]

Returns the χ2 of the fit.

Definition at line 75 of file StFmsClusterFitter.cxx.

Here is the call graph for this function:

Int_t FMSCluster::StFmsClusterFitter::fit2PhotonCluster ( const Double_t *  para,
const Double_t *  step,
const Double_t *  low,
const Double_t *  up,
PhotonList photons 
)

Specialized fit function for exactly 2-photon fit.

Argument arrays are as for fit(). However as this is for 2-photon fits only, the input arrays should always have 7 (3 * 2 photons + 1) elements. Additionally each element has a different meaning here:

  • 0: Still a constant parameter, should be set to 2 for 2-photon fitting.
  • 1: x-position of pi0.
  • 2: y-position of pi0.
  • 3: Distance between 2 photons.
  • 4: Theta angle of displacement vector from photon 2 to photon 1.
  • 5: z_gg, from -1 to +1, so we do not set E1 > E2.
  • 6: Total energy of two photons.

Returns the χ2 of the fit.

Definition at line 172 of file StFmsClusterFitter.cxx.

Here is the call graph for this function:

static int FMSCluster::StFmsClusterFitter::maxNFittedPhotons ( )
inlinestatic

Maximum number of photons that can be fit at once.

Definition at line 126 of file StFmsClusterFitter.h.

void FMSCluster::StFmsClusterFitter::minimizationFunction2Photon ( Int_t &  nparam,
Double_t *  grad,
Double_t &  fval,
Double_t *  param,
Int_t  iflag 
)
staticprivate

Minuit minimization function for fit2PhotonCluster() routine

Also see comments for minimizationFunction().

Definition at line 355 of file StFmsClusterFitter.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void FMSCluster::StFmsClusterFitter::minimizationFunctionNPhoton ( Int_t &  npar,
Double_t *  grad,
Double_t &  fval,
Double_t *  par,
Int_t  iflag 
)
staticprivate

Minuit minimization function for fit() routine.

For the purpose of this function and a description of its arguments see https://wwwasdoc.web.cern.ch/wwwasdoc/minuit/node14.html

For its use in ROOT via TMinuit see http://root.cern.ch/root/htmldoc/TMinuit.html#TMinuit:SetFCN

Definition at line 301 of file StFmsClusterFitter.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

StFmsClusterFitter& FMSCluster::StFmsClusterFitter::operator= ( const StFmsClusterFitter )
private

Disallow assignment.

void FMSCluster::StFmsClusterFitter::setTowers ( StFmsTowerCluster::Towers towers)
inline

Set the tower list to fit when calling fit() or fit2PhotonCluster()

Definition at line 70 of file StFmsClusterFitter.h.

TF2 * FMSCluster::StFmsClusterFitter::showerShapeFunction ( )

Return the shower shape function.

The shower shape gives the fractional energy deposition by a photon in a tower as a function of the distance of the photon from the tower center.

Definition at line 71 of file StFmsClusterFitter.cxx.

Member Data Documentation

const Int_t FMSCluster::StFmsClusterFitter::kMaxNPhotons = 7
staticprivate

Maximum number that can be fitted.

Definition at line 129 of file StFmsClusterFitter.h.

TMinuit FMSCluster::StFmsClusterFitter::mMinuit
private

Minuit fitting interface.

Definition at line 167 of file StFmsClusterFitter.h.

Double_t FMSCluster::StFmsClusterFitter::mSteps[3 *kMaxNPhotons+1]
private

Step size in each fit variable.

Definition at line 165 of file StFmsClusterFitter.h.

StFmsTowerCluster::Towers * FMSCluster::StFmsClusterFitter::mTowers
staticprivate

List of towers to fit.

Definition at line 168 of file StFmsClusterFitter.h.

Double_t FMSCluster::StFmsClusterFitter::mTowerWidth
private

width of one lead glass module

Definition at line 166 of file StFmsClusterFitter.h.

Float_t FMSCluster::StFmsClusterFitter::mTowerWidthXY
staticprivate

glass width X, Y in cm

Definition at line 169 of file StFmsClusterFitter.h.


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