File indexing completed on 2024-04-06 12:30:42
0001 #include "SimMuon/CSCDigitizer/src/CSCDriftSim.h"
0002 #include <cmath>
0003 #include <iostream>
0004
0005
0006
0007 double CSCDriftSim::avgPathLengthLowB() {
0008 static const double coeff[7] = {.28872209, .21705601, .063908389, -.012224924, .012901814, -.0089355058, -.015769145};
0009
0010
0011 float ret_val;
0012
0013
0014 double x10, x11, x12, x13, x20, x21, x22;
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 x10 = 1.;
0055 x11 = fabs(ycell) * 2. - 1.;
0056 x12 = x11 * 2. * x11 - x10;
0057 x13 = x11 * 2. * x12 - x11;
0058 x20 = 1.;
0059 x21 = fabs(zcell) * 2. - 1.;
0060 x22 = x21 * 2. * x21 - x20;
0061 ret_val = coeff[0] + coeff[1] * x11 + coeff[2] * x21 + coeff[3] * x12 * x22 + coeff[4] * x22 + coeff[5] * x13 +
0062 coeff[6] * x11 * x21;
0063 return ret_val;
0064 }
0065
0066 double CSCDriftSim::pathSigmaLowB() {
0067
0068
0069 static const double coeff[12] = {.002854441,
0070 8.701339e-4,
0071 .0053064193,
0072 .0012356508,
0073 9.8627318e-4,
0074 .0013802449,
0075 -5.4633755e-4,
0076 .0026078648,
0077 .0044171026,
0078 6.2029063e-4,
0079 .0011392474,
0080 -.0056275595};
0081
0082
0083 float ret_val;
0084
0085
0086 double x11, x12, x13, x14, x15, x16, x21, x22, x23, x24, x25, x26, x27, x28, x29, x210, x211, x212,
0087 x213;
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130 x11 = fabs(ycell) * 2. - 1.;
0131 x12 = x11 * x11;
0132 x13 = x11 * x12;
0133 x14 = x11 * x13;
0134 x15 = x11 * x14;
0135 x16 = x11 * x15;
0136
0137 x21 = fabs(zcell) * 2. - 1.;
0138 x22 = x21 * x21;
0139 x23 = x21 * x22;
0140 x24 = x21 * x23;
0141 x25 = x21 * x24;
0142 x26 = x21 * x25;
0143 x27 = x21 * x26;
0144 x28 = x21 * x27;
0145 x29 = x21 * x28;
0146 x210 = x21 * x29;
0147 x211 = x21 * x210;
0148 x212 = x21 * x211;
0149 x213 = x21 * x212;
0150 ret_val = coeff[0] + coeff[1] * x23 + coeff[2] * x24 + coeff[3] * x13 + coeff[4] * x11 * x21 + coeff[5] * x11 * x22 +
0151 coeff[6] * x16 + coeff[7] * x213 + coeff[8] * x212 + coeff[9] * x21 + coeff[10] * x11 * x23 +
0152 coeff[11] * x26;
0153
0154 return ret_val;
0155 }
0156
0157 double CSCDriftSim::avgDriftTimeLowB() {
0158
0159
0160 static const double coeff[20] = {42.981588, 25.732805, 26.539129, 16.719016, 10.862044, 7.4859085, 5.0353142,
0161 3.3620548, 1.9057762, 2.2207695, -2.6787582, 1.2977292, -.8358091, 1.2452612,
0162 .74813469, -.57581194, .32705275, -.85426489, -.55688158, -.38384903};
0163
0164
0165 float ret_val;
0166
0167
0168 double x10, x11, x12, x13, x14, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29;
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209
0210 x10 = 1.;
0211 x11 = fabs(ycell) * 2. - 1.;
0212 x12 = x11 * 2. * x11 - x10;
0213 x13 = x11 * 2. * x12 - x11;
0214 x14 = x11 * 2. * x13 - x12;
0215 x20 = 1.;
0216 x21 = fabs(zcell) * 2. - 1.;
0217 x22 = x21 * 2. * x21 - x20;
0218 x23 = x21 * 2. * x22 - x21;
0219 x24 = x21 * 2. * x23 - x22;
0220 x25 = x21 * 2. * x24 - x23;
0221 x26 = x21 * 2. * x25 - x24;
0222 x27 = x21 * 2. * x26 - x25;
0223 x28 = x21 * 2. * x27 - x26;
0224 x29 = x21 * 2. * x28 - x27;
0225
0226 ret_val = coeff[0] + coeff[1] * x11 + coeff[2] * x21 + coeff[3] * x22 + coeff[4] * x23 + coeff[5] * x24 +
0227 coeff[6] * x25 + coeff[7] * x26 + coeff[8] * x12 + coeff[9] * x27 + coeff[10] * x11 * x21 +
0228 coeff[11] * x28 + coeff[12] * x13 + coeff[13] * x12 * x21 + coeff[14] * x29 + coeff[15] * x13 * x21 +
0229 coeff[16] * x14 + coeff[17] * x11 * x22 + coeff[18] * x11 * x23 + coeff[19] * x11 * x24;
0230 return ret_val;
0231 }
0232
0233 double CSCDriftSim::driftTimeSigmaLowB() {
0234
0235
0236 static const double coeff[19] = {6.2681223,
0237 3.5916437,
0238 5.5425809,
0239 4.6974052,
0240 3.8472392,
0241 3.1019155,
0242 2.4323913,
0243 1.8695623,
0244 1.3909068,
0245 .99056625,
0246 .52066638,
0247 .64671229,
0248 .68023389,
0249 .40512251,
0250 .40202738,
0251 .23908531,
0252 -.41245784,
0253 -.32196924,
0254 -.29890696};
0255
0256
0257 double x11, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x210, x211, x212;
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299
0300 x11 = fabs(ycell) * 2. - 1.;
0301 x20 = 1.;
0302 x21 = fabs(zcell) * 2. - 1.;
0303 x22 = x21 * 2. * x21 - x20;
0304 x23 = x21 * 2. * x22 - x21;
0305 x24 = x21 * 2. * x23 - x22;
0306 x25 = x21 * 2. * x24 - x23;
0307 x26 = x21 * 2. * x25 - x24;
0308 x27 = x21 * 2. * x26 - x25;
0309 x28 = x21 * 2. * x27 - x26;
0310 x29 = x21 * 2. * x28 - x27;
0311 x210 = x21 * 2. * x29 - x28;
0312 x211 = x21 * 2. * x210 - x29;
0313 x212 = x21 * 2. * x211 - x210;
0314
0315 return coeff[0] * x21 + coeff[1] + coeff[2] * x22 + coeff[3] * x23 + coeff[4] * x24 + coeff[5] * x25 +
0316 coeff[6] * x26 + coeff[7] * x27 + coeff[8] * x28 + coeff[9] * x29 + coeff[10] * x11 + coeff[11] * x11 * x21 +
0317 coeff[12] * x210 + coeff[13] * x11 * x22 + coeff[14] * x211 + coeff[15] * x212 + coeff[16] * x11 * x25 +
0318 coeff[17] * x11 * x27 + coeff[18] * x11 * x26;
0319 }