ATLAS Offline Software
NnNormalization.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
8 #include <cmath>
9 #include <limits>
10 
11 inline bool
12 roughlyEqual(const double d, const double target, const double tolerance=0.001){
13  return (fabs(d-target)<tolerance);
14 }
15 
16 double norm_rawToT(const double input){
17  return (input-21.)/12.;
18 }
19 
20 double back_rawToT(const double input){
21  return input*12.+21.;
22 }
23 
24 double norm_ToT(const double input){
25  return (input-15000.)/15000.;
26 }
27 
28 double back_ToT(const double input){
29  return input*15000.+15000.;
30 }
31 
32 double norm_pitch(const double input,const bool addIBL){
33  if (!addIBL){
34  if (roughlyEqual(input,0.4)) return -0.5;
35  if (roughlyEqual(input,0.6)) return +0.5;
36  //sroe, changed in response to ATLASRECTS-1827
37  return std::numeric_limits<double>::quiet_NaN();
38  //throw SiClusterizationToolNormalizationException();
39  //return -1; //never reached!
40  } else {
41  return (input-0.37)*10.;
42  }
43 }
44 
45 double back_pitch(const double input,const bool addIBL){
46  if (!addIBL){
47  if (roughlyEqual(input,-0.5)) return 0.4;
48  if (roughlyEqual(input,0.5)) return 0.6;
49  return std::numeric_limits<double>::quiet_NaN();
50  //throw SiClusterizationToolNormalizationException();
51  //return 0; //never reached!
52  } else {
53  return input*0.10+0.37;
54  }
55 }
56 
57 double norm_layerNumber(const double input){
58  return (input-0.95)/0.8;
59 }
60 
61 double back_layerNumber(const double input){
62  return input*0.8+0.95;
63 }
64 double norm_layerType(const double input){
65  return input/0.65;
66 }
67 double back_layerType(const double input){
68  return input*0.65;
69 }
70 
71 double norm_phi(const double input){
72  return (input-0.1)*10.;
73 }
74 
75 double back_phi(const double input){
76  return input*0.1+0.1;
77 }
78 
79 double norm_theta(const double input){
80  return (input)/0.8;
81 }
82 
83 double back_theta(const double input){
84  return input*0.8;
85 }
86 double norm_phiBS(const double input){
87  return (input-0.1)*10.;
88 }
89 
90 double back_phiBS(const double input){
91  return input*0.1+0.1;
92 }
93 
94 double norm_thetaBS(const double input){
95  return (input)/0.8;
96 }
97 
98 double back_thetaBS(const double input){
99  return input*0.8;
100 }
101 double norm_etaModule(const double input){
102  return input*0.5;
103 }
104 double back_etaModule(const double input){
105  return input*2.;
106 }
107 
108 double norm_posX(const double input,const bool recenter){
109  if (recenter) return (input)/0.41;
110  return (input-(-0.58))/0.41;
111 }
112 
113 double back_posX(const double input,const bool recenter){
114  if (recenter) return input*0.41;
115  return input*0.41+(-0.58);
116 }
117 
118 double norm_posY(const double input){
119  return input/0.34;
120 }
121 
122 double back_posY(const double input){
123  return input*0.34+0.;
124 }
125 double norm_errorX(const double input){
126  return (input-0.0005)*1000.;
127 }
128 double back_errorX(const double input){
129  return input*0.001+0.0005;
130 }
131 
132 double norm_errorY(const double input){
133  return (input-0.018)/0.048;
134 }
135 
136 double back_errorY(const double input){
137  return input*0.048+0.018;
138 }
139 
140 double errorHalfIntervalX(const int nParticles){
141  return (nParticles==1) ? 0.03:0.05;
142 }
143 
144 double errorHalfIntervalY(const int nParticles){
145  return (nParticles==1) ? 0.3:0.4;
146 }
147 
148 
back_phiBS
double back_phiBS(const double input)
Definition: NnNormalization.cxx:90
SiClusterizationToolNormalizationException.h
JetGeom::recenter
point_t recenter(const point_t &p, const point_t &center)
Definition: cyl_geom.h:226
norm_layerNumber
double norm_layerNumber(const double input)
Definition: NnNormalization.cxx:57
back_errorX
double back_errorX(const double input)
Definition: NnNormalization.cxx:128
back_rawToT
double back_rawToT(const double input)
Definition: NnNormalization.cxx:20
hist_file_dump.d
d
Definition: hist_file_dump.py:137
errorHalfIntervalY
double errorHalfIntervalY(const int nParticles)
Definition: NnNormalization.cxx:144
back_thetaBS
double back_thetaBS(const double input)
Definition: NnNormalization.cxx:98
back_posY
double back_posY(const double input)
Definition: NnNormalization.cxx:122
norm_errorX
double norm_errorX(const double input)
Definition: NnNormalization.cxx:125
norm_layerType
double norm_layerType(const double input)
Definition: NnNormalization.cxx:64
norm_theta
double norm_theta(const double input)
Definition: NnNormalization.cxx:79
back_layerNumber
double back_layerNumber(const double input)
Definition: NnNormalization.cxx:61
errorHalfIntervalX
double errorHalfIntervalX(const int nParticles)
Definition: NnNormalization.cxx:140
back_etaModule
double back_etaModule(const double input)
Definition: NnNormalization.cxx:104
norm_rawToT
double norm_rawToT(const double input)
Definition: NnNormalization.cxx:16
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
norm_posX
double norm_posX(const double input, const bool recenter)
Definition: NnNormalization.cxx:108
roughlyEqual
bool roughlyEqual(const double d, const double target, const double tolerance=0.001)
Definition: NnNormalization.cxx:12
norm_phi
double norm_phi(const double input)
Definition: NnNormalization.cxx:71
back_errorY
double back_errorY(const double input)
Definition: NnNormalization.cxx:136
back_posX
double back_posX(const double input, const bool recenter)
Definition: NnNormalization.cxx:113
norm_ToT
double norm_ToT(const double input)
Definition: NnNormalization.cxx:24
tolerance
Definition: suep_shower.h:17
norm_posY
double norm_posY(const double input)
Definition: NnNormalization.cxx:118
norm_thetaBS
double norm_thetaBS(const double input)
Definition: NnNormalization.cxx:94
back_theta
double back_theta(const double input)
Definition: NnNormalization.cxx:83
back_pitch
double back_pitch(const double input, const bool addIBL)
Definition: NnNormalization.cxx:45
copySelective.target
string target
Definition: copySelective.py:37
back_layerType
double back_layerType(const double input)
Definition: NnNormalization.cxx:67
norm_errorY
double norm_errorY(const double input)
Definition: NnNormalization.cxx:132
NnNormalization.h
norm_pitch
double norm_pitch(const double input, const bool addIBL)
Definition: NnNormalization.cxx:32
norm_phiBS
double norm_phiBS(const double input)
Definition: NnNormalization.cxx:86
back_phi
double back_phi(const double input)
Definition: NnNormalization.cxx:75
norm_etaModule
double norm_etaModule(const double input)
Definition: NnNormalization.cxx:101
back_ToT
double back_ToT(const double input)
Definition: NnNormalization.cxx:28