Geometry
CSCGeometry
src
CSCGattiFunction.cc
Go to the documentation of this file.
1
#include "
Geometry/CSCGeometry/interface/CSCGattiFunction.h
"
2
#include "
Geometry/CSCGeometry/interface/CSCChamberSpecs.h
"
3
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
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
11
void
CSCGattiFunction::initChamberSpecs
(
const
CSCChamberSpecs
& chamberSpecs) {
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
}
MessageLogger.h
CSCGattiFunction::binValue
double binValue(double x, double stripWidth) const
Definition:
CSCGattiFunction.cc:30
CSCChamberSpecs
Definition:
CSCChamberSpecs.h:39
DDAxes::x
CSCChamberSpecs::wireRadius
float wireRadius() const
Definition:
CSCChamberSpecs.h:159
CSCChamberSpecs::wireSpacing
float wireSpacing() const
Definition:
CSCChamberSpecs.cc:175
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
CSCGattiFunction::k2
double k2
Definition:
CSCGattiFunction.h:56
CSCGattiFunction::CSCGattiFunction
CSCGattiFunction()
Definition:
CSCGattiFunction.cc:9
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
h
CSCGattiFunction::k3
double k3
Definition:
CSCGattiFunction.h:56
CSCGattiFunction::norm
double norm
Definition:
CSCGattiFunction.h:57
CSCGattiFunction::thePreviousSpecs
const CSCChamberSpecs * thePreviousSpecs
Definition:
CSCGattiFunction.h:59
CSCGattiFunction::sqrtk3
double sqrtk3
Definition:
CSCGattiFunction.h:57
genVertex_cff.x
x
Definition:
genVertex_cff.py:12
CSCGattiFunction::initChamberSpecs
void initChamberSpecs(const CSCChamberSpecs &)
Calculates k1, k2, k3, h per chamber type, if necessary.
Definition:
CSCGattiFunction.cc:11
CSCGattiFunction.h
M_PI_2
#define M_PI_2
Definition:
CSCGattiFunction.cc:6
CSCGattiFunction::k1
double k1
Definition:
CSCGattiFunction.h:56
CSCChamberSpecs.h
LogTrace
#define LogTrace(id)
Definition:
MessageLogger.h:234
CSCChamberSpecs::anodeCathodeSpacing
float anodeCathodeSpacing() const
Definition:
CSCChamberSpecs.h:136
Generated for CMSSW Reference Manual by
1.8.16