64 void endJob()
override;
111 usesResource(
"TFileService");
113 hRhToken = consumes<HBHERecHitCollection>(iConfig.
getUntrackedParameter<
string>(
"HBHERecHits",
"hbheprereco"));
114 hRhTokenGPU = consumes<HBHERecHitCollection>(
119 hEnergy_2dM0 = FileService->make<TH2F>(
"hEnergy_2dM0",
"hEnergy_2dM0", 1000, 0., 100., 1000, 0., 100.);
120 hEnergy_2dM0->GetXaxis()->SetTitle(
"Cpu M0 Energy");
121 hEnergy_2dM0->GetYaxis()->SetTitle(
"GPU M0 Energy");
123 hEnergy_2dMahi = FileService->make<TH2F>(
"hEnergy_2dMahi",
"hEnergy_2dMahi", 1000, 0., 100., 1000, 0., 100.);
124 hEnergy_2dMahi->GetXaxis()->SetTitle(
"CPU Energy");
125 hEnergy_2dMahi->GetYaxis()->SetTitle(
"GPU Energy");
127 hTime_2dMahi = FileService->make<TH2F>(
"hTime_2dMahi",
"hTime_2dMahi", 250, -12.5, 12.5, 250, -12.5, 12.5);
128 hTime_2dMahi->GetXaxis()->SetTitle(
"Mahi Time CPU");
129 hTime_2dMahi->GetYaxis()->SetTitle(
"Mahi Time GPU");
133 hEnergyM0_cpu = FileService->make<TH1F>(
"hEnergyM0_cpu",
"hEnergyM0_cpu", 100, 0., 100.);
134 hEnergyM0_cpu->GetXaxis()->SetTitle(
"CPU Energy");
136 hEnergy_cpu = FileService->make<TH1F>(
"hEnergy_cpu",
"hEnergy_cpu", 50, 0., 50.);
137 hEnergy_cpu->GetXaxis()->SetTitle(
"CPU Energy");
139 hEnergy_gpu = FileService->make<TH1F>(
"hEnergy_gpu",
"hEnergy_gpu", 50, 0., 50.);
140 hEnergy_gpu->GetXaxis()->SetTitle(
"GPU Energy");
144 hEnergy_cpugpu = FileService->make<TH1F>(
"hEnergy_cpugpu",
"hEnergy_cpugpu", 500, -2.5, 2.5);
145 hEnergy_cpugpu->GetXaxis()->SetTitle(
"GPU Energy - CPU Energy [GeV]");
146 hEnergy_cpugpu->GetYaxis()->SetTitle(
"# RecHits");
149 FileService->make<TH1F>(
"hEnergy_cpugpu_rel",
"hEnergy_cpugpu_rel ( E > 0.005 GeV)", 500, -2.5, 2.5);
150 hEnergy_cpugpu_rel->GetXaxis()->SetTitle(
"(GPU Energy - CPU Energy) / CPU energy");
151 hEnergy_cpugpu_rel->GetYaxis()->SetTitle(
"# RecHits");
155 hTime_cpu = FileService->make<TH1F>(
"hTime_cpu",
"hTime_cpu", 50, -25., 25.);
156 hTime_cpu->GetXaxis()->SetTitle(
"CPU Time");
158 hTime_gpu = FileService->make<TH1F>(
"hTime_gpu",
"hTime_gpu", 50, -25., 25.);
159 hTime_gpu->GetXaxis()->SetTitle(
"GPU Time");
161 Unmatched = FileService->make<TH2F>(
"Unmatched",
"Unmatched (eta,phi)", 100, -50., 50., 85, 0., 85.);
162 Matched = FileService->make<TH2F>(
"Matched",
"Matched (eta,phi)", 100, -50., 50., 85, 0., 85.);
177 iEvent.getByToken(hRhToken, hRecHits);
180 iEvent.getByToken(hRhTokenGPU, hRecHitsGPU);
183 for (
int i = 0;
i < (
int)hRecHits->
size();
i++) {
188 depth = (*hRecHits)[
i].id().depth();
190 iPhi = detID_rh.
iphi();
193 Method0Energy = (*hRecHits)[
i].eraw();
194 RecHitEnergy = (*hRecHits)[
i].energy();
195 RecHitTime = (*hRecHits)[
i].time();
197 hEnergy_cpu->Fill(RecHitEnergy);
198 hTime_cpu->Fill(RecHitTime);
211 for (
int i = 0;
i < (
int)hRecHitsGPU->
size();
i++) {
216 depthGPU = (*hRecHitsGPU)[
i].id().depth();
217 iEtaGPU = detID_rh.
ieta();
218 iPhiGPU = detID_rh.
iphi();
221 Method0EnergyGPU = (*hRecHitsGPU)[
i].eraw();
222 RecHitEnergyGPU = (*hRecHitsGPU)[
i].energy();
223 RecHitTimeGPU = (*hRecHitsGPU)[
i].time();
225 hEnergy_gpu->Fill(RecHitEnergyGPU);
226 hTime_gpu->Fill(RecHitTimeGPU);
240 for (
int i = 0;
i < (
int)hRecHits->
size();
i++) {
243 bool unmatched =
true;
246 for (
int j = 0;
j < (
int)hRecHitsGPU->
size();
j++) {
249 if ((detID_rh == detID_gpu)) {
258 auto relValue = ((*hRecHitsGPU)[
j].energy() - (*hRecHits)[
i].energy()) / (*hRecHits)[
i].energy();
260 hEnergy_2dM0->Fill((*hRecHits)[
i].eraw(), (*hRecHitsGPU)[
j].eraw());
261 hEnergy_2dMahi->Fill((*hRecHits)[
i].
energy(), (*hRecHitsGPU)[
j].
energy());
262 hEnergy_cpugpu->Fill((*hRecHitsGPU)[
j].
energy() - (*hRecHits)[
i].
energy());
263 if ((*hRecHits)[
i].
energy() > 0.005)
264 hEnergy_cpugpu_rel->Fill(relValue);
265 hTime_2dMahi->Fill((*hRecHits)[
i].
time(), (*hRecHitsGPU)[
j].
time());
285 Unmatched->Fill(detID_rh.
ieta(), detID_rh.
iphi());
void analyze(const edm::Event &, const edm::EventSetup &) override
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
T getUntrackedParameter(std::string const &, T const &) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void addDefault(ParameterSetDescription const &psetDescription)
constexpr int ieta() const
get the cell ieta
edm::EDGetTokenT< HBHERecHitCollection > hRhToken
HCALGPUAnalyzer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< HBHERecHitCollection > hRhTokenGPU
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::Service< TFileService > FileService
constexpr uint32_t rawId() const
get the raw id
TH1F * hEnergy_cpugpu_rel
constexpr int iphi() const
get the cell iphi