cluster.cc File Reference

#include <math.h>
#include <stdio.h>
#include "cluster.h"

Include dependency graph for cluster.cc:

Go to the source code of this file.

Defines

#define MinPeakEnergy   0.08
#define MinShowerEnergy   0.1
#define MaxLen   1000
#define MaxNofPeaks   10
#define PeakIter   6
#define Emin   0.002
#define chisq   3.
#define XABSURD   -999999.
#define YABSURD   -999999.
#define max(a, b)   ((a) > (b) ? (a) : (b))
#define min(a, b)   ((a) < (b) ? (a) : (b))
#define ABS(x)   ((x) < 0 ? -(x) : (x))
#define lowint(x)   ((x) < 0 ? int(x-1) : int(x))
#define asinht(x)   (log((x)+sqrt((x)*(x)+1)))
#define sinht(x)   ((exp(x)-exp(-(x)))/2.)

Functions

int Hit_NCompare (const void *, const void *)
int Hit_ACompare (const void *, const void *)
void CopyVector (int *, int *, int)
void CopyVector (hit *, hit *, int)
void ZeroVector (int *, int)
void ZeroVector (float *, int)
void ZeroVector (hit *, int)
void ResizeVector (int *, int, int)
void CorrectPosition (float, float, float, float *, float *)
void CalculateErrors (float e, float x, float y, float *pde, float *pdx, float *pdy, float *pdz)
void GlobalToSector (float, float, float, float *, float *, float *)
void SectorToGlobal (float xsec, float ysec, float zsec, float *px, float *py, float *pz)
void SectorToGlobalErr (float dxsec, float dysec, float dzsec, float *pdx, float *pdy, float *pdz)
void gamma (int, hit *, float *, float *, float *, float *, float *, float *, float *, float *)
void twogamma (int, hit *, float *, float *, float *, float *, float *, float *, float *)
void mom1 (int, hit *, float *, float *, float *)
void momenta (int, hit *, float *, float *, float *, float *, float *, float *)
void c3to5 (float, float, float, float, float, float, float *, float *, float *, float *, float *, float *)
void SetProfileParameters (int, float, float, float)
float ClusterChisq (int, hit *, float, float, float)
float Chi2Limit (int ND)
float EMCcell (float xc, float yc, float en)
int Find_Clusters (list< hit > hlist, list< cluster > *pClList)
void SetGeometry (SecGeom sg, float *Vertex)
void SetChi2Limit (int limit)
float Chi2Correct (float Chi2, int ND)
void SetThreshold (float Thresh)

Variables

float epar00 = 0.005
float epar0 = 0.0014
float epar1 = 0.03
float epar2 = -0.03
float epar3 = 0.
float epar4 = 4.0
int EMCzSize = 72
int EMCySize = 36
float Tower_zSize = 5.535
float Tower_ySize = 5.535
float xVertex = 0
float yVertex = 0
float zVertex = 0
float xSector = 500
float ySector = -97
float zSector = -196
float normx = 1
float normy = 0
float normz = 0
float Chi2Level [50]
float Chi2Level1 [50]
float Chi2Level2 [50]
float sin4a
float sinax
float sinay
float ppar1
float ppar2
float ppar3
float ppar4
float pShiftx
float pShifty


Define Documentation

#define ABS  )     ((x) < 0 ? -(x) : (x))
 

Definition at line 175 of file cluster.cc.

Referenced by CorrectPosition(), EMCcell(), gamma(), SetProfileParameters(), and twogamma().

#define asinht  )     (log((x)+sqrt((x)*(x)+1)))
 

Definition at line 177 of file cluster.cc.

Referenced by CorrectPosition().

#define chisq   3.
 

Definition at line 108 of file cluster.cc.

Referenced by peakarea::GetCGmin(), peakarea::GetChar(), and peakarea::GetChi2().

#define Emin   0.002
 

Definition at line 105 of file cluster.cc.

#define lowint  )     ((x) < 0 ? int(x-1) : int(x))
 

Definition at line 176 of file cluster.cc.

Referenced by CorrectPosition(), and cluster::GetImpactTower().

#define max a,
 )     ((a) > (b) ? (a) : (b))
 

Definition at line 173 of file cluster.cc.

Referenced by emcClusterContainerv4::addCluster(), emcClusterContainerv3::addCluster(), emcClusterContainerv2::addCluster(), emcClusterContainerv1::addCluster(), emcTowerContainerv2::addTower(), emcTowerContainerv1::addTower(), and SetThreshold().

#define MaxLen   1000
 

Definition at line 96 of file cluster.cc.

Referenced by Find_Clusters().

#define MaxNofPeaks   10
 

Definition at line 99 of file cluster.cc.

Referenced by mEmcClusterNewModule::event(), and cluster::GetPeaks().

