18 using namespace edm::eventsetup;
26 std::cout <<
"--- Dumping QIEs - update ---" << std::endl;
30 std::ofstream outStream2(
dumprefs.c_str());
31 std::cout <<
"--- Dumping QIEs - reference ---" << std::endl;
36 std::vector<DetId> listNewChan = myNewQIEs->getAllChannels();
40 std::vector<DetId>::iterator cell;
43 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
45 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
46 if (cell == listNewChan.end())
48 throw cms::Exception(
"DataDoesNotMatch") <<
"Value not found in reference" << std::endl;
54 bool failflag =
false;
101 if (first->
slope(1, 3) != second->
slope(1, 3))
103 if (first->
slope(2, 0) != second->
slope(2, 0))
105 if (first->
slope(2, 1) != second->
slope(2, 1))
107 if (first->
slope(2, 2) != second->
slope(2, 2))
109 if (first->
slope(2, 3) != second->
slope(2, 3))
111 if (first->
slope(3, 0) != second->
slope(3, 0))
113 if (first->
slope(3, 1) != second->
slope(3, 1))
115 if (first->
slope(3, 2) != second->
slope(3, 2))
117 if (first->
slope(3, 3) != second->
slope(3, 3))
120 throw cms::Exception(
"DataDoesNotMatch") <<
"Values are do not match";
122 listNewChan.erase(cell);
125 std::cout <<
"These are identical" << std::endl;
133 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
135 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
136 if (cell == listNewChan.end())
138 const HcalQIECoder* myCoder = myRefQIEs->getCoder(mydetid);
140 resultQIEs->addCoder(*myCoder);
143 const HcalQIECoder* myCoder = myNewQIEs->getCoder(mydetid);
145 resultQIEs->addCoder(*myCoder);
146 listNewChan.erase(cell);
149 for (std::vector<DetId>::iterator it = listNewChan.begin(); it != listNewChan.end(); it++)
152 const HcalQIECoder* myCoder = myNewQIEs->getCoder(mydetid);
154 resultQIEs->addCoder(*myCoder);
157 std::ofstream outStream3(
outfile.c_str());
158 std::cout <<
"--- Dumping QIEs - the combined ones ---" << std::endl;
165 std::vector<DetId> listResult = resultQIEs->getAllChannels();
167 std::vector<HcalGenericDetId> listEMap = myRefEMap->allPrecisionId();
168 for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++) {
170 if (
std::find(listResult.begin(), listResult.end(), mydetid) == listResult.end()) {
HcalQIEDataCheck(edm::ParameterSet const &ps)
T getUntrackedParameter(std::string const &, T const &) const
float slope(unsigned fCapId, unsigned fRange) const
#define DEFINE_FWK_MODULE(type)
edm::ESGetToken< HcalQIEData, HcalQIEDataRcd > m_tok1
edm::ESGetToken< HcalElectronicsMap, HcalElectronicsMapRcd > m_tokmap
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool getData(T &iHolder) const
U second(std::pair< T, U > const &p)
float offset(unsigned fCapId, unsigned fRange) const
std::vector< DetId > getAllChannels() const
~HcalQIEDataCheck() override
void analyze(const edm::Event &ev, const edm::EventSetup &es) override
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
edm::ESGetToken< HcalQIEData, HcalQIEDataRcd > m_tok2