53 histfile_ =
new TFile(
"histos.root",
"RECREATE");
54 tree_ =
new TTree(
"TPGtree",
"TPGtree");
62 for (
unsigned int i = 0;
i < 2; ++
i) {
74 hTPvsRechit_ =
new TH2F(
"TP_vs_RecHit",
"TP vs rechit", 256, -1, 255, 255, 0, 255);
75 hTPoverRechit_ =
new TH1F(
"TP_over_RecHit",
"TP over rechit", 500, 0, 4);
78 geomToken_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
81 eTTmapToken_ = esConsumes<EcalTrigTowerConstituentsMap, IdealGeometryRecord>();
105 for (
unsigned int i = 0;
i <
tp.product()->size();
i++) {
107 int subdet =
d.id().subDet() - 1;
109 ecal_et_[subdet]->Fill(
d.compressedEt());
111 if (
d.id().ietaAbs() == 27 ||
d.id().ietaAbs() == 28) {
113 ecal_et_[subdet]->Fill(
d.compressedEt() * 2.);
115 ecal_et_[subdet]->Fill(
d.compressedEt());
138 map<EcalTrigTowerDetId, float> mapTow_Et;
140 for (
unsigned int i = 0;
i < rechit_EB_col.
product()->
size();
i++) {
145 bool test_alreadyin =
false;
146 map<EcalTrigTowerDetId, float>::iterator ittest = mapTow_Et.find(towid1);
147 if (ittest != mapTow_Et.end())
148 test_alreadyin =
true;
151 unsigned int j =
i + 1;
152 bool loopend =
false;
153 unsigned int count = 0;
154 while (
j < rechit_EB_col.
product()->
size() && !loopend) {
158 if (towid1 == towid2) {
166 mapTow_Et.insert(pair<EcalTrigTowerDetId, float>(towid1, Etsum));
169 for (
unsigned int i = 0;
i < rechit_EE_col.
product()->
size();
i++) {
174 bool test_alreadyin =
false;
175 map<EcalTrigTowerDetId, float>::iterator ittest = mapTow_Et.find(towid1);
176 if (ittest != mapTow_Et.end())
177 test_alreadyin =
true;
180 unsigned int j =
i + 1;
181 bool loopend =
false;
182 unsigned int count = 0;
183 while (
j < rechit_EE_col.
product()->
size() && !loopend) {
186 if (towid1 == towid2) {
196 mapTow_Et.insert(pair<EcalTrigTowerDetId, float>(towid1, Etsum));
200 for (
unsigned int i = 0;
i <
tp.product()->size();
i++) {
203 map<EcalTrigTowerDetId, float>::iterator it = mapTow_Et.find(TPtowid);
204 float Et = ecalScale.
getTPGInGeV(
d.compressedEt(), TPtowid);
205 if (
d.id().ietaAbs() == 27 ||
d.id().ietaAbs() == 28)
213 if (it != mapTow_Et.end()) {
223 for (
unsigned int i = 0;
i < 2; ++
i) {