#define min a,
 )     ((a) < (b) ? (a) : (b))
 

Definition at line 174 of file cluster.cc.

Referenced by Chi2Limit(), emcTowerContainerv3::expand_for(), emcTowerContainerT< T >::expand_for(), emcClusterContainerT< T >::expand_for(), and cluster::GetHits().

#define MinPeakEnergy   0.08
 

Definition at line 90 of file cluster.cc.

Referenced by cluster::GetPeaks().

#define MinShowerEnergy   0.1
 

Definition at line 93 of file cluster.cc.

#define PeakIter   6
 

Definition at line 102 of file cluster.cc.

#define sinht  )     ((exp(x)-exp(-(x)))/2.)
 

Definition at line 178 of file cluster.cc.

Referenced by CorrectPosition().

#define XABSURD   -999999.
 

Definition at line 119 of file cluster.cc.

Referenced by peakarea::GetCGmin(), peakarea::GetGammas(), and cluster::GetMoments().

#define YABSURD   -999999.
 

Definition at line 120 of file cluster.cc.

Referenced by peakarea::GetCGmin(), peakarea::GetGammas(), and cluster::GetMoments().


Function Documentation

void c3to5 float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float *  ,
float *  ,
float *  ,
float *  ,
float *  ,
float * 
 

Definition at line 1233 of file cluster.cc.

void CalculateErrors float  e,
float  x,
float  y,
float *  pde,
float *  pdx,
float *  pdy,
float *  pdz
 

Definition at line 1521 of file cluster.cc.

References SectorToGlobalErr(), sinax, and sinay.

Referenced by emshower::GetChar(), peakarea::GetChar(), cluster::GetChar(), emshower::GetErrors(), and cluster::GetErrors().

float Chi2Correct float  Chi2,
int  ND
 

Definition at line 1713 of file cluster.cc.

Referenced by peakarea::GetChar(), peakarea::GetChi2(), and peakarea::GetGammas().

float Chi2Limit int  ND  ) 
 

Definition at line 1695 of file cluster.cc.

References Chi2Level, and min.

Referenced by peakarea::GetGammas().

float ClusterChisq int  ,
hit ,
float  ,
float  ,
float 
 

Definition at line 1133 of file cluster.cc.

References hit::amp, EMCcell(), epar0, epar00, epar1, epar2, epar3, epar4, and sin4a.

Referenced by gamma().

void CopyVector hit ,
hit ,
int 
 

Definition at line 1662 of file cluster.cc.

void CopyVector int *  ,
int *  ,
int 
 

Definition at line 1656 of file cluster.cc.

Referenced by ResizeVector().

void CorrectPosition float  ,
float  ,
float  ,
float *  ,
float * 
 

Definition at line 1550 of file cluster.cc.

References ABS, asinht, lowint, SetProfileParameters(), sinax, sinay, sinht, Tower_ySize, and Tower_zSize.

Referenced by emshower::GetChar(), peakarea::GetChar(), cluster::GetChar(), cluster::GetCorrPos(), and emshower::GetCorrPos().

float EMCcell float  xc,
float  yc,
float  en
 

Definition at line 1302 of file cluster.cc.

References ABS, ppar1, ppar2, ppar3, ppar4, pShiftx, pShifty, r3, and SetProfileParameters().

Referenced by ClusterChisq().

int Find_Clusters list< hit hlist,
list< cluster > *  pClList
 

Definition at line 1325 of file cluster.cc.

References Hit_NCompare(), MaxLen, and cluster::ReInitialize().

void gamma int  ,
hit ,
float *  ,
float *  ,
float *  ,
float *  ,
float *  ,
float *  ,
float *  ,
float * 
 

Definition at line 886 of file cluster.cc.

References ABS, ClusterChisq(), mom1(), and SetProfileParameters().

Referenced by peakarea::GetCGmin(), peakarea::GetChar(), peakarea::GetChi2(), and peakarea::GetGammas().

void GlobalToSector float  ,
float  ,
float  ,
float *  ,
float *  ,
float * 
 

Definition at line 1495 of file cluster.cc.

References normx, normy, xSector, ySector, and zSector.

Referenced by SetProfileParameters().

int Hit_ACompare const void *  ,
const void * 
 

Definition at line 1617 of file cluster.cc.

Referenced by cluster::GetHits().

int Hit_NCompare const void *  ,
const void * 
 

Definition at line 1612 of file cluster.cc.

Referenced by Find_Clusters(), cluster::GetE9(), and cluster::GetPeaks().

void mom1 int  ,
hit ,
float *  ,
float *  ,
float * 
 

Definition at line 1154 of file cluster.cc.

References hit::amp, and hit::ich.

Referenced by gamma().

void momenta int  ,
hit ,
float *  ,
float *  ,
float *  ,
float *  ,
float *  ,
float * 
 

Definition at line 1184 of file cluster.cc.

References hit::amp, and hit::ich.

Referenced by twogamma().

void ResizeVector int *  ,
int  ,
int 
 

Definition at line 1641 of file cluster.cc.

References CopyVector().

void SectorToGlobal float  xsec,
float  ysec,
float  zsec,
float *  px,
float *  py,
float *  pz
 

Definition at line 1507 of file cluster.cc.

References normx, normy, xSector, ySector, and zSector.

Referenced by emshower::GetChar(), peakarea::GetChar(), cluster::GetChar(), cluster::GetGlobalPos(), and emshower::GetGlobalPos().

void SectorToGlobalErr float  dxsec,
float  dysec,
float  dzsec,
float *  pdx,
float *  pdy,
float *  pdz
 

Definition at line 1514 of file cluster.cc.

References normx, and normy.

Referenced by CalculateErrors().

void SetChi2Limit int  limit  ) 
 

Definition at line 1668 of file cluster.cc.

References Chi2Level, Chi2Level1, and Chi2Level2.

void SetGeometry SecGeom  sg,
float *  Vertex
 

Definition at line 1450 of file cluster.cc.

References EMCySize, normx, normy, normz, SecGeom::nxyz, SecGeom::ny, SecGeom::nz, Tower_ySize, SecGeom::Tower_ySize, Tower_zSize, SecGeom::Tower_zSize, xSector, xVertex, SecGeom::xyz0, ySector, yVertex, zSector, and zVertex.

void SetProfileParameters int  ,
float  ,
float  ,
float 
 

Definition at line 1245 of file cluster.cc.

References ABS, GlobalToSector(), ppar1, ppar2, ppar3, ppar4, pShiftx, pShifty, sin4a, sinax, sinay, Tower_ySize, Tower_zSize, xVertex, yVertex, and zVertex.

Referenced by CorrectPosition(), EMCcell(), and gamma().

void SetThreshold float  Thresh  ) 
 

Definition at line 1729 of file cluster.cc.

References epar0, epar00, and max.

void twogamma int  ,
hit ,
float *  ,
float *  ,
float *  ,
float *  ,
float *  ,
float *  ,
float * 
 

Definition at line 995 of file cluster.cc.

References ABS, hit::amp, momenta(), and r.

void ZeroVector hit ,
int 
 

Definition at line 1636 of file cluster.cc.

References hit::amp, and hit::tof.

void ZeroVector float *  ,
int 
 

Definition at line 1630 of file cluster.cc.

void ZeroVector int *  ,
int 
 

Definition at line 1624 of file cluster.cc.

Referenced by cluster::GetHits().


Variable Documentation

float Chi2Level[50]
 

Initial value:

{
    6.634899, 4.605171, 3.780564, 3.318915, 3.017103,    
    2.801872, 2.639259, 2.511249, 2.407341, 2.320967,    
    2.247720, 2.184744, 2.129863, 2.081515, 2.038526,    
    1.999994, 1.965214, 1.933627, 1.904781, 1.878311,    
    1.853912, 1.831334, 1.810365, 1.790825, 1.772564, 
    1.755449, 1.739367, 1.724222, 1.709926, 1.696406,    
    1.683593, 1.671430, 1.659864, 1.648850, 1.638344,    
    1.628311, 1.618716, 1.609528, 1.600721, 1.592268,    
    1.584148, 1.576338, 1.568822, 1.561579, 1.554596,    
    1.547856, 1.541346, 1.535055, 1.528968, 1.523077 }

Definition at line 132 of file cluster.cc.

Referenced by Chi2Limit(), and SetChi2Limit().

float Chi2Level1[50]
 

Initial value:

{
    6.634899, 4.605171, 3.780564, 3.318915, 3.017103,    
    2.801872, 2.639259, 2.511249, 2.407341, 2.320967,    
    2.247720, 2.184744, 2.129863, 2.081515, 2.038526,    
    1.999994, 1.965214, 1.933627, 1.904781, 1.878311,    
    1.853912, 1.831334, 1.810365, 1.790825, 1.772564, 
    1.755449, 1.739367, 1.724222, 1.709926, 1.696406,    
    1.683593, 1.671430, 1.659864, 1.648850, 1.638344,    
    1.628311, 1.618716, 1.609528, 1.600721, 1.592268,    
    1.584148, 1.576338, 1.568822, 1.561579, 1.554596,    
    1.547856, 1.541346, 1.535055, 1.528968, 1.523077 }

Definition at line 145 of file cluster.cc.

Referenced by SetChi2Limit().

float Chi2Level2[50]
 

Initial value:

{
    5.411895, 3.912024, 3.278443, 2.916812, 2.677547,    
    2.505458, 2.374582, 2.271008, 2.186567, 2.116065,    
    2.056169, 2.004491, 1.959343, 1.919481, 1.883964,    
    1.852072, 1.823237, 1.797008, 1.773021, 1.750981,    
    1.730640, 1.711795, 1.694274, 1.677931, 1.662643,    
    1.648301, 1.634814, 1.622101, 1.610093, 1.598727,    
    1.587948, 1.577709, 1.567968, 1.558684, 1.549824,    
    1.541357, 1.533256, 1.525494, 1.518051, 1.510903,    
    1.504033, 1.497424, 1.491059, 1.484924, 1.479006,    
    1.473292, 1.467771, 1.462433, 1.457267, 1.452265 }

Definition at line 158 of file cluster.cc.

Referenced by SetChi2Limit().

int EMCySize = 36
 

Definition at line 123 of file cluster.cc.

Referenced by cluster::GetImpactTower(), and SetGeometry().

int EMCzSize = 72
 

Definition at line 122 of file cluster.cc.

Referenced by cluster::GetE9(), cluster::GetImpactTower(), and cluster::GetPeaks().

float epar0 = 0.0014
 

Definition at line 112 of file cluster.cc.

Referenced by ClusterChisq(), and SetThreshold().

float epar00 = 0.005
 

Definition at line 111 of file cluster.cc.

Referenced by ClusterChisq(), and SetThreshold().

float epar1 = 0.03
 

Definition at line 113 of file cluster.cc.

Referenced by ClusterChisq().

float epar2 = -0.03
 

Definition at line 114 of file cluster.cc.

Referenced by ClusterChisq().

float epar3 = 0.
 

Definition at line 115 of file cluster.cc.

Referenced by ClusterChisq().

float epar4 = 4.0
 

Definition at line 116 of file cluster.cc.

Referenced by ClusterChisq().

float normx = 1
 

Definition at line 129 of file cluster.cc.

Referenced by GlobalToSector(), SectorToGlobal(), SectorToGlobalErr(), and SetGeometry().

float normy = 0
 

Definition at line 129 of file cluster.cc.

Referenced by GlobalToSector(), SectorToGlobal(), SectorToGlobalErr(), and SetGeometry().

float normz = 0
 

Definition at line 129 of file cluster.cc.

Referenced by SetGeometry().

float ppar1
 

Definition at line 171 of file cluster.cc.

Referenced by EMCcell(), and SetProfileParameters().

float ppar2
 

Definition at line 171 of file cluster.cc.

Referenced by EMCcell(), and SetProfileParameters().

float ppar3
 

Definition at line 171 of file cluster.cc.

Referenced by EMCcell(), and SetProfileParameters().

float ppar4
 

Definition at line 171 of file cluster.cc.

Referenced by EMCcell(), and SetProfileParameters().

float pShiftx
 

Definition at line 171 of file cluster.cc.

Referenced by EMCcell(), and SetProfileParameters().

float pShifty
 

Definition at line 171 of file cluster.cc.

Referenced by EMCcell(), and SetProfileParameters().

float sin4a
 

Definition at line 170 of file cluster.cc.

Referenced by ClusterChisq(), and SetProfileParameters().

float sinax
 

Definition at line 170 of file cluster.cc.

Referenced by CalculateErrors(), CorrectPosition(), and SetProfileParameters().

float sinay
 

Definition at line 170 of file cluster.cc.

Referenced by CalculateErrors(), CorrectPosition(), and SetProfileParameters().

float Tower_ySize = 5.535
 

Definition at line 125 of file cluster.cc.

Referenced by CorrectPosition(), peakarea::GetCGmin(), peakarea::GetChar(), peakarea::GetGammas(), cluster::GetImpactTower(), SetGeometry(), and SetProfileParameters().

float Tower_zSize = 5.535
 

Definition at line 124 of file cluster.cc.

Referenced by CorrectPosition(), peakarea::GetCGmin(), peakarea::GetChar(), peakarea::GetGammas(), cluster::GetImpactTower(), SetGeometry(), and SetProfileParameters().

float xSector = 500
 

Definition at line 128 of file cluster.cc.

Referenced by GlobalToSector(), SectorToGlobal(), and SetGeometry().

float xVertex = 0
 

Definition at line 127 of file cluster.cc.

Referenced by SetGeometry(), and SetProfileParameters().

float ySector = -97
 

Definition at line 128 of file cluster.cc.

Referenced by GlobalToSector(), SectorToGlobal(), and SetGeometry().

float yVertex = 0
 

Definition at line 127 of file cluster.cc.

Referenced by SetGeometry(), and SetProfileParameters().

float zSector = -196
 

Definition at line 128 of file cluster.cc.

Referenced by GlobalToSector(), SectorToGlobal(), and SetGeometry().

float zVertex = 0
 

Definition at line 127 of file cluster.cc.

Referenced by SetGeometry(), and SetProfileParameters().