L1Trigger
L1TMuonBarrel
src
L1TMuonBarrelKalmanLUTs.cc
Go to the documentation of this file.
1
#include "
L1Trigger/L1TMuonBarrel/interface/L1TMuonBarrelKalmanLUTs.h
"
2
#include "
FWCore/ParameterSet/interface/FileInPath.h
"
3
4
L1TMuonBarrelKalmanLUTs::L1TMuonBarrelKalmanLUTs
(
const
std::string
&
filename
) {
5
edm::FileInPath
path
(
filename
);
6
lutFile_
=
new
TFile(
path
.fullPath().c_str());
7
8
lut_
[3 * 64 + 8] = (TH1*)
lutFile_
->Get(
"gain_8_3"
);
9
lut_
[2 * 64 + 8] = (TH1*)
lutFile_
->Get(
"gain_8_2"
);
10
lut_
[2 * 64 + 12] = (TH1*)
lutFile_
->Get(
"gain_12_2"
);
11
lut_
[2 * 64 + 4] = (TH1*)
lutFile_
->Get(
"gain_4_2"
);
12
lut_
[1 * 64 + 12] = (TH1*)
lutFile_
->Get(
"gain_12_1"
);
13
lut_
[1 * 64 + 10] = (TH1*)
lutFile_
->Get(
"gain_10_1"
);
14
lut_
[1 * 64 + 6] = (TH1*)
lutFile_
->Get(
"gain_6_1"
);
15
lut_
[1 * 64 + 14] = (TH1*)
lutFile_
->Get(
"gain_14_1"
);
16
lut_
[3] = (TH1*)
lutFile_
->Get(
"gain_3_0"
);
17
lut_
[5] = (TH1*)
lutFile_
->Get(
"gain_5_0"
);
18
lut_
[6] = (TH1*)
lutFile_
->Get(
"gain_6_0"
);
19
lut_
[7] = (TH1*)
lutFile_
->Get(
"gain_7_0"
);
20
lut_
[9] = (TH1*)
lutFile_
->Get(
"gain_9_0"
);
21
lut_
[10] = (TH1*)
lutFile_
->Get(
"gain_10_0"
);
22
lut_
[11] = (TH1*)
lutFile_
->Get(
"gain_11_0"
);
23
lut_
[12] = (TH1*)
lutFile_
->Get(
"gain_12_0"
);
24
lut_
[13] = (TH1*)
lutFile_
->Get(
"gain_13_0"
);
25
lut_
[14] = (TH1*)
lutFile_
->Get(
"gain_14_0"
);
26
lut_
[15] = (TH1*)
lutFile_
->Get(
"gain_15_0"
);
27
28
lut2_
[3 * 64 + 8] = (TH1*)
lutFile_
->Get(
"gain2_8_3"
);
29
lut2_
[2 * 64 + 8] = (TH1*)
lutFile_
->Get(
"gain2_8_2"
);
30
lut2_
[2 * 64 + 4] = (TH1*)
lutFile_
->Get(
"gain2_4_2"
);
31
lut2_
[1 * 64 + 8] = (TH1*)
lutFile_
->Get(
"gain2_8_1"
);
32
lut2_
[1 * 64 + 4] = (TH1*)
lutFile_
->Get(
"gain2_4_1"
);
33
lut2_
[1 * 64 + 2] = (TH1*)
lutFile_
->Get(
"gain2_2_1"
);
34
35
coarseEta_
[3] = (TH1*)
lutFile_
->Get(
"coarseEta_3"
);
36
coarseEta_
[5] = (TH1*)
lutFile_
->Get(
"coarseEta_5"
);
37
coarseEta_
[6] = (TH1*)
lutFile_
->Get(
"coarseEta_6"
);
38
coarseEta_
[7] = (TH1*)
lutFile_
->Get(
"coarseEta_7"
);
39
coarseEta_
[9] = (TH1*)
lutFile_
->Get(
"coarseEta_9"
);
40
41
coarseEta_
[10] = (TH1*)
lutFile_
->Get(
"coarseEta_10"
);
42
coarseEta_
[11] = (TH1*)
lutFile_
->Get(
"coarseEta_11"
);
43
coarseEta_
[12] = (TH1*)
lutFile_
->Get(
"coarseEta_12"
);
44
coarseEta_
[13] = (TH1*)
lutFile_
->Get(
"coarseEta_13"
);
45
coarseEta_
[14] = (TH1*)
lutFile_
->Get(
"coarseEta_14"
);
46
coarseEta_
[15] = (TH1*)
lutFile_
->Get(
"coarseEta_15"
);
47
}
48
49
L1TMuonBarrelKalmanLUTs::~L1TMuonBarrelKalmanLUTs
() {
50
lutFile_
->Close();
51
if
(
lutFile_
!=
nullptr
)
52
delete
lutFile_
;
53
}
54
55
std::vector<float>
L1TMuonBarrelKalmanLUTs::trackGain
(
uint
step
,
uint
bitmask,
uint
K) {
56
std::vector<float>
gain
(4, 0.0);
57
const
TH1*
h
=
lut_
[64 *
step
+ bitmask];
58
gain
[0] =
h
->GetBinContent(K + 1);
59
gain
[2] = -
h
->GetBinContent(1024 + K + 1);
60
return
gain
;
61
}
62
63
std::vector<float>
L1TMuonBarrelKalmanLUTs::trackGain2
(
uint
step
,
uint
bitmask,
uint
K) {
64
std::vector<float>
gain
(4, 0.0);
65
66
// printf("Track gain %d %d %d\n",step,bitmask,K);
67
const
TH1*
h
=
lut2_
[64 *
step
+ bitmask];
68
gain
[0] =
h
->GetBinContent(K + 1);
69
gain
[1] =
h
->GetBinContent(512 + K + 1);
70
gain
[2] = -
h
->GetBinContent(2 * 512 + K + 1);
71
gain
[3] =
h
->GetBinContent(3 * 512 + K + 1);
72
return
gain
;
73
}
74
75
std::pair<float, float>
L1TMuonBarrelKalmanLUTs::vertexGain
(
uint
bitmask,
uint
K) {
76
const
TH1*
h
=
lut_
[bitmask];
77
std::pair<float, float>
gain
(-
h
->GetBinContent(K + 1), -
h
->GetBinContent(1024 + K + 1));
78
return
gain
;
79
}
80
81
uint
L1TMuonBarrelKalmanLUTs::coarseEta
(
uint
pattern
,
uint
mask) {
82
const
TH1*
h
=
coarseEta_
[
pattern
];
83
return
uint
(
h
->GetBinContent(
h
->GetXaxis()->FindBin(mask)));
84
}
L1TMuonBarrelKalmanLUTs::trackGain2
std::vector< float > trackGain2(uint, uint, uint)
Definition:
L1TMuonBarrelKalmanLUTs.cc:63
L1TMuonBarrelKalmanLUTs::trackGain
std::vector< float > trackGain(uint, uint, uint)
Definition:
L1TMuonBarrelKalmanLUTs.cc:55
L1TMuonBarrelKalmanLUTs::L1TMuonBarrelKalmanLUTs
L1TMuonBarrelKalmanLUTs(const std::string &)
Definition:
L1TMuonBarrelKalmanLUTs.cc:4
step
step
Definition:
StallMonitor.cc:94
L1TMuonBarrelKalmanLUTs::lut2_
std::map< uint, const TH1 * > lut2_
Definition:
L1TMuonBarrelKalmanLUTs.h:22
L1TMuonBarrelKalmanLUTs::~L1TMuonBarrelKalmanLUTs
~L1TMuonBarrelKalmanLUTs()
Definition:
L1TMuonBarrelKalmanLUTs.cc:49
parallelization.uint
uint
Definition:
parallelization.py:124
L1TMuonBarrelKalmanLUTs::coarseEta
uint coarseEta(uint, uint)
Definition:
L1TMuonBarrelKalmanLUTs.cc:81
FileInPath.h
edm::FileInPath
Definition:
FileInPath.h:64
L1TMuonBarrelKalmanLUTs::vertexGain
std::pair< float, float > vertexGain(uint, uint)
Definition:
L1TMuonBarrelKalmanLUTs.cc:75
L1TMuonBarrelKalmanLUTs.h
corrVsCorr.filename
filename
Definition:
corrVsCorr.py:123
h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
L1TMuonBarrelKalmanLUTs::coarseEta_
std::map< uint, const TH1 * > coarseEta_
Definition:
L1TMuonBarrelKalmanLUTs.h:23
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition:
topSingleLeptonDQM_PU_cfi.py:39
L1TMuonBarrelKalmanLUTs::lutFile_
TFile * lutFile_
Definition:
L1TMuonBarrelKalmanLUTs.h:20
PedestalClient_cfi.gain
gain
Definition:
PedestalClient_cfi.py:37
L1TMuonBarrelKalmanLUTs::lut_
std::map< uint, const TH1 * > lut_
Definition:
L1TMuonBarrelKalmanLUTs.h:21
castor_dqm_sourceclient_file_cfg.path
path
Definition:
castor_dqm_sourceclient_file_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16