CondFormats
CSCObjects
src
CSCReadoutMappingFromFile.cc
Go to the documentation of this file.
1
#include <
CondFormats/CSCObjects/interface/CSCReadoutMappingFromFile.h
>
2
#include <
FWCore/MessageLogger/interface/MessageLogger.h
>
3
#include <
FWCore/ParameterSet/interface/FileInPath.h
>
4
#include <iostream>
5
#include <fstream>
6
#include <sstream>
7
8
CSCReadoutMappingFromFile::CSCReadoutMappingFromFile
(
const
edm::ParameterSet
& ps) {
fill
(ps); }
9
10
CSCReadoutMappingFromFile::~CSCReadoutMappingFromFile
() {}
11
12
void
CSCReadoutMappingFromFile::fill
(
const
edm::ParameterSet
& ps) {
13
edm::FileInPath
fp
= ps.
getParameter
<
edm::FileInPath
>(
"theMappingFile"
);
14
theMappingFile
=
fp
.fullPath();
15
std::ifstream
in
(
theMappingFile
.c_str());
16
std::string
line
;
17
const
std::string
commentFlag =
"#"
;
18
if
(!
in
) {
19
edm::LogError
(
"CSC"
) <<
" Failed to open file "
<<
theMappingFile
<<
" containing mapping."
;
20
}
else
{
21
edm::LogInfo
(
"CSC"
) <<
" Opened file "
<<
theMappingFile
<<
" containing mapping."
;
22
23
while
(getline(
in
,
line
)) {
// getline() from <string>
24
// LogDebug("CSC") << line;
25
if
(
line
[0] != commentFlag[0]) {
26
int
i1
,
i2
,
i3
, i4, i5, i6, i7, i8, i9, i10, i11;
27
std::istringstream is(
line
);
28
is >>
i1
>>
i2
>>
i3
>> i4 >> i5 >> i6 >> i7 >> i8 >> i9 >> i10 >> i11;
29
// LogDebug("CSC") << i1 << " " << i2 << " " << i3 << " " << i4 << " " <<
30
// i5 << " " << i6 << " " << i7 << " " << i8 << " " << i9;
31
addRecord
(
i1
,
i2
,
i3
, i4, i5, i6, i7, i8, i9, i10, i11);
32
}
33
}
34
}
35
36
return
;
37
}
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition:
testProducerWithPsetDescEmpty_cfi.py:46
testProducerWithPsetDescEmpty_cfi.i3
i3
Definition:
testProducerWithPsetDescEmpty_cfi.py:47
MessageLogger.h
CSCReadoutMappingFromFile::~CSCReadoutMappingFromFile
~CSCReadoutMappingFromFile() override
Destructor.
Definition:
CSCReadoutMappingFromFile.cc:10
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition:
testProducerWithPsetDescEmpty_cfi.py:45
personalPlayback.fp
fp
Definition:
personalPlayback.py:523
edm::LogInfo
Log< level::Info, false > LogInfo
Definition:
MessageLogger.h:125
FileInPath.h
edm::FileInPath
Definition:
FileInPath.h:64
CSCReadoutMappingFromFile::theMappingFile
std::string theMappingFile
Definition:
CSCReadoutMappingFromFile.h:28
CSCReadoutMappingFromFile.h
CSCReadoutMappingFromFile::CSCReadoutMappingFromFile
CSCReadoutMappingFromFile()
Definition:
CSCReadoutMappingFromFile.h:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
CSCReadoutMapping::addRecord
void addRecord(int endcap, int station, int ring, int chamber, int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc)
Definition:
CSCReadoutMapping.cc:47
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
CSCReadoutMappingFromFile::fill
void fill(const edm::ParameterSet &ps) override
Fill mapping store.
Definition:
CSCReadoutMappingFromFile.cc:12
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
mps_splice.line
line
Definition:
mps_splice.py:76
Generated for CMSSW Reference Manual by
1.8.16