34 std::ofstream outStream(
dumprefs.c_str());
35 std::cout <<
"--- Dumping Pedestals - reference ---" << std::endl;
40 std::cout <<
"--- Dumping Pedestals - updated ---" << std::endl;
47 std::vector<DetId>::iterator cell;
48 bool failflag =
false;
49 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
51 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
52 if (cell == listNewChan.end())
60 const float* oldvalue = (myRefPeds->
getValues(mydetid))->getValues();
61 if ((*oldvalue != *values) || (*(oldvalue + 1) != *(values + 1)) || (*(oldvalue + 2) != *(values + 2)) ||
62 (*(oldvalue + 3) != *(values + 3))) {
63 throw cms::Exception(
"DataDoesNotMatch") <<
"Value does not match";
69 listNewChan.erase(cell);
73 std::cout <<
"These are identical" << std::endl;
79 std::vector<DetId>::iterator cell;
80 bool failflag =
false;
81 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
83 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
84 if (cell == listNewChan.end()) {
88 const float* oldvalue = (myRefPeds->
getValues(mydetid))->getValues();
89 if ((fabs(*oldvalue - *values) >
epsilon) || (fabs(*(oldvalue + 1) - *(values + 1)) >
epsilon) ||
90 (fabs(*(oldvalue + 2) - *(values + 2)) >
epsilon) || (fabs(*(oldvalue + 3) - *(values + 3)) >
epsilon)) {
91 throw cms::Exception(
"DataDoesNotMatch") <<
"Values differ by more than deltaP";
95 listNewChan.erase(cell);
99 std::cout <<
"These are identical to within deltaP" << std::endl;
110 std::vector<DetId>::iterator cell;
111 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
113 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
114 if (cell == listNewChan.end())
126 listNewChan.erase(cell);
130 for (std::vector<DetId>::iterator it = listNewChan.begin(); it != listNewChan.end(); it++)
142 std::vector<HcalGenericDetId> listEMap = myRefEMap->
allPrecisionId();
145 for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++) {
149 if (
std::find(listResult.begin(), listResult.end(), mydetid) == listResult.end()) {
156 std::ofstream outStream3(
outfile.c_str());
157 std::cout <<
"--- Dumping Pedestals - the combined ones ---" << std::endl;
HcalPedestalsCheck(edm::ParameterSet const &ps)
T getUntrackedParameter(std::string const &, T const &) const
~HcalPedestalsCheck() override
const Item * getValues(DetId fId, bool throwOnFail=true) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
#define DEFINE_FWK_MODULE(type)
std::vector< DetId > getAllChannels() const
std::vector< HcalGenericDetId > allPrecisionId() const
void analyze(const edm::Event &ev, const edm::EventSetup &es) override
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
bool validatepedestalsflag
bool addValues(const Item &myItem)
T const * product() const
const HcalTopology * topo() const