CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 CSCGattiFunction::CSCGattiFunction() : k1(0.), k2(0.), k3(0.), h(0.), norm(0.), sqrtk3(0.), thePreviousSpecs(nullptr) {}
10 
12  if (&chamberSpecs != thePreviousSpecs) {
13  LogTrace("CSCGattiFunction") << "CSCGattiFunction::initChamberSpecs setting new values.";
14  h = chamberSpecs.anodeCathodeSpacing();
15  double s = chamberSpecs.wireSpacing();
16  double ra = chamberSpecs.wireRadius();
17  static const double parm[5] = {.1989337e-02, -.6901542e-04, .8665786, 154.6177, -.6801630e-03};
18  k3 = (parm[0] * s / h + parm[1]) * (parm[2] * s / ra + parm[3] + parm[4] * s * s / ra / ra);
19  sqrtk3 = sqrt(k3);
20  norm = 0.5 / std::atan(sqrtk3);
21  k2 = M_PI_2 * (1. - sqrtk3 / 2.);
22  k1 = 0.25 * k2 * sqrtk3 / std::atan(sqrtk3);
23  thePreviousSpecs = &chamberSpecs;
24  }
25 
26  LogTrace("CSCGattiFunction") << "CSCGattiFunction: constants k1=" << k1 << ", k2=" << k2 << ", k3=" << k3
27  << ", h=" << h << ", norm=" << norm;
28 }
29 
30 double CSCGattiFunction::binValue(double x, double stripWidth) const {
31  double tanh1 = tanh(k2 * (x + stripWidth * 0.5) / h);
32  double tanh2 = tanh(k2 * (x - stripWidth * 0.5) / h);
33  return norm * (std::atan(sqrtk3 * tanh1) - std::atan(sqrtk3 * tanh2));
34 }
double binValue(double x, double stripWidth) const
#define M_PI_2
float wireRadius() const
#define LogTrace(id)
void initChamberSpecs(const CSCChamberSpecs &)
Calculates k1, k2, k3, h per chamber type, if necessary.
T sqrt(T t)
Definition: SSEVec.h:19
const CSCChamberSpecs * thePreviousSpecs
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
float wireSpacing() const
float anodeCathodeSpacing() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4