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 
10  lut_[3*64+8] = (TH1*)lutFile_->Get("gain_8_3");
11  lut_[2*64+8] = (TH1*)lutFile_->Get("gain_8_2");
12  lut_[2*64+12] = (TH1*)lutFile_->Get("gain_12_2");
13  lut_[2*64+4] = (TH1*)lutFile_->Get("gain_4_2");
14  lut_[1*64+12] = (TH1*)lutFile_->Get("gain_12_1");
15  lut_[1*64+10] = (TH1*)lutFile_->Get("gain_10_1");
16  lut_[1*64+6] = (TH1*)lutFile_->Get("gain_6_1");
17  lut_[1*64+14] = (TH1*)lutFile_->Get("gain_14_1");
18  lut_[3] = (TH1*)lutFile_->Get("gain_3_0");
19  lut_[5] = (TH1*)lutFile_->Get("gain_5_0");
20  lut_[6] = (TH1*)lutFile_->Get("gain_6_0");
21  lut_[7] = (TH1*)lutFile_->Get("gain_7_0");
22  lut_[9] = (TH1*)lutFile_->Get("gain_9_0");
23  lut_[10] = (TH1*)lutFile_->Get("gain_10_0");
24  lut_[11] = (TH1*)lutFile_->Get("gain_11_0");
25  lut_[12] = (TH1*)lutFile_->Get("gain_12_0");
26  lut_[13] = (TH1*)lutFile_->Get("gain_13_0");
27  lut_[14] = (TH1*)lutFile_->Get("gain_14_0");
28  lut_[15] = (TH1*)lutFile_->Get("gain_15_0");
29 
30  lut2_[3*64+8] = (TH1*)lutFile_->Get("gain2_8_3");
31  lut2_[2*64+8] = (TH1*)lutFile_->Get("gain2_8_2");
32  lut2_[2*64+4] = (TH1*)lutFile_->Get("gain2_4_2");
33  lut2_[1*64+8] = (TH1*)lutFile_->Get("gain2_8_1");
34  lut2_[1*64+4] = (TH1*)lutFile_->Get("gain2_4_1");
35  lut2_[1*64+2] = (TH1*)lutFile_->Get("gain2_2_1");
36 
37 
38 
39  coarseEta_[3] = (TH1*)lutFile_->Get("coarseEta_3");
40  coarseEta_[5] = (TH1*)lutFile_->Get("coarseEta_5");
41  coarseEta_[6] = (TH1*)lutFile_->Get("coarseEta_6");
42  coarseEta_[7] = (TH1*)lutFile_->Get("coarseEta_7");
43  coarseEta_[9] = (TH1*)lutFile_->Get("coarseEta_9");
44 
45  coarseEta_[10] = (TH1*)lutFile_->Get("coarseEta_10");
46  coarseEta_[11] = (TH1*)lutFile_->Get("coarseEta_11");
47  coarseEta_[12] = (TH1*)lutFile_->Get("coarseEta_12");
48  coarseEta_[13] = (TH1*)lutFile_->Get("coarseEta_13");
49  coarseEta_[14] = (TH1*)lutFile_->Get("coarseEta_14");
50  coarseEta_[15] = (TH1*)lutFile_->Get("coarseEta_15");
51 
52 
53 
54 
55 }
56 
58  lutFile_->Close();
59  if (lutFile_ !=nullptr)
60  delete lutFile_;
61 }
62 
63 
64 std::vector<float> L1TMuonBarrelKalmanLUTs::trackGain(uint step,uint bitmask,uint K) {
65  std::vector<float> gain(4,0.0);
66  const TH1* h = lut_[64*step+bitmask];
67  gain[0] = h->GetBinContent(K+1);
68  gain[2] = -h->GetBinContent(1024+K+1);
69  return gain;
70 }
71 
72 
73 std::vector<float> L1TMuonBarrelKalmanLUTs::trackGain2(uint step,uint bitmask,uint K) {
74  std::vector<float> gain(4,0.0);
75 
76  // printf("Track gain %d %d %d\n",step,bitmask,K);
77  const TH1* h = lut2_[64*step+bitmask];
78  gain[0] = h->GetBinContent(K+1);
79  gain[1] = h->GetBinContent(512+K+1);
80  gain[2] = -h->GetBinContent(2*512+K+1);
81  gain[3] = h->GetBinContent(3*512+K+1);
82  return gain;
83 
84 
85 }
86 
87 
88 std::pair<float,float> L1TMuonBarrelKalmanLUTs::vertexGain(uint bitmask,uint K) {
89  const TH1* h = lut_[bitmask];
90  std::pair<float,float> gain(-h->GetBinContent(K+1),-h->GetBinContent(1024+K+1) );
91  return gain;
92 }
93 
94 
95 
97  const TH1* h = coarseEta_[pattern];
98  return uint(h->GetBinContent(h->GetXaxis()->FindBin(mask)));
99 }
std::map< uint, const TH1 * > lut_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
L1TMuonBarrelKalmanLUTs(const std::string &)
std::map< uint, const TH1 * > lut2_
std::vector< float > trackGain2(uint, uint, uint)
std::pair< float, float > vertexGain(uint, uint)
def uint(string)
std::map< uint, const TH1 * > coarseEta_
std::string fullPath() const
Definition: FileInPath.cc:163
step
Definition: StallMonitor.cc:94
std::vector< float > trackGain(uint, uint, uint)