ATLAS Offline Software
KFLUT.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 // KFLUT
6 // contains LUT values for KF corrections to MET
7 //
8 
9 #include<cmath>
11 #include <iostream>
12 
13 using namespace std;
14 
16 
17  fillLUT();
18 }
19 
21 
22 }
23 
24 
26 
27  int bin = 0;
28  if (eta >= etalimits.back()) return (etalimits.size()-1);
29  if (eta < etalimits[0]) return 0;
30 
31  int sizelim = etalimits.size() - 1 ;
32  for (int j=0;j< sizelim ;j++) {
33  if (abs(eta) >= etalimits[j] && abs(eta) < etalimits[j+1]) {
34  bin = j;
35  }
36  }
37 
38  return bin;
39 
40 
41 }
42 
43 
44 int TCS::KFLUT::getetbin(unsigned int et){
45 
46  int binet = 0;
47  if (et >= etlimits.back()) return (etlimits.size()-1);
48  if (et < etlimits[0]) return 0;
49 
50  int sizelimet = etlimits.size() - 1 ;
51  for (int i=0;i< sizelimet ;i++) {
52  if (et >= etlimits[i] && et < etlimits[i+1]) {
53  binet = i;
54  }
55  }
56  return binet;
57 
58 
59 }
60 
61 
62 double TCS::KFLUT::getcorrKF(int iet,int jeta){
63 
64  return LUTKF.at(iet).at(jeta);
65 
66 
67 }
68 
70 
71  etalimits = {-0.10,0.10,0.30,0.50,0.70,0.90,1.10,1.30,1.50,1.70,1.90,2.10,2.33,2.55,2.80,3.42};
72  etlimits = {8,16,32,64,128,1024};
73 
74  vector<double> v0 {0.14,0.12,0.12,0.17,0.26,0.3,0.3,0.42,0.38,0.19,0.16,0.15,0.52,0.59,0.62,0.33};
75  vector<double> v1 {0.19,0.17,0.18,0.2,0.27,0.3,0.3,0.43,0.36,0.19,0.16,0.14,0.33,0.35,0.38,0.28};
76  vector<double> v2 {0.13,0.11,0.11,0.13,0.17,0.19,0.18,0.28,0.21,0.11,0.09,0.08,0.12,0.09,0.12,0.17};
77  vector<double> v3 {-0.01,-0.02,-0.02,-0.01,0.02,0.03,0.03,0.12,0.04,-0.04,-0.05,-0.06,-0.03,-0.06,-0.03,0.05};
78  vector<double> v4 {-0.12,-0.12,-0.12,-0.11,-0.08,-0.07,-0.08,-0.01,-0.08,-0.14,-0.14,-0.15,-0.13,-0.15,-0.12,-0.04};
79 
80  LUTKF.push_back(v0);
81  LUTKF.push_back(v1);
82  LUTKF.push_back(v2);
83  LUTKF.push_back(v3);
84  LUTKF.push_back(v4);
85 
86  //Correction for rounding when 7 decimal bit applied
87  for (auto &vet : LUTKF){
88  for (auto &veta : vet){
89  veta = std::round(veta*std::pow(2,7))/std::pow(2,7);
90  }
91  }
92 }
et
Extra patterns decribing particle interation process.
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
KFLUT.h
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
bin
Definition: BinsDiffFromStripMedian.h:43
TCS::KFLUT::getetbin
int getetbin(unsigned int et)
Definition: KFLUT.cxx:44
TCS::KFLUT::KFLUT
KFLUT()
Definition: KFLUT.cxx:15
TCS::KFLUT::getetabin
int getetabin(double eta)
Definition: KFLUT.cxx:25
TCS::KFLUT::getcorrKF
double getcorrKF(int i, int j)
Definition: KFLUT.cxx:62
parseMapping.v0
def v0
Definition: parseMapping.py:149
lumiFormat.i
int i
Definition: lumiFormat.py:85
TCS::KFLUT::fillLUT
void fillLUT()
Definition: KFLUT.cxx:69
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
TCS::KFLUT::~KFLUT
~KFLUT()
Definition: KFLUT.cxx:20
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15