13 using namespace edm::eventsetup;
20 std::vector<DetId> listNewChan = myNewPeds->getAllChannels();
21 std::vector<DetId> listRefChan = myRefPeds->getAllChannels();
22 std::vector<DetId>::iterator cell;
23 bool failflag =
false;
24 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
26 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
27 if (cell == listNewChan.end()) {
30 const float*
values = (myNewPeds->getValues(mydetid))->getValues();
31 const float* oldvalue = (myRefPeds->getValues(mydetid))->getValues();
32 if ((*values == 0) && (*(values + 1) == 0) && (*(values + 2) == 0) && (*(values + 3) == 0))
34 if ((*oldvalue - *values) + (*(oldvalue + 1) - *(values + 1)) + (*(oldvalue + 2) - *(values + 2)) +
35 (*(oldvalue + 3) - *(values + 3)) / 4 >
38 << (*oldvalue - *
values) <<
" " << (*(oldvalue + 1) - *(values + 1)) <<
" "
39 << (*(oldvalue + 2) - *(values + 2)) <<
" " << (*(oldvalue + 3) - *(values + 3)) << std::endl;
42 listNewChan.erase(cell);
47 std::cout <<
"These are identical to within deltaP" << std::endl;
50 std::ofstream outStream3(
outfile.c_str());
51 std::cout <<
"--- Pedestals changed! ---" << std::endl;
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
constexpr uint32_t rawId() const
get the raw id
edm::ESGetToken< HcalPedestals, HcalPedestalsRcd > m_tok2
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool getData(T &iHolder) const
void analyze(const edm::Event &ev, const edm::EventSetup &es) override
edm::ESGetToken< HcalPedestals, HcalPedestalsRcd > m_tok1
HcalAutoPedestalValidator(edm::ParameterSet const &ps)
~HcalAutoPedestalValidator() override