CMS 3D CMS Logo

L1TMuonBarrelKalmanLUTs.cc
Go to the documentation of this file.
3 
5  edm::FileInPath path(filename);
6  lutFile_ = new TFile(path.fullPath().c_str());
7 
8 
9  lut_[15*100+3] = (TH1*)lutFile_->Get("gain_15_3");
10  lut_[15*100+2] = (TH1*)lutFile_->Get("gain_15_2");
11  lut_[15*100+1] = (TH1*)lutFile_->Get("gain_15_1");
12  lut_[15*100] = (TH1*)lutFile_->Get("gain_15_0");
13  lut_[14*100+3] = (TH1*)lutFile_->Get("gain_14_3");
14  lut_[14*100+2] = (TH1*)lutFile_->Get("gain_14_2");
15  lut_[14*100] = (TH1*)lutFile_->Get("gain_14_0");
16 
17  lut_[13*100+3] = (TH1*)lutFile_->Get("gain_13_3");
18  lut_[13*100+1] = (TH1*)lutFile_->Get("gain_13_1");
19  lut_[13*100] = (TH1*)lutFile_->Get("gain_13_0");
20 
21  lut_[12*100+3] = (TH1*)lutFile_->Get("gain_12_3");
22  lut_[12*100] = (TH1*)lutFile_->Get("gain_12_0");
23 
24  lut_[11*100+2] = (TH1*)lutFile_->Get("gain_11_2");
25  lut_[11*100+1] = (TH1*)lutFile_->Get("gain_11_1");
26  lut_[11*100] = (TH1*)lutFile_->Get("gain_11_0");
27 
28  lut_[10*100+2] = (TH1*)lutFile_->Get("gain_10_2");
29  lut_[10*100] = (TH1*)lutFile_->Get("gain_10_0");
30 
31  lut_[9*100+1] = (TH1*)lutFile_->Get("gain_9_1");
32  lut_[9*100] = (TH1*)lutFile_->Get("gain_9_0");
33 
34  lut_[7*100+2] = (TH1*)lutFile_->Get("gain_7_2");
35  lut_[7*100+1] = (TH1*)lutFile_->Get("gain_7_1");
36  lut_[7*100] = (TH1*)lutFile_->Get("gain_7_0");
37 
38  lut_[6*100+2] = (TH1*)lutFile_->Get("gain_6_2");
39  lut_[6*100] = (TH1*)lutFile_->Get("gain_6_0");
40 
41  lut_[5*100+1] = (TH1*)lutFile_->Get("gain_5_1");
42  lut_[5*100] = (TH1*)lutFile_->Get("gain_5_0");
43  lut_[3*100+1] = (TH1*)lutFile_->Get("gain_3_1");
44  lut_[3*100] = (TH1*)lutFile_->Get("gain_3_0");
45 
46 }
47 
49  lutFile_->Close();
50  if (lutFile_ !=nullptr)
51  delete lutFile_;
52 }
53 
54 
55 std::vector<float> L1TMuonBarrelKalmanLUTs::trackGain(uint step,uint bitmask,uint K) {
56  std::vector<float> gain(4,0.0);
57  // printf("Track gain %d %d %d\n",step,bitmask,K);
58  const TH1* h = lut_[100*bitmask+step];
59  gain[0] = h->GetBinContent(K+1);
60  gain[1] = h->GetBinContent(1024+K+1);
61  gain[2] = -h->GetBinContent(2*1024+K+1);
62  gain[3] = h->GetBinContent(3*1024+K+1);
63  return gain;
64 }
65 
66 
67 std::pair<float,float> L1TMuonBarrelKalmanLUTs::vertexGain(uint bitmask,uint K) {
68  const TH1* h = lut_[100*bitmask];
69  std::pair<float,float> gain(-h->GetBinContent(K+1),-h->GetBinContent(1024+K+1) );
70  return gain;
71 }
std::map< uint, const TH1 * > lut_
L1TMuonBarrelKalmanLUTs(const std::string &)
std::pair< float, float > vertexGain(uint, uint)
def uint(string)
std::string fullPath() const
Definition: FileInPath.cc:197
step
std::vector< float > trackGain(uint, uint, uint)