28 std::vector<DetId>::iterator cell;
29 bool failflag =
false;
30 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++)
33 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
34 if (cell == listNewChan.end()) {
continue;}
38 const float* oldvalue = (myRefPeds->
getValues( mydetid ))->getValues();
39 if( (*values==0) &&(*(values+1)==0) && (*(values+2)==0) && (*(values+3)==0) )
continue;
40 if( (*oldvalue-*values) + (*(oldvalue+1)-*(values+1)) + (*(oldvalue+2)-*(values+2)) + (*(oldvalue+3)-*(values+3))/4 >
epsilon)
42 std::cout <<
"Channel " << std::hex << mydetid.
rawId() <<
" Values differ by " <<
std::dec << (*oldvalue-*
values) <<
" " << (*(oldvalue+1)-*(values+1)) <<
" " << (*(oldvalue+2)-*(values+2)) <<
" " << (*(oldvalue+3)-*(values+3)) << std::endl;
45 listNewChan.erase(cell);
49 if(!failflag)
std::cout <<
"These are identical to within deltaP" << std::endl;
53 std::ofstream outStream3(
outfile.c_str());
54 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
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
void analyze(const edm::Event &ev, const edm::EventSetup &es) override
HcalAutoPedestalValidator(edm::ParameterSet const &ps)
~HcalAutoPedestalValidator() override
T const * product() const