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);
70 hTPvsTow_ieta_=
new TH2F(
"TP_vs_Tow_ieta",
"TP vs Tow ieta ; i#eta(tow); i#eta(tp)",200,-100,100,200,-100,100);
72 hTPvsRechit_=
new TH2F(
"TP_vs_RecHit",
"TP vs rechit Et;E_{T}(rh) (GeV);E_{T}(tp) (GeV)",100,0,50,100,0,50);
73 hTPoverRechit_=
new TH1F(
"TP_over_RecHit",
"Et(TP/rechit); E_{T}(tp)/E_{T}(rh); Counts",500,0,4);
74 hRechitEt_=
new TH1F(
"RecHitEt",
"E_{T};E_{T}(rh) (GeV);Counts",100,0,50);
75 hTPEt_=
new TH1F(
"TPEt",
"E_{T}{tp);E_{T}(rh) (GeV);Count",100,0,50);
76 hRatioEt_ =
new TH1F(
"RatioTPoverRH",
"Et",100,0,50);
77 hAllRechitEt_=
new TH1F(
"AllRecHit",
"Et",100,0,50);
79 hTP_iphiVsieta_=
new TH2F(
"TP_iphiVsieta",
"TP i#phi vs i#eta ; i#eta(tp); i#phi(tp)",10,70,80,10,340,350);
80 hRH_iphiVsieta_=
new TH2F(
"RH_iphiVsieta",
"RH i#phi vs i#eta ; i#eta(rh); i#phi(rh)",10,70,80,10,340,350);
81 hTP_iphiVsieta_fullrange_=
new TH2F(
"TP_iphiVsieta_fullrange",
"TP i#phi vs i#eta ; i#eta(tp); i#phi(tp)",200,-100,100,350,0,350);
82 hRH_iphiVsieta_fullrange_=
new TH2F(
"RH_iphiVsieta_fullrange",
"RH i#phi vs i#eta ; i#eta(rh); i#phi(rh)",200,-100,100,350,0,350);
116 if ( nEvents_==1) this->init(iSetup);
131 for (
unsigned int i=0;
i<tp.product()->size();
i++) {
138 if (!recHits_)
return;
142 iEvent.
getByToken(rechits_labelEB_,rechit_EB_col);
148 theBarrelGeometry = &(*theBarrelGeometry_handle);
150 if (debug_)
std::cout <<
" TP analyzer =================> Treating event "<<iEvent.
id()<<
", Number of EB rechits "<< rechit_EB_col.product()->size() <<
" Number of TPs " << tp.product()->size() << std::endl;
164 for (
unsigned int i=0;
i<tp.product()->size();
i++) {
176 if ( Et==0)
continue;
185 tpIphi_ = TPid.
iphi() ;
186 tpIeta_ = TPid.
ieta() ;
190 hTP_iphiVsieta_->Fill(TPid.
ieta(), TPid.
iphi(), Et);
191 hTP_iphiVsieta_fullrange_->Fill(TPid.
ieta(), TPid.
iphi(), Et);
193 for (
unsigned int j=0;
j<rechit_EB_col.product()->size();
j++) {
194 const EBDetId & myid1=(*rechit_EB_col.product())[
j].
id();
195 float theta = theBarrelGeometry->getGeometry(myid1)->getPosition().theta();
196 float rhEt=((*rechit_EB_col.product())[
j].
energy())*
sin(theta);
197 if ( myid1 == TPid ) {
198 if (debug_)
std::cout <<
" Analyzer same cristal " << myid1 <<
" " << TPid << std::endl;
210 rhIphi_ = myid1.
iphi() ;
211 rhIeta_ = myid1.
ieta() ;
212 hRH_iphiVsieta_->Fill(myid1.
ieta(), myid1.
iphi(), rhEt);
213 hRH_iphiVsieta_fullrange_->Fill(myid1.
ieta(), myid1.
iphi(), rhEt);
215 hTPvsRechit_->Fill(rhEt,Et);
216 hTPoverRechit_->Fill(Et/rhEt);
217 if (debug_)
std::cout <<
" TP compressed et " << d.
compressedEt() <<
" Et in GeV " << Et <<
" RH Et " << rhEt <<
" Et/rhEt " << Et/rhEt << std::endl;
218 hRechitEt_->Fill(rhEt);
220 if ( rhEt < 1000000) eRec_ = rhEt;
230 hRatioEt_->Divide( hTPEt_, hRechitEt_);
232 for (
unsigned int j=0;
j<rechit_EB_col.product()->size();
j++) {
233 const EBDetId & myid1=(*rechit_EB_col.product())[
j].
id();
234 float theta = theBarrelGeometry->getGeometry(myid1)->getPosition().theta();
235 float rhEt=((*rechit_EB_col.product())[
j].
energy())*
sin(theta);
237 hAllRechitEt_ ->Fill(rhEt);
246 for (
unsigned int i=0;
i<ecal_parts_.size();++
i) {
247 ecal_et_[
i]->Write();
248 ecal_tt_[
i]->Write();
249 ecal_fgvb_[
i]->Write();
254 hTPvsTow_ieta_->Write();
255 hTPvsTow_eta_->Write();
256 hTPvsRechit_->Write();
257 hTPoverRechit_->Write();
258 hAllRechitEt_->Write();
262 hTP_iphiVsieta_->Write();
263 hRH_iphiVsieta_->Write();
264 hTP_iphiVsieta_fullrange_->Write();
265 hRH_iphiVsieta_fullrange_->Write();
T getParameter(std::string const &) const
void setEventSetup(const edm::EventSetup &evtSetup)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
int compressedEt() const
get the encoded/compressed Et of interesting sample
int iphi() const
get the crystal iphi
const EBDetId & id() const
int ieta() const
get the crystal ieta
EcalEBTrigPrimAnalyzer(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
void init(const edm::EventSetup &)
~EcalEBTrigPrimAnalyzer()