52 void endJob()
override;
73 ecal_parts_.push_back(
"Barrel");
74 ecal_parts_.push_back(
"Endcap");
76 histFile_ =
new TFile(
"histos.root",
"RECREATE");
77 for (
unsigned int i = 0;
i < 2; ++
i) {
80 sprintf(
t,
"%s_energy", ecal_parts_[
i].c_str());
81 ecal_et_[
i] =
new TH1I(
t,
"Et", 255, 0, 255);
85 sprintf(titleTTF,
"%s_ttf", ecal_parts_[
i].c_str());
86 ecal_tt_[
i] =
new TH1I(titleTTF,
"TTF", 10, 0, 10);
90 sprintf(titleFG,
"%s_fgvb", ecal_parts_[
i].c_str());
91 ecal_fgvb_[
i] =
new TH1I(titleFG,
"FGVB", 10, 0, 10);
96 ecal_tp_token_ = consumes<EcalTrigPrimDigiCollection>(
edm::InputTag(label_, producer_));
115 iEvent.getByToken(ecal_tp_token_,
tp);
116 for (
unsigned int i = 0;
i <
tp.product()->size();
i++) {
118 int subdet =
d.id().subDet() - 1;
122 ecal_et_[subdet]->Fill(
d.compressedEt());
124 if (
d.id().ietaAbs() == 27 ||
d.id().ietaAbs() == 28) {
126 ecal_et_[subdet]->Fill(
d.compressedEt() * 2.);
128 ecal_et_[subdet]->Fill(
d.compressedEt());
130 ecal_tt_[subdet]->Fill(
d.ttFlag());
131 ecal_fgvb_[subdet]->Fill(
d.fineGrain());
142 for (
unsigned int i = 0;
i < 2; ++
i) {
143 ecal_et_[
i]->Write();
144 ecal_tt_[
i]->Write();
145 ecal_fgvb_[
i]->Write();
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecal_tp_token_
TPGCheck(const edm::ParameterSet &)
std::vector< std::string > ecal_parts_