16 f =
new TFile(
rootfile.c_str(),
"RECREATE");
19 ocMapUp =
new TH2F(
"ocMapUp",
"occupancy_map_updated_gains",83,-41.5,41.5,72,0.5,72.5);
20 ocMapRef =
new TH2F(
"ocMapRef",
"occupancy_map_updated_gains",83,-41.5,41.5,72,0.5,72.5);
24 diffUpRefCap0 =
new TH1F(
"diffUpRefCap0",
"difference_update_reference_Cap0",100,-0.5,0.5);
25 ratioUpRefCap0 =
new TH1F(
"ratioUpRefCap0",
"ration_update_reference_Cap0",100,0.5,1.5);
26 gainsUpCap0 =
new TH1F(
"gainsUpCap0",
"gains_update_Cap0",100,0.0,0.6);
27 gainsRefCap0 =
new TH1F(
"gainsRefCap0",
"gains_reference_Cap0",100,0.0,0.6);
29 diffUpRefCap1 =
new TH1F(
"diffUpRefCap1",
"difference_update_reference_Cap1",100,-0.5,0.5);
30 ratioUpRefCap1 =
new TH1F(
"ratioUpRefCap1",
"ration_update_reference_Cap1",100,0.5,1.5);
31 gainsUpCap1 =
new TH1F(
"gainsUpCap1",
"gains_update_Cap1",100,0.0,0.6);
32 gainsRefCap1 =
new TH1F(
"gainsRefCap1",
"gains_reference_Cap1",100,0.0,0.6);
34 diffUpRefCap2 =
new TH1F(
"diffUpRefCap2",
"difference_update_reference_Cap2",100,-0.5,0.5);
35 ratioUpRefCap2 =
new TH1F(
"ratioUpRefCap2",
"ration_update_reference_Cap2",100,0.5,1.5);
36 gainsUpCap2 =
new TH1F(
"gainsUpCap2",
"gains_update_Cap2",100,0.0,0.6);
37 gainsRefCap2 =
new TH1F(
"gainsRefCap2",
"gains_reference_Cap2",100,0.0,0.6);
39 diffUpRefCap3 =
new TH1F(
"diffUpRefCap3",
"difference_update_reference_Cap3",100,-0.5,0.5);
40 ratioUpRefCap3 =
new TH1F(
"ratioUpRefCap3",
"ration_update_reference_Cap3",100,0.5,1.5);
41 gainsUpCap3 =
new TH1F(
"gainsUpCap3",
"gains_update_Cap3",100,0.0,0.6);
42 gainsRefCap3 =
new TH1F(
"gainsRefCap3",
"gains_reference_Cap3",100,0.0,0.6);
52 bool epsilonflag =
false;
53 bool notequalsflag =
false;
73 std::cout <<
"--- Dumping Gains - update ---" << std::endl;
77 std::ofstream outStream2(
dumprefs.c_str());
78 std::cout <<
"--- Dumping Gains - reference ---" << std::endl;
85 std::vector<DetId>::const_iterator cell;
88 for (std::vector<DetId>::const_iterator it = listRefChan.begin(); it!=listRefChan.end(); it++)
103 cell =
std::find(listNewChan.begin(), listNewChan.end(), (*it));
104 if (cell != listNewChan.end() )
116 if(fabs(valCap0up - valCap0) >
epsilon) epsilonflag =
true;
117 if(fabs(valCap1up - valCap1) >
epsilon) epsilonflag =
true;
118 if(fabs(valCap2up - valCap2) >
epsilon) epsilonflag =
true;
119 if(fabs(valCap3up - valCap3) >
epsilon) epsilonflag =
true;
121 if(valCap0up != valCap0) notequalsflag =
true;
122 if(valCap1up != valCap1) notequalsflag =
true;
123 if(valCap2up != valCap2) notequalsflag =
true;
124 if(valCap3up != valCap3) notequalsflag =
true;
132 for (std::vector<DetId>::const_iterator it = listNewChan.begin(); it!=listNewChan.end(); it++)
146 if(epsilonflag)
throw cms::Exception(
"DataDoesNotMatch") <<
"Values differ by more than deltaG" << std::endl;
148 std::cout <<
"These gains do not differ by more than deltaG" << std::endl;
152 if(notequalsflag)
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++)
167 cell =
std::find(listNewChan.begin(), listNewChan.end(), mydetid);
168 if (cell == listNewChan.end())
186 std::vector<HcalGenericDetId> listEMap = myRefEMap->
allPrecisionId();
188 for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++)
191 if (
std::find(listResult.begin(), listResult.end(), mydetid ) == listResult.end() )
201 std::ofstream outStream3(
outfile.c_str());
202 std::cout <<
"--- Dumping Gains - the combined ones ---" << std::endl;
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
const Item * getValues(DetId fId, bool throwOnFail=true) const
float getValue(int fCapId) const
get value for capId = 0..3
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void analyze(const edm::Event &ev, const edm::EventSetup &es)
std::vector< DetId > getAllChannels() const
std::vector< HcalGenericDetId > allPrecisionId() const
HcalGainsCheck(edm::ParameterSet const &ps)
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
bool addValues(const Item &myItem)
T const * product() const
const HcalTopology * topo() const