Main Page
Namespaces
Classes
Package Documentation
CondTools
Ecal
src
EcalTPGSpikeThresholdfromFile.cc
Go to the documentation of this file.
1
#include "
CondTools/Ecal/interface/EcalTPGSpikeThresholdfromFile.h
"
2
3
#include "
FWCore/Framework/interface/ESHandle.h
"
4
5
#include "
FWCore/ParameterSet/interface/ParameterSetfwd.h
"
6
7
#include "
Geometry/EcalMapping/interface/EcalElectronicsMapping.h
"
8
#include "
Geometry/EcalMapping/interface/EcalMappingRcd.h
"
9
10
#include<iostream>
11
#include<fstream>
12
#include <sstream>
13
14
popcon::EcalTPGSpikeThresholdfromFile::EcalTPGSpikeThresholdfromFile
(
const
edm::ParameterSet
& ps)
15
: m_name(ps.getUntrackedParameter<
std
::
string
>(
"name"
,
"EcalTPGSpikeThresholdfromFile"
)) {
16
17
std::cout
<<
"EcalTPGSpikeThresholdfromFile constructor\n"
<< std::endl;
18
}
19
20
popcon::EcalTPGSpikeThresholdfromFile::~EcalTPGSpikeThresholdfromFile
(){
21
// do nothing
22
}
23
24
void
popcon::EcalTPGSpikeThresholdfromFile::getNewObjects
() {
25
std::cout
<<
"------- Ecal -> getNewObjects\n"
;
26
edm::LogInfo
(
"EcalTPGSpikeThresholdfromFile"
) <<
"Started GetNewObjects!!!"
;
27
28
Ref
payload
=
lastPayload
();
29
30
// here popcon tells us which is the last since of the last object in the offline DB
31
32
int
fileIOV;
33
std::cout
<<
"LinPed which input IOV do you want "
<< std::endl;
34
std::cin >> fileIOV;
35
std::ifstream fLin;
36
std::ostringstream oss;
37
oss << fileIOV;
38
std::string
fname
=
"/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv6_trans_"
+ oss.str() +
"_spikekill.txt"
;
39
fLin.open(fname.c_str());
40
if
(!fLin.is_open()) {
41
std::cout
<<
"ERROR : can't open file '"
<< fname << std::endl;
42
return
;
43
}
44
std::cout
<<
" file "
<< fname <<
" opened"
<< std::endl;
45
std::string
line
;
46
for
(
int
i
= 0;
i
< 365223;
i
++) getline (fLin, line);
47
char
tow[8];
48
unsigned
int
towerId
,
Threshold
;
49
EcalTPGSpike
*
lut
=
new
EcalTPGSpike
();
50
for
(
int
istrip = 0; istrip < 2448; istrip++) {
51
getline (fLin, line);
52
sscanf(line.c_str(),
"%s %u"
, tow, &
towerId
);
53
if
(istrip < 10)
std::cout
<<
" string "
<< tow <<
" Id "
<<
towerId
;
54
getline (fLin, line);
// LUTGroupId
55
getline (fLin, line);
// FgGroupId
56
getline (fLin, line);
// spike_killing_threshold
57
if
(istrip < 10)
std::cout
<<
" line "
<<
line
;
58
sscanf(line.c_str(),
"%u"
, &
Threshold
);
59
if
(istrip < 10)
std::cout
<<
" Threshold "
<< Threshold << std::endl;
60
61
lut->
setValue
(towerId, Threshold);
62
}
// end loop over EB towers
63
fLin.close();
64
65
m_to_transfer
.push_back(std::make_pair(lut, fileIOV));
66
67
std::cout
<<
"Ecal -> end of getNewObjects -----------\n"
;
68
}
reco::JetExtendedAssociation::Ref
edm::Ref< Container > Ref
Definition:
JetExtendedAssociation.h:32
mps_fire.i
i
Definition:
mps_fire.py:329
EcalElectronicsMapping.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
popcon::EcalTPGSpikeThresholdfromFile::getNewObjects
void getNewObjects() override
Definition:
EcalTPGSpikeThresholdfromFile.cc:24
popcon::EcalTPGSpikeThresholdfromFile::~EcalTPGSpikeThresholdfromFile
~EcalTPGSpikeThresholdfromFile() override
Definition:
EcalTPGSpikeThresholdfromFile.cc:20
std
Definition:
JetResolutionObject.h:80
EcalTPGSpike::setValue
void setValue(const uint32_t &id, const uint16_t &val)
Definition:
EcalTPGSpike.cc:10
ParameterSetfwd.h
popcon::PopConSourceHandler< EcalTPGSpike >::m_to_transfer
OldContainer m_to_transfer
Definition:
PopConSourceHandler.h:190
EcalMappingRcd.h
popcon::PopConSourceHandler< EcalTPGSpike >::lastPayload
Ref lastPayload() const
Definition:
PopConSourceHandler.h:102
mps_splice.line
line
Definition:
mps_splice.py:75
ESHandle.h
jetExtractorBlock_cff.Threshold
Threshold
Definition:
jetExtractorBlock_cff.py:21
jets_cff.payload
payload
Definition:
jets_cff.py:142
edm::LogInfo
Definition:
MessageLogger.h:238
DataFormats::L1THGCal::towerId
l1t::HGCalTowerID towerId
Definition:
classes.h:36
alignmentValidation.fname
string fname
main script
Definition:
alignmentValidation.py:958
edm::ParameterSet
Definition:
ParameterSet.h:36
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
EcalTPGSpike
Definition:
EcalTPGSpike.h:9
lumiPlot.lut
lut
Definition:
lumiPlot.py:245
EcalTPGSpikeThresholdfromFile.h
popcon::EcalTPGSpikeThresholdfromFile::EcalTPGSpikeThresholdfromFile
EcalTPGSpikeThresholdfromFile(edm::ParameterSet const &)
Definition:
EcalTPGSpikeThresholdfromFile.cc:14
Generated for CMSSW Reference Manual by
1.8.11