40 histfile_ =
new TFile(
"histos.root",
"RECREATE");
41 tree_ =
new TTree(
"TPGtree",
"TPGtree");
54 ecal_et_[
i] =
new TH1I(title,
"Et", 255, 0, 255);
56 ecal_tt_[
i] =
new TH1I(title,
"TTF", 10, 0, 10);
60 eTTmapToken_ = esConsumes<EcalTrigTowerConstituentsMap, IdealGeometryRecord>();
69 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 hAllTPperEvt_ =
new TH1F(
"AllTPperEvt",
"TP per Event; N_{TP}; ", 100, 0., 20000.);
71 hTPperEvt_ =
new TH1F(
"TPperEvt",
"N_{TP} per Event; N_{TP}; ", 100, 0., 500.);
72 hTP_iphiVsieta_ =
new TH2F(
"TP_iphiVsieta",
"TP i#phi vs i#eta ; i#eta(tp); i#phi(tp)", 10, 70, 80, 10, 340, 350);
74 new TH2F(
"TP_iphiVsieta_fullrange",
"TP i#phi vs i#eta ; i#eta(tp); i#phi(tp)", 200, -100, 100, 350, 0, 350);
78 new TH2F(
"TP_vs_Tow_ieta",
"TP vs Tow ieta ; i#eta(tow); i#eta(tp)", 200, -100, 100, 200, -100, 100);
80 hTPvsRechit_ =
new TH2F(
"TP_vs_RecHit",
"TP vs rechit Et;E_{T}(rh) (GeV);E_{T}(tp) (GeV)", 100, 0, 50, 100, 0, 50);
81 hDeltaEt_ =
new TH1F(
"DeltaEt",
"[Et(rh)-Et(TP)]/Et(rh); [E_{T}(rh)-E_{T}(tp)]/E_{T}(rh); Counts", 200, -1, 1);
82 hTPoverRechit_ =
new TH1F(
"TP_over_RecHit",
"Et(TP/rechit); E_{T}(tp)/E_{T}(rh); Counts", 200, 0, 2);
83 hRechitEt_ =
new TH1F(
"RecHitEt",
"E_{T};E_{T}(rh) (GeV);Counts", 100, 0, 50);
84 hTPEt_ =
new TH1F(
"TPEt",
"E_{T}{tp);E_{T}(rh) (GeV);Count", 100, 0, 50);
85 hRatioEt_ =
new TH1F(
"RatioTPoverRH",
"Et", 100, 0, 50);
88 hRH_iphiVsieta_ =
new TH2F(
"RH_iphiVsieta",
"RH i#phi vs i#eta ; i#eta(rh); i#phi(rh)", 10, 70, 80, 10, 340, 350);
90 new TH2F(
"RH_iphiVsieta_fullrange",
"RH i#phi vs i#eta ; i#eta(rh); i#phi(rh)", 200, -100, 100, 350, 0, 350);
128 for (
unsigned int i = 0;
i <
tp.product()->size();
i++) {
148 std::cout <<
" TP analyzer =================> Treating event " << iEvent.
id() <<
" Number of TPs "
149 <<
tp.product()->size() << std::endl;
151 std::cout <<
" Number of EB rechits " << rechit_EB_col.product()->size() << std::endl;
165 for (
unsigned int i = 0;
i <
tp.product()->size();
i++) {
183 for (
int iBx = 0; iBx < d.
size(); iBx++) {
202 for (
unsigned int j = 0;
j < rechit_EB_col.product()->size();
j++) {
203 const EBDetId& myid1 = (*rechit_EB_col.product())[
j].
id();
204 float theta = theBarrelGeometry->getGeometry(myid1)->getPosition().theta();
205 float rhEt = ((*rechit_EB_col.product())[
j].
energy()) *
sin(theta);
208 std::cout <<
" Analyzer same cristal " << myid1 <<
" " << TPid << std::endl;
229 std::cout <<
" TP compressed et " << d.
encodedEt() <<
" Et in GeV " << Et <<
" RH Et " << rhEt
230 <<
" Et/rhEt " << Et / rhEt << std::endl;
249 for (
unsigned int j = 0;
j < rechit_EB_col.product()->size();
j++) {
250 const EBDetId& myid1 = (*rechit_EB_col.product())[
j].
id();
251 float theta = theBarrelGeometry->getGeometry(myid1)->getPosition().theta();
252 float rhEt = ((*rechit_EB_col.product())[
j].
energy()) *
sin(theta);
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
edm::EDGetTokenT< EcalRecHitCollection > rechits_labelEB_
edm::ESGetToken< CaloSubdetectorGeometry, EcalBarrelGeometryRecord > barrelGeomToken_
int iphi() const
get the crystal iphi
const EBDetId & id() const
EcalTPGScale::Tokens tokens_
edm::EDGetTokenT< EBDigiCollection > tokenEBdigi_
TH2F * hTP_iphiVsieta_fullrange_
~EcalEBTrigPrimAnalyzer() override
const EcalEBTriggerPrimitiveSample & sample(int i) const
int encodedEt() const
get the 10 bits Et of interesting sample
int ieta() const
get the crystal ieta
EcalEBTrigPrimAnalyzer(const edm::ParameterSet &)
std::vector< edm::EDGetTokenT< int > > tokens_
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecord > eTTmapToken_
T getParameter(std::string const &) const
std::vector< std::string > ecal_parts_
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
edm::EDGetTokenT< EcalEBTrigPrimDigiCollection > primToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void analyze(const edm::Event &, const edm::EventSetup &) override
void init(const edm::EventSetup &)
TH2F * hRH_iphiVsieta_fullrange_