ATLAS Offline Software
Loading...
Searching...
No Matches
QratCscClusterFitter.cxx File Reference

Go to the source code of this file.

Typedefs

using Results = std::vector<Result>

Enumerations

enum  CscStation { UNKNOWN_STATION , CSS , CSL }
enum  CscPlane {
  CSS_ETA , CSL_ETA , CSS_PHI , CSL_PHI ,
  UNKNOWN_PLANE
}
enum  CscClusterStatus
 Enum to represent the cluster status - see the specific enum values for more details. More...

Functions

int qrat_correction (CscPlane plane, double qrat, double &cor, double &dcordqrat)
int qrat_interpolation (double qrmin, const std::vector< double > &corvals, double qrat, double &cor, double &dcordqrat)
int qrat_atanh (const double a, const double b, double c, const double x0, double qrat, double &cor, double &dcordqrat)
 Calculate QRAT correction from inverse hyperbolic tangent based on a fit to the plot of pos x vs charge ratio qrat to the function qrat(x) = a + b* tanh(c*(x-x0)) Here we use the inverse of the above function x = atanh((qrat-a)/b)/c+x0 to obtain positions from charge ratios.

Typedef Documentation

◆ Results

using Results = std::vector<Result>

Definition at line 27 of file QratCscClusterFitter.cxx.

Enumeration Type Documentation

◆ CscClusterStatus

Enum to represent the cluster status - see the specific enum values for more details.

Definition at line 23 of file CscClusterStatus.h.

23 {
24
27
30
31 // Spoiled cluster list, it should be handled with care in reconstruction
32
35
38
41
44
47
50
51 // Parabola interpolation failed in peak strip
52 // OR either left or right strip is hot or dead
54
55 // any of left/peak/right strip is saturated...
57
60
64
65 // Spoiled cluster list, it should be handled with care in reconstruction
66
69
72
75
78
81
85
86 // Parabola interpolation failed in peak strip
87 // OR either left or right strip is hot or dead
89
90 // any of left/peak/right strip is saturated...
92
95 };
@ CscStatusUnspoiled
Clean cluster with precision fit.
@ CscStatusSimple
Cluster with non-precision fit.
@ CscStatusStripFitFailed
@ CscStatusSplitQratInconsistent
Positions from Qrat_left and Qrat_right is not consistent after split cluster.
@ CscStatusUndefined
Undefined, should not happen, most likely indicates a problem.
@ CscStatusSplitStripFitFailed
@ CscStatusSkewed
Skewed, e.g.
@ CscStatusSplitUnspoiled
Clean cluster with precision fit after split cluster.
@ CscStatusEdge
Cluster reaches the edge of plane.
@ CscStatusWide
Too wide.
@ CscStatusSplitWide
Too wide.
@ CscStatusSplitEdge
Cluster reaches the edge of plane after split cluster.
@ CscStatusSplitSaturated
@ CscStatusSplitSimple
Cluster with non-precision fit after split cluster.
@ CscStatusMultiPeak
More than one peak in cluster.
@ CscStatusSplitSkewed
Skewed, e.g.
@ CscStatusSaturated
@ CscStatusSplitNarrow
Too narrow after split cluster.
@ CscStatusSplitMultiPeak
More than one peak in cluster after split cluster.
@ CscStatusQratInconsistent
Positions from Qrat_left and Qrat_right is not consistent.
@ CscStatusNarrow
Too narrow.

◆ CscPlane

enum CscPlane
Enumerator
CSS_ETA 
CSL_ETA 
CSS_PHI 
CSL_PHI 
UNKNOWN_PLANE 

Definition at line 30 of file QratCscClusterFitter.cxx.

◆ CscStation

enum CscStation
Enumerator
UNKNOWN_STATION 
CSS 
CSL 

Definition at line 29 of file QratCscClusterFitter.cxx.

Function Documentation

◆ qrat_atanh()

int qrat_atanh ( const double a,
const double b,
double c,
const double x0,
double qrat,
double & cor,
double & dcordqrat )

Calculate QRAT correction from inverse hyperbolic tangent based on a fit to the plot of pos x vs charge ratio qrat to the function qrat(x) = a + b* tanh(c*(x-x0)) Here we use the inverse of the above function x = atanh((qrat-a)/b)/c+x0 to obtain positions from charge ratios.

Output is shifted by 0.5, so the center of the strip is at x=0.

Parameters
a= parameter of correction function
b= parameter of correction function
c= parameter of correction function
x0= parameter of correction function
qrat= input value of qrat = Q_right/Q_peak
cor= output of corrected position in the range -0.5 to 0.5
dcordqrat= derivative of cor w.r.t. qrat for error estimates
Returns
0 if no error, 1 if qrat is negative

Definition at line 194 of file QratCscClusterFitter.cxx.

194 {
195 if (qrat <= 0) return 1; // avoid trouble in error calculation
196 // minimum qrat value (at pos=-1) or use pos = -0.5?
197 double qrmin = a + b * tanh(c * (-1 - x0));
198
199 // Treat any QRAT below the minimum as if it were at the minumum.
200 if (qrat < qrmin) qrat = qrmin;
201 double z = (qrat - a) / b;
202 cor = atanh(z) / c + x0;
203 dcordqrat = 1.0 / (1.0 - z * z) / b / c;
204
205 return 0;
206}
static Double_t a
#define z

◆ qrat_correction()

int qrat_correction ( CscPlane plane,
double qrat,
double & cor,
double & dcordqrat )

Definition at line 62 of file QratCscClusterFitter.cxx.

62 {
63 std::vector<double> pfac;
64 if (plane == CSS_ETA) {
65 if (qrat < 0.095) return 1;
66 if (qrat > 1.01) return 1;
67 if (qrat < 0.15) {
68 pfac.push_back(-5.483);
69 pfac.push_back(130.6);
70 pfac.push_back(-1296.);
71 pfac.push_back(5994.);
72 pfac.push_back(-10580.);
73 } else if (qrat < 0.30) {
74 pfac.push_back(-0.9225);
75 pfac.push_back(5.569);
76 pfac.push_back(2.908);
77 pfac.push_back(-66.19);
78 pfac.push_back(108.5);
79 } else {
80 pfac.push_back(-0.4246);
81 pfac.push_back(2.619);
82 pfac.push_back(-3.642);
83 pfac.push_back(2.837);
84 pfac.push_back(-0.8916);
85 }
86 } else if (plane == CSL_ETA) {
87 if (qrat < 0.105) return 1;
88 if (qrat > 1.01) return 1;
89 if (qrat < 0.25) {
90 pfac.push_back(-2.823);
91 pfac.push_back(42.71);
92 pfac.push_back(-279.1);
93 pfac.push_back(879.2);
94 pfac.push_back(-1062.);
95 } else {
96 pfac.push_back(-0.5409);
97 pfac.push_back(3.110);
98 pfac.push_back(-4.630);
99 pfac.push_back(3.800);
100 pfac.push_back(-1.241);
101 }
102 } else {
103 return 3;
104 }
105 cor = 0.0;
106 dcordqrat = 0.0;
107 double term = 1.0;
108 for (unsigned int ipow = 0; ipow < pfac.size(); ++ipow) {
109 dcordqrat += ipow * pfac[ipow] * term;
110 if (ipow) term *= qrat;
111 cor += pfac[ipow] * term;
112 }
113 return 0;
114}

◆ qrat_interpolation()

int qrat_interpolation ( double qrmin,
const std::vector< double > & corvals,
double qrat,
double & cor,
double & dcordqrat )

Definition at line 128 of file QratCscClusterFitter.cxx.

128 {
129 int nbin = corvals.size();
130 if (!nbin) return 1;
131 // Treat any QRAT below the minimum as if it were at the minumum.
132 if (qrat < qrmin) qrat = qrmin;
133 // Find the bin holding dqrat.
134 double dqrat = 1.0 / nbin;
135 int bin = int(qrat / dqrat);
136 // Extract the value for this bin (x1) and the preceding (x0)
137 // and the following (x2).
138 double x1 = corvals[bin];
139 if (x1 == 0.0) return 2;
140 double x0 = bin == 0 ? 0.0 : corvals[bin - 1];
141 double x2 = bin == nbin - 1 ? 1.0 : corvals[bin + 1];
142 // Assign the qrat values for these bins. If this is the first
143 // bin with data, then use the input qrmin.
144 double qrat0 = dqrat * bin;
145 double qrat1 = qrat0 + dqrat;
146
147 if (x0 == 0.0) {
148 if (qrmin > qrat0 && qrmin < qrat1) { qrat0 = qrmin; }
149 }
150 // Calculate correction and derivative.
151 // Use quadratic interpolation with the high edge of this bin,
152 // the preceding and the following. For the last bin, use linear
153 // interpolation.
154 if (bin == nbin - 1) {
155 double a = x0;
156 double b = (x1 - x0) / dqrat;
157 cor = a + b * (qrat - qrat0);
158 dcordqrat = b;
159 } else {
160 double d0 = qrat1 - qrat0;
161 double d = dqrat;
162 double w = 1.0 / (d0 * d * d + d0 * d0 * d);
163 double a = x1;
164 double b = w * d * d * (x1 - x0) + w * d0 * d0 * (x2 - x1);
165 double c = w * d0 * (x2 - x1) - w * d * (x1 - x0);
166 cor = a + b * (qrat - qrat1) + c * (qrat - qrat1) * (qrat - qrat1);
167 dcordqrat = b + 2.0 * c * (qrat - qrat1);
168 }
169 if (cor < 0.0) cor = 0.0;
170 // Shift correction to center of bin.
171 cor -= 0.50;
172 return 0;
173}