50 }
else if ((std::strcmp(
s_operation.c_str(),
"sadd")==0) ||
54 std::cerr <<
"Scalar operation: using val=" << val << std::endl;
56 throw cms::Exception(
"Unknown",
"modGains") <<
"Unknown operator. " 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++) {
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);
122 std::ofstream outStream (
fileOut.c_str());
T getUntrackedParameter(std::string const &, T const &) const
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
void analyze(edm::Event const &, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
const Item * getValues(DetId fId, bool throwOnFail=true) const
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
const bool exists(DetId fId) const
modGains(const edm::ParameterSet &)
bool getObject(std::istream &fInput, HcalPedestals *fObject)
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
bool addValues(const Item &myItem)