StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
FMSCluster::StFmsClusterFitter Class Reference

#include <StFmsClusterFitter.h>

Inheritance diagram for FMSCluster::StFmsClusterFitter:

Public Member Functions

 StFmsClusterFitter (Int_t detectorId, Float_t xw, Float_t yw, Float_t scaleShowerShapeLarge, Float_t scaleShowerShapeSmall, Int_t ShowerShapeWithAngle, Int_t MergeSmallToLarge, double vertexZ)
 
 StFmsClusterFitter ()
 
virtual ~StFmsClusterFitter ()
 
TF2 * showerShapeFunction ()
 
void setTowers (StFmsTowerCluster::Towers *towers)
 
Double_t fitNPhoton (const std::vector< double > &parameteres, const std::vector< double > &steps, const std::vector< double > &lower, const std::vector< double > &up, PhotonList *photons)
 
Double_t fitNPhoton (const std::vector< double > &parameters, const std::vector< double > &lower, const std::vector< double > &up, PhotonList *photons)
 
Int_t fit2Photon (const std::array< double, 7 > &parameters, const std::array< double, 7 > &steps, const std::array< double, 7 > &lower, const std::array< double, 7 > &upper, PhotonList *photons)
 

Static Public Member Functions

static Double_t energyDepositionInTowerOLD (Double_t x, Double_t y, Double_t *par)
 
static Double_t energyDepositionInTower (Double_t *x, Double_t *par)
 
static Double_t energyDepositionInTower (Double_t x, Double_t y, Double_t xun, Double_t yun, Double_t *parmeters, Int_t MergeSmallToLarge, double vertexz)
 
static Double_t energyDepositionInTowerSingleLayer (Double_t x, Double_t y, Double_t *parameters)
 
static int maxNFittedPhotons ()
 

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:

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 95 of file StFmsClusterFitter.h.

Constructor & Destructor Documentation

FMSCluster::StFmsClusterFitter::StFmsClusterFitter ( Int_t  detectorId,
Float_t  xw,
Float_t  yw,
Float_t  scaleShowerShapeLarge,
Float_t  scaleShowerShapeSmall,
Int_t  ShowerShapeWithAngle,
Int_t  MergeSmallToLarge,
double  vertexZ 
)

Constructor using detector geometry for a single sub-detector

Definition at line 194 of file StFmsClusterFitter.cxx.

FMSCluster::StFmsClusterFitter::StFmsClusterFitter ( )
inline

Default constructor.

Todo:
Actually initialize things!

Definition at line 106 of file StFmsClusterFitter.h.

FMSCluster::StFmsClusterFitter::~StFmsClusterFitter ( )
virtual

Destructor

Definition at line 213 of file StFmsClusterFitter.cxx.

Member Function Documentation

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

adding 6 slices aong z with angle taken into account

Definition at line 354 of file StFmsClusterFitter.cxx.

Double_t FMSCluster::StFmsClusterFitter::energyDepositionInTowerOLD ( Double_t  x,
Double_t  y,
Double_t *  par 
)
inlinestatic

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 296 of file StFmsClusterFitter.h.

Int_t FMSCluster::StFmsClusterFitter::fit2Photon ( const std::array< double, 7 > &  parameters,
const std::array< double, 7 > &  steps,
const std::array< double, 7 > &  lower,
const std::array< double, 7 > &  upper,
PhotonList *  photons 
)

Specialized fit function for exactly 2-photon fit.

Argument meanings are as for fitNPhoton(). 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 308 of file StFmsClusterFitter.cxx.

Double_t FMSCluster::StFmsClusterFitter::fitNPhoton ( const std::vector< double > &  parameteres,
const std::vector< double > &  steps,
const std::vector< double > &  lower,
const std::vector< double > &  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 empty 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 219 of file StFmsClusterFitter.cxx.

Referenced by fitNPhoton().

Double_t FMSCluster::StFmsClusterFitter::fitNPhoton ( const std::vector< double > &  parameters,
const std::vector< double > &  lower,
const std::vector< double > &  up,
PhotonList *  photons 
)

Calls fitNPhoton() with default step sizes

Definition at line 269 of file StFmsClusterFitter.cxx.

References fitNPhoton().

int FMSCluster::StFmsClusterFitter::maxNFittedPhotons ( )
static

Maximum number of photons that can be fit at once.

Definition at line 400 of file StFmsClusterFitter.cxx.

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

Set the tower list to fit when calling fitNPhoton() or fit2Photon()

Definition at line 549 of file StFmsClusterFitter.cxx.

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 215 of file StFmsClusterFitter.cxx.


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