src
Calibration
Tools
src
EcalIndexingTools.cc
Go to the documentation of this file.
1
#include "
Calibration/Tools/interface/EcalIndexingTools.h
"
2
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
3
4
#include <iostream>
5
6
EcalIndexingTools
*
EcalIndexingTools::instance_
=
nullptr
;
7
8
void
EcalIndexingTools::setBinRange
(
9
int
nBinsEta
,
double
minEta
,
double
maxEta
,
int
nBinsEt,
double
minEt
,
double
maxEt
) {
10
// std::cout<< "[EcalIndexingTools::setBinRange] setting values "<< nBinsEta << " " << minEta << " " << maxEta << std::endl;
11
12
totNumberOfBins_
=
nBinsEta
* nBinsEt;
13
14
nBinsEt_
= nBinsEt;
15
nBinsEta_
=
nBinsEta
;
16
17
minEt_
=
minEt
;
18
minEta_
=
minEta
;
19
maxEt_
=
maxEt
;
20
maxEta_
=
maxEta
;
21
22
// std::cout<< "[EcalIndexingTools::setBinRange] read back values: "<< nBinsEta_ << " " << minEta_ << " " << maxEta_ << std::endl;
23
24
return
;
25
}
26
27
int
EcalIndexingTools::getProgressiveIndex
(
double
myEta,
double
myEt) {
28
std::cout
<<
"minEt_ "
<<
minEt_
<< std::endl;
29
std::cout
<<
"minEta_ "
<<
minEta_
<< std::endl;
30
std::cout
<<
"maxEt_ "
<<
maxEt_
<< std::endl;
31
std::cout
<<
"maxEta_ "
<<
maxEta_
<< std::endl;
32
34
35
double
BoundaryEt[100] = {-99.};
36
double
BoundaryEta[100] = {-99.};
37
38
for
(
int
i
= 0;
i
< (
nBinsEt_
+ 1);
i
++) {
39
BoundaryEt[
i
] =
minEt_
+
i
* ((
maxEt_
-
minEt_
) / (
double
)
nBinsEt_
);
40
// std::cout << "i " << i << " BoundaryEt[i] "<< BoundaryEt[i] <<std::endl;
41
}
42
43
for
(
int
i
= 0;
i
< (
nBinsEta_
+ 1);
i
++) {
44
BoundaryEta[
i
] =
minEta_
+
i
* ((
maxEta_
-
minEta_
) / (
double
)
nBinsEta_
);
45
//std::cout << "i " << i << " BoundaryEta[i] "<< BoundaryEta[i] <<std::endl;
46
}
47
49
int
etBin
(-1);
50
int
etaBin
(-1);
51
52
for
(
int
i
= 0;
i
<
nBinsEta_
;
i
++) {
53
if
(myEta > BoundaryEta[
i
] && myEta <= BoundaryEta[
i
+ 1])
54
etaBin
=
i
;
55
}
56
57
for
(
int
i
= 0;
i
<
nBinsEt_
;
i
++) {
58
if
(myEt > BoundaryEt[
i
] && myEt <= BoundaryEt[
i
+ 1])
59
etBin
=
i
;
60
}
61
62
// std::cout << " myEta "<< myEta << " myEt "<< myEt << " etaBin "<< etaBin << " etBin "<< etBin << std::endl;
63
65
66
int
in
=
etaBin
*
nBinsEta_
+
etBin
;
67
68
//std::cout << "Progressive index " << in << std::endl;
69
70
return
in
;
71
}
EcalIndexingTools::totNumberOfBins_
int totNumberOfBins_
Definition:
EcalIndexingTools.h:16
mps_fire.i
i
Definition:
mps_fire.py:428
EcalIndexingTools::maxEt_
double maxEt_
Definition:
EcalIndexingTools.h:18
EcalIndexingTools::setBinRange
void setBinRange(int, double, double, int, double, double)
Definition:
EcalIndexingTools.cc:8
MessageLogger.h
EcalIndexingTools::minEta_
double minEta_
Definition:
EcalIndexingTools.h:18
photonAnalyzer_cfi.etBin
etBin
Definition:
photonAnalyzer_cfi.py:53
maxEta
double maxEta
Definition:
PFJetBenchmarkAnalyzer.cc:76
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
EcalIndexingTools.h
EgHLTOffEleSelection_cfi.minEt
minEt
Definition:
EgHLTOffEleSelection_cfi.py:10
EcalIndexingTools::instance_
static EcalIndexingTools * instance_
Definition:
EcalIndexingTools.h:12
EcalIndexingTools::minEt_
double minEt_
Definition:
EcalIndexingTools.h:18
EcalIndexingTools
Definition:
EcalIndexingTools.h:9
EcalIndexingTools::getProgressiveIndex
int getProgressiveIndex(double, double)
Definition:
EcalIndexingTools.cc:27
EgHLTOffEleSelection_cfi.minEta
minEta
Definition:
EgHLTOffEleSelection_cfi.py:11
EcalIndexingTools::nBinsEt_
int nBinsEt_
Definition:
EcalIndexingTools.h:16
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
EcalIndexingTools::maxEta_
double maxEta_
Definition:
EcalIndexingTools.h:18
EcalIndexingTools::nBinsEta_
int nBinsEta_
Definition:
EcalIndexingTools.h:16
etaBin
int etaBin(const l1t::HGCalMulticluster *cl)
Definition:
L1EGammaEEProducer.cc:18
hgcalTowerMapProducer_cfi.nBinsEta
nBinsEta
Definition:
hgcalTowerMapProducer_cfi.py:10
heavyionUCCDQM_cfi.maxEt
maxEt
Definition:
heavyionUCCDQM_cfi.py:14
Generated for CMSSW Reference Manual by
1.8.14