38 ecal_parts_.push_back(
"Barrel");
40 histfile_ =
new TFile(
"histos.root",
"RECREATE");
41 tree_ =
new TTree(
"TPGtree",
"TPGtree");
42 tree_->Branch(
"tpIphi", &tpIphi_,
"tpIphi/I");
43 tree_->Branch(
"tpIeta", &tpIeta_,
"tpIeta/I");
44 tree_->Branch(
"rhIphi", &rhIphi_,
"rhIphi/I");
45 tree_->Branch(
"rhIeta", &rhIeta_,
"rhIeta/I");
46 tree_->Branch(
"eRec", &eRec_,
"eRec/F");
47 tree_->Branch(
"tpgADC", &tpgADC_,
"tpgADC/I");
48 tree_->Branch(
"tpgGeV", &tpgGeV_,
"tpgGeV/F");
49 tree_->Branch(
"ttf", &ttf_,
"ttf/I");
50 tree_->Branch(
"fg", &fg_,
"fg/I");
51 for (
unsigned int i = 0;
i < ecal_parts_.size(); ++
i) {
53 sprintf(
title,
"%s_Et", ecal_parts_[
i].c_str());
54 ecal_et_[
i] =
new TH1I(
title,
"Et", 255, 0, 255);
55 sprintf(
title,
"%s_ttf", ecal_parts_[
i].c_str());
56 ecal_tt_[
i] =
new TH1I(
title,
"TTF", 10, 0, 10);
57 sprintf(
title,
"%s_fgvb", ecal_parts_[
i].c_str());
58 ecal_fgvb_[
i] =
new TH1I(
title,
"FGVB", 10, 0, 10);
68 hTPvsTow_eta_ =
new TH2F(
"TP_vs_Tow_eta",
"TP vs Tow eta ; #eta(tow); #eta(tp)", 50, -2.5, 2.5, 50, -2.5, 2.5);
69 hAllTPperEvt_ =
new TH1F(
"AllTPperEvt",
"TP per Event; N_{TP}; ", 100, 0., 20000.);
70 hTPperEvt_ =
new TH1F(
"TPperEvt",
"N_{TP} per Event; N_{TP}; ", 100, 0., 500.);
71 hTP_iphiVsieta_ =
new TH2F(
"TP_iphiVsieta",
"TP i#phi vs i#eta ; i#eta(tp); i#phi(tp)", 10, 70, 80, 10, 340, 350);
72 hTP_iphiVsieta_fullrange_ =
73 new TH2F(
"TP_iphiVsieta_fullrange",
"TP i#phi vs i#eta ; i#eta(tp); i#phi(tp)", 200, -100, 100, 350, 0, 350);
77 new TH2F(
"TP_vs_Tow_ieta",
"TP vs Tow ieta ; i#eta(tow); i#eta(tp)", 200, -100, 100, 200, -100, 100);
79 hTPvsRechit_ =
new TH2F(
"TP_vs_RecHit",
"TP vs rechit Et;E_{T}(rh) (GeV);E_{T}(tp) (GeV)", 100, 0, 50, 100, 0, 50);
80 hDeltaEt_ =
new TH1F(
"DeltaEt",
"[Et(rh)-Et(TP)]/Et(rh); [E_{T}(rh)-E_{T}(tp)]/E_{T}(rh); Counts", 200, -1, 1);
81 hTPoverRechit_ =
new TH1F(
"TP_over_RecHit",
"Et(TP/rechit); E_{T}(tp)/E_{T}(rh); Counts", 200, 0, 2);
82 hRechitEt_ =
new TH1F(
"RecHitEt",
"E_{T};E_{T}(rh) (GeV);Counts", 100, 0, 50);
83 hTPEt_ =
new TH1F(
"TPEt",
"E_{T}{tp);E_{T}(rh) (GeV);Count", 100, 0, 50);
84 hRatioEt_ =
new TH1F(
"RatioTPoverRH",
"Et", 100, 0, 50);
85 hAllRechitEt_ =
new TH1F(
"AllRecHit",
"Et", 100, 0, 50);
87 hRH_iphiVsieta_ =
new TH2F(
"RH_iphiVsieta",
"RH i#phi vs i#eta ; i#eta(rh); i#phi(rh)", 10, 70, 80, 10, 340, 350);
88 hRH_iphiVsieta_fullrange_ =
89 new TH2F(
"RH_iphiVsieta_fullrange",
"RH i#phi vs i#eta ; i#eta(rh); i#phi(rh)", 200, -100, 100, 350, 0, 350);
127 for (
unsigned int i = 0;
i <
tp.product()->size();
i++) {
131 ecal_et_[subdet]->Fill(
d.encodedEt());
140 iEvent.getByToken(rechits_labelEB_, rechit_EB_col);
148 std::cout <<
" TP analyzer =================> Treating event " <<
iEvent.id() <<
" Number of TPs "
149 <<
tp.product()->size() << std::endl;
153 hAllTPperEvt_->Fill(
float(
tp.product()->size()));
166 for (
unsigned int i = 0;
i <
tp.product()->size();
i++) {
177 float Et =
d.encodedEt() / 8.;
183 std::cout <<
" TP digi size " <<
d.size() << std::endl;
184 for (
int iBx = 0; iBx <
d.size(); iBx++) {
185 std::cout <<
" TP samples " <<
d.sample(iBx) << std::endl;
194 tpIphi_ = TPid.
iphi();
195 tpIeta_ = TPid.
ieta();
196 tpgADC_ =
d.encodedEt();
199 hTP_iphiVsieta_->Fill(TPid.
ieta(), TPid.
iphi(), Et);
200 hTP_iphiVsieta_fullrange_->Fill(TPid.
ieta(), TPid.
iphi(), Et);
203 for (
unsigned int j = 0;
j < rechit_EB_col.
product()->
size();
j++) {
209 std::cout <<
" Analyzer same cristal " << myid1 <<
" " << TPid << std::endl;
221 rhIphi_ = myid1.
iphi();
222 rhIeta_ = myid1.
ieta();
223 hRH_iphiVsieta_->Fill(myid1.
ieta(), myid1.
iphi(), rhEt);
224 hRH_iphiVsieta_fullrange_->Fill(myid1.
ieta(), myid1.
iphi(), rhEt);
226 hTPvsRechit_->Fill(rhEt, Et);
227 hTPoverRechit_->Fill(Et / rhEt);
228 hDeltaEt_->Fill((rhEt - Et) / rhEt);
230 std::cout <<
" TP compressed et " <<
d.encodedEt() <<
" Et in GeV " << Et <<
" RH Et " << rhEt
231 <<
" Et/rhEt " << Et / rhEt << std::endl;
232 hRechitEt_->Fill(rhEt);
246 hTPperEvt_->Fill(
float(nTP));
249 hRatioEt_->Divide(hTPEt_, hRechitEt_);
250 for (
unsigned int j = 0;
j < rechit_EB_col.
product()->
size();
j++) {
255 hAllRechitEt_->Fill(rhEt);
261 for (
unsigned int i = 0;
i < ecal_parts_.size(); ++
i) {
262 ecal_et_[
i]->Write();
263 ecal_tt_[
i]->Write();
264 ecal_fgvb_[
i]->Write();
267 hAllTPperEvt_->Write();
271 hTPvsTow_ieta_->Write();
272 hTPvsTow_eta_->Write();
273 hTPvsRechit_->Write();
274 hTPoverRechit_->Write();
275 hAllRechitEt_->Write();
280 hTP_iphiVsieta_->Write();
281 hRH_iphiVsieta_->Write();
282 hTP_iphiVsieta_fullrange_->Write();
283 hRH_iphiVsieta_fullrange_->Write();