File indexing completed on 2024-04-06 12:30:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "SimMuon/DTDigitizer/src/DTDriftTimeParametrization.cc"
0016
0017 #include <iostream>
0018
0019 void average() {
0020 short interpolate = 1;
0021 DTDriftTimeParametrization::drift_time DT;
0022 static const DTDriftTimeParametrization p;
0023 double alpha = 0;
0024 double Bwire = 0;
0025 double Bnorm = 0;
0026
0027 float mean = 0;
0028 int count = 0;
0029 for (int i = 1; i < 21; i++) {
0030 p.MB_DT_drift_time(i, alpha, Bwire, Bnorm, 0, &DT, interpolate);
0031 mean += DT.v_drift;
0032 count++;
0033 }
0034
0035 mean /= count;
0036
0037 std::cout << " mean vd = " << mean;
0038 }
0039
0040 void printDt(double x, double alpha, double Bwire, double Bnorm, int ifl) {
0041 short interpolate = 1;
0042
0043 DTDriftTimeParametrization::drift_time DT;
0044 static const DTDriftTimeParametrization p;
0045 unsigned short status = p.MB_DT_drift_time(x, alpha, Bwire, Bnorm, ifl, &DT, interpolate);
0046
0047 std::cout << "(x = " << x << ", alpha = " << alpha << ", Bwire = " << Bwire << ", Bnorm = " << Bnorm
0048 << ", ifl = " << ifl << "):" << std::endl
0049 << "\tt_drift (ns) = " << DT.t_drift << " t_width_m = " << DT.t_width_m << " t_width_p = " << DT.t_width_p
0050 << " v_drift (ns) = " << DT.v_drift << " status " << status << std::endl;
0051
0052 }
0053
0054 int main() {
0055 average();
0056
0057 std::cout << "Enter x(mm), alpha(deg), Bwire(T), Bnorm(T), ifl(0=x from "
0058 "wire; 1=x fom cell edge)"
0059 << std::endl;
0060
0061 while (true) {
0062 double x = 0, alpha = 0, Bwire = 0, Bnorm = 0;
0063 int ifl = 1;
0064 std::cin >> x >> alpha >> Bwire >> Bnorm >> ifl;
0065 if (!std::cin)
0066 break;
0067 printDt(x, alpha, Bwire, Bnorm, ifl);
0068 }
0069 }