00001 #include "SimMuon/CSCDigitizer/src/CSCDriftSim.h"
00002 #include <cmath>
00003
00004 double CSCDriftSim::avgPathLengthHighB() {
00005
00006
00007 static const double coeff[18] = { .16916627,.11057547,.054287448,.01179527,
00008 .0062073273,-.013570915,-.0027121772,-.0053792764,-.0027452986,
00009 -.0020556715,.0021511659,.0011376412,.0026183373,.0017980602,
00010 -.0012975418,-.0010798782,-.0012322628,-8.3635924e-4 };
00011
00012
00013 double x10, x11, x12, x13, x14, x20, x21, x22, x23, x24, x25;
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 x10 = 1.;
00056 x11 = fabs(ycell) * 2. - 1.;
00057 x12 = x11 * 2. * x11 - x10;
00058 x13 = x11 * 2. * x12 - x11;
00059 x14 = x11 * 2. * x13 - x12;
00060 x20 = 1.;
00061 x21 = fabs(zcell) * 2. - 1.;
00062 x22 = x21 * 2. * x21 - x20;
00063 x23 = x21 * 2. * x22 - x21;
00064 x24 = x21 * 2. * x23 - x22;
00065 x25 = x21 * 2. * x24 - x23;
00066
00067 return coeff[0] + coeff[1] * x11 + coeff[2] * x21 + coeff[3] * x22 +
00068 coeff[4] * x12 + coeff[5] * x11 * x21 + coeff[6] * x13 + coeff[7]
00069 * x12 * x22 + coeff[8] * x12 * x23 + coeff[9] * x11 * x24 + coeff[
00070 10] * x12 * x21 + coeff[11] * x14 + coeff[12] * x11 * x22 + coeff[
00071 13] * x13 * x22 + coeff[14] * x13 * x21 + coeff[15] * x12 * x24 +
00072 coeff[16] * x11 * x25 + coeff[17] * x11 * x23;
00073 }
00074
00075
00076 double CSCDriftSim::pathSigmaHighB() {
00077
00078
00079 static const double coeff[9] = { .0049089564,.0091482062,.0024036507,
00080 .0065285652,.0041487742,-.0038102526,-.0043923587,.0019230151,
00081 .0013543258 };
00082
00083
00084 float ret_val;
00085
00086
00087 double x10, x11, x12, x13, x14, x15, x16, x20, x21, x22, x23,
00088 x24, x25, x26, x27, x28, x29;
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 x10 = 1.;
00132 x11 = fabs(ycell) * 2. - 1.;
00133 x12 = x11 * x11;
00134 x13 = x11 * x12;
00135 x14 = x11 * x13;
00136 x15 = x11 * x14;
00137 x16 = x11 * x15;
00138 x20 = 1.;
00139 x21 = fabs(zcell) * 2. - 1.;
00140 x22 = x21 * x21;
00141 x23 = x21 * x22;
00142 x24 = x21 * x23;
00143 x25 = x21 * x24;
00144 x26 = x21 * x25;
00145 x27 = x21 * x26;
00146 x28 = x21 * x27;
00147 x29 = x21 * x28;
00148
00149 ret_val = coeff[0] + coeff[1] * x21 + coeff[2] * x11 + coeff[3] * x22 +
00150 coeff[4] * x11 * x21 + coeff[5] * x16 * x22 + coeff[6] * x16 *
00151 x23 + coeff[7] * x11 * x22 + coeff[8] * x29;
00152
00153 return ret_val;
00154 }
00155
00156
00157 double CSCDriftSim::avgDriftTimeHighB() {
00158
00159
00160 static const double coeff[27] = { 22.384492,10.562894,14.032961,7.06233,
00161 3.5523289,-5.0176704,1.999075,1.0635552,-3.2770096,-2.7384958,
00162 .98411495,-2.0963696,-1.4006525,-.47542728,.64179451,-.80308436,
00163 .42964647,-.4153324,.50423068,.35049792,-.42595896,-.30947641,
00164 .16671267,-.21336584,.22979164,.23481052,.32550435 };
00165
00166
00167 float ret_val;
00168
00169
00170 double x10, x11, x12, x13, x14, x15, x16, x17, x20, x21, x22,
00171 x23, x24, x25, x26, x27;
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214 x10 = 1.;
00215 x11 = fabs(ycell) * 2. - 1.;
00216 x12 = x11 * 2. * x11 - x10;
00217 x13 = x11 * 2. * x12 - x11;
00218 x14 = x11 * 2. * x13 - x12;
00219 x15 = x11 * 2. * x14 - x13;
00220 x16 = x11 * 2. * x15 - x14;
00221 x17 = x11 * 2. * x16 - x15;
00222 x20 = 1.;
00223 x21 = fabs(zcell) * 2. - 1.;
00224 x22 = x21 * 2. * x21 - x20;
00225 x23 = x21 * 2. * x22 - x21;
00226 x24 = x21 * 2. * x23 - x22;
00227 x25 = x21 * 2. * x24 - x23;
00228 x26 = x21 * 2. * x25 - x24;
00229 x27 = x21 * 2. * x26 - x25;
00230
00231 ret_val = coeff[0] + coeff[1] * x11 + coeff[2] * x21 + coeff[3] * x22 +
00232 coeff[4] * x23 + coeff[5] * x11 * x21 + coeff[6] * x24 + coeff[7]
00233 * x12 + coeff[8] * x11 * x22 + coeff[9] * x11 * x23 + coeff[10] *
00234 x25 + coeff[11] * x11 * x24 + coeff[12] * x11 * x25 + coeff[13] *
00235 x13 + coeff[14] * x12 * x21 + coeff[15] * x11 * x26 + coeff[16] *
00236 x26 + coeff[17] * x11 * x27 + coeff[18] * x17 * x21 + coeff[19] *
00237 x15 * x21 + coeff[20] * x12 * x22 + coeff[21] * x12 * x23 + coeff[
00238 22] * x27 + coeff[23] * x14 * x22 + coeff[24] * x16 * x21 + coeff[
00239 25] * x17 + coeff[26] * x17 * x22;
00240
00241 return ret_val;
00242 }
00243
00244
00245 double CSCDriftSim::driftTimeSigmaHighB() {
00246
00247
00248 static const double coeff[17] = { 5.5533465,3.3733352,3.776603,2.2673355,
00249 1.3401485,.84209333,-.71621378,.57572407,-.52313936,-.78790514,
00250 -.71786066,.43370011,.29223306,-.37791975,.21121024,.31513644,
00251 .25382701 };
00252
00253
00254 float ret_val;
00255
00256
00257 double x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20,
00258 x21, x22, x23, x24, x25, x26, x27, x28, x29;
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302 x10 = 1.;
00303 x11 = fabs(ycell) * 2. - 1.;
00304 x12 = x11 * 2. * x11 - x10;
00305 x13 = x11 * 2. * x12 - x11;
00306 x14 = x11 * 2. * x13 - x12;
00307 x15 = x11 * 2. * x14 - x13;
00308 x16 = x11 * 2. * x15 - x14;
00309 x17 = x11 * 2. * x16 - x15;
00310 x18 = x11 * 2. * x17 - x16;
00311 x19 = x11 * 2. * x18 - x17;
00312 x20 = 1.;
00313 x21 = fabs(zcell) * 2. - 1.;
00314 x22 = x21 * 2. * x21 - x20;
00315 x23 = x21 * 2. * x22 - x21;
00316 x24 = x21 * 2. * x23 - x22;
00317 x25 = x21 * 2. * x24 - x23;
00318 x26 = x21 * 2. * x25 - x24;
00319 x27 = x21 * 2. * x26 - x25;
00320 x28 = x21 * 2. * x27 - x26;
00321 x29 = x21 * 2. * x28 - x27;
00322
00323 ret_val = coeff[0] * x21 + coeff[1] + coeff[2] * x22 + coeff[3] * x23 +
00324 coeff[4] * x24 + coeff[5] * x25 + coeff[6] * x11 * x23 + coeff[7]
00325 * x26 + coeff[8] * x11 * x25 + coeff[9] * x11 * x24 + coeff[10] *
00326 x11 * x22 + coeff[11] * x27 + coeff[12] * x28 + coeff[13] * x11 *
00327 x26 + coeff[14] * x29 + coeff[15] * x16 * x21 + coeff[16] * x18 *
00328 x21;
00329
00330 return ret_val;
00331 }
00332