17 using namespace edm::eventsetup;
33 std::cout <<
"--- Dumping QIEs - update ---" << std::endl;
37 std::ofstream outStream2(
dumprefs.c_str());
38 std::cout <<
"--- Dumping QIEs - reference ---" << std::endl;
43 std::vector<DetId> listNewChan = myNewQIEs->getAllChannels();
47 std::vector<DetId>::iterator cell;
50 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++)
53 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
54 if (cell == listNewChan.end())
56 throw cms::Exception(
"DataDoesNotMatch") <<
"Value not found in reference" << std::endl;
64 bool failflag =
false;
65 if(first->
offset(0,0) != second->
offset(0,0)) failflag =
true;
66 if(first->
offset(0,1) != second->
offset(0,1)) failflag =
true;
67 if(first->
offset(0,2) != second->
offset(0,2)) failflag =
true;
68 if(first->
offset(0,3) != second->
offset(0,3)) failflag =
true;
69 if(first->
offset(1,0) != second->
offset(1,0)) failflag =
true;
70 if(first->
offset(1,1) != second->
offset(1,1)) failflag =
true;
71 if(first->
offset(1,2) != second->
offset(1,2)) failflag =
true;
72 if(first->
offset(1,3) != second->
offset(1,3)) failflag =
true;
73 if(first->
offset(2,0) != second->
offset(2,0)) failflag =
true;
74 if(first->
offset(2,1) != second->
offset(2,1)) failflag =
true;
75 if(first->
offset(2,2) != second->
offset(2,2)) failflag =
true;
76 if(first->
offset(2,3) != second->
offset(2,3)) failflag =
true;
77 if(first->
offset(3,0) != second->
offset(3,0)) failflag =
true;
78 if(first->
offset(3,1) != second->
offset(3,1)) failflag =
true;
79 if(first->
offset(3,2) != second->
offset(3,2)) failflag =
true;
80 if(first->
offset(3,3) != second->
offset(3,3)) failflag =
true;
81 if(first->
slope(0,0) != second->
slope(0,0)) failflag =
true;
82 if(first->
slope(0,1) != second->
slope(0,1)) failflag =
true;
83 if(first->
slope(0,2) != second->
slope(0,2)) failflag =
true;
84 if(first->
slope(0,3) != second->
slope(0,3)) failflag =
true;
85 if(first->
slope(1,0) != second->
slope(1,0)) failflag =
true;
86 if(first->
slope(1,1) != second->
slope(1,1)) failflag =
true;
87 if(first->
slope(1,2) != second->
slope(1,2)) failflag =
true;
88 if(first->
slope(1,3) != second->
slope(1,3)) failflag =
true;
89 if(first->
slope(2,0) != second->
slope(2,0)) failflag =
true;
90 if(first->
slope(2,1) != second->
slope(2,1)) failflag =
true;
91 if(first->
slope(2,2) != second->
slope(2,2)) failflag =
true;
92 if(first->
slope(2,3) != second->
slope(2,3)) failflag =
true;
93 if(first->
slope(3,0) != second->
slope(3,0)) failflag =
true;
94 if(first->
slope(3,1) != second->
slope(3,1)) failflag =
true;
95 if(first->
slope(3,2) != second->
slope(3,2)) failflag =
true;
96 if(first->
slope(3,3) != second->
slope(3,3)) failflag =
true;
97 if(failflag)
throw cms::Exception(
"DataDoesNotMatch") <<
"Values are do not match";
99 listNewChan.erase(cell);
102 std::cout <<
"These are identical" << std::endl;
111 if(
outfile.compare(
"null")!=0){
112 for (std::vector<DetId>::iterator it = listRefChan.begin(); it != listRefChan.end(); it++)
115 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
116 if (cell == listNewChan.end())
118 const HcalQIECoder* myCoder = myRefQIEs->getCoder( mydetid );
120 resultQIEs->addCoder( *myCoder );
124 const HcalQIECoder* myCoder = myNewQIEs->getCoder( mydetid );
126 resultQIEs->addCoder( *myCoder );
127 listNewChan.erase(cell);
130 for (std::vector<DetId>::iterator it = listNewChan.begin(); it != listNewChan.end(); it++)
133 const HcalQIECoder* myCoder = myNewQIEs->getCoder( mydetid );
135 resultQIEs->addCoder( *myCoder );
138 std::ofstream outStream3(
outfile.c_str());
139 std::cout <<
"--- Dumping QIEs - the combined ones ---" << std::endl;
146 std::vector<DetId> listResult = resultQIEs->getAllChannels();
148 std::vector<HcalGenericDetId> listEMap = myRefEMap->allPrecisionId();
149 for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++)
152 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)
void analyze(const edm::Event &ev, const edm::EventSetup &es)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
U second(std::pair< T, U > const &p)
float offset(unsigned fCapId, unsigned fRange) const
std::vector< DetId > getAllChannels() const
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)