31 std::ofstream outStream(
dumprefs.c_str());
32 std::cout <<
"--- Dumping Pedestals - reference ---" << std::endl;
37 std::cout <<
"--- Dumping Pedestals - updated ---" << std::endl;
44 std::vector<DetId>::iterator cell;
45 bool failflag =
false;
46 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
48 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
49 if (cell == listNewChan.end())
57 const float* oldvalue = (myRefPeds->
getValues(mydetid))->getValues();
58 if ((*oldvalue != *
values) || (*(oldvalue + 1) != *(
values + 1)) || (*(oldvalue + 2) != *(
values + 2)) ||
59 (*(oldvalue + 3) != *(
values + 3))) {
60 throw cms::Exception(
"DataDoesNotMatch") <<
"Value does not match";
66 listNewChan.erase(cell);
70 std::cout <<
"These are identical" << std::endl;
76 std::vector<DetId>::iterator cell;
77 bool failflag =
false;
78 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
80 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
81 if (cell == listNewChan.end()) {
85 const float* oldvalue = (myRefPeds->
getValues(mydetid))->getValues();
88 throw cms::Exception(
"DataDoesNotMatch") <<
"Values differ by more than deltaP";
92 listNewChan.erase(cell);
96 std::cout <<
"These are identical to within deltaP" << std::endl;
107 std::vector<DetId>::iterator cell;
108 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
110 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
111 if (cell == listNewChan.end())
123 listNewChan.erase(cell);
127 for (std::vector<DetId>::iterator it = listNewChan.begin(); it != listNewChan.end(); it++)
139 std::vector<HcalGenericDetId> listEMap = myRefEMap->
allPrecisionId();
142 for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++) {
146 if (
std::find(listResult.begin(), listResult.end(), mydetid) == listResult.end()) {
153 std::ofstream outStream3(
outfile.c_str());
154 std::cout <<
"--- Dumping Pedestals - the combined ones ---" << std::endl;
HcalPedestalsCheck(edm::ParameterSet const &ps)
~HcalPedestalsCheck() override
edm::ESGetToken< HcalPedestals, HcalPedestalsRcd > m_tok2
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const Item * getValues(DetId fId, bool throwOnFail=true) const
T getUntrackedParameter(std::string const &, T const &) const
const HcalTopology * topo() const
std::vector< DetId > getAllChannels() const
#define DEFINE_FWK_MODULE(type)
bool getData(T &iHolder) const
edm::ESGetToken< HcalElectronicsMap, HcalElectronicsMapRcd > m_tokmap
void analyze(const edm::Event &ev, const edm::EventSetup &es) override
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
std::vector< HcalGenericDetId > allPrecisionId() const
edm::ESGetToken< HcalPedestals, HcalPedestalsRcd > m_tok1
bool validatepedestalsflag
bool addValues(const Item &myItem)