src
CalibCalorimetry
HcalTPGAlgos
src
HcalEmap.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: CalibCalorimetry/HcalTPGAlgos
4
// Class : HcalEmap
5
//
6
// Implementation:
7
// structure and functionality for HCAL electronic map
8
// NOTE!
9
// Keep xdaq and Oracle dependencies out of here!
10
//
11
// Original Author: Gena Kukartsev, kukarzev@fnal.gov
12
// Created: Tue Oct 14 14:30:20 CDT 2009
13
//
14
15
#include <cstdio>
16
#include <iostream>
17
#include <fstream>
18
#include <sstream>
19
#include <vector>
20
#include "
CalibCalorimetry/HcalTPGAlgos/interface/HcalEmap.h
"
21
#include "
DataFormats/HcalDetId/interface/HcalDetId.h
"
22
23
using namespace
std
;
24
25
int
HcalEmap::read_map
(
std::string
filename
) {
26
int
lines
= 0;
27
28
std::string
_row;
29
ifstream inFile(
filename
.c_str(),
std::ios::in
);
30
if
(!inFile) {
31
std::cout
<<
"Unable to open file with the electronic map: "
<<
filename
<< std::endl;
32
}
else
{
33
std::cout
<<
"File with the electronic map opened successfully: "
<<
filename
<< std::endl;
34
}
35
while
(getline(inFile, _row)) {
36
HcalEmapRow
aRow;
37
char
fpga[32];
38
char
subdet[32];
39
40
int
_read;
41
const
char
* _format =
"%d %d %d %s %d %d %d %d %s %d %d %d"
;
42
_read = sscanf(_row.c_str(),
43
_format,
44
&(aRow.
rawId
),
45
&(aRow.
crate
),
46
&(aRow.
slot
),
47
fpga,
48
&(aRow.
dcc
),
49
&(aRow.
spigot
),
50
&(aRow.
fiber
),
51
&(aRow.
fiberchan
),
52
subdet,
53
&(aRow.
ieta
),
54
&(aRow.
iphi
),
55
&(aRow.
idepth
));
56
if
(_read >= 12) {
57
lines
++;
58
59
aRow.
subdet
.append(subdet);
60
aRow.
topbottom
.append(fpga);
61
62
map
.push_back(aRow);
63
}
64
}
65
inFile.close();
66
std::cout
<<
"HcalEmap: "
<<
lines
<<
" lines read"
<< std::endl;
67
68
return
0;
69
}
70
71
std::vector<HcalEmap::HcalEmapRow>&
HcalEmap::get_map
(
void
) {
return
map
; }
72
73
bool
HcalEmap::HcalEmapRow::operator<
(
const
HcalEmap::HcalEmapRow
&
other
)
const
{
return
rawId <
other
.rawId; }
74
75
//
76
// _____ test procedures for the HcalEmap class _____________________________
77
//
78
int
HcalEmap_test::test_read_map
(
std::string
filename
) {
79
HcalEmap
map
(
filename
);
80
return
0;
81
}
HcalEmap::HcalEmapRow::iphi
int iphi
Definition:
HcalEmap.h:40
corrVsCorr.filename
filename
Definition:
corrVsCorr.py:123
HcalEmap::HcalEmapRow::idepth
int idepth
Definition:
HcalEmap.h:40
HcalEmap::HcalEmapRow::spigot
int spigot
Definition:
HcalEmap.h:40
HcalEmap.h
HcalEmap
Definition:
HcalEmap.h:32
std
Definition:
JetResolutionObject.h:76
HcalEmap_test::test_read_map
int test_read_map(std::string filename)
Definition:
HcalEmap.cc:78
HcalEmap::HcalEmapRow::fiber
int fiber
Definition:
HcalEmap.h:40
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
HcalEmap::HcalEmapRow
Definition:
HcalEmap.h:38
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HcalEmap::HcalEmapRow::slot
int slot
Definition:
HcalEmap.h:40
groupFilesInBlocks.lines
lines
Definition:
groupFilesInBlocks.py:95
HcalEmap::HcalEmapRow::subdet
std::string subdet
Definition:
HcalEmap.h:41
HcalEmap::HcalEmapRow::ieta
int ieta
Definition:
HcalEmap.h:40
HcalDetId.h
trackingPlots.other
other
Definition:
trackingPlots.py:1464
HcalEmap::HcalEmapRow::topbottom
std::string topbottom
Definition:
HcalEmap.h:41
genParticles_cff.map
map
Definition:
genParticles_cff.py:11
HcalEmap::HcalEmapRow::crate
int crate
Definition:
HcalEmap.h:40
HcalEmap::HcalEmapRow::fiberchan
int fiberchan
Definition:
HcalEmap.h:40
HcalEmap::HcalEmapRow::dcc
int dcc
Definition:
HcalEmap.h:40
HcalEmap::get_map
std::vector< HcalEmap::HcalEmapRow > & get_map(void)
Definition:
HcalEmap.cc:71
HcalEmap::HcalEmapRow::operator<
bool operator<(const HcalEmapRow &other) const
Definition:
HcalEmap.cc:73
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
HcalEmap::read_map
int read_map(std::string filename)
Definition:
HcalEmap.cc:25
HcalEmap::HcalEmapRow::rawId
int rawId
Definition:
HcalEmap.h:40
Generated for CMSSW Reference Manual by
1.8.14