34 {
35
36 if(arg!=0){
37 const CaloDetDescrElement *caloDDE = (const CaloDetDescrElement*) arg;
38
40
41#ifndef NDEBUG
46
48
50 << clus->
energy(CaloSampling::PreSamplerB) );
52 << clus->
energy(CaloSampling::EMB1) );
54 << clus->
energy(CaloSampling::EMB2) );
56 << clus->
energy(CaloSampling::EMB3) );
58 << clus->
energy(CaloSampling::PreSamplerE) );
60 << clus->
energy(CaloSampling::EME1) );
62 << clus->
energy(CaloSampling::EME2) );
64 << clus->
energy(CaloSampling::EME3) );
65
68 ATH_MSG_DEBUG(
"[GOOD]: seedCell location and selected eta range agree" );
71 ATH_MSG_DEBUG(
"[BAD]: seedCell location and selected eta range disagree !!" );
72#endif
73
74
77 return;
78
80 double elt_eta = caloDDE->
eta();
81 double elt_deta = caloDDE->
deta();
82
83
84
85 double u = 2*(
eta-elt_eta)/elt_deta;
86
87
88 double elt_eta_raw = clus->
rawEta();
89
90 if(elt_eta_raw<0.)
u=-
u;
91
92
93 if(u>1)
95 else if(u<-1)
97
98
99 double aeta = fabs(
eta - elt_eta + elt_eta_raw);
100
101#ifndef NDEBUG
108#endif
109
110
111 int region_ndx=-1;
113 unsigned int nreg =
regions.size();
114
115
116 for (
unsigned int i=0;
i<nreg;
i++) {
119 break;
120 }
121 }
122
123
124 if(region_ndx<0){
125 return;
126 }
127
128
129
132 u = fmod(aeta,cellsize)/cellsize*2 - 1;
133 }
134
136
138
139
140 const CxxUtils::Array<1> energies =
m_energies();
141 unsigned int n_energies = energies.
size();
142 unsigned int shape[] = {n_energies, 2};
143 CaloRec::WritableArrayData<2> corrtab (shape);
144
145
146
147
148 unsigned int beg = 0;
149 unsigned int end = n_energies;
150 if(energy <= energies[0])
152 else if(energy >= energies[n_energies-1])
154
155
156 int n_good = 0;
157 for (
unsigned int i=beg;
i<
end;
i++)
158 docalc(i, *builder, energies, corrtab, n_good);
159
160
161
162 while (n_good==0 && beg>0) {
164 docalc (beg, *builder, energies, corrtab, n_good);
165 }
166 while (n_good == 0 && end<n_energies) {
167 docalc(end, *builder, energies, corrtab, n_good);
169 }
170
171
172
173
174
175 float offs=0;
176
177 if(n_good==0){
178 offs=0;
179 }
180 else if(n_good==1){
181 offs=corrtab[0][1];
182 }
183 else if(energy<=corrtab[0][0]){
184 offs=corrtab[0][1];
185 }
186 else if(energy>=corrtab[n_good-1][0]) {
187 offs=corrtab[n_good-1][1];
188 }
189 else{
191 energy,
193 1,
194 CaloRec::Array<1>(),
195 n_good);
196 }
197
199 offs=-offs;
200
202
203#ifndef NDEBUG
207#endif
208
210 }
211}
Scalar eta() const
pseudorapidity method
static const std::vector< std::string > regions
float eta() const
cell eta
float deta() const
cell deta
const CaloDetDescriptor * descriptor() const
cell descriptor
bool is_lar_em_barrel() const
descriptor belongs to EM barrel
bool is_lar_em_endcap() const
descriptor belongs to EM end cap
unsigned int size(unsigned int dim=0) const
Return the size of the array along one dimension.
Constant< CxxUtils::Array< 1 > > m_energies
Table of energies at which the correction was tabulated.
void docalc(int, const CaloClusterCorrectionCommon::TableBuilder &, const CxxUtils::Array< 1 > &, CxxUtils::WritableArray< 2 > &, int &) const
Constant< int > m_energy_degree
Degree of the polynomial interpolation in energy.
Constant< bool > m_isRange_barrel
Constant< CxxUtils::Array< 2 > > m_regions
Calibration constant: table of regions.
float rawEta() const
get Raw Eta (no calibration)
void setEta(float)
set Eta (calibrated)
float eta() const
get Eta (calibrated)
float energy() const
get Energy (calibrated)
float interpolate(const CaloRec::Array< 2 > &a, float x, unsigned int degree, unsigned int ycol=1, const CaloRec::Array< 1 > ®ions=CaloRec::Array< 1 >(), int n_points=-1, bool fixZero=false)
Polynomial interpolation in a table.
@ u
Enums for curvilinear frames.