17 f =
new TFile(
rootfile.c_str(),
"RECREATE");
20 ocMapUp =
new TH2F(
"ocMapUp",
"occupancy_map_updated_gains", 83, -41.5, 41.5, 72, 0.5, 72.5);
21 ocMapRef =
new TH2F(
"ocMapRef",
"occupancy_map_updated_gains", 83, -41.5, 41.5, 72, 0.5, 72.5);
25 diffUpRefCap0 =
new TH1F(
"diffUpRefCap0",
"difference_update_reference_Cap0", 100, -0.5, 0.5);
26 ratioUpRefCap0 =
new TH1F(
"ratioUpRefCap0",
"ration_update_reference_Cap0", 100, 0.5, 1.5);
27 gainsUpCap0 =
new TH1F(
"gainsUpCap0",
"gains_update_Cap0", 100, 0.0, 0.6);
28 gainsRefCap0 =
new TH1F(
"gainsRefCap0",
"gains_reference_Cap0", 100, 0.0, 0.6);
30 diffUpRefCap1 =
new TH1F(
"diffUpRefCap1",
"difference_update_reference_Cap1", 100, -0.5, 0.5);
31 ratioUpRefCap1 =
new TH1F(
"ratioUpRefCap1",
"ration_update_reference_Cap1", 100, 0.5, 1.5);
32 gainsUpCap1 =
new TH1F(
"gainsUpCap1",
"gains_update_Cap1", 100, 0.0, 0.6);
33 gainsRefCap1 =
new TH1F(
"gainsRefCap1",
"gains_reference_Cap1", 100, 0.0, 0.6);
35 diffUpRefCap2 =
new TH1F(
"diffUpRefCap2",
"difference_update_reference_Cap2", 100, -0.5, 0.5);
36 ratioUpRefCap2 =
new TH1F(
"ratioUpRefCap2",
"ration_update_reference_Cap2", 100, 0.5, 1.5);
37 gainsUpCap2 =
new TH1F(
"gainsUpCap2",
"gains_update_Cap2", 100, 0.0, 0.6);
38 gainsRefCap2 =
new TH1F(
"gainsRefCap2",
"gains_reference_Cap2", 100, 0.0, 0.6);
40 diffUpRefCap3 =
new TH1F(
"diffUpRefCap3",
"difference_update_reference_Cap3", 100, -0.5, 0.5);
41 ratioUpRefCap3 =
new TH1F(
"ratioUpRefCap3",
"ration_update_reference_Cap3", 100, 0.5, 1.5);
42 gainsUpCap3 =
new TH1F(
"gainsUpCap3",
"gains_update_Cap3", 100, 0.0, 0.6);
43 gainsRefCap3 =
new TH1F(
"gainsRefCap3",
"gains_reference_Cap3", 100, 0.0, 0.6);
51 bool epsilonflag =
false;
52 bool notequalsflag =
false;
65 std::cout <<
"--- Dumping Gains - update ---" << std::endl;
69 std::ofstream outStream2(
dumprefs.c_str());
70 std::cout <<
"--- Dumping Gains - reference ---" << std::endl;
77 std::vector<DetId>::const_iterator cell;
80 for (std::vector<DetId>::const_iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
94 cell =
std::find(listNewChan.begin(), listNewChan.end(), (*it));
95 if (cell != listNewChan.end())
107 if (fabs(valCap0up - valCap0) >
epsilon)
109 if (fabs(valCap1up - valCap1) >
epsilon)
111 if (fabs(valCap2up - valCap2) >
epsilon)
113 if (fabs(valCap3up - valCap3) >
epsilon)
116 if (valCap0up != valCap0)
117 notequalsflag =
true;
118 if (valCap1up != valCap1)
119 notequalsflag =
true;
120 if (valCap2up != valCap2)
121 notequalsflag =
true;
122 if (valCap3up != valCap3)
123 notequalsflag =
true;
131 for (std::vector<DetId>::const_iterator it = listNewChan.begin(); it != listNewChan.end(); it++) {
145 throw cms::Exception(
"DataDoesNotMatch") <<
"Values differ by more than deltaG" << std::endl;
147 std::cout <<
"These gains do not differ by more than deltaG" << std::endl;
152 throw cms::Exception(
"DataDoesNotMatch") <<
"Values do not match" << std::endl;
154 std::cout <<
"These gains are identical" << std::endl;
163 for (std::vector<DetId>::const_iterator it = listRefChan.begin(); it != listRefChan.end(); it++) {
166 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
167 if (cell == listNewChan.end())
184 std::vector<HcalGenericDetId> listEMap = myRefEMap->
allPrecisionId();
186 for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++) {
188 if (
std::find(listResult.begin(), listResult.end(), mydetid) == listResult.end()) {
197 std::ofstream outStream3(
outfile.c_str());
198 std::cout <<
"--- Dumping Gains - the combined ones ---" << std::endl;
edm::ESGetToken< HcalElectronicsMap, HcalElectronicsMapRcd > m_tokmap
#define DEFINE_FWK_MODULE(type)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const Item * getValues(DetId fId, bool throwOnFail=true) const
T getUntrackedParameter(std::string const &, T const &) const
const HcalTopology * topo() const
void analyze(const edm::Event &ev, const edm::EventSetup &es) override
std::vector< DetId > getAllChannels() const
bool getData(T &iHolder) const
HcalGainsCheck(edm::ParameterSet const &ps)
float getValue(int fCapId) const
get value for capId = 0..3
edm::ESGetToken< HcalGains, HcalGainsRcd > m_tok1
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
std::vector< HcalGenericDetId > allPrecisionId() const
bool addValues(const Item &myItem)
edm::ESGetToken< HcalGains, HcalGainsRcd > m_tok2