Definition at line 22 of file modGains.cc.
Implements edm::one::EDAnalyzerBase.
Definition at line 63 of file modGains.cc.
References HcalCondObjectContainer< Item >::addValues(), MessageLogger_cfi::cerr, DEFINE_FWK_MODULE, HcalDbASCIIIO::dumpObject(), HcalCondObjectContainer< Item >::exists(), fileCorr, fileIn, fileOut, edm::EventSetup::get(), HcalDbASCIIIO::getObject(), HcalRespCorr::getValue(), HcalCondObjectContainer< Item >::getValues(), mps_fire::i, s_operation, val, and vectorop.
Referenced by beginRun().
71 std::ifstream inStream (
fileIn.c_str());
78 std::ifstream inCorr (
fileCorr.c_str());
84 std::vector<DetId> channels = gainsIn.getAllChannels ();
85 std::cerr <<
"size = " << channels.size() << std::endl;
86 for (
unsigned i = 0;
i < channels.size();
i++) {
92 if (corrsIn.exists(
id)) {
93 val = corrsIn.getValues(
id)->getValue();
96 std::cerr <<
"Vector operation, " <<
i <<
"th channel: using val=" <<
val << std::endl;
99 std::unique_ptr<HcalGain> p_item;
101 p_item = std::make_unique<HcalGain>(
id, gainsIn.getValues(
id)->getValue(0) +
val, gainsIn.getValues(
id)->getValue(1) +
val,
102 gainsIn.getValues(
id)->getValue(2) +
val, gainsIn.getValues(
id)->getValue(3) +
val);
105 p_item = std::make_unique<HcalGain>(
id, gainsIn.getValues(
id)->getValue(0) -
val, gainsIn.getValues(
id)->getValue(1) -
val,
106 gainsIn.getValues(
id)->getValue(2) -
val, gainsIn.getValues(
id)->getValue(3) -
val);
109 p_item = std::make_unique<HcalGain>(
id, gainsIn.getValues(
id)->getValue(0) *
val, gainsIn.getValues(
id)->getValue(1) *
val,
110 gainsIn.getValues(
id)->getValue(2) *
val, gainsIn.getValues(
id)->getValue(3) *
val);
113 p_item = std::make_unique<HcalGain>(
id, gainsIn.getValues(
id)->getValue(0) /
val, gainsIn.getValues(
id)->getValue(1) /
val,
114 gainsIn.getValues(
id)->getValue(2) /
val, gainsIn.getValues(
id)->getValue(3) /
val);
118 if (p_item) gainsOut.addValues(*p_item);
122 std::ofstream outStream (
fileOut.c_str());
bool getObject(std::istream &fInput, HcalPedestals *fObject)
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)