49 }
else if ((std::strcmp(
s_operation.c_str(),
"sadd")==0) ||
53 std::cerr <<
"Scalar operation: using val=" << val << std::endl;
55 throw cms::Exception(
"Unknown",
"modGains") <<
"Unknown operator. " 70 std::ifstream inStream (
fileIn.c_str());
77 std::ifstream inCorr (
fileCorr.c_str());
83 std::vector<DetId> channels = gainsIn.getAllChannels ();
84 std::cerr <<
"size = " << channels.size() << std::endl;
85 for (
unsigned i = 0;
i < channels.size();
i++) {
95 std::cerr <<
"Vector operation, " <<
i <<
"th channel: using val=" <<
val << std::endl;
100 p_item =
new HcalGain(
id, gainsIn.getValues(
id)->getValue(0) +
val, gainsIn.getValues(
id)->getValue(1) +
val,
101 gainsIn.getValues(
id)->getValue(2) +
val, gainsIn.getValues(
id)->getValue(3) +
val);
104 p_item =
new HcalGain(
id, gainsIn.getValues(
id)->getValue(0) -
val, gainsIn.getValues(
id)->getValue(1) -
val,
105 gainsIn.getValues(
id)->getValue(2) -
val, gainsIn.getValues(
id)->getValue(3) -
val);
108 p_item =
new HcalGain(
id, gainsIn.getValues(
id)->getValue(0) *
val, gainsIn.getValues(
id)->getValue(1) *
val,
109 gainsIn.getValues(
id)->getValue(2) *
val, gainsIn.getValues(
id)->getValue(3) *
val);
112 p_item =
new HcalGain(
id, gainsIn.getValues(
id)->getValue(0) /
val, gainsIn.getValues(
id)->getValue(1) /
val,
113 gainsIn.getValues(
id)->getValue(2) /
val, gainsIn.getValues(
id)->getValue(3) /
val);
121 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)