48 }
else if ((std::strcmp(
s_operation.c_str(),
"sadd") == 0) || (std::strcmp(
s_operation.c_str(),
"ssub") == 0) ||
51 std::cerr <<
"Scalar operation: using val=" << val << std::endl;
66 std::ifstream inStream(
fileIn.c_str());
75 std::ifstream inCorr(
fileCorr.c_str());
82 std::vector<DetId>
channels = gainsIn.getAllChannels();
83 std::cerr <<
"size = " << channels.size() << std::endl;
84 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,
102 gainsIn.getValues(
id)->getValue(0) +
val,
103 gainsIn.getValues(
id)->getValue(1) +
val,
104 gainsIn.getValues(
id)->getValue(2) +
val,
105 gainsIn.getValues(
id)->getValue(3) +
val);
108 p_item = std::make_unique<HcalGain>(
id,
109 gainsIn.getValues(
id)->getValue(0) -
val,
110 gainsIn.getValues(
id)->getValue(1) -
val,
111 gainsIn.getValues(
id)->getValue(2) -
val,
112 gainsIn.getValues(
id)->getValue(3) -
val);
115 p_item = std::make_unique<HcalGain>(
id,
116 gainsIn.getValues(
id)->getValue(0) *
val,
117 gainsIn.getValues(
id)->getValue(1) *
val,
118 gainsIn.getValues(
id)->getValue(2) *
val,
119 gainsIn.getValues(
id)->getValue(3) *
val);
122 p_item = std::make_unique<HcalGain>(
id,
123 gainsIn.getValues(
id)->getValue(0) /
val,
124 gainsIn.getValues(
id)->getValue(1) /
val,
125 gainsIn.getValues(
id)->getValue(2) /
val,
126 gainsIn.getValues(
id)->getValue(3) /
val);
134 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
const Item * getValues(DetId fId, bool throwOnFail=true) const
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
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)