Main Page
Namespaces
Classes
Package Documentation
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
9
void
EcalIndexingTools::setBinRange
(
int
nBinsEta,
double
minEta
,
double
maxEta
,
int
nBinsEt,
double
minEt,
double
maxEt){
10
11
// std::cout<< "[EcalIndexingTools::setBinRange] setting values "<< nBinsEta << " " << minEta << " " << maxEta << std::endl;
12
13
totNumberOfBins_
= nBinsEta*nBinsEt;
14
15
nBinsEt_
= nBinsEt;
16
nBinsEta_
= nBinsEta;
17
18
minEt_
= minEt;
19
minEta_
=
minEta
;
20
maxEt_
= maxEt;
21
maxEta_
=
maxEta
;
22
23
// std::cout<< "[EcalIndexingTools::setBinRange] read back values: "<< nBinsEta_ << " " << minEta_ << " " << maxEta_ << std::endl;
24
25
return
;
26
27
}
28
29
30
int
EcalIndexingTools::getProgressiveIndex
(
double
myEta,
double
myEt){
31
32
33
std::cout
<<
"minEt_ "
<<
minEt_
<<std::endl;
34
std::cout
<<
"minEta_ "
<<
minEta_
<<std::endl;
35
std::cout
<<
"maxEt_ "
<<
maxEt_
<<std::endl;
36
std::cout
<<
"maxEta_ "
<<
maxEta_
<<std::endl;
37
39
40
double
BoundaryEt[100] = {-99.};
41
double
BoundaryEta[100] = {-99.};
42
43
for
(
int
i
= 0;
i
< (
nBinsEt_
+ 1 );
i
++ ){
44
45
BoundaryEt[
i
] =
minEt_
+
i
* ( (
maxEt_
-
minEt_
)/ (
double
)
nBinsEt_
);
46
// std::cout << "i " << i << " BoundaryEt[i] "<< BoundaryEt[i] <<std::endl;
47
48
}
49
50
for
(
int
i
= 0;
i
< (
nBinsEta_
+ 1 );
i
++ ){
51
52
BoundaryEta[
i
] =
minEta_
+
i
* ( (
maxEta_
-
minEta_
)/ (
double
)
nBinsEta_
);
53
//std::cout << "i " << i << " BoundaryEta[i] "<< BoundaryEta[i] <<std::endl;
54
55
}
56
58
int
etBin
(-1);
59
int
etaBin
(-1);
60
61
for
(
int
i
= 0;
i
<
nBinsEta_
;
i
++ ){
62
if
( myEta > BoundaryEta[
i
] &&
63
myEta <= BoundaryEta[
i
+1] )
64
etaBin=
i
;
65
}
66
67
for
(
int
i
= 0;
i
<
nBinsEt_
;
i
++ ){
68
if
( myEt > BoundaryEt[
i
] &&
69
myEt <= BoundaryEt[
i
+1] )
70
etBin=
i
;
71
}
72
73
// std::cout << " myEta "<< myEta << " myEt "<< myEt << " etaBin "<< etaBin << " etBin "<< etBin << std::endl;
74
76
77
int
in
= etaBin * nBinsEta_ +
etBin
;
78
79
//std::cout << "Progressive index " << in << std::endl;
80
81
return
in
;
82
83
}
84
EcalIndexingTools::totNumberOfBins_
int totNumberOfBins_
Definition:
EcalIndexingTools.h:19
MessageLogger.h
mps_fire.i
i
Definition:
mps_fire.py:330
EcalIndexingTools::maxEt_
double maxEt_
Definition:
EcalIndexingTools.h:21
EcalIndexingTools::setBinRange
void setBinRange(int, double, double, int, double, double)
Definition:
EcalIndexingTools.cc:9
trackingPOGFilters_cfi.minEta
minEta
Definition:
trackingPOGFilters_cfi.py:107
EcalIndexingTools::minEta_
double minEta_
Definition:
EcalIndexingTools.h:21
maxEta
double maxEta
Definition:
PFJetBenchmarkAnalyzer.cc:74
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
EcalIndexingTools.h
EcalIndexingTools::instance_
static EcalIndexingTools * instance_
Definition:
EcalIndexingTools.h:15
conversionPostprocessing_cfi.etaBin
etaBin
Definition:
conversionPostprocessing_cfi.py:18
EcalIndexingTools::minEt_
double minEt_
Definition:
EcalIndexingTools.h:21
EcalIndexingTools
Definition:
EcalIndexingTools.h:10
EcalIndexingTools::getProgressiveIndex
int getProgressiveIndex(double, double)
Definition:
EcalIndexingTools.cc:30
conversionPostprocessing_cfi.etBin
etBin
Definition:
conversionPostprocessing_cfi.py:14
EcalIndexingTools::nBinsEt_
int nBinsEt_
Definition:
EcalIndexingTools.h:19
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
EcalIndexingTools::maxEta_
double maxEta_
Definition:
EcalIndexingTools.h:21
EcalIndexingTools::nBinsEta_
int nBinsEta_
Definition:
EcalIndexingTools.h:19
Generated for CMSSW Reference Manual by
1.8.11