CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PhotonFix.cc
Go to the documentation of this file.
1 #include <cmath>
2 #include <cassert>
3 #include <fstream>
4 #include <iomanip>
5 
6 // ensure that this include points to the appropriate location for PhotonFix.h
7 #include "../interface/PhotonFix.h"
8 
9 PhotonFix::PhotonFix(double e, double eta, double phi, double r9) :
10  _e(e), _eta(eta), _phi(phi), _r9(r9) {
11 
12  setup();
13 }
14 
16  // Check constants have been set up
18 
19  // Determine if EB or EE
20  _be=(fabs(_eta)<1.48?0:1);
21 
22  // Determine if high or low R9
23  if(_be==0) _hl=(_r9>=0.94?0:1);
24  else _hl=(_r9>=0.95?0:1);
25 
26  // Coordinates relative to cracks
27  double r2Min;
28  if(_be==0) {
29 
30  r2Min=1.0e6;
31  for(unsigned i(0);i<169;i++) {
32  for(unsigned j(0);j<360;j++) {
33  double de(_eta-_barrelCGap[i][j][0]);
34  double df(dPhi(_phi,_barrelCGap[i][j][1]));
35  double r2(de*de+df*df);
36 
37  if(r2<r2Min) {
38  r2Min=r2;
39  if(i>=84) {
40  _aC= de;
41  _bC=-df;
42  } else {
43  _aC=-de;
44  _bC= df;
45  }
46  }
47  }
48  }
49 
50  r2Min=1.0e6;
51  for(unsigned i(0);i<33;i++) {
52  for(unsigned j(0);j<180;j++) {
53  double de(_eta-_barrelSGap[i][j][0]);
54  double df(dPhi(_phi,_barrelSGap[i][j][1]));
55  double r2(de*de+df*df);
56 
57  if(r2<r2Min) {
58  r2Min=r2;
59  if(i>=16) {
60  _aS= de;
61  _bS=-df;
62  } else {
63  _aS=-de;
64  _bS= df;
65  }
66  }
67  }
68  }
69 
70  r2Min=1.0e6;
71  for(unsigned i(0);i<7;i++) {
72  for(unsigned j(0);j<18;j++) {
73  double de(_eta-_barrelMGap[i][j][0]);
74  double df(dPhi(_phi,_barrelMGap[i][j][1]));
75  double r2(de*de+df*df);
76 
77  if(r2<r2Min) {
78  r2Min=r2;
79  if(i>=3) {
80  _aM= de;
81  _bM=-df;
82  } else {
83  _aM=-de;
84  _bM= df;
85  }
86  }
87  }
88  }
89 
90  } else {
91  unsigned iz(_eta>=0.0?0:1);
92  double r[2]={xZ(),yZ()};
93 
94  r2Min=1.0e6;
95  for(unsigned i(0);i<7080;i++) {
96  double dx(r[0]-_endcapCGap[iz][i][0]);
97  double dy(r[1]-_endcapCGap[iz][i][1]);
98  double r2(dx*dx+dy*dy);
99 
100  if(r2<r2Min) {
101  r2Min=r2;
102  if(r[0]>0.0) _aC= dx;
103  else _aC=-dx;
104  if(r[1]>0.0) _bC= dy;
105  else _bC=-dy;
106  }
107  }
108 
109  r2Min=1.0e6;
110  for(unsigned i(0);i<264;i++) {
111  double dx(r[0]-_endcapSGap[iz][i][0]);
112  double dy(r[1]-_endcapSGap[iz][i][1]);
113  double r2(dx*dx+dy*dy);
114 
115  if(r2<r2Min) {
116  r2Min=r2;
117  if(r[0]>0.0) _aS= dx;
118  else _aS=-dx;
119  if(r[1]>0.0) _bS= dy;
120  else _bS=-dy;
121  }
122  }
123 
124  r2Min=1.0e6;
125  for(unsigned i(0);i<1;i++) {
126  double dx(r[0]-_endcapMGap[iz][i][0]);
127  double dy(r[1]-_endcapMGap[iz][i][1]);
128  double r2(dx*dx+dy*dy);
129 
130  if(r2<r2Min) {
131  r2Min=r2;
132  if(iz==0) {_aM= dx;_bM= dy;}
133  else {_aM=-dx;_bM=-dy;}
134  }
135  }
136  }
137 }
138 
139 double PhotonFix::fixedEnergy() const {
140  double f(0.0);
141 
142  // Overall scale and energy(T) dependence
143  f =_meanScale[_be][_hl][0];
144  f+=_meanScale[_be][_hl][1]*_e;
145  f+=_meanScale[_be][_hl][2]*_e/cosh(_eta);
146  f+=_meanScale[_be][_hl][3]*cosh(_eta)/_e;
147 
148  // General eta or zeta dependence
149  if(_be==0) {
150  f+=_meanAT[_be][_hl][0]*_eta*_eta;
151  f+=expCorrection(_eta,_meanBT[_be][_hl]);
152  } else {
153  f+=_meanAT[_be][_hl][0]*xZ()*xZ();
154  f+=_meanBT[_be][_hl][0]*yZ()*yZ();
155  }
156 
157  // Eta or x crystal, submodule and module dependence
159  f+=expCorrection(_aS,_meanAS[_be][_hl]);
160  f+=expCorrection(_aM,_meanAM[_be][_hl]);
161 
162  // Phi or y crystal, submodule and module dependence
163  f+=expCorrection(_bC,_meanBC[_be][_hl]);
164  f+=expCorrection(_bS,_meanBS[_be][_hl]);
165  f+=expCorrection(_bM,_meanBM[_be][_hl]);
166 
167  // R9 dependence
168  if(_hl==0) {
169  f+=_meanR9[_be][_hl][1]*(_r9-_meanR9[_be][_hl][0])*(_r9-_meanR9[_be][_hl][0])
170  +_meanR9[_be][_hl][2]*(_r9-_meanR9[_be][_hl][0])*(_r9-_meanR9[_be][_hl][0])*(_r9-_meanR9[_be][_hl][0]);
171  } else {
172  f+=_meanR9[_be][_hl][0]*_r9+_meanR9[_be][_hl][1]*_r9*_r9+_meanR9[_be][_hl][2]*_r9*_r9*_r9;
173  }
174 
175  return _e*f;
176 }
177 
178 double PhotonFix::sigmaEnergy() const {
179 
180  // Overall resolution scale vs energy
181  double sigma;
182  if(_be==0) {
183  sigma =_sigmaScale[_be][_hl][0]*_sigmaScale[_be][_hl][0];
184  //std::cout << "PhotonFix::sigmaEnergy 1 sigma = " << sigma << std::endl;
185  sigma+=_sigmaScale[_be][_hl][1]*_sigmaScale[_be][_hl][1]*_e;
186  //std::cout << "PhotonFix::sigmaEnergy 2 sigma = " << sigma << std::endl;
187  sigma+=_sigmaScale[_be][_hl][2]*_sigmaScale[_be][_hl][2]*_e*_e;
188  //std::cout << "PhotonFix::sigmaEnergy 3 sigma = " << sigma << std::endl;
189  } else {
190  sigma =_sigmaScale[_be][_hl][0]*_sigmaScale[_be][_hl][0]*cosh(_eta)*cosh(_eta);
191  sigma+=_sigmaScale[_be][_hl][1]*_sigmaScale[_be][_hl][1]*_e;
192  sigma+=_sigmaScale[_be][_hl][2]*_sigmaScale[_be][_hl][2]*_e*_e;
193  }
194  sigma=sqrt(sigma);
195 
196  double f(1.0);
197 
198  // General eta or zeta dependence
199  if(_be==0) {
200  f+=_sigmaAT[_be][_hl][0]*_eta*_eta;
201  //std::cout << "PhotonFix::sigmaEnergy 4 f = " << f << std::endl;
202  f+=expCorrection(_eta,_sigmaBT[_be][_hl]);
203  //std::cout << "PhotonFix::sigmaEnergy 5 f = " << f << std::endl;
204  } else {
205  f+=_sigmaAT[_be][_hl][0]*xZ()*xZ();
206  f+=_sigmaBT[_be][_hl][0]*yZ()*yZ();
207  }
208 
209  // Eta or x crystal, submodule and module dependence
211  //std::cout << "PhotonFix::sigmaEnergy 6 f = " << f << std::endl;
212  f+=expCorrection(_aS,_sigmaAS[_be][_hl]);
213  //std::cout << "PhotonFix::sigmaEnergy 7 f = " << f << std::endl;
214  f+=expCorrection(_aM,_sigmaAM[_be][_hl]);
215  //std::cout << "PhotonFix::sigmaEnergy 8 f = " << f << std::endl;
216 
217  // Phi or y crystal, submodule and module dependence
218  f+=expCorrection(_bC,_sigmaBC[_be][_hl]);
219  //std::cout << "PhotonFix::sigmaEnergy 9 f = " << f << std::endl;
220  f+=expCorrection(_bS,_sigmaBS[_be][_hl]);
221  //std::cout << "PhotonFix::sigmaEnergy 10 f = " << f << std::endl;
222  f+=expCorrection(_bM,_sigmaBM[_be][_hl]);
223  //std::cout << "PhotonFix::sigmaEnergy 11 f = " << f << std::endl;
224 
225  // R9 dependence
226  if(_hl==0) {
227  f+=_sigmaR9[_be][_hl][1]*(_r9-_sigmaR9[_be][_hl][0])*(_r9-_sigmaR9[_be][_hl][0])
228  +_sigmaR9[_be][_hl][2]*(_r9-_sigmaR9[_be][_hl][0])*(_r9-_sigmaR9[_be][_hl][0])*(_r9-_sigmaR9[_be][_hl][0]);
229  //std::cout << "PhotonFix::sigmaEnergy 12 f = " << f << std::endl;
230  } else {
231  f+=_sigmaR9[_be][_hl][0]*_r9+_sigmaR9[_be][_hl][1]*_r9*_r9;
232  //std::cout << "PhotonFix::sigmaEnergy 13 f = " << f << std::endl;
233  }
234 
235  return sigma*f;
236 }
237 
238 double PhotonFix::rawEnergy() const {
239  return _e;
240 }
241 
242 double PhotonFix::eta() const {
243  return _eta;
244 }
245 
246 double PhotonFix::phi() const {
247  return _phi;
248 }
249 
250 double PhotonFix::r9() const {
251  return _r9;
252 }
253 
254 double PhotonFix::etaC() const {
255  assert(_be==0);
256  return _aC;
257 }
258 
259 double PhotonFix::etaS() const {
260  assert(_be==0);
261  return _aS;
262 }
263 
264 double PhotonFix::etaM() const {
265  assert(_be==0);
266  return _aM;
267 }
268 
269 double PhotonFix::phiC() const {
270  assert(_be==0);
271  return _bC;
272 }
273 
274 double PhotonFix::phiS() const {
275  assert(_be==0);
276  return _bS;
277 }
278 
279 double PhotonFix::phiM() const {
280  assert(_be==0);
281  return _bM;
282 }
283 
284 double PhotonFix::xZ() const {
285  assert(_be==1);
286  return asinh(cos(_phi)/sinh(_eta));
287 }
288 
289 double PhotonFix::xC() const {
290  assert(_be==1);
291  return _aC;
292 }
293 
294 double PhotonFix::xS() const {
295  assert(_be==1);
296  return _aS;
297 }
298 
299 double PhotonFix::xM() const {
300  assert(_be==1);
301  return _aM;
302 }
303 
304 double PhotonFix::yZ() const {
305  assert(_be==1);
306  return asinh(sin(_phi)/sinh(_eta));
307 }
308 
309 double PhotonFix::yC() const {
310  assert(_be==1);
311  return _bC;
312 }
313 
314 double PhotonFix::yS() const {
315  assert(_be==1);
316  return _bS;
317 }
318 
319 double PhotonFix::yM() const {
320  assert(_be==1);
321  return _bM;
322 }
323 
324 double PhotonFix::GetaPhi(double f0, double f1){
325  return aPhi(f0,f1);
326 }
327 
328 void PhotonFix::barrelCGap(unsigned i, unsigned j, unsigned k, double c){
329  _barrelCGap[i][j][k] = c;
330 }
331 void PhotonFix::barrelSGap(unsigned i, unsigned j, unsigned k, double c){
332  _barrelSGap[i][j][k] = c;
333 }
334 void PhotonFix::barrelMGap(unsigned i, unsigned j, unsigned k, double c){
335  _barrelMGap[i][j][k] = c;
336 }
337 void PhotonFix::endcapCrystal(unsigned i, unsigned j, bool c){
338  _endcapCrystal[i][j] = c;
339 }
340 void PhotonFix::endcapCGap(unsigned i, unsigned j, unsigned k, double c){
341  _endcapCGap[i][j][k] = c;
342 }
343 void PhotonFix::endcapSGap(unsigned i, unsigned j, unsigned k, double c){
344  _endcapSGap[i][j][k] = c;
345 }
346 void PhotonFix::endcapMGap(unsigned i, unsigned j, unsigned k, double c){
347  _endcapMGap[i][j][k] = c;
348 }
349 
350 
351 void PhotonFix::print() const {
352  std::cout << "PhotonFix: e,eta,phi,r9 = " << _e << ", " << _eta << ", " << _phi << ", " << _r9 << ", gaps "
353  << _aC << ", " << _aS << ", " << _aM << ", "
354  << _bC << ", " << _bS << ", " << _bM << std::endl;
355 }
356 
357 void PhotonFix::setParameters(unsigned be, unsigned hl, const double *p) {
358  for(unsigned i(0);i<4;i++) {
359  _meanScale[be][hl][i] =p[i+ 0*4];
360  _meanAT[be][hl][i] =p[i+ 1*4];
361  _meanAC[be][hl][i] =p[i+ 2*4];
362  _meanAS[be][hl][i] =p[i+ 3*4];
363  _meanAM[be][hl][i] =p[i+ 4*4];
364  _meanBT[be][hl][i] =p[i+ 5*4];
365  _meanBC[be][hl][i] =p[i+ 6*4];
366  _meanBS[be][hl][i] =p[i+ 7*4];
367  _meanBM[be][hl][i] =p[i+ 8*4];
368  _meanR9[be][hl][i] =p[i+ 9*4];
369 
370  _sigmaScale[be][hl][i]=p[i+10*4];
371  _sigmaAT[be][hl][i] =p[i+11*4];
372  _sigmaAC[be][hl][i] =p[i+12*4];
373  _sigmaAS[be][hl][i] =p[i+13*4];
374  _sigmaAM[be][hl][i] =p[i+14*4];
375  _sigmaBT[be][hl][i] =p[i+15*4];
376  _sigmaBC[be][hl][i] =p[i+16*4];
377  _sigmaBS[be][hl][i] =p[i+17*4];
378  _sigmaBM[be][hl][i] =p[i+18*4];
379  _sigmaR9[be][hl][i] =p[i+19*4];
380  }
381 }
382 
383 void PhotonFix::getParameters(unsigned be, unsigned hl, double *p) {
384  for(unsigned i(0);i<4;i++) {
385  p[i+ 0*4]=_meanScale[be][hl][i];
386  p[i+ 1*4]=_meanAT[be][hl][i];
387  p[i+ 2*4]=_meanAC[be][hl][i];
388  p[i+ 3*4]=_meanAS[be][hl][i];
389  p[i+ 4*4]=_meanAM[be][hl][i];
390  p[i+ 5*4]=_meanBT[be][hl][i];
391  p[i+ 6*4]=_meanBC[be][hl][i];
392  p[i+ 7*4]=_meanBS[be][hl][i];
393  p[i+ 8*4]=_meanBM[be][hl][i];
394  p[i+ 9*4]=_meanR9[be][hl][i];
395 
396  p[i+10*4]=_sigmaScale[be][hl][i];
397  p[i+11*4]=_sigmaAT[be][hl][i];
398  p[i+12*4]=_sigmaAC[be][hl][i];
399  p[i+13*4]=_sigmaAS[be][hl][i];
400  p[i+14*4]=_sigmaAM[be][hl][i];
401  p[i+15*4]=_sigmaBT[be][hl][i];
402  p[i+16*4]=_sigmaBC[be][hl][i];
403  p[i+17*4]=_sigmaBS[be][hl][i];
404  p[i+18*4]=_sigmaBM[be][hl][i];
405  p[i+19*4]=_sigmaR9[be][hl][i];
406  }
407 }
408 
409 void PhotonFix::dumpParameters(std::ostream &o) {
410  for(unsigned be(0);be<2;be++) {
411  for(unsigned hl(0);hl<2;hl++) {
412  for(unsigned i(0);i<4;i++) {
413  o << " _meanScale[" << be << "][" << hl << "][" << i << "]=" << _meanScale[be][hl][i] << ";" << std::endl;
414  }
415  for(unsigned i(0);i<4;i++) {
416  o << " _meanAT[" << be << "][" << hl << "][" << i << "]=" << _meanAT[be][hl][i] << ";" << std::endl;
417  }
418  for(unsigned i(0);i<4;i++) {
419  o << " _meanAC[" << be << "][" << hl << "][" << i << "]=" << _meanAC[be][hl][i] << ";" << std::endl;
420  }
421  for(unsigned i(0);i<4;i++) {
422  o << " _meanAS[" << be << "][" << hl << "][" << i << "]=" << _meanAS[be][hl][i] << ";" << std::endl;
423  }
424  for(unsigned i(0);i<4;i++) {
425  o << " _meanAM[" << be << "][" << hl << "][" << i << "]=" << _meanAM[be][hl][i] << ";" << std::endl;
426  }
427  for(unsigned i(0);i<4;i++) {
428  o << " _meanBT[" << be << "][" << hl << "][" << i << "]=" << _meanBT[be][hl][i] << ";" << std::endl;
429  }
430  for(unsigned i(0);i<4;i++) {
431  o << " _meanBC[" << be << "][" << hl << "][" << i << "]=" << _meanBC[be][hl][i] << ";" << std::endl;
432  }
433  for(unsigned i(0);i<4;i++) {
434  o << " _meanBS[" << be << "][" << hl << "][" << i << "]=" << _meanBS[be][hl][i] << ";" << std::endl;
435  }
436  for(unsigned i(0);i<4;i++) {
437  o << " _meanBM[" << be << "][" << hl << "][" << i << "]=" << _meanBM[be][hl][i] << ";" << std::endl;
438  }
439  for(unsigned i(0);i<4;i++) {
440  o << " _meanR9[" << be << "][" << hl << "][" << i << "]=" << _meanR9[be][hl][i] << ";" << std::endl;
441  }
442  o << std::endl;
443 
444  for(unsigned i(0);i<4;i++) {
445  o << " _sigmaScale[" << be << "][" << hl << "][" << i << "]=" << _sigmaScale[be][hl][i] << ";" << std::endl;
446  }
447  for(unsigned i(0);i<4;i++) {
448  o << " _sigmaAT[" << be << "][" << hl << "][" << i << "]=" << _sigmaAT[be][hl][i] << ";" << std::endl;
449  }
450  for(unsigned i(0);i<4;i++) {
451  o << " _sigmaAC[" << be << "][" << hl << "][" << i << "]=" << _sigmaAC[be][hl][i] << ";" << std::endl;
452  }
453  for(unsigned i(0);i<4;i++) {
454  o << " _sigmaAS[" << be << "][" << hl << "][" << i << "]=" << _sigmaAS[be][hl][i] << ";" << std::endl;
455  }
456  for(unsigned i(0);i<4;i++) {
457  o << " _sigmaAM[" << be << "][" << hl << "][" << i << "]=" << _sigmaAM[be][hl][i] << ";" << std::endl;
458  }
459  for(unsigned i(0);i<4;i++) {
460  o << " _sigmaBT[" << be << "][" << hl << "][" << i << "]=" << _sigmaBT[be][hl][i] << ";" << std::endl;
461  }
462  for(unsigned i(0);i<4;i++) {
463  o << " _sigmaBC[" << be << "][" << hl << "][" << i << "]=" << _sigmaBC[be][hl][i] << ";" << std::endl;
464  }
465  for(unsigned i(0);i<4;i++) {
466  o << " _sigmaBS[" << be << "][" << hl << "][" << i << "]=" << _sigmaBS[be][hl][i] << ";" << std::endl;
467  }
468  for(unsigned i(0);i<4;i++) {
469  o << " _sigmaBM[" << be << "][" << hl << "][" << i << "]=" << _sigmaBM[be][hl][i] << ";" << std::endl;
470  }
471  for(unsigned i(0);i<4;i++) {
472  o << " _sigmaR9[" << be << "][" << hl << "][" << i << "]=" << _sigmaR9[be][hl][i] << ";" << std::endl;
473  }
474  o << std::endl;
475  }
476  }
477 }
478 
479 void PhotonFix::printParameters(std::ostream &o) {
480  o << "PhotonFix::printParameters()" << std::endl;
481 
482  for(unsigned be(0);be<2;be++) {
483  for(unsigned hl(0);hl<2;hl++) {
484  o << " Parameters for " << (be==0?"barrel":"endcap")
485  << ", " << (hl==0?"high":"low") << " R9" << std::endl;
486 
487  o << " Mean scaling ";
488  for(unsigned i(0);i<4;i++) o << std::setw(14) << _meanScale[be][hl][i];
489  o << std::endl;
490  o << " Mean " << (be==0?"Eta ":"ZetaX") << " total ";
491  for(unsigned i(0);i<4;i++) o << std::setw(14) << _meanAT[be][hl][i];
492  o << std::endl;
493  o << " Mean " << (be==0?"Eta ":"ZetaX") << " crystal ";
494  for(unsigned i(0);i<4;i++) o << std::setw(14) << _meanAC[be][hl][i];
495  o << std::endl;
496  o << " Mean " << (be==0?"Eta ":"ZetaX") << " submodule";
497  for(unsigned i(0);i<4;i++) o << std::setw(14) << _meanAS[be][hl][i];
498  o << std::endl;
499  o << " Mean " << (be==0?"Eta ":"ZetaX") << " module ";
500  for(unsigned i(0);i<4;i++) o << std::setw(14) << _meanAM[be][hl][i];
501  o << std::endl;
502  o << " Mean " << (be==0?"Eta zero ":"ZetaY total ");
503  for(unsigned i(0);i<4;i++) o << std::setw(14) << _meanBT[be][hl][i];
504  o << std::endl;
505  o << " Mean " << (be==0?"Phi ":"ZetaY") << " crystal ";
506  for(unsigned i(0);i<4;i++) o << std::setw(14) << _meanBC[be][hl][i];
507  o << std::endl;
508  o << " Mean " << (be==0?"Phi ":"ZetaY") << " submodule";
509  for(unsigned i(0);i<4;i++) o << std::setw(14) << _meanBS[be][hl][i];
510  o << std::endl;
511  o << " Mean " << (be==0?"Phi ":"ZetaY") << " module ";
512  for(unsigned i(0);i<4;i++) o << std::setw(14) << _meanBM[be][hl][i];
513  o << std::endl;
514  o << " Mean R9 ";
515  for(unsigned i(0);i<4;i++) o << std::setw(14) << _meanR9[be][hl][i];
516  o << std::endl;
517 
518  o << " Sigma scaling ";
519  for(unsigned i(0);i<4;i++) o << std::setw(14) << _sigmaScale[be][hl][i];
520  o << std::endl;
521  o << " Sigma " << (be==0?"Eta ":"ZetaX") << " total ";
522  for(unsigned i(0);i<4;i++) o << std::setw(14) << _sigmaAT[be][hl][i];
523  o << std::endl;
524  o << " Sigma " << (be==0?"Eta ":"ZetaX") << " crystal ";
525  for(unsigned i(0);i<4;i++) o << std::setw(14) << _sigmaAC[be][hl][i];
526  o << std::endl;
527  o << " Sigma " << (be==0?"Eta ":"ZetaX") << " submodule";
528  for(unsigned i(0);i<4;i++) o << std::setw(14) << _sigmaAS[be][hl][i];
529  o << std::endl;
530  o << " Sigma " << (be==0?"Eta ":"ZetaX") << " module ";
531  for(unsigned i(0);i<4;i++) o << std::setw(14) << _sigmaAM[be][hl][i];
532  o << std::endl;
533  o << " Sigma " << (be==0?"Eta ":"ZetaY") << " total ";
534  for(unsigned i(0);i<4;i++) o << std::setw(14) << _sigmaBT[be][hl][i];
535  o << std::endl;
536  o << " Sigma " << (be==0?"Eta ":"ZetaY") << " crystal ";
537  for(unsigned i(0);i<4;i++) o << std::setw(14) << _sigmaBC[be][hl][i];
538  o << std::endl;
539  o << " Sigma " << (be==0?"Phi ":"ZetaY") << " submodule";
540  for(unsigned i(0);i<4;i++) o << std::setw(14) << _sigmaBS[be][hl][i];
541  o << std::endl;
542  o << " Sigma " << (be==0?"Phi ":"ZetaY") << " module ";
543  for(unsigned i(0);i<4;i++) o << std::setw(14) << _sigmaBM[be][hl][i];
544  o << std::endl;
545  o << " Sigma R9 ";
546  for(unsigned i(0);i<4;i++) o << std::setw(14) << _sigmaR9[be][hl][i];
547  o << std::endl;
548  }
549  }
550 }
551 
552 double PhotonFix::asinh(double s) {
553  if(s>=0.0) return log(sqrt(s*s+1.0)+s);
554  else return -log(sqrt(s*s+1.0)-s);
555 }
556 
557 void PhotonFix::dumpGaps(std::ostream &o) {
558  o << std::setprecision(15);
559 
560  for(unsigned i(0);i<169;i++) {
561  for(unsigned j(0);j<360;j++) {
562  for(unsigned k(0);k<2;k++) {
563  o << _barrelCGap[i][j][k] << std::endl;
564  }
565  }
566  }
567 
568  for(unsigned i(0);i<33;i++) {
569  for(unsigned j(0);j<180;j++) {
570  for(unsigned k(0);k<2;k++) {
571  o << _barrelSGap[i][j][k] << std::endl;
572  }
573  }
574  }
575 
576  for(unsigned i(0);i<7;i++) {
577  for(unsigned j(0);j<18;j++) {
578  for(unsigned k(0);k<2;k++) {
579  o << _barrelMGap[i][j][k] << std::endl;
580  }
581  }
582  }
583 
584  for(unsigned i(0);i<100;i++) {
585  for(unsigned j(0);j<100;j++) {
586  if(_endcapCrystal[i][j]) o << 0 << std::endl;
587  else o << 1 << std::endl;
588  }
589  }
590 
591  for(unsigned i(0);i<2;i++) {
592  for(unsigned j(0);j<7080;j++) {
593  for(unsigned k(0);k<2;k++) {
594  o << _endcapCGap[i][j][k] << std::endl;
595  }
596  }
597  }
598 
599  for(unsigned i(0);i<2;i++) {
600  for(unsigned j(0);j<264;j++) {
601  for(unsigned k(0);k<2;k++) {
602  o << _endcapSGap[i][j][k] << std::endl;
603  }
604  }
605  }
606 
607  for(unsigned i(0);i<2;i++) {
608  for(unsigned j(0);j<1;j++) {
609  for(unsigned k(0);k<2;k++) {
610  o << _endcapMGap[i][j][k] << std::endl;
611  }
612  }
613  }
614 }
615 
616 double PhotonFix::dPhi(double f0, double f1) {
617  double df(f0-f1);
618  if(df> _onePi) df-=_twoPi;
619  if(df<-_onePi) df+=_twoPi;
620  return df;
621 }
622 
623 double PhotonFix::aPhi(double f0, double f1) {
624  double af(0.5*(f0+f1));
625  if(fabs(dPhi(af,f0))>0.5*_onePi) {
626  if(af>=0.0) af-=_onePi;
627  else af+=_onePi;
628  }
629 
630  assert(fabs(dPhi(af,f0))<0.5*_onePi);
631  assert(fabs(dPhi(af,f1))<0.5*_onePi);
632 
633  return af;
634 }
635 
636 double PhotonFix::expCorrection(double a, const double *p) {
637  if(p[1]==0.0 || p[2]==0.0 || p[3]==0.0) return 0.0;
638 
639  double b(a-p[0]);
640  if(b>=0.0) return p[1]*exp(-fabs(p[2])*b);
641  else return p[1]*exp( fabs(p[3])*b);
642 }
643 
644 double PhotonFix::gausCorrection(double a, const double *p) {
645  if(p[1]==0.0 || p[2]==0.0 || p[3]==0.0) return 0.0;
646 
647  double b(a-p[0]);
648  if(b>=0.0) return p[1]*exp(-0.5*p[2]*p[2]*b*b);
649  else return p[1]*exp(-0.5*p[3]*p[3]*b*b);
650 }
652  return _initialised;
653 }
655  if(_initialised) return false;
656 
657 
660  return true;
661 }
662 
664  _initialised=false;
665 
666  if(s=="Nominal") {
667  for(unsigned be(0);be<2;be++) {
668  for(unsigned hl(0);hl<2;hl++) {
669  for(unsigned i(0);i<4;i++) {
670  _meanScale[be][hl][i]=0;
671  _meanAT[be][hl][i]=0;
672  _meanAC[be][hl][i]=0;
673  _meanAS[be][hl][i]=0;
674  _meanAM[be][hl][i]=0;
675  _meanBT[be][hl][i]=0;
676  _meanBC[be][hl][i]=0;
677  _meanBS[be][hl][i]=0;
678  _meanBM[be][hl][i]=0;
679  _meanR9[be][hl][i]=0;
680 
681  _sigmaScale[be][hl][i]=0;
682  _sigmaAT[be][hl][i]=0;
683  _sigmaAC[be][hl][i]=0;
684  _sigmaAS[be][hl][i]=0;
685  _sigmaAM[be][hl][i]=0;
686  _sigmaBT[be][hl][i]=0;
687  _sigmaBC[be][hl][i]=0;
688  _sigmaBS[be][hl][i]=0;
689  _sigmaBM[be][hl][i]=0;
690  _sigmaR9[be][hl][i]=0;
691  }
692 
693  _meanScale[be][hl][0]=1.0;
694  if(be==0) {
695  _sigmaScale[be][hl][0]=0.2;
696  _sigmaScale[be][hl][1]=0.03;
697  _sigmaScale[be][hl][2]=0.006;
698  } else {
699  _sigmaScale[be][hl][0]=0.25;
700  _sigmaScale[be][hl][1]=0.05;
701  _sigmaScale[be][hl][2]=0.010;
702  }
703  }
704  }
705 
706  _initialised=true;
707  }
708 
709  if(s=="3_8") {
710  _meanScale[0][0][0]=0.994724;
711  _meanScale[0][0][1]=1.98102e-06;
712  _meanScale[0][0][2]=1.43015e-05;
713  _meanScale[0][0][3]=-0.0908525;
714  _meanAT[0][0][0]=0.0;
715  _meanAT[0][0][1]=0.0;
716  _meanAT[0][0][2]=0.0;
717  _meanAT[0][0][3]=0.0;
718  _meanAC[0][0][0]=-0.00352041;
719  _meanAC[0][0][1]=0.00982015;
720  _meanAC[0][0][2]=434.32;
721  _meanAC[0][0][3]=529.508;
722  _meanAS[0][0][0]=-1.1;
723  _meanAS[0][0][1]=0.00135995;
724  _meanAS[0][0][2]=295.712;
725  _meanAS[0][0][3]=5.13202e+07;
726  _meanAM[0][0][0]=-0.00140562;
727  _meanAM[0][0][1]=0.156322;
728  _meanAM[0][0][2]=263.097;
729  _meanAM[0][0][3]=222.294;
730  _meanBT[0][0][0]=0.0;
731  _meanBT[0][0][1]=0.0;
732  _meanBT[0][0][2]=0.0;
733  _meanBT[0][0][3]=0.0;
734  _meanBC[0][0][0]=-0.00294295;
735  _meanBC[0][0][1]=0.011533;
736  _meanBC[0][0][2]=562.905;
737  _meanBC[0][0][3]=421.097;
738  _meanBS[0][0][0]=-0.00204373;
739  _meanBS[0][0][1]=0.00347592;
740  _meanBS[0][0][2]=36.5614;
741  _meanBS[0][0][3]=1265.25;
742  _meanBM[0][0][0]=-0.00275381;
743  _meanBM[0][0][1]=0.0812447;
744  _meanBM[0][0][2]=216.885;
745  _meanBM[0][0][3]=264.754;
746  _meanR9[0][0][0]=0.952584;
747  _meanR9[0][0][1]=22.7119;
748  _meanR9[0][0][2]=402.816;
749  _meanR9[0][0][3]=0;
750 
751  _sigmaScale[0][0][0]=0.167184;
752  _sigmaScale[0][0][1]=6.14323e-11;
753  _sigmaScale[0][0][2]=0.00769693;
754  _sigmaScale[0][0][3]=0;
755  _sigmaAT[0][0][0]=0.228255;
756  _sigmaAT[0][0][1]=0;
757  _sigmaAT[0][0][2]=0;
758  _sigmaAT[0][0][3]=0;
759  _sigmaAC[0][0][0]=-0.00411906;
760  _sigmaAC[0][0][1]=0.077799;
761  _sigmaAC[0][0][2]=23.1033;
762  _sigmaAC[0][0][3]=-3e+17;
763  _sigmaAS[0][0][0]=0;
764  _sigmaAS[0][0][1]=0;
765  _sigmaAS[0][0][2]=0;
766  _sigmaAS[0][0][3]=0;
767  _sigmaAM[0][0][0]=-0.000130695;
768  _sigmaAM[0][0][1]=11.2121;
769  _sigmaAM[0][0][2]=468.535;
770  _sigmaAM[0][0][3]=407.652;
771  _sigmaBT[0][0][0]=1.33384e-05;
772  _sigmaBT[0][0][1]=8.77098;
773  _sigmaBT[0][0][2]=324.048;
774  _sigmaBT[0][0][3]=239.868;
775  _sigmaBC[0][0][0]=-0.00281964;
776  _sigmaBC[0][0][1]=0.125811;
777  _sigmaBC[0][0][2]=538.949;
778  _sigmaBC[0][0][3]=1358.76;
779  _sigmaBS[0][0][0]=0;
780  _sigmaBS[0][0][1]=0;
781  _sigmaBS[0][0][2]=0;
782  _sigmaBS[0][0][3]=0;
783  _sigmaBM[0][0][0]=-0.00293676;
784  _sigmaBM[0][0][1]=8.88276;
785  _sigmaBM[0][0][2]=350.032;
786  _sigmaBM[0][0][3]=580.354;
787  _sigmaR9[0][0][0]=0.955876;
788  _sigmaR9[0][0][1]=2254.5;
789  _sigmaR9[0][0][2]=14627;
790  _sigmaR9[0][0][3]=0;
791 
792  _meanScale[0][1][0]=0.888348;
793  _meanScale[0][1][1]=1.20452e-05;
794  _meanScale[0][1][2]=-1.04458e-05;
795  _meanScale[0][1][3]=-0.542383;
796  _meanAT[0][1][0]=0.0;
797  _meanAT[0][1][1]=0.0;
798  _meanAT[0][1][2]=0.0;
799  _meanAT[0][1][3]=0.0;
800  _meanAC[0][1][0]=-0.00320856;
801  _meanAC[0][1][1]=0.0240109;
802  _meanAC[0][1][2]=115.145;
803  _meanAC[0][1][3]=205.859;
804  _meanAS[0][1][0]=0.0349736;
805  _meanAS[0][1][1]=-0.00232864;
806  _meanAS[0][1][2]=318.584;
807  _meanAS[0][1][3]=1.4e+09;
808  _meanAM[0][1][0]=-0.00104798;
809  _meanAM[0][1][1]=0.208249;
810  _meanAM[0][1][2]=297.049;
811  _meanAM[0][1][3]=220.609;
812  _meanBT[0][1][0]=0.0;
813  _meanBT[0][1][1]=0.0;
814  _meanBT[0][1][2]=0.0;
815  _meanBT[0][1][3]=0.0;
816  _meanBC[0][1][0]=-0.00420429;
817  _meanBC[0][1][1]=0.00203991;
818  _meanBC[0][1][2]=172.278;
819  _meanBC[0][1][3]=410.677;
820  _meanBS[0][1][0]=-0.0430854;
821  _meanBS[0][1][1]=0.0961883;
822  _meanBS[0][1][2]=0.196958;
823  _meanBS[0][1][3]=11442.2;
824  _meanBM[0][1][0]=-0.00389457;
825  _meanBM[0][1][1]=0.0449086;
826  _meanBM[0][1][2]=78.9252;
827  _meanBM[0][1][3]=103.237;
828  _meanR9[0][1][0]=0.0182102;
829  _meanR9[0][1][1]=-0.03752;
830  _meanR9[0][1][2]=0.0198881;
831  _meanR9[0][1][3]=0;
832 
833  _sigmaScale[0][1][0]=0.386681;
834  _sigmaScale[0][1][1]=0.0913412;
835  _sigmaScale[0][1][2]=0.00119232;
836  _sigmaScale[0][1][3]=0;
837  _sigmaAT[0][1][0]=1.36562;
838  _sigmaAT[0][1][1]=0;
839  _sigmaAT[0][1][2]=0;
840  _sigmaAT[0][1][3]=0;
841  _sigmaAC[0][1][0]=-0.00504613;
842  _sigmaAC[0][1][1]=-1.09115;
843  _sigmaAC[0][1][2]=8.57406;
844  _sigmaAC[0][1][3]=57.1351;
845  _sigmaAS[0][1][0]=0;
846  _sigmaAS[0][1][1]=0;
847  _sigmaAS[0][1][2]=0;
848  _sigmaAS[0][1][3]=0;
849  _sigmaAM[0][1][0]=-0.00014319;
850  _sigmaAM[0][1][1]=5.39527;
851  _sigmaAM[0][1][2]=432.566;
852  _sigmaAM[0][1][3]=265.165;
853  _sigmaBT[0][1][0]=-0.040161;
854  _sigmaBT[0][1][1]=2.65711;
855  _sigmaBT[0][1][2]=-0.398357;
856  _sigmaBT[0][1][3]=-0.440649;
857  _sigmaBC[0][1][0]=0.00580015;
858  _sigmaBC[0][1][1]=-0.631833;
859  _sigmaBC[0][1][2]=18594.3;
860  _sigmaBC[0][1][3]=4.00955e+08;
861  _sigmaBS[0][1][0]=0;
862  _sigmaBS[0][1][1]=0;
863  _sigmaBS[0][1][2]=0;
864  _sigmaBS[0][1][3]=0;
865  _sigmaBM[0][1][0]=-0.00376665;
866  _sigmaBM[0][1][1]=3.74316;
867  _sigmaBM[0][1][2]=102.72;
868  _sigmaBM[0][1][3]=157.396;
869  _sigmaR9[0][1][0]=-3.12696;
870  _sigmaR9[0][1][1]=1.75114;
871  _sigmaR9[0][1][2]=0;
872  _sigmaR9[0][1][3]=0;
873 
874  _meanScale[1][0][0]=0.999461;
875  _meanScale[1][0][1]=4.37414e-06;
876  _meanScale[1][0][2]=4.92078e-06;
877  _meanScale[1][0][3]=-0.121609;
878  _meanAT[1][0][0]=0.0;
879  _meanAT[1][0][1]=0.0;
880  _meanAT[1][0][2]=0.0;
881  _meanAT[1][0][3]=0.0;
882  _meanAC[1][0][0]=-0.000396058;
883  _meanAC[1][0][1]=0.0144837;
884  _meanAC[1][0][2]=1374.93;
885  _meanAC[1][0][3]=945.634;
886  _meanAS[1][0][0]=-0.000871036;
887  _meanAS[1][0][1]=0.0442747;
888  _meanAS[1][0][2]=645.709;
889  _meanAS[1][0][3]=962.845;
890  _meanAM[1][0][0]=0.000434298;
891  _meanAM[1][0][1]=0.0658628;
892  _meanAM[1][0][2]=1928.49;
893  _meanAM[1][0][3]=728.522;
894  _meanBT[1][0][0]=0.0;
895  _meanBT[1][0][1]=0.0;
896  _meanBT[1][0][2]=0.0;
897  _meanBT[1][0][3]=0.0;
898  _meanBC[1][0][0]=-0.000452212;
899  _meanBC[1][0][1]=0.0129968;
900  _meanBC[1][0][2]=1056.08;
901  _meanBC[1][0][3]=759.102;
902  _meanBS[1][0][0]=-0.000786157;
903  _meanBS[1][0][1]=0.0346555;
904  _meanBS[1][0][2]=592.239;
905  _meanBS[1][0][3]=854.285;
906  _meanBM[1][0][0]=-0.0665038;
907  _meanBM[1][0][1]=-0.00211713;
908  _meanBM[1][0][2]=4.84395;
909  _meanBM[1][0][3]=11.6644;
910  _meanR9[1][0][0]=0.971355;
911  _meanR9[1][0][1]=47.2751;
912  _meanR9[1][0][2]=536.907;
913  _meanR9[1][0][3]=0;
914 
915  _sigmaScale[1][0][0]=0.254641;
916  _sigmaScale[1][0][1]=0.00264818;
917  _sigmaScale[1][0][2]=0.0114953;
918  _sigmaScale[1][0][3]=0;
919  _sigmaAT[1][0][0]=0.935839;
920  _sigmaAT[1][0][1]=0;
921  _sigmaAT[1][0][2]=0;
922  _sigmaAT[1][0][3]=0;
923  _sigmaAC[1][0][0]=-0.00476475;
924  _sigmaAC[1][0][1]=2.14548;
925  _sigmaAC[1][0][2]=29937;
926  _sigmaAC[1][0][3]=2.6e+11;
927  _sigmaAS[1][0][0]=-8.17285e-05;
928  _sigmaAS[1][0][1]=1.5821;
929  _sigmaAS[1][0][2]=1928.83;
930  _sigmaAS[1][0][3]=902.519;
931  _sigmaAM[1][0][0]=0.0278577;
932  _sigmaAM[1][0][1]=0.58439;
933  _sigmaAM[1][0][2]=43.3575;
934  _sigmaAM[1][0][3]=19.7836;
935  _sigmaBT[1][0][0]=-0.456051;
936  _sigmaBT[1][0][1]=0;
937  _sigmaBT[1][0][2]=0;
938  _sigmaBT[1][0][3]=0;
939  _sigmaBC[1][0][0]=-0.00264527;
940  _sigmaBC[1][0][1]=0.696043;
941  _sigmaBC[1][0][2]=7.49509e+12;
942  _sigmaBC[1][0][3]=96843;
943  _sigmaBS[1][0][0]=0.000258933;
944  _sigmaBS[1][0][1]=1.28387;
945  _sigmaBS[1][0][2]=1668.71;
946  _sigmaBS[1][0][3]=730.716;
947  _sigmaBM[1][0][0]=0.00121506;
948  _sigmaBM[1][0][1]=0.938541;
949  _sigmaBM[1][0][2]=9003.57;
950  _sigmaBM[1][0][3]=288.897;
951  _sigmaR9[1][0][0]=1.01207;
952  _sigmaR9[1][0][1]=-816.244;
953  _sigmaR9[1][0][2]=-16283.8;
954  _sigmaR9[1][0][3]=0;
955 
956  _meanScale[1][1][0]=0.324634;
957  _meanScale[1][1][1]=9.48206e-05;
958  _meanScale[1][1][2]=1.0e-12;
959  _meanScale[1][1][3]=1.0e-12;
960  _meanAT[1][1][0]=0.0;
961  _meanAT[1][1][1]=0.0;
962  _meanAT[1][1][2]=0.0;
963  _meanAT[1][1][3]=0.0;
964  _meanAC[1][1][0]=-0.00158311;
965  _meanAC[1][1][1]=0.0106161;
966  _meanAC[1][1][2]=338.964;
967  _meanAC[1][1][3]=797.172;
968  _meanAS[1][1][0]=-0.00960269;
969  _meanAS[1][1][1]=-0.00496491;
970  _meanAS[1][1][2]=934.472;
971  _meanAS[1][1][3]=8.32667e-16;
972  _meanAM[1][1][0]=-0.00219814;
973  _meanAM[1][1][1]=0.653906;
974  _meanAM[1][1][2]=0.0949848;
975  _meanAM[1][1][3]=0.0977831;
976  _meanBT[1][1][0]=0.0;
977  _meanBT[1][1][1]=0.0;
978  _meanBT[1][1][2]=0.0;
979  _meanBT[1][1][3]=0.0;
980  _meanBC[1][1][0]=-0.00423472;
981  _meanBC[1][1][1]=0.0279695;
982  _meanBC[1][1][2]=28073.7;
983  _meanBC[1][1][3]=118612;
984  _meanBS[1][1][0]=-0.0012476;
985  _meanBS[1][1][1]=0.02744;
986  _meanBS[1][1][2]=390.697;
987  _meanBS[1][1][3]=727.861;
988  _meanBM[1][1][0]=-1.36573e-05;
989  _meanBM[1][1][1]=0.0667504;
990  _meanBM[1][1][2]=-80154.4;
991  _meanBM[1][1][3]=576.637;
992  _meanR9[1][1][0]=0.113317;
993  _meanR9[1][1][1]=0.0142669;
994  _meanR9[1][1][2]=-0.125721;
995  _meanR9[1][1][3]=0;
996 
997  _sigmaScale[1][1][0]=0.471767;
998  _sigmaScale[1][1][1]=0.211196;
999  _sigmaScale[1][1][2]=0.0240124;
1000  _sigmaScale[1][1][3]=0;
1001  _sigmaAT[1][1][0]=0.404395;
1002  _sigmaAT[1][1][1]=0;
1003  _sigmaAT[1][1][2]=0;
1004  _sigmaAT[1][1][3]=0;
1005  _sigmaAC[1][1][0]=0.00173151;
1006  _sigmaAC[1][1][1]=-0.479291;
1007  _sigmaAC[1][1][2]=11583.5;
1008  _sigmaAC[1][1][3]=-7e+09;
1009  _sigmaAS[1][1][0]=0.000450387;
1010  _sigmaAS[1][1][1]=0.662978;
1011  _sigmaAS[1][1][2]=924.051;
1012  _sigmaAS[1][1][3]=448.417;
1013  _sigmaAM[1][1][0]=0.00335603;
1014  _sigmaAM[1][1][1]=0.648407;
1015  _sigmaAM[1][1][2]=134.672;
1016  _sigmaAM[1][1][3]=27.4139;
1017  _sigmaBT[1][1][0]=0.602402;
1018  _sigmaBT[1][1][1]=0;
1019  _sigmaBT[1][1][2]=0;
1020  _sigmaBT[1][1][3]=0;
1021  _sigmaBC[1][1][0]=-0.00256192;
1022  _sigmaBC[1][1][1]=2.01276;
1023  _sigmaBC[1][1][2]=114558;
1024  _sigmaBC[1][1][3]=2.15421e+06;
1025  _sigmaBS[1][1][0]=0.00151576;
1026  _sigmaBS[1][1][1]=0.359084;
1027  _sigmaBS[1][1][2]=329.414;
1028  _sigmaBS[1][1][3]=154.509;
1029  _sigmaBM[1][1][0]=-0.0452587;
1030  _sigmaBM[1][1][1]=1.26253;
1031  _sigmaBM[1][1][2]=1.9e+09;
1032  _sigmaBM[1][1][3]=1058.76;
1033  _sigmaR9[1][1][0]=4.59667;
1034  _sigmaR9[1][1][1]=-5.14404;
1035  _sigmaR9[1][1][2]=0;
1036  _sigmaR9[1][1][3]=0;
1037 
1038  _initialised=true;
1039  }
1040 
1041  if(s=="3_11") {
1042  _meanScale[0][0][0]=0.994363;
1043  _meanScale[0][0][1]=4.84904e-07;
1044  _meanScale[0][0][2]=1.54475e-05;
1045  _meanScale[0][0][3]=-0.103309;
1046  _meanAT[0][0][0]=0.0;
1047  _meanAT[0][0][1]=0.0;
1048  _meanAT[0][0][2]=0.0;
1049  _meanAT[0][0][3]=0.0;
1050  _meanAC[0][0][0]=-0.00360057;
1051  _meanAC[0][0][1]=0.00970858;
1052  _meanAC[0][0][2]=409.406;
1053  _meanAC[0][0][3]=527.952;
1054  _meanAS[0][0][0]=-1.1;
1055  _meanAS[0][0][1]=0.00135995;
1056  _meanAS[0][0][2]=295.712;
1057  _meanAS[0][0][3]=5.13202e+07;
1058  _meanAM[0][0][0]=-0.00129854;
1059  _meanAM[0][0][1]=0.151466;
1060  _meanAM[0][0][2]=261.828;
1061  _meanAM[0][0][3]=214.662;
1062  _meanBT[0][0][0]=0.0;
1063  _meanBT[0][0][1]=0.0;
1064  _meanBT[0][0][2]=0.0;
1065  _meanBT[0][0][3]=0.0;
1066  _meanBC[0][0][0]=-0.00286864;
1067  _meanBC[0][0][1]=0.0114118;
1068  _meanBC[0][0][2]=563.962;
1069  _meanBC[0][0][3]=412.922;
1070  _meanBS[0][0][0]=-0.00210996;
1071  _meanBS[0][0][1]=0.00327867;
1072  _meanBS[0][0][2]=23.617;
1073  _meanBS[0][0][3]=1018.45;
1074  _meanBM[0][0][0]=-0.002287;
1075  _meanBM[0][0][1]=0.0848984;
1076  _meanBM[0][0][2]=235.575;
1077  _meanBM[0][0][3]=260.773;
1078  _meanR9[0][0][0]=0.951724;
1079  _meanR9[0][0][1]=23.7181;
1080  _meanR9[0][0][2]=177.34;
1081  _meanR9[0][0][3]=0;
1082 
1083  _sigmaScale[0][0][0]=0.187578;
1084  _sigmaScale[0][0][1]=-0.000901045;
1085  _sigmaScale[0][0][2]=0.00673186;
1086  _sigmaScale[0][0][3]=0;
1087  _sigmaAT[0][0][0]=0.183777;
1088  _sigmaAT[0][0][1]=0;
1089  _sigmaAT[0][0][2]=0;
1090  _sigmaAT[0][0][3]=0;
1091  _sigmaAC[0][0][0]=-0.00430202;
1092  _sigmaAC[0][0][1]=0.122501;
1093  _sigmaAC[0][0][2]=51.9772;
1094  _sigmaAC[0][0][3]=-3e+17;
1095  _sigmaAS[0][0][0]=0;
1096  _sigmaAS[0][0][1]=0;
1097  _sigmaAS[0][0][2]=0;
1098  _sigmaAS[0][0][3]=0;
1099  _sigmaAM[0][0][0]=0.00101883;
1100  _sigmaAM[0][0][1]=11.2009;
1101  _sigmaAM[0][0][2]=593.111;
1102  _sigmaAM[0][0][3]=345.433;
1103  _sigmaBT[0][0][0]=-6.02356e-05;
1104  _sigmaBT[0][0][1]=6.99896;
1105  _sigmaBT[0][0][2]=235.996;
1106  _sigmaBT[0][0][3]=196;
1107  _sigmaBC[0][0][0]=-0.00282254;
1108  _sigmaBC[0][0][1]=0.18764;
1109  _sigmaBC[0][0][2]=509.825;
1110  _sigmaBC[0][0][3]=1400.14;
1111  _sigmaBS[0][0][0]=0;
1112  _sigmaBS[0][0][1]=0;
1113  _sigmaBS[0][0][2]=0;
1114  _sigmaBS[0][0][3]=0;
1115  _sigmaBM[0][0][0]=-0.00252199;
1116  _sigmaBM[0][0][1]=39.1544;
1117  _sigmaBM[0][0][2]=612.481;
1118  _sigmaBM[0][0][3]=905.994;
1119  _sigmaR9[0][0][0]=0.95608;
1120  _sigmaR9[0][0][1]=2203.31;
1121  _sigmaR9[0][0][2]=-22454.2;
1122  _sigmaR9[0][0][3]=0;
1123 
1124  _meanScale[0][1][0]=0.889415;
1125  _meanScale[0][1][1]=1.21788e-05;
1126  _meanScale[0][1][2]=-4.3438e-06;
1127  _meanScale[0][1][3]=-0.629968;
1128  _meanAT[0][1][0]=0.0;
1129  _meanAT[0][1][1]=0.0;
1130  _meanAT[0][1][2]=0.0;
1131  _meanAT[0][1][3]=0.0;
1132  _meanAC[0][1][0]=-0.00313701;
1133  _meanAC[0][1][1]=0.0227998;
1134  _meanAC[0][1][2]=128.653;
1135  _meanAC[0][1][3]=234.333;
1136  _meanAS[0][1][0]=0.0346198;
1137  _meanAS[0][1][1]=-0.00261336;
1138  _meanAS[0][1][2]=177.983;
1139  _meanAS[0][1][3]=1.19839e+14;
1140  _meanAM[0][1][0]=-0.00100745;
1141  _meanAM[0][1][1]=0.264247;
1142  _meanAM[0][1][2]=337.255;
1143  _meanAM[0][1][3]=251.454;
1144  _meanBT[0][1][0]=0.0;
1145  _meanBT[0][1][1]=0.0;
1146  _meanBT[0][1][2]=0.0;
1147  _meanBT[0][1][3]=0.0;
1148  _meanBC[0][1][0]=-0.00397794;
1149  _meanBC[0][1][1]=0.00219079;
1150  _meanBC[0][1][2]=176.842;
1151  _meanBC[0][1][3]=450.29;
1152  _meanBS[0][1][0]=-2e+07;
1153  _meanBS[0][1][1]=0.0957598;
1154  _meanBS[0][1][2]=-8.88573e-27;
1155  _meanBS[0][1][3]=11442.2;
1156  _meanBM[0][1][0]=-0.00366315;
1157  _meanBM[0][1][1]=0.0622186;
1158  _meanBM[0][1][2]=94.5155;
1159  _meanBM[0][1][3]=126.404;
1160  _meanR9[0][1][0]=0.00636789;
1161  _meanR9[0][1][1]=0.000336062;
1162  _meanR9[0][1][2]=-0.0092699;
1163  _meanR9[0][1][3]=0;
1164 
1165  _sigmaScale[0][1][0]=0.685096;
1166  _sigmaScale[0][1][1]=0.129065;
1167  _sigmaScale[0][1][2]=-0.00212486;
1168  _sigmaScale[0][1][3]=0;
1169  _sigmaAT[0][1][0]=0.898865;
1170  _sigmaAT[0][1][1]=0;
1171  _sigmaAT[0][1][2]=0;
1172  _sigmaAT[0][1][3]=0;
1173  _sigmaAC[0][1][0]=-0.00492979;
1174  _sigmaAC[0][1][1]=-1.20123;
1175  _sigmaAC[0][1][2]=2.89231;
1176  _sigmaAC[0][1][3]=18.2059;
1177  _sigmaAS[0][1][0]=0;
1178  _sigmaAS[0][1][1]=0;
1179  _sigmaAS[0][1][2]=0;
1180  _sigmaAS[0][1][3]=0;
1181  _sigmaAM[0][1][0]=-0.000727825;
1182  _sigmaAM[0][1][1]=8.42395;
1183  _sigmaAM[0][1][2]=512.032;
1184  _sigmaAM[0][1][3]=415.962;
1185  _sigmaBT[0][1][0]=-0.0336364;
1186  _sigmaBT[0][1][1]=2.45182;
1187  _sigmaBT[0][1][2]=-0.284353;
1188  _sigmaBT[0][1][3]=-0.31679;
1189  _sigmaBC[0][1][0]=0.00510553;
1190  _sigmaBC[0][1][1]=-0.953869;
1191  _sigmaBC[0][1][2]=113872;
1192  _sigmaBC[0][1][3]=1.35966e+09;
1193  _sigmaBS[0][1][0]=0;
1194  _sigmaBS[0][1][1]=0;
1195  _sigmaBS[0][1][2]=0;
1196  _sigmaBS[0][1][3]=0;
1197  _sigmaBM[0][1][0]=-0.0034071;
1198  _sigmaBM[0][1][1]=4.19719;
1199  _sigmaBM[0][1][2]=128.952;
1200  _sigmaBM[0][1][3]=180.604;
1201  _sigmaR9[0][1][0]=-3.38988;
1202  _sigmaR9[0][1][1]=2.0714;
1203  _sigmaR9[0][1][2]=0;
1204  _sigmaR9[0][1][3]=0;
1205 
1206  _meanScale[1][0][0]=1.0009;
1207  _meanScale[1][0][1]=-4.79805e-06;
1208  _meanScale[1][0][2]=3.34625e-05;
1209  _meanScale[1][0][3]=-0.194267;
1210  _meanAT[1][0][0]=0.0;
1211  _meanAT[1][0][1]=0.0;
1212  _meanAT[1][0][2]=0.0;
1213  _meanAT[1][0][3]=0.0;
1214  _meanAC[1][0][0]=-0.000177563;
1215  _meanAC[1][0][1]=0.0122839;
1216  _meanAC[1][0][2]=1798.92;
1217  _meanAC[1][0][3]=776.856;
1218  _meanAS[1][0][0]=-0.000533039;
1219  _meanAS[1][0][1]=0.0642604;
1220  _meanAS[1][0][2]=969.596;
1221  _meanAS[1][0][3]=1004.15;
1222  _meanAM[1][0][0]=0.000163185;
1223  _meanAM[1][0][1]=0.085936;
1224  _meanAM[1][0][2]=1593.17;
1225  _meanAM[1][0][3]=681.623;
1226  _meanBT[1][0][0]=0.0;
1227  _meanBT[1][0][1]=0.0;
1228  _meanBT[1][0][2]=0.0;
1229  _meanBT[1][0][3]=0.0;
1230  _meanBC[1][0][0]=-0.000518186;
1231  _meanBC[1][0][1]=0.0121868;
1232  _meanBC[1][0][2]=1112.53;
1233  _meanBC[1][0][3]=933.281;
1234  _meanBS[1][0][0]=-0.000750734;
1235  _meanBS[1][0][1]=0.03859;
1236  _meanBS[1][0][2]=547.579;
1237  _meanBS[1][0][3]=775.887;
1238  _meanBM[1][0][0]=-0.190395;
1239  _meanBM[1][0][1]=-0.00362647;
1240  _meanBM[1][0][2]=5.25687;
1241  _meanBM[1][0][3]=-2.8e+08;
1242  _meanR9[1][0][0]=0.972346;
1243  _meanR9[1][0][1]=53.9185;
1244  _meanR9[1][0][2]=1354.5;
1245  _meanR9[1][0][3]=0;
1246 
1247  _sigmaScale[1][0][0]=0.348019;
1248  _sigmaScale[1][0][1]=-6.43731e-11;
1249  _sigmaScale[1][0][2]=0.0158647;
1250  _sigmaScale[1][0][3]=0;
1251  _sigmaAT[1][0][0]=0.215239;
1252  _sigmaAT[1][0][1]=0;
1253  _sigmaAT[1][0][2]=0;
1254  _sigmaAT[1][0][3]=0;
1255  _sigmaAC[1][0][0]=-0.00492298;
1256  _sigmaAC[1][0][1]=-3.40058;
1257  _sigmaAC[1][0][2]=17263.9;
1258  _sigmaAC[1][0][3]=2.6e+11;
1259  _sigmaAS[1][0][0]=-0.000237998;
1260  _sigmaAS[1][0][1]=3.0258;
1261  _sigmaAS[1][0][2]=1811.25;
1262  _sigmaAS[1][0][3]=1846.79;
1263  _sigmaAM[1][0][0]=0.0210134;
1264  _sigmaAM[1][0][1]=0.328359;
1265  _sigmaAM[1][0][2]=22.49;
1266  _sigmaAM[1][0][3]=14.5021;
1267  _sigmaBT[1][0][0]=-0.495072;
1268  _sigmaBT[1][0][1]=0;
1269  _sigmaBT[1][0][2]=0;
1270  _sigmaBT[1][0][3]=0;
1271  _sigmaBC[1][0][0]=-0.00265007;
1272  _sigmaBC[1][0][1]=0.970549;
1273  _sigmaBC[1][0][2]=-6.89119e+07;
1274  _sigmaBC[1][0][3]=180110;
1275  _sigmaBS[1][0][0]=0.00045833;
1276  _sigmaBS[1][0][1]=2.16342;
1277  _sigmaBS[1][0][2]=3582.4;
1278  _sigmaBS[1][0][3]=1100.36;
1279  _sigmaBM[1][0][0]=0.00188871;
1280  _sigmaBM[1][0][1]=1.66177;
1281  _sigmaBM[1][0][2]=3.2e+08;
1282  _sigmaBM[1][0][3]=2163.81;
1283  _sigmaR9[1][0][0]=-220.415;
1284  _sigmaR9[1][0][1]=5.19136e-08;
1285  _sigmaR9[1][0][2]=3.04028e-10;
1286  _sigmaR9[1][0][3]=0;
1287 
1288  _meanScale[1][1][0]=0.338011;
1289  _meanScale[1][1][1]=9.47815e-05;
1290  _meanScale[1][1][2]=-0.000238735;
1291  _meanScale[1][1][3]=-0.846414;
1292  _meanAT[1][1][0]=0.0;
1293  _meanAT[1][1][1]=0.0;
1294  _meanAT[1][1][2]=0.0;
1295  _meanAT[1][1][3]=0.0;
1296  _meanAC[1][1][0]=-0.00125367;
1297  _meanAC[1][1][1]=0.013324;
1298  _meanAC[1][1][2]=203.988;
1299  _meanAC[1][1][3]=431.951;
1300  _meanAS[1][1][0]=0.000282607;
1301  _meanAS[1][1][1]=0.0307431;
1302  _meanAS[1][1][2]=343.509;
1303  _meanAS[1][1][3]=274.957;
1304  _meanAM[1][1][0]=0.0020258;
1305  _meanAM[1][1][1]=0.643913;
1306  _meanAM[1][1][2]=0.0693877;
1307  _meanAM[1][1][3]=0.0816029;
1308  _meanBT[1][1][0]=0.0;
1309  _meanBT[1][1][1]=0.0;
1310  _meanBT[1][1][2]=0.0;
1311  _meanBT[1][1][3]=0.0;
1312  _meanBC[1][1][0]=-0.00513833;
1313  _meanBC[1][1][1]=5.94424e+08;
1314  _meanBC[1][1][2]=-62814.9;
1315  _meanBC[1][1][3]=118612;
1316  _meanBS[1][1][0]=-0.00152129;
1317  _meanBS[1][1][1]=0.0234694;
1318  _meanBS[1][1][2]=186.483;
1319  _meanBS[1][1][3]=754.201;
1320  _meanBM[1][1][0]=-0.000404987;
1321  _meanBM[1][1][1]=0.156384;
1322  _meanBM[1][1][2]=-1.7e+08;
1323  _meanBM[1][1][3]=1793.83;
1324  _meanR9[1][1][0]=0.0645278;
1325  _meanR9[1][1][1]=0.161614;
1326  _meanR9[1][1][2]=-0.215822;
1327  _meanR9[1][1][3]=0;
1328 
1329  _sigmaScale[1][1][0]=1.07376;
1330  _sigmaScale[1][1][1]=7.47238e-13;
1331  _sigmaScale[1][1][2]=0.0289594;
1332  _sigmaScale[1][1][3]=0;
1333  _sigmaAT[1][1][0]=-0.520907;
1334  _sigmaAT[1][1][1]=0;
1335  _sigmaAT[1][1][2]=0;
1336  _sigmaAT[1][1][3]=0;
1337  _sigmaAC[1][1][0]=0.00165941;
1338  _sigmaAC[1][1][1]=-0.351422;
1339  _sigmaAC[1][1][2]=8968.94;
1340  _sigmaAC[1][1][3]=-7e+09;
1341  _sigmaAS[1][1][0]=0.000490279;
1342  _sigmaAS[1][1][1]=0.554531;
1343  _sigmaAS[1][1][2]=469.111;
1344  _sigmaAS[1][1][3]=457.541;
1345  _sigmaAM[1][1][0]=0.00102079;
1346  _sigmaAM[1][1][1]=0.628055;
1347  _sigmaAM[1][1][2]=53.9452;
1348  _sigmaAM[1][1][3]=72.911;
1349  _sigmaBT[1][1][0]=-0.461542;
1350  _sigmaBT[1][1][1]=0;
1351  _sigmaBT[1][1][2]=0;
1352  _sigmaBT[1][1][3]=0;
1353  _sigmaBC[1][1][0]=-0.00219303;
1354  _sigmaBC[1][1][1]=0.874327;
1355  _sigmaBC[1][1][2]=71353.2;
1356  _sigmaBC[1][1][3]=2.09924e+08;
1357  _sigmaBS[1][1][0]=0.00104021;
1358  _sigmaBS[1][1][1]=0.236098;
1359  _sigmaBS[1][1][2]=482.954;
1360  _sigmaBS[1][1][3]=191.984;
1361  _sigmaBM[1][1][0]=-0.000116086;
1362  _sigmaBM[1][1][1]=2.4438;
1363  _sigmaBM[1][1][2]=1.9e+09;
1364  _sigmaBM[1][1][3]=-700.271;
1365  _sigmaR9[1][1][0]=4.59374;
1366  _sigmaR9[1][1][1]=-5.06202;
1367  _sigmaR9[1][1][2]=0;
1368  _sigmaR9[1][1][3]=0;
1369 
1370  _initialised=true;
1371  }
1372 
1373  if(s=="4_2") {
1374  _meanScale[0][0][0]=0.996757;
1375  _meanScale[0][0][1]=-1.02729e-05;
1376  _meanScale[0][0][2]=2.92397e-05;
1377  _meanScale[0][0][3]=-0.0892806;
1378  _meanAT[0][0][0]=0.000616189;
1379  _meanAT[0][0][1]=0;
1380  _meanAT[0][0][2]=0;
1381  _meanAT[0][0][3]=0;
1382  _meanAC[0][0][0]=-0.00343502;
1383  _meanAC[0][0][1]=0.0102123;
1384  _meanAC[0][0][2]=460.294;
1385  _meanAC[0][0][3]=510.925;
1386  _meanAS[0][0][0]=0;
1387  _meanAS[0][0][1]=0;
1388  _meanAS[0][0][2]=0;
1389  _meanAS[0][0][3]=0;
1390  _meanAM[0][0][0]=-0.0010363;
1391  _meanAM[0][0][1]=0.147364;
1392  _meanAM[0][0][2]=280.742;
1393  _meanAM[0][0][3]=200.903;
1394  _meanBT[0][0][0]=0;
1395  _meanBT[0][0][1]=0.0290516;
1396  _meanBT[0][0][2]=-113.185;
1397  _meanBT[0][0][3]=-176099;
1398  _meanBC[0][0][0]=-0.00262961;
1399  _meanBC[0][0][1]=0.0134481;
1400  _meanBC[0][0][2]=699.825;
1401  _meanBC[0][0][3]=401.452;
1402  _meanBS[0][0][0]=0;
1403  _meanBS[0][0][1]=0;
1404  _meanBS[0][0][2]=0;
1405  _meanBS[0][0][3]=0;
1406  _meanBM[0][0][0]=-0.00170238;
1407  _meanBM[0][0][1]=0.0751873;
1408  _meanBM[0][0][2]=232.9;
1409  _meanBM[0][0][3]=225.712;
1410  _meanR9[0][0][0]=0.946441;
1411  _meanR9[0][0][1]=19.5162;
1412  _meanR9[0][0][2]=173.503;
1413  _meanR9[0][0][3]=0;
1414 
1415  _sigmaScale[0][0][0]=0.196245;
1416  _sigmaScale[0][0][1]=0.0191932;
1417  _sigmaScale[0][0][2]=0.00660053;
1418  _sigmaScale[0][0][3]=0;
1419  _sigmaAT[0][0][0]=0.179417;
1420  _sigmaAT[0][0][1]=0;
1421  _sigmaAT[0][0][2]=0;
1422  _sigmaAT[0][0][3]=0;
1423  _sigmaAC[0][0][0]=-0.00383752;
1424  _sigmaAC[0][0][1]=0.0881981;
1425  _sigmaAC[0][0][2]=88.6384;
1426  _sigmaAC[0][0][3]=-3e+17;
1427  _sigmaAS[0][0][0]=0;
1428  _sigmaAS[0][0][1]=0;
1429  _sigmaAS[0][0][2]=0;
1430  _sigmaAS[0][0][3]=0;
1431  _sigmaAM[0][0][0]=0.000932441;
1432  _sigmaAM[0][0][1]=10.1637;
1433  _sigmaAM[0][0][2]=610.691;
1434  _sigmaAM[0][0][3]=290.271;
1435  _sigmaBT[0][0][0]=-0.00599323;
1436  _sigmaBT[0][0][1]=1.71943;
1437  _sigmaBT[0][0][2]=90.7352;
1438  _sigmaBT[0][0][3]=164.449;
1439  _sigmaBC[0][0][0]=-0.00167802;
1440  _sigmaBC[0][0][1]=0.303306;
1441  _sigmaBC[0][0][2]=1326.56;
1442  _sigmaBC[0][0][3]=765.552;
1443  _sigmaBS[0][0][0]=0;
1444  _sigmaBS[0][0][1]=0;
1445  _sigmaBS[0][0][2]=0;
1446  _sigmaBS[0][0][3]=0;
1447  _sigmaBM[0][0][0]=-0.00252598;
1448  _sigmaBM[0][0][1]=52.0947;
1449  _sigmaBM[0][0][2]=660.313;
1450  _sigmaBM[0][0][3]=1052.64;
1451  _sigmaR9[0][0][0]=0.952982;
1452  _sigmaR9[0][0][1]=1961.39;
1453  _sigmaR9[0][0][2]=22382.1;
1454  _sigmaR9[0][0][3]=0;
1455 
1456  _meanScale[0][1][0]=0.88802;
1457  _meanScale[0][1][1]=1.61e-05;
1458  _meanScale[0][1][2]=-1.08e-05;
1459  _meanScale[0][1][3]=-0.489;
1460  _meanAT[0][1][0]=-0.00165;
1461  _meanAT[0][1][1]=0;
1462  _meanAT[0][1][2]=0;
1463  _meanAT[0][1][3]=0;
1464  _meanAC[0][1][0]=-0.003195;
1465  _meanAC[0][1][1]=0.02012;
1466  _meanAC[0][1][2]=151.6;
1467  _meanAC[0][1][3]=255;
1468  _meanAS[0][1][0]=0;
1469  _meanAS[0][1][1]=0;
1470  _meanAS[0][1][2]=0;
1471  _meanAS[0][1][3]=0;
1472  _meanAM[0][1][0]=-0.00055;
1473  _meanAM[0][1][1]=0.1515;
1474  _meanAM[0][1][2]=534;
1475  _meanAM[0][1][3]=330;
1476  _meanBT[0][1][0]=0;
1477  _meanBT[0][1][1]=0.187;
1478  _meanBT[0][1][2]=299.298;
1479  _meanBT[0][1][3]=428.221;
1480  _meanBC[0][1][0]=-0.00366;
1481  _meanBC[0][1][1]=0.0038;
1482  _meanBC[0][1][2]=760;
1483  _meanBC[0][1][3]=760;
1484  _meanBS[0][1][0]=0;
1485  _meanBS[0][1][1]=0;
1486  _meanBS[0][1][2]=0;
1487  _meanBS[0][1][3]=0;
1488  _meanBM[0][1][0]=-0.00316;
1489  _meanBM[0][1][1]=0.0404;
1490  _meanBM[0][1][2]=137;
1491  _meanBM[0][1][3]=146;
1492  _meanR9[0][1][0]=0.02573;
1493  _meanR9[0][1][1]=-0.03722;
1494  _meanR9[0][1][2]=0.0144;
1495  _meanR9[0][1][3]=0;
1496 
1497  _sigmaScale[0][1][0]=0.66;
1498  _sigmaScale[0][1][1]=0.07465;
1499  _sigmaScale[0][1][2]=-0.00373;
1500  _sigmaScale[0][1][3]=0;
1501  _sigmaAT[0][1][0]=1.363;
1502  _sigmaAT[0][1][1]=0;
1503  _sigmaAT[0][1][2]=0;
1504  _sigmaAT[0][1][3]=0;
1505  _sigmaAC[0][1][0]=-0.00342;
1506  _sigmaAC[0][1][1]=-1.667;
1507  _sigmaAC[0][1][2]=6.6;
1508  _sigmaAC[0][1][3]=14;
1509  _sigmaAS[0][1][0]=0;
1510  _sigmaAS[0][1][1]=0;
1511  _sigmaAS[0][1][2]=0;
1512  _sigmaAS[0][1][3]=0;
1513  _sigmaAM[0][1][0]=-0.00094;
1514  _sigmaAM[0][1][1]=12.0228;
1515  _sigmaAM[0][1][2]=536;
1516  _sigmaAM[0][1][3]=464;
1517  _sigmaBT[0][1][0]=0.022;
1518  _sigmaBT[0][1][1]=3.223;
1519  _sigmaBT[0][1][2]=-0.361;
1520  _sigmaBT[0][1][3]=-0.318;
1521  _sigmaBC[0][1][0]=0.00567264;
1522  _sigmaBC[0][1][1]=-1.184;
1523  _sigmaBC[0][1][2]=76000;
1524  _sigmaBC[0][1][3]=2.14748e+08;
1525  _sigmaBS[0][1][0]=0;
1526  _sigmaBS[0][1][1]=0;
1527  _sigmaBS[0][1][2]=0;
1528  _sigmaBS[0][1][3]=0;
1529  _sigmaBM[0][1][0]=-0.00236;
1530  _sigmaBM[0][1][1]=5.78;
1531  _sigmaBM[0][1][2]=166;
1532  _sigmaBM[0][1][3]=203.5;
1533  _sigmaR9[0][1][0]=-2.94;
1534  _sigmaR9[0][1][1]=1.53445;
1535  _sigmaR9[0][1][2]=0;
1536  _sigmaR9[0][1][3]=0;
1537 
1538  _meanScale[1][0][0]=0.993921;
1539  _meanScale[1][0][1]=-8.11417e-06;
1540  _meanScale[1][0][2]=3.23086e-05;
1541  _meanScale[1][0][3]=-0.0976369;
1542  _meanAT[1][0][0]=0.0691979;
1543  _meanAT[1][0][1]=0;
1544  _meanAT[1][0][2]=0;
1545  _meanAT[1][0][3]=0;
1546  _meanAC[1][0][0]=-0.000310485;
1547  _meanAC[1][0][1]=0.0169478;
1548  _meanAC[1][0][2]=1301.97;
1549  _meanAC[1][0][3]=796.53;
1550  _meanAS[1][0][0]=-0.0005425;
1551  _meanAS[1][0][1]=0.0676613;
1552  _meanAS[1][0][2]=790.284;
1553  _meanAS[1][0][3]=970;
1554  _meanAM[1][0][0]=0.000134362;
1555  _meanAM[1][0][1]=0.364822;
1556  _meanAM[1][0][2]=3396.04;
1557  _meanAM[1][0][3]=2407.2;
1558  _meanBT[1][0][0]=0.0456649;
1559  _meanBT[1][0][1]=0;
1560  _meanBT[1][0][2]=0;
1561  _meanBT[1][0][3]=0;
1562  _meanBC[1][0][0]=-0.000356413;
1563  _meanBC[1][0][1]=0.0167018;
1564  _meanBC[1][0][2]=1394.52;
1565  _meanBC[1][0][3]=823.035;
1566  _meanBS[1][0][0]=-0.000484;
1567  _meanBS[1][0][1]=0.0542618;
1568  _meanBS[1][0][2]=798.07;
1569  _meanBS[1][0][3]=1019.88;
1570  _meanBM[1][0][0]=-0.175333;
1571  _meanBM[1][0][1]=-0.00324513;
1572  _meanBM[1][0][2]=2.87972;
1573  _meanBM[1][0][3]=7.58712e+12;
1574  _meanR9[1][0][0]=0.96393;
1575  _meanR9[1][0][1]=29.6072;
1576  _meanR9[1][0][2]=334.89;
1577  _meanR9[1][0][3]=0;
1578 
1579  _sigmaScale[1][0][0]=0.337911;
1580  _sigmaScale[1][0][1]=1.03419e-11;
1581  _sigmaScale[1][0][2]=0.0153846;
1582  _sigmaScale[1][0][3]=0;
1583  _sigmaAT[1][0][0]=1.12;
1584  _sigmaAT[1][0][1]=0;
1585  _sigmaAT[1][0][2]=0;
1586  _sigmaAT[1][0][3]=0;
1587  _sigmaAC[1][0][0]=48.1275;
1588  _sigmaAC[1][0][1]=1.50005e+08;
1589  _sigmaAC[1][0][2]=21231.6;
1590  _sigmaAC[1][0][3]=2.6e+11;
1591  _sigmaAS[1][0][0]=-0.00036952;
1592  _sigmaAS[1][0][1]=2.75194;
1593  _sigmaAS[1][0][2]=1045.06;
1594  _sigmaAS[1][0][3]=1420.87;
1595  _sigmaAM[1][0][0]=0.05567;
1596  _sigmaAM[1][0][1]=0.32;
1597  _sigmaAM[1][0][2]=420;
1598  _sigmaAM[1][0][3]=12.8233;
1599  _sigmaBT[1][0][0]=-0.22312;
1600  _sigmaBT[1][0][1]=0;
1601  _sigmaBT[1][0][2]=0;
1602  _sigmaBT[1][0][3]=0;
1603  _sigmaBC[1][0][0]=-0.00320087;
1604  _sigmaBC[1][0][1]=59.2836;
1605  _sigmaBC[1][0][2]=7.49509e+12;
1606  _sigmaBC[1][0][3]=1.32714e+07;
1607  _sigmaBS[1][0][0]=0.000189384;
1608  _sigmaBS[1][0][1]=2.89111;
1609  _sigmaBS[1][0][2]=2468.02;
1610  _sigmaBS[1][0][3]=1294.69;
1611  _sigmaBM[1][0][0]=0.00154629;
1612  _sigmaBM[1][0][1]=16.9762;
1613  _sigmaBM[1][0][2]=1.05e+07;
1614  _sigmaBM[1][0][3]=-9e+06;
1615  _sigmaR9[1][0][0]=99.68;
1616  _sigmaR9[1][0][1]=-9.37265e-08;
1617  _sigmaR9[1][0][2]=6.91613e-09;
1618  _sigmaR9[1][0][3]=0;
1619 
1620  _meanScale[1][1][0]=0.340125;
1621  _meanScale[1][1][1]=-5.02007e-05;
1622  _meanScale[1][1][2]=0.000208216;
1623  _meanScale[1][1][3]=-1.32063;
1624  _meanAT[1][1][0]=-0.092494;
1625  _meanAT[1][1][1]=0;
1626  _meanAT[1][1][2]=0;
1627  _meanAT[1][1][3]=0;
1628  _meanAC[1][1][0]=-0.00131984;
1629  _meanAC[1][1][1]=0.00950668;
1630  _meanAC[1][1][2]=259.804;
1631  _meanAC[1][1][3]=705.003;
1632  _meanAS[1][1][0]=-0.00705787;
1633  _meanAS[1][1][1]=-0.00581517;
1634  _meanAS[1][1][2]=7.10951e+10;
1635  _meanAS[1][1][3]=-68.7322;
1636  _meanAM[1][1][0]=-0.00496966;
1637  _meanAM[1][1][1]=0.655834;
1638  _meanAM[1][1][2]=0.0491064;
1639  _meanAM[1][1][3]=0.0632471;
1640  _meanBT[1][1][0]=-0.158344;
1641  _meanBT[1][1][1]=0;
1642  _meanBT[1][1][2]=0;
1643  _meanBT[1][1][3]=0;
1644  _meanBC[1][1][0]=-0.00498431;
1645  _meanBC[1][1][1]=-18315.4;
1646  _meanBC[1][1][2]=50760;
1647  _meanBC[1][1][3]=118612;
1648  _meanBS[1][1][0]=-0.000620577;
1649  _meanBS[1][1][1]=0.0247672;
1650  _meanBS[1][1][2]=437.005;
1651  _meanBS[1][1][3]=374.823;
1652  _meanBM[1][1][0]=0.000431046;
1653  _meanBM[1][1][1]=0.0224695;
1654  _meanBM[1][1][2]=-1.06e+07;
1655  _meanBM[1][1][3]=-135.039;
1656  _meanR9[1][1][0]=0.151826;
1657  _meanR9[1][1][1]=0.00348896;
1658  _meanR9[1][1][2]=-0.161781;
1659  _meanR9[1][1][3]=0;
1660 
1661  _sigmaScale[1][1][0]=1.19993;
1662  _sigmaScale[1][1][1]=1.38778e-17;
1663  _sigmaScale[1][1][2]=0.0251314;
1664  _sigmaScale[1][1][3]=0;
1665  _sigmaAT[1][1][0]=-0.791929;
1666  _sigmaAT[1][1][1]=0;
1667  _sigmaAT[1][1][2]=0;
1668  _sigmaAT[1][1][3]=0;
1669  _sigmaAC[1][1][0]=0.0015505;
1670  _sigmaAC[1][1][1]=-0.530085;
1671  _sigmaAC[1][1][2]=33506.7;
1672  _sigmaAC[1][1][3]=-7e+09;
1673  _sigmaAS[1][1][0]=7.98682e-05;
1674  _sigmaAS[1][1][1]=0.875124;
1675  _sigmaAS[1][1][2]=483.102;
1676  _sigmaAS[1][1][3]=1005.71;
1677  _sigmaAM[1][1][0]=-0.00510653;
1678  _sigmaAM[1][1][1]=1.05312;
1679  _sigmaAM[1][1][2]=49.6466;
1680  _sigmaAM[1][1][3]=7.11474e+12;
1681  _sigmaBT[1][1][0]=-1.30079;
1682  _sigmaBT[1][1][1]=0;
1683  _sigmaBT[1][1][2]=0;
1684  _sigmaBT[1][1][3]=0;
1685  _sigmaBC[1][1][0]=-0.00202301;
1686  _sigmaBC[1][1][1]=4.19368;
1687  _sigmaBC[1][1][2]=-1.08161e+07;
1688  _sigmaBC[1][1][3]=-6e+09;
1689  _sigmaBS[1][1][0]=0.00182147;
1690  _sigmaBS[1][1][1]=0.25995;
1691  _sigmaBS[1][1][2]=881.576;
1692  _sigmaBS[1][1][3]=304.891;
1693  _sigmaBM[1][1][0]=-0.0454995;
1694  _sigmaBM[1][1][1]=7.63845;
1695  _sigmaBM[1][1][2]=1.9e+09;
1696  _sigmaBM[1][1][3]=150001;
1697  _sigmaR9[1][1][0]=5.69741;
1698  _sigmaR9[1][1][1]=-6.23853;
1699  _sigmaR9[1][1][2]=0;
1700  _sigmaR9[1][1][3]=0;
1701 
1702  _initialised=true;
1703  }
1704 
1705  if(s=="4_2e") {
1706  _meanScale[0][0][0]=1.02133;
1707  _meanScale[0][0][1]=-0.000183073;
1708  _meanScale[0][0][2]=0.000252052;
1709  _meanScale[0][0][3]=0.300892;
1710  _meanAT[0][0][0]=0.016876;
1711  _meanAT[0][0][1]=0;
1712  _meanAT[0][0][2]=0;
1713  _meanAT[0][0][3]=0;
1714  _meanAC[0][0][0]=-0.00327969;
1715  _meanAC[0][0][1]=0.00932112;
1716  _meanAC[0][0][2]=430.176;
1717  _meanAC[0][0][3]=440.94;
1718  _meanAS[0][0][0]=0;
1719  _meanAS[0][0][1]=0;
1720  _meanAS[0][0][2]=0;
1721  _meanAS[0][0][3]=0;
1722  _meanAM[0][0][0]=-0.000876726;
1723  _meanAM[0][0][1]=0.128953;
1724  _meanAM[0][0][2]=262.609;
1725  _meanAM[0][0][3]=204.869;
1726  _meanBT[0][0][0]=0;
1727  _meanBT[0][0][1]=0;
1728  _meanBT[0][0][2]=0;
1729  _meanBT[0][0][3]=0;
1730  _meanBC[0][0][0]=-0.00316342;
1731  _meanBC[0][0][1]=0.00801235;
1732  _meanBC[0][0][2]=552.944;
1733  _meanBC[0][0][3]=507.239;
1734  _meanBS[0][0][0]=0;
1735  _meanBS[0][0][1]=0;
1736  _meanBS[0][0][2]=0;
1737  _meanBS[0][0][3]=0;
1738  _meanBM[0][0][0]=-0.00171652;
1739  _meanBM[0][0][1]=0.0746995;
1740  _meanBM[0][0][2]=190.606;
1741  _meanBM[0][0][3]=210.147;
1742  _meanR9[0][0][0]=0.847311;
1743  _meanR9[0][0][1]=-10.0049;
1744  _meanR9[0][0][2]=67.613;
1745  _meanR9[0][0][3]=0;
1746 
1747  _sigmaScale[0][0][0]=0.345777;
1748  _sigmaScale[0][0][1]=0.0375747;
1749  _sigmaScale[0][0][2]=-0.00516299;
1750  _sigmaScale[0][0][3]=0;
1751  _sigmaAT[0][0][0]=0.994444;
1752  _sigmaAT[0][0][1]=0;
1753  _sigmaAT[0][0][2]=0;
1754  _sigmaAT[0][0][3]=0;
1755  _sigmaAC[0][0][0]=-0.00380373;
1756  _sigmaAC[0][0][1]=-1.00415;
1757  _sigmaAC[0][0][2]=110274;
1758  _sigmaAC[0][0][3]=-3e+17;
1759  _sigmaAS[0][0][0]=0;
1760  _sigmaAS[0][0][1]=0;
1761  _sigmaAS[0][0][2]=0;
1762  _sigmaAS[0][0][3]=0;
1763  _sigmaAM[0][0][0]=-0.000881147;
1764  _sigmaAM[0][0][1]=8.76414;
1765  _sigmaAM[0][0][2]=455.387;
1766  _sigmaAM[0][0][3]=412.382;
1767  _sigmaBT[0][0][0]=0.00578517;
1768  _sigmaBT[0][0][1]=2.28008;
1769  _sigmaBT[0][0][2]=-3.36e+07;
1770  _sigmaBT[0][0][3]=-152.696;
1771  _sigmaBC[0][0][0]=-0.00161997;
1772  _sigmaBC[0][0][1]=50513.8;
1773  _sigmaBC[0][0][2]=-1.26888e+07;
1774  _sigmaBC[0][0][3]=3.75561e+07;
1775  _sigmaBS[0][0][0]=0;
1776  _sigmaBS[0][0][1]=0;
1777  _sigmaBS[0][0][2]=0;
1778  _sigmaBS[0][0][3]=0;
1779  _sigmaBM[0][0][0]=-0.00168415;
1780  _sigmaBM[0][0][1]=6.89324;
1781  _sigmaBM[0][0][2]=272.169;
1782  _sigmaBM[0][0][3]=315.424;
1783  _sigmaR9[0][0][0]=0.952571;
1784  _sigmaR9[0][0][1]=0;
1785  _sigmaR9[0][0][2]=0;
1786  _sigmaR9[0][0][3]=0;
1787 
1788  _meanScale[0][1][0]=0.870259;
1789  _meanScale[0][1][1]=0.000234598;
1790  _meanScale[0][1][2]=-0.000262422;
1791  _meanScale[0][1][3]=0.277914;
1792  _meanAT[0][1][0]=1e-06;
1793  _meanAT[0][1][1]=0;
1794  _meanAT[0][1][2]=0;
1795  _meanAT[0][1][3]=0;
1796  _meanAC[0][1][0]=-0.00324258;
1797  _meanAC[0][1][1]=0.0209948;
1798  _meanAC[0][1][2]=167.983;
1799  _meanAC[0][1][3]=305.464;
1800  _meanAS[0][1][0]=0.0333341;
1801  _meanAS[0][1][1]=-591.066;
1802  _meanAS[0][1][2]=1.48079e+11;
1803  _meanAS[0][1][3]=1.61987e+07;
1804  _meanAM[0][1][0]=-0.000991417;
1805  _meanAM[0][1][1]=0.121994;
1806  _meanAM[0][1][2]=367.004;
1807  _meanAM[0][1][3]=289.22;
1808  _meanBT[0][1][0]=0;
1809  _meanBT[0][1][1]=0.187;
1810  _meanBT[0][1][2]=299.298;
1811  _meanBT[0][1][3]=428.221;
1812  _meanBC[0][1][0]=-0.00437016;
1813  _meanBC[0][1][1]=0.00235015;
1814  _meanBC[0][1][2]=759.85;
1815  _meanBC[0][1][3]=-5018.79;
1816  _meanBS[0][1][0]=-1.2e+08;
1817  _meanBS[0][1][1]=0.0934286;
1818  _meanBS[0][1][2]=-1.226e-16;
1819  _meanBS[0][1][3]=11442.2;
1820  _meanBM[0][1][0]=-0.000153536;
1821  _meanBM[0][1][1]=0.0101487;
1822  _meanBM[0][1][2]=60.0003;
1823  _meanBM[0][1][3]=-4.4e+08;
1824  _meanR9[0][1][0]=0.0853634;
1825  _meanR9[0][1][1]=-0.263819;
1826  _meanR9[0][1][2]=0.200892;
1827  _meanR9[0][1][3]=0;
1828 
1829  _sigmaScale[0][1][0]=0.705452;
1830  _sigmaScale[0][1][1]=-0.0781086;
1831  _sigmaScale[0][1][2]=0.0039561;
1832  _sigmaScale[0][1][3]=0;
1833  _sigmaAT[0][1][0]=1.46888;
1834  _sigmaAT[0][1][1]=0;
1835  _sigmaAT[0][1][2]=0;
1836  _sigmaAT[0][1][3]=0;
1837  _sigmaAC[0][1][0]=-0.00537924;
1838  _sigmaAC[0][1][1]=-0.740685;
1839  _sigmaAC[0][1][2]=1.59714;
1840  _sigmaAC[0][1][3]=31.9922;
1841  _sigmaAS[0][1][0]=0;
1842  _sigmaAS[0][1][1]=0;
1843  _sigmaAS[0][1][2]=0;
1844  _sigmaAS[0][1][3]=0;
1845  _sigmaAM[0][1][0]=0.000163134;
1846  _sigmaAM[0][1][1]=7.30822;
1847  _sigmaAM[0][1][2]=632.013;
1848  _sigmaAM[0][1][3]=373.003;
1849  _sigmaBT[0][1][0]=0.00253725;
1850  _sigmaBT[0][1][1]=2.97332;
1851  _sigmaBT[0][1][2]=-0.516548;
1852  _sigmaBT[0][1][3]=-0.50994;
1853  _sigmaBC[0][1][0]=0.00578715;
1854  _sigmaBC[0][1][1]=-0.473225;
1855  _sigmaBC[0][1][2]=8363.08;
1856  _sigmaBC[0][1][3]=2.36808e+19;
1857  _sigmaBS[0][1][0]=0;
1858  _sigmaBS[0][1][1]=0;
1859  _sigmaBS[0][1][2]=0;
1860  _sigmaBS[0][1][3]=0;
1861  _sigmaBM[0][1][0]=0.000184199;
1862  _sigmaBM[0][1][1]=3.82105;
1863  _sigmaBM[0][1][2]=93.4062;
1864  _sigmaBM[0][1][3]=95.4072;
1865  _sigmaR9[0][1][0]=1.20664;
1866  _sigmaR9[0][1][1]=-3.43548;
1867  _sigmaR9[0][1][2]=0;
1868  _sigmaR9[0][1][3]=0;
1869 
1870  _meanScale[1][0][0]=0.966787;
1871  _meanScale[1][0][1]=4.77112e-05;
1872  _meanScale[1][0][2]=-4.47768e-05;
1873  _meanScale[1][0][3]=0.0854689;
1874  _meanAT[1][0][0]=0.0691979;
1875  _meanAT[1][0][1]=0;
1876  _meanAT[1][0][2]=0;
1877  _meanAT[1][0][3]=0;
1878  _meanAC[1][0][0]=-0.000985244;
1879  _meanAC[1][0][1]=0.0132327;
1880  _meanAC[1][0][2]=530.13;
1881  _meanAC[1][0][3]=1008.64;
1882  _meanAS[1][0][0]=-0.000571197;
1883  _meanAS[1][0][1]=0.0579624;
1884  _meanAS[1][0][2]=687.722;
1885  _meanAS[1][0][3]=836.21;
1886  _meanAM[1][0][0]=0.00052402;
1887  _meanAM[1][0][1]=0.402941;
1888  _meanAM[1][0][2]=3615.29;
1889  _meanAM[1][0][3]=1495.1;
1890  _meanBT[1][0][0]=0.0456649;
1891  _meanBT[1][0][1]=0;
1892  _meanBT[1][0][2]=0;
1893  _meanBT[1][0][3]=0;
1894  _meanBC[1][0][0]=-0.000675969;
1895  _meanBC[1][0][1]=0.0118283;
1896  _meanBC[1][0][2]=1050.1;
1897  _meanBC[1][0][3]=1329.8;
1898  _meanBS[1][0][0]=-0.000254569;
1899  _meanBS[1][0][1]=0.0576783;
1900  _meanBS[1][0][2]=853.571;
1901  _meanBS[1][0][3]=938.698;
1902  _meanBM[1][0][0]=-0.186506;
1903  _meanBM[1][0][1]=-0.00654349;
1904  _meanBM[1][0][2]=1.09286;
1905  _meanBM[1][0][3]=-5.8e+08;
1906  _meanR9[1][0][0]=0.951164;
1907  _meanR9[1][0][1]=-0.323083;
1908  _meanR9[1][0][2]=506.054;
1909  _meanR9[1][0][3]=0;
1910 
1911  _sigmaScale[1][0][0]=0.443288;
1912  _sigmaScale[1][0][1]=1.73472e-18;
1913  _sigmaScale[1][0][2]=0.0134633;
1914  _sigmaScale[1][0][3]=0;
1915  _sigmaAT[1][0][0]=6.60294;
1916  _sigmaAT[1][0][1]=0;
1917  _sigmaAT[1][0][2]=0;
1918  _sigmaAT[1][0][3]=0;
1919  _sigmaAC[1][0][0]=48.1275;
1920  _sigmaAC[1][0][1]=1.50005e+08;
1921  _sigmaAC[1][0][2]=21231.6;
1922  _sigmaAC[1][0][3]=2.6e+11;
1923  _sigmaAS[1][0][0]=0.000112234;
1924  _sigmaAS[1][0][1]=2.38201;
1925  _sigmaAS[1][0][2]=1368.36;
1926  _sigmaAS[1][0][3]=1014.58;
1927  _sigmaAM[1][0][0]=0.0227945;
1928  _sigmaAM[1][0][1]=1.35035;
1929  _sigmaAM[1][0][2]=34.8078;
1930  _sigmaAM[1][0][3]=41.2653;
1931  _sigmaBT[1][0][0]=4.6512;
1932  _sigmaBT[1][0][1]=0;
1933  _sigmaBT[1][0][2]=0;
1934  _sigmaBT[1][0][3]=0;
1935  _sigmaBC[1][0][0]=-0.00385034;
1936  _sigmaBC[1][0][1]=9860.11;
1937  _sigmaBC[1][0][2]=7.49509e+12;
1938  _sigmaBC[1][0][3]=5.55794e+07;
1939  _sigmaBS[1][0][0]=0.000287389;
1940  _sigmaBS[1][0][1]=2.22754;
1941  _sigmaBS[1][0][2]=2066.43;
1942  _sigmaBS[1][0][3]=926.247;
1943  _sigmaBM[1][0][0]=0.00110983;
1944  _sigmaBM[1][0][1]=4.70582;
1945  _sigmaBM[1][0][2]=8.47552e+10;
1946  _sigmaBM[1][0][3]=-4572.21;
1947  _sigmaR9[1][0][0]=141.283;
1948  _sigmaR9[1][0][1]=-6.07621e-07;
1949  _sigmaR9[1][0][2]=1.40907e-08;
1950  _sigmaR9[1][0][3]=0;
1951 
1952  _meanScale[1][1][0]=0.290862;
1953  _meanScale[1][1][1]=-5.93303e-05;
1954  _meanScale[1][1][2]=0.000431058;
1955  _meanScale[1][1][3]=0.350738;
1956  _meanAT[1][1][0]=-0.092494;
1957  _meanAT[1][1][1]=0;
1958  _meanAT[1][1][2]=0;
1959  _meanAT[1][1][3]=0;
1960  _meanAC[1][1][0]=-0.00105099;
1961  _meanAC[1][1][1]=0.0195863;
1962  _meanAC[1][1][2]=162.87;
1963  _meanAC[1][1][3]=259.479;
1964  _meanAS[1][1][0]=-0.00820192;
1965  _meanAS[1][1][1]=-0.00404515;
1966  _meanAS[1][1][2]=-9e+12;
1967  _meanAS[1][1][3]=-12.1537;
1968  _meanAM[1][1][0]=0.00430129;
1969  _meanAM[1][1][1]=0.647006;
1970  _meanAM[1][1][2]=0.0524654;
1971  _meanAM[1][1][3]=0.057336;
1972  _meanBT[1][1][0]=-0.158344;
1973  _meanBT[1][1][1]=0;
1974  _meanBT[1][1][2]=0;
1975  _meanBT[1][1][3]=0;
1976  _meanBC[1][1][0]=-0.00661496;
1977  _meanBC[1][1][1]=-0.0551321;
1978  _meanBC[1][1][2]=1286.49;
1979  _meanBC[1][1][3]=118612;
1980  _meanBS[1][1][0]=-0.000517633;
1981  _meanBS[1][1][1]=0.0294134;
1982  _meanBS[1][1][2]=414.964;
1983  _meanBS[1][1][3]=487.294;
1984  _meanBM[1][1][0]=0.00298075;
1985  _meanBM[1][1][1]=0.0146853;
1986  _meanBM[1][1][2]=-7.17525e+06;
1987  _meanBM[1][1][3]=41.9253;
1988  _meanR9[1][1][0]=0.213804;
1989  _meanR9[1][1][1]=-0.395466;
1990  _meanR9[1][1][2]=0.202973;
1991  _meanR9[1][1][3]=0;
1992 
1993  _sigmaScale[1][1][0]=1.29656;
1994  _sigmaScale[1][1][1]=9.61084e-11;
1995  _sigmaScale[1][1][2]=0.0270649;
1996  _sigmaScale[1][1][3]=0;
1997  _sigmaAT[1][1][0]=-0.0115339;
1998  _sigmaAT[1][1][1]=0;
1999  _sigmaAT[1][1][2]=0;
2000  _sigmaAT[1][1][3]=0;
2001  _sigmaAC[1][1][0]=0.0013797;
2002  _sigmaAC[1][1][1]=-0.445789;
2003  _sigmaAC[1][1][2]=29539.8;
2004  _sigmaAC[1][1][3]=-3.6e+08;
2005  _sigmaAS[1][1][0]=0.000213606;
2006  _sigmaAS[1][1][1]=0.547654;
2007  _sigmaAS[1][1][2]=892.47;
2008  _sigmaAS[1][1][3]=408.826;
2009  _sigmaAM[1][1][0]=-0.00121353;
2010  _sigmaAM[1][1][1]=1.10052;
2011  _sigmaAM[1][1][2]=31.303;
2012  _sigmaAM[1][1][3]=80.0479;
2013  _sigmaBT[1][1][0]=0.470361;
2014  _sigmaBT[1][1][1]=0;
2015  _sigmaBT[1][1][2]=0;
2016  _sigmaBT[1][1][3]=0;
2017  _sigmaBC[1][1][0]=-0.00222463;
2018  _sigmaBC[1][1][1]=18440.6;
2019  _sigmaBC[1][1][2]=5.80805e+07;
2020  _sigmaBC[1][1][3]=-4.43323e+17;
2021  _sigmaBS[1][1][0]=0.00156455;
2022  _sigmaBS[1][1][1]=0.337173;
2023  _sigmaBS[1][1][2]=281.318;
2024  _sigmaBS[1][1][3]=252.457;
2025  _sigmaBM[1][1][0]=-0.0455886;
2026  _sigmaBM[1][1][1]=1.47875;
2027  _sigmaBM[1][1][2]=1.9e+09;
2028  _sigmaBM[1][1][3]=1193.93;
2029  _sigmaR9[1][1][0]=8.89993;
2030  _sigmaR9[1][1][1]=-9.8386;
2031  _sigmaR9[1][1][2]=0;
2032  _sigmaR9[1][1][3]=0;
2033 
2034  _initialised=true;
2035  }
2036 
2038  return true;
2039 }
2040 
2041 // Get the geometry of cracks and gaps from file
2043 
2044  std::ifstream fin("../test/PhotonFix.dat");
2045  assert(fin);
2046 
2047  std::cout << "Reading in here" << std::endl;
2048  for(unsigned i(0);i<169;i++) {
2049  for(unsigned j(0);j<360;j++) {
2050  for(unsigned k(0);k<2;k++) {
2051  fin >> _barrelCGap[i][j][k];
2052  }
2053  }
2054  }
2055 
2056  for(unsigned i(0);i<33;i++) {
2057  for(unsigned j(0);j<180;j++) {
2058  for(unsigned k(0);k<2;k++) {
2059  fin >> _barrelSGap[i][j][k];
2060  }
2061  }
2062  }
2063 
2064  for(unsigned i(0);i<7;i++) {
2065  for(unsigned j(0);j<18;j++) {
2066  for(unsigned k(0);k<2;k++) {
2067  fin >> _barrelMGap[i][j][k];
2068  }
2069  }
2070  }
2071  for(unsigned i(0);i<100;i++) {
2072  for(unsigned j(0);j<100;j++) {
2073  unsigned k;
2074  fin >> k;
2075  _endcapCrystal[i][j]=(k==0);
2076  }
2077  }
2078 
2079  for(unsigned i(0);i<2;i++) {
2080  for(unsigned j(0);j<7080;j++) {
2081  for(unsigned k(0);k<2;k++) {
2082  fin >> _endcapCGap[i][j][k];
2083  }
2084  }
2085  }
2086 
2087  for(unsigned i(0);i<2;i++) {
2088  for(unsigned j(0);j<264;j++) {
2089  for(unsigned k(0);k<2;k++) {
2090  fin >> _endcapSGap[i][j][k];
2091  }
2092  }
2093  }
2094 
2095  for(unsigned i(0);i<2;i++) {
2096  for(unsigned j(0);j<1;j++) {
2097  for(unsigned k(0);k<2;k++) {
2098  fin >> _endcapMGap[i][j][k];
2099  }
2100  }
2101  }
2102 
2103  assert(fin);
2104 
2105  return true;
2106 }
2107 
2108 const double PhotonFix::_onePi(acos(-1.0));
2109 const double PhotonFix::_twoPi(2.0*acos(-1.0));
2110 
2111 bool PhotonFix::_initialised=false;
2112 
2113 double PhotonFix::_meanScale[2][2][4];
2114 double PhotonFix::_meanAT[2][2][4];
2115 double PhotonFix::_meanAC[2][2][4];
2116 double PhotonFix::_meanAS[2][2][4];
2117 double PhotonFix::_meanAM[2][2][4];
2118 double PhotonFix::_meanBT[2][2][4];
2119 double PhotonFix::_meanBC[2][2][4];
2120 double PhotonFix::_meanBS[2][2][4];
2121 double PhotonFix::_meanBM[2][2][4];
2122 double PhotonFix::_meanR9[2][2][4];
2123 
2124 double PhotonFix::_sigmaScale[2][2][4];
2125 double PhotonFix::_sigmaAT[2][2][4];
2126 double PhotonFix::_sigmaAC[2][2][4];
2127 double PhotonFix::_sigmaAS[2][2][4];
2128 double PhotonFix::_sigmaAM[2][2][4];
2129 double PhotonFix::_sigmaBT[2][2][4];
2130 double PhotonFix::_sigmaBC[2][2][4];
2131 double PhotonFix::_sigmaBS[2][2][4];
2132 double PhotonFix::_sigmaBM[2][2][4];
2133 double PhotonFix::_sigmaR9[2][2][4];
2134 
2135 double PhotonFix::_barrelCGap[169][360][2];
2136 double PhotonFix::_barrelSGap[33][180][2];
2137 double PhotonFix::_barrelMGap[7][18][2];
2138 
2139 bool PhotonFix::_endcapCrystal[100][100];
2140 double PhotonFix::_endcapCGap[2][7080][2];
2141 double PhotonFix::_endcapSGap[2][264][2];
2142 double PhotonFix::_endcapMGap[2][1][2];
static void getParameters(unsigned be, unsigned hl, double *p)
Definition: PhotonFix.cc:383
int i
Definition: DBlmapReader.cc:9
static double _meanScale[2][2][4]
Definition: PhotonFix.h:138
static double _meanAS[2][2][4]
Definition: PhotonFix.h:141
double xC() const
Definition: PhotonFix.cc:289
static double _meanBM[2][2][4]
Definition: PhotonFix.h:146
double _phi
Definition: PhotonFix.h:127
static double _endcapCGap[2][7080][2]
Definition: PhotonFix.h:168
unsigned _hl
Definition: PhotonFix.h:126
static void dumpGaps(std::ostream &o)
Definition: PhotonFix.cc:557
double fixedEnergy() const
Definition: PhotonFix.cc:139
PhotonFix(double e, double eta, double phi, double r9)
Definition: PhotonFix.cc:9
static bool _endcapCrystal[100][100]
Definition: PhotonFix.h:167
static bool initialised()
Definition: PhotonFix.cc:651
static double expCorrection(double a, const double *p)
Definition: PhotonFix.cc:636
double rawEnergy() const
Definition: PhotonFix.cc:238
static double _sigmaAS[2][2][4]
Definition: PhotonFix.h:153
static double _barrelSGap[33][180][2]
Definition: PhotonFix.h:163
static double _meanBC[2][2][4]
Definition: PhotonFix.h:144
static double aPhi(double f0, double f1)
Definition: PhotonFix.cc:623
static double _sigmaAM[2][2][4]
Definition: PhotonFix.h:154
double phiS() const
Definition: PhotonFix.cc:274
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
assert(m_qm.get())
static double _meanR9[2][2][4]
Definition: PhotonFix.h:147
double _bC
Definition: PhotonFix.h:128
static double _meanAC[2][2][4]
Definition: PhotonFix.h:140
static double gausCorrection(double a, const double *p)
Definition: PhotonFix.cc:644
static double _sigmaBS[2][2][4]
Definition: PhotonFix.h:157
double xZ() const
Definition: PhotonFix.cc:284
static double _sigmaR9[2][2][4]
Definition: PhotonFix.h:159
static double _barrelCGap[169][360][2]
Definition: PhotonFix.h:162
static bool initialiseGeometry(const std::string &s)
Definition: PhotonFix.cc:2042
double yZ() const
Definition: PhotonFix.cc:304
static void endcapSGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:343
static bool initialise(const std::string &s="Nominal")
Definition: PhotonFix.cc:654
unsigned _be
Definition: PhotonFix.h:126
static double asinh(double s)
Definition: PhotonFix.cc:552
static double _sigmaScale[2][2][4]
Definition: PhotonFix.h:150
void setup()
Definition: PhotonFix.cc:15
static void barrelMGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:334
double etaM() const
Definition: PhotonFix.cc:264
static double _meanBS[2][2][4]
Definition: PhotonFix.h:145
static void printParameters(std::ostream &o)
Definition: PhotonFix.cc:479
static void barrelCGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:328
static void endcapMGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:346
double phi() const
Definition: PhotonFix.cc:246
static double _endcapSGap[2][264][2]
Definition: PhotonFix.h:169
static double _meanAT[2][2][4]
Definition: PhotonFix.h:139
static void barrelSGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:331
static double _endcapMGap[2][1][2]
Definition: PhotonFix.h:170
static const double _onePi
Definition: PhotonFix.h:131
double _aM
Definition: PhotonFix.h:128
double etaS() const
Definition: PhotonFix.cc:259
T sqrt(T t)
Definition: SSEVec.h:48
static void endcapCGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:340
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double _r9
Definition: PhotonFix.h:127
int j
Definition: DBlmapReader.cc:9
static void endcapCrystal(unsigned i, unsigned j, bool c)
Definition: PhotonFix.cc:337
double _bM
Definition: PhotonFix.h:128
double f[11][100]
static double _meanAM[2][2][4]
Definition: PhotonFix.h:142
static void setParameters(unsigned be, unsigned hl, const double *p)
Definition: PhotonFix.cc:357
double _eta
Definition: PhotonFix.h:127
double yM() const
Definition: PhotonFix.cc:319
static double _sigmaBC[2][2][4]
Definition: PhotonFix.h:156
double etaC() const
Definition: PhotonFix.cc:254
double sigmaEnergy() const
Definition: PhotonFix.cc:178
static bool initialiseParameters(const std::string &s)
Definition: PhotonFix.cc:663
static bool _initialised
Definition: PhotonFix.h:135
double yS() const
Definition: PhotonFix.cc:314
double _aS
Definition: PhotonFix.h:128
static double _sigmaAT[2][2][4]
Definition: PhotonFix.h:151
double _bS
Definition: PhotonFix.h:128
double yC() const
Definition: PhotonFix.cc:309
double b
Definition: hdecay.h:120
double eta() const
Definition: PhotonFix.cc:242
static double _meanBT[2][2][4]
Definition: PhotonFix.h:143
Geom::Phi< T > phi() const
static double _sigmaBT[2][2][4]
Definition: PhotonFix.h:155
static const double _twoPi
Definition: PhotonFix.h:132
double phiC() const
Definition: PhotonFix.cc:269
double a
Definition: hdecay.h:121
double r9() const
Definition: PhotonFix.cc:250
double phiM() const
Definition: PhotonFix.cc:279
static double _sigmaBM[2][2][4]
Definition: PhotonFix.h:158
double _aC
Definition: PhotonFix.h:128
double xM() const
Definition: PhotonFix.cc:299
tuple cout
Definition: gather_cfg.py:121
static double dPhi(double f0, double f1)
Definition: PhotonFix.cc:616
double _e
Definition: PhotonFix.h:127
static void dumpParameters(std::ostream &o)
Definition: PhotonFix.cc:409
static double _barrelMGap[7][18][2]
Definition: PhotonFix.h:164
void print() const
Definition: PhotonFix.cc:351
static double _sigmaAC[2][2][4]
Definition: PhotonFix.h:152
double xS() const
Definition: PhotonFix.cc:294
static double GetaPhi(double f0, double f1)
Definition: PhotonFix.cc:324