CommonTools
TrackerMap
bin
print_TrackerMap.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <string>
3
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
#include "
CommonTools/TrackerMap/interface/TrackerMap.h
"
6
7
void
printTrackerMap
(
const
std::string
filename
,
8
const
std::string
title
,
9
const
std::string
outfile
,
10
const
int
size
,
11
const
std::string
logscale,
12
std::string
withpixel,
13
const
float
min
,
14
const
float
max
);
15
16
int
main
(
int
argc
,
char
*
argv
[]) {
17
if
(
argc
>= 4) {
18
int
size
= 4500;
19
float
min
= 10.;
20
float
max
= -1.;
21
std::string
logscale =
"False"
;
22
std::string
withpixel =
"False"
;
23
24
char
*
filename
=
argv
[1];
25
char
*
title
=
argv
[2];
26
char
*
outfile
=
argv
[3];
27
std::cout
<<
"ready to use file "
<<
filename
<<
" to create the map "
<<
title
<<
" and save it in "
<<
outfile
28
<< std::endl;
29
30
if
(
argc
>= 5) {
31
size
= atoi(
argv
[4]);
32
}
33
if
(
argc
>= 6) {
34
logscale =
argv
[5];
35
withpixel =
argv
[6];
36
}
37
if
(
argc
>= 9) {
38
min
= atof(
argv
[7]);
39
max
= atof(
argv
[8]);
40
}
41
42
printTrackerMap
(
filename
,
title
,
outfile
,
size
, logscale, withpixel,
min
,
max
);
43
44
}
else
{
45
std::cout
<<
"Wrong number of arguments: "
<<
argc
<< std::endl;
46
return
-1;
47
}
48
49
return
0;
50
}
51
52
void
printTrackerMap
(
const
std::string
filename
,
53
const
std::string
title
,
54
const
std::string
outfile
,
55
const
int
size
,
56
const
std::string
logscale,
57
std::string
withpixel,
58
const
float
min
,
59
const
float
max
) {
60
edm::ParameterSet
pset
;
61
62
if
(logscale ==
"True"
)
63
pset
.addUntrackedParameter<
bool
>(
"logScale"
,
true
);
64
if
(logscale ==
"False"
)
65
pset
.addUntrackedParameter<
bool
>(
"logScale"
,
false
);
66
67
TrackerMap
themap(
pset
);
68
themap.setTitle(
title
);
// title as input parameter
69
double
ratio
= 2400. / 4500.;
70
if
(withpixel ==
"True"
) {
71
themap.addPixel(
true
);
72
themap.onlyPixel(
false
);
73
ratio
= 8. / 19.;
74
}
75
if
(withpixel ==
"Only"
) {
76
themap.addPixel(
false
);
77
themap.onlyPixel(
true
);
78
ratio
= 16. / 9.;
79
}
80
if
(withpixel ==
"False"
) {
81
themap.addPixel(
false
);
82
themap.onlyPixel(
false
);
83
ratio
= 8. / 15.;
84
}
85
86
std::ifstream
input
(
filename
);
87
88
unsigned
int
detid;
89
float
val
;
90
91
while
(
input
>> detid >>
val
) {
92
themap.fill_current_val(detid,
val
);
93
}
94
95
std::cout
<<
"preparing a map with size "
<<
size
<<
"x"
<<
int
(
size
*
ratio
) << std::endl;
96
97
themap.save(
true
,
min
,
max
,
outfile
,
size
,
int
(
size
*
ratio
));
// name and size as input parameters
98
}
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
particleFlowDisplacedVertex_cfi.ratio
ratio
Definition:
particleFlowDisplacedVertex_cfi.py:93
corrVsCorr.filename
filename
Definition:
corrVsCorr.py:123
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
cmsBatch.argv
argv
Definition:
cmsBatch.py:279
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
TrackerMap.h
input
static std::string const input
Definition:
EdmProvDump.cc:47
ParameterSet.h
main
int main(int argc, char *argv[])
Definition:
print_TrackerMap.cc:16
createfilelist.int
int
Definition:
createfilelist.py:10
SiStripPI::min
Definition:
SiStripPayloadInspectorHelper.h:178
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:178
timingPdfMaker.outfile
outfile
Definition:
timingPdfMaker.py:350
TrackerMap
Definition:
TrackerMap.h:76
runGCPTkAlMap.title
string title
Definition:
runGCPTkAlMap.py:94
dir2webdir.argc
argc
Definition:
dir2webdir.py:39
printTrackerMap
void printTrackerMap(const std::string filename, const std::string title, const std::string outfile, const int size, const std::string logscale, std::string withpixel, const float min, const float max)
Definition:
print_TrackerMap.cc:52
edm::ParameterSet
Definition:
ParameterSet.h:47
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
heppy_batch.val
val
Definition:
heppy_batch.py:351
Generated for CMSSW Reference Manual by
1.8.14