Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:42

0001 #include "SimMuon/CSCDigitizer/src/CSCDriftSim.h"
0002 #include <cmath>
0003 
0004 // the following functions were all generated by f2c.
0005 // vin tried to optimize them...
0006 //     with no sizeble effect....
0007 
0008 double CSCDriftSim::avgDrift() const {
0009   /* Initialized data */
0010 
0011   static const double coeff[6] = {-.08618265, -.0020471805, -7.7771331e-4, -.0058433565, -5.0241491e-4, .0010223353};
0012 
0013   /* ! Parameterization of Lorentz drift in CSCs */
0014   /* ***********************************************************************
0015    * DOC MC_ALL_BDFT                                                       *
0016    *                                                                       *
0017    * DOC  Function    : Parameterization of the Lorentz drift of electrons *
0018    * DOC                in the muon endcap CSCs.                           *
0019    *                                                                       *
0020    * DOC  References  : None                                               *
0021    *                                                                       *
0022    * DOC  Arguments   : BZ  - z componant of the local magnetic            *
0023    *                         field in kgauss                               *
0024    * DOC                ZCELL - distance from the anode wire in the wire   *
0025    *                           plane coordinate normalized to one          *
0026    * DOC  Errors      : None                                               *
0027    *                                                                       *
0028    * DOC  Returns     : Drift distance along the anode wire                *
0029    *                                                                       *
0030    * DOC  Created     : 15-OCT-1996   Author : Jeff Rowe                   *
0031    * ***********************************************************************
0032    */
0033 
0034   const double x10 = 1.;
0035   const double x11 = bz / 40.;
0036   const double x12 = x11 * 2. * x11 - x10;
0037   const double x13 = x11 * 2. * x12 - x11;
0038   const double x14 = x11 * 2. * x13 - x12;
0039   const double x15 = x11 * 2. * x14 - x13;
0040   const double x16 = x11 * 2. * x15 - x14;
0041   const double x17 = x11 * 2. * x16 - x15;
0042   const double x18 = x11 * 2. * x17 - x16;
0043   const double x19 = x11 * 2. * x18 - x17;
0044   const double x20 = 1.;
0045   const double x21 = zcell;
0046   const double x22 = x21 * 2. * x21 - x20;
0047   const double x23 = x21 * 2. * x22 - x21;
0048   const double x24 = x21 * 2. * x23 - x22;
0049   const double x25 = x21 * 2. * x24 - x23;
0050   const double x26 = x21 * 2. * x25 - x24;
0051   const double x27 = x21 * 2. * x26 - x25;
0052 
0053   // not sure why we need a minus sign for avgDrift, but we think the
0054   // parametrization has a wrong sign.  For the +z endcap, bz should
0055   // be negative in local coord, so it should drift to the right
0056   // if drifting up (neg zcell), and to the left if it drifts down.  It doesn't.
0057   // the first-order term here is -0.08 * bz/40 * zcell
0058 
0059   return -1 * (coeff[0] * x11 * x21 + coeff[1] * x17 * x21 + coeff[2] * x21 + coeff[3] * x11 * x27 + coeff[4] * x22 +
0060                coeff[5] * x19);
0061 }
0062 
0063 double CSCDriftSim::driftSigma() const {
0064   // Initialized data
0065 
0066   static const double coeff[3] = {.01069525, .010364504, .0021662697};
0067 
0068   /* ! Parameterization of Lorentz drift error in CSCs */
0069   /*************************************************************************
0070    * DOC MC_ALL_BSIG                                                       *
0071    *                                                                       *
0072    * DOC  Function    : Parameterization of the dispersion in Lorentz Drift*
0073    * DOC                in the muon endcap CSCs.                           *
0074    *                                                                       *
0075    * DOC  References  : None                                               *
0076    *                                                                       *
0077    * DOC  Arguments   : BZ  - z componant of the local magnetic            *
0078    * DOC                ZCELL - distance from the anode wire in the wire   *
0079    *                           plane coordinate normalized to 1            *
0080    * DOC  Errors      : None                                               *
0081    *                                                                       *
0082    * DOC  Returns     : Dispersion in Lorentz drift along anode wire       *
0083    *                                                                       *
0084    * DOC  Created     : 15-OCT-1996   Author : Jeff Rowe                   *
0085    * ***********************************************************************
0086    */
0087 
0088   const double x11 = bz / 40.;
0089   const double x20 = 1.;
0090   const double x21 = zcell;
0091   const double x22 = x21 * 2. * x21 - x20;
0092 
0093   return coeff[0] + coeff[1] * x11 * x21 + coeff[2] * x22;
0094 }