38 std::ofstream outStream(
dumprefs.c_str());
39 std::cout <<
"--- Dumping Pedestals - reference ---" << std::endl;
44 std::cout <<
"--- Dumping Pedestals - updated ---" << std::endl;
51 std::vector<DetId>::iterator cell;
52 bool failflag =
false;
53 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++)
56 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
57 if (cell == listNewChan.end())
66 const float* oldvalue = (myRefPeds->
getValues( mydetid ))->getValues();
67 if( (*oldvalue != *values) || (*(oldvalue + 1)!=*(values+1)) || (*(oldvalue + 2)!=*(values+2)) || (*(oldvalue + 3)!=*(values+3)) ){
68 throw cms::Exception(
"DataDoesNotMatch") <<
"Value does not match";
74 listNewChan.erase(cell);
77 if(!failflag)
std::cout <<
"These are identical" << std::endl;
83 std::vector<DetId>::iterator cell;
84 bool failflag =
false;
85 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++)
88 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
89 if (cell == listNewChan.end())
96 const float* oldvalue = (myRefPeds->
getValues( mydetid ))->getValues();
97 if( (fabs(*oldvalue-*values)>
epsilon) || (fabs(*(oldvalue+1)-*(values+1))>
epsilon) || (fabs(*(oldvalue+2)-*(values+2))>
epsilon) || (fabs(*(oldvalue+3)-*(values+3))>
epsilon) ){
98 throw cms::Exception(
"DataDoesNotMatch") <<
"Values differ by more than deltaP";
102 listNewChan.erase(cell);
105 if(!failflag)
std::cout <<
"These are identical to within deltaP" << std::endl;
117 std::vector<DetId>::iterator cell;
118 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++)
121 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
122 if (cell == listNewChan.end())
135 listNewChan.erase(cell);
140 for (std::vector<DetId>::iterator it = listNewChan.begin(); it != listNewChan.end(); it++)
153 std::vector<HcalGenericDetId> listEMap = myRefEMap->
allPrecisionId();
156 for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++)
161 if (
std::find(listResult.begin(), listResult.end(), mydetid ) == listResult.end())
169 std::ofstream outStream3(
outfile.c_str());
170 std::cout <<
"--- Dumping Pedestals - the combined ones ---" << std::endl;
HcalPedestalsCheck(edm::ParameterSet const &ps)
T getUntrackedParameter(std::string const &, T const &) const
~HcalPedestalsCheck() override
#define DEFINE_FWK_MODULE(type)
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)
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