CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCGattiFunction.cc
Go to the documentation of this file.
4 #include <cmath>
5 #ifndef M_PI_2
6 #define M_PI_2 1.57079632679489661923
7 #endif
8 
9 
11 : k1(0.),
12  k2(0.),
13  k3(0.),
14  h(0.),
15  norm(0.),
16  sqrtk3(0.),
17  thePreviousSpecs(0)
18 {
19 }
20 
21 
23  if(&chamberSpecs != thePreviousSpecs) {
24  LogTrace("CSCGattiFunction") << "CSCGattiFunction::initChamberSpecs setting new values.";
25  h = chamberSpecs.anodeCathodeSpacing();
26  double s = chamberSpecs.wireSpacing();
27  double ra = chamberSpecs.wireRadius();
28  static const double parm[5] = {.1989337e-02, -.6901542e-04, .8665786,
29  154.6177, -.6801630e-03 };
30  k3 = (parm[0]*s/h + parm[1])
31  * (parm[2]*s/ra + parm[3] + parm[4]*s*s/ra/ra);
32  sqrtk3 = sqrt(k3);
33  norm = 0.5 / std::atan( sqrtk3 );
34  k2 = M_PI_2 * (1. - sqrtk3/2.);
35  k1 = 0.25 * k2 * sqrtk3 / std::atan(sqrtk3);
36  thePreviousSpecs = &chamberSpecs;
37  }
38 
39  LogTrace("CSCGattiFunction") << "CSCGattiFunction: constants k1=" <<
40  k1 << ", k2=" << k2 << ", k3=" << k3 <<
41  ", h=" << h << ", norm=" << norm;
42 }
43 
44 
45 double CSCGattiFunction::binValue( double x, double stripWidth) const {
46  double tanh1 = tanh(k2 * (x+stripWidth*0.5)/h );
47  double tanh2 = tanh(k2 * (x-stripWidth*0.5)/h );
48  return norm * ( std::atan(sqrtk3*tanh1) - std::atan(sqrtk3*tanh2) );
49 }
50 
double binValue(double x, double stripWidth) const
#define M_PI_2
float wireRadius() const
void initChamberSpecs(const CSCChamberSpecs &)
Calculates k1, k2, k3, h per chamber type, if necessary.
T sqrt(T t)
Definition: SSEVec.h:46
const CSCChamberSpecs * thePreviousSpecs
float wireSpacing() const
#define LogTrace(id)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
float anodeCathodeSpacing() const
x
Definition: VDTMath.h:216