17 getAllProvenances(
false),
18 printProvenanceInfo(
false),
22 std::string MsgLoggerCat =
"GlobalHitsProdHist_GlobalHitsProdHist";
65 <<
"\n===============================\n" 66 <<
"Initialized as EDProducer with parameter values:\n" 67 <<
" Name = " <<
fName <<
"\n" 68 <<
" Verbosity = " << verbosity <<
"\n" 69 <<
" Frequency = " << frequency <<
"\n" 70 <<
" VtxUnit = " << vtxunit <<
"\n" 71 <<
" GetProv = " << getAllProvenances <<
"\n" 72 <<
" PrintProv = " << printProvenanceInfo <<
"\n" 73 <<
" PxlBrlLowSrc = " << PxlBrlLowSrc_.label() <<
":" << PxlBrlLowSrc_.instance() <<
"\n" 74 <<
" PxlBrlHighSrc = " << PxlBrlHighSrc_.
label() <<
":" << PxlBrlHighSrc_.
instance() <<
"\n" 75 <<
" PxlFwdLowSrc = " << PxlFwdLowSrc_.
label() <<
":" << PxlBrlLowSrc_.instance() <<
"\n" 76 <<
" PxlFwdHighSrc = " << PxlFwdHighSrc_.
label() <<
":" << PxlBrlHighSrc_.
instance() <<
"\n" 77 <<
" SiTIBLowSrc = " << SiTIBLowSrc_.
label() <<
":" << SiTIBLowSrc_.
instance() <<
"\n" 78 <<
" SiTIBHighSrc = " << SiTIBHighSrc_.
label() <<
":" << SiTIBHighSrc_.
instance() <<
"\n" 79 <<
" SiTOBLowSrc = " << SiTOBLowSrc_.
label() <<
":" << SiTOBLowSrc_.
instance() <<
"\n" 80 <<
" SiTOBHighSrc = " << SiTOBHighSrc_.
label() <<
":" << SiTOBHighSrc_.
instance() <<
"\n" 81 <<
" SiTIDLowSrc = " << SiTIDLowSrc_.
label() <<
":" << SiTIDLowSrc_.
instance() <<
"\n" 82 <<
" SiTIDHighSrc = " << SiTIDHighSrc_.
label() <<
":" << SiTIDHighSrc_.
instance() <<
"\n" 83 <<
" SiTECLowSrc = " << SiTECLowSrc_.
label() <<
":" << SiTECLowSrc_.
instance() <<
"\n" 84 <<
" SiTECHighSrc = " << SiTECHighSrc_.
label() <<
":" << SiTECHighSrc_.
instance() <<
"\n" 85 <<
" MuonCscSrc = " << MuonCscSrc_.
label() <<
":" << MuonCscSrc_.
instance() <<
"\n" 86 <<
" MuonDtSrc = " << MuonDtSrc_.
label() <<
":" << MuonDtSrc_.
instance() <<
"\n" 87 <<
" MuonRpcSrc = " << MuonRpcSrc_.
label() <<
":" << MuonRpcSrc_.
instance() <<
"\n" 88 <<
" ECalEBSrc = " << ECalEBSrc_.
label() <<
":" << ECalEBSrc_.
instance() <<
"\n" 89 <<
" ECalEESrc = " << ECalEESrc_.
label() <<
":" << ECalEESrc_.
instance() <<
"\n" 90 <<
" ECalESSrc = " << ECalESSrc_.
label() <<
":" << ECalESSrc_.
instance() <<
"\n" 91 <<
" HCalSrc = " << HCalSrc_.
label() <<
":" << HCalSrc_.
instance() <<
"\n" 92 <<
"===============================\n";
100 sprintf(hname,
"hMCRGP1");
102 sprintf(htitle,
"RawGenParticles");
103 hMCRGP[0] =
new TH1F(hname, htitle, 100, 0., 5000.);
104 sprintf(hname,
"hMCRGP2");
106 hMCRGP[1] =
new TH1F(hname, htitle, 100, 0., 500.);
107 for (Int_t
i = 0;
i < 2; ++
i) {
108 hMCRGP[
i]->GetXaxis()->SetTitle(
"Number of Raw Generated Particles");
109 hMCRGP[
i]->GetYaxis()->SetTitle(
"Count");
113 sprintf(hname,
"hMCG4Vtx1");
115 sprintf(htitle,
"G4 Vertices");
116 hMCG4Vtx[0] =
new TH1F(hname, htitle, 100, 0., 50000.);
117 sprintf(hname,
"hMCG4Vtx2");
119 hMCG4Vtx[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
120 for (Int_t
i = 0;
i < 2; ++
i) {
121 hMCG4Vtx[
i]->GetXaxis()->SetTitle(
"Number of Vertices");
122 hMCG4Vtx[
i]->GetYaxis()->SetTitle(
"Count");
126 sprintf(hname,
"hMCG4Trk1");
128 sprintf(htitle,
"G4 Tracks");
129 hMCG4Trk[0] =
new TH1F(hname, htitle, 150, 0., 15000.);
130 sprintf(hname,
"hMCG4Trk2");
132 hMCG4Trk[1] =
new TH1F(hname, htitle, 150, -0.5, 99.5);
133 for (Int_t
i = 0;
i < 2; ++
i) {
134 hMCG4Trk[
i]->GetXaxis()->SetTitle(
"Number of Tracks");
135 hMCG4Trk[
i]->GetYaxis()->SetTitle(
"Count");
139 sprintf(hname,
"hGeantVtxX1");
141 sprintf(htitle,
"Geant vertex x/micrometer");
142 hGeantVtxX[0] =
new TH1F(hname, htitle, 100, -8000000., 8000000.);
143 sprintf(hname,
"hGeantVtxX2");
145 hGeantVtxX[1] =
new TH1F(hname, htitle, 100, -50., 50.);
146 for (Int_t
i = 0;
i < 2; ++
i) {
147 hGeantVtxX[
i]->GetXaxis()->SetTitle(
"x of Vertex (um)");
152 sprintf(hname,
"hGeantVtxY1");
154 sprintf(htitle,
"Geant vertex y/micrometer");
155 hGeantVtxY[0] =
new TH1F(hname, htitle, 100, -8000000, 8000000.);
156 sprintf(hname,
"hGeantVtxY2");
158 hGeantVtxY[1] =
new TH1F(hname, htitle, 100, -50., 50.);
159 for (Int_t
i = 0;
i < 2; ++
i) {
160 hGeantVtxY[
i]->GetXaxis()->SetTitle(
"y of Vertex (um)");
165 sprintf(hname,
"hGeantVtxZ1");
167 sprintf(htitle,
"Geant vertex z/millimeter");
168 hGeantVtxZ[0] =
new TH1F(hname, htitle, 100, -11000., 11000.);
169 sprintf(hname,
"hGeantVtxZ2");
171 hGeantVtxZ[1] =
new TH1F(hname, htitle, 100, -250., 250.);
172 for (Int_t
i = 0;
i < 2; ++
i) {
173 hGeantVtxZ[
i]->GetXaxis()->SetTitle(
"z of Vertex (mm)");
178 sprintf(hname,
"hGeantTrkPt");
180 sprintf(htitle,
"Geant track pt/GeV");
181 hGeantTrkPt =
new TH1F(hname, htitle, 100, 0., 200.);
182 hGeantTrkPt->GetXaxis()->SetTitle(
"pT of Track (GeV)");
186 sprintf(hname,
"hGeantTrkE");
188 sprintf(htitle,
"Geant track E/GeV");
189 hGeantTrkE =
new TH1F(hname, htitle, 100, 0., 5000.);
190 hGeantTrkE->GetXaxis()->SetTitle(
"E of Track (GeV)");
195 sprintf(hname,
"hCaloEcal1");
197 sprintf(htitle,
"Ecal hits");
198 hCaloEcal[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
199 sprintf(hname,
"hCaloEcal2");
201 hCaloEcal[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
203 sprintf(hname,
"hCaloEcalE1");
205 sprintf(htitle,
"Ecal hits, energy/GeV");
206 hCaloEcalE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
207 sprintf(hname,
"hCaloEcalE2");
209 hCaloEcalE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
211 sprintf(hname,
"hCaloEcalToF1");
213 sprintf(htitle,
"Ecal hits, ToF/ns");
214 hCaloEcalToF[0] =
new TH1F(hname, htitle, 100, 0., 1000.);
215 sprintf(hname,
"hCaloEcalToF2");
217 hCaloEcalToF[1] =
new TH1F(hname, htitle, 100, 0., 100.);
219 for (Int_t
i = 0;
i < 2; ++
i) {
220 hCaloEcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
223 hCaloEcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
226 hCaloEcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
231 sprintf(hname,
"hCaloEcalPhi");
233 sprintf(htitle,
"Ecal hits, phi/rad");
235 hCaloEcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
239 sprintf(hname,
"hCaloEcalEta");
241 sprintf(htitle,
"Ecal hits, eta");
247 sprintf(hname,
"hCaloPreSh1");
249 sprintf(htitle,
"PreSh hits");
250 hCaloPreSh[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
251 sprintf(hname,
"hCaloPreSh2");
253 hCaloPreSh[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
255 sprintf(hname,
"hCaloPreShE1");
257 sprintf(htitle,
"PreSh hits, energy/GeV");
258 hCaloPreShE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
259 sprintf(hname,
"hCaloPreShE2");
261 hCaloPreShE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
263 sprintf(hname,
"hCaloPreShToF1");
265 sprintf(htitle,
"PreSh hits, ToF/ns");
267 sprintf(hname,
"hCaloPreShToF2");
271 for (Int_t
i = 0;
i < 2; ++
i) {
272 hCaloPreSh[
i]->GetXaxis()->SetTitle(
"Number of Hits");
275 hCaloPreShE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
278 hCaloPreShToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
283 sprintf(hname,
"hCaloPreShPhi");
285 sprintf(htitle,
"PreSh hits, phi/rad");
291 sprintf(hname,
"hCaloPreShEta");
293 sprintf(htitle,
"PreSh hits, eta");
300 sprintf(hname,
"hCaloHcal1");
302 sprintf(htitle,
"Hcal hits");
303 hCaloHcal[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
304 sprintf(hname,
"hCaloHcal2");
306 hCaloHcal[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
308 sprintf(hname,
"hCaloHcalE1");
310 sprintf(htitle,
"Hcal hits, energy/GeV");
311 hCaloHcalE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
312 sprintf(hname,
"hCaloHcalE2");
314 hCaloHcalE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
316 sprintf(hname,
"hCaloHcalToF1");
318 sprintf(htitle,
"Hcal hits, ToF/ns");
319 hCaloHcalToF[0] =
new TH1F(hname, htitle, 100, 0., 1000.);
320 sprintf(hname,
"hCaloHcalToF2");
322 hCaloHcalToF[1] =
new TH1F(hname, htitle, 100, 0., 100.);
324 for (Int_t
i = 0;
i < 2; ++
i) {
325 hCaloHcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
328 hCaloHcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
331 hCaloHcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
336 sprintf(hname,
"hCaloHcalPhi");
338 sprintf(htitle,
"Hcal hits, phi/rad");
340 hCaloHcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
344 sprintf(hname,
"hCaloHcalEta");
346 sprintf(htitle,
"Hcal hits, eta");
353 sprintf(hname,
"hTrackerPx1");
355 sprintf(htitle,
"Pixel hits");
356 hTrackerPx[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
357 sprintf(hname,
"hTrackerPx2");
359 hTrackerPx[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
360 for (Int_t
i = 0;
i < 2; ++
i) {
361 hTrackerPx[
i]->GetXaxis()->SetTitle(
"Number of Pixel Hits");
366 sprintf(hname,
"hTrackerPxPhi");
368 sprintf(htitle,
"Pixel hits phi/rad");
374 sprintf(hname,
"hTrackerPxEta");
376 sprintf(htitle,
"Pixel hits eta");
382 sprintf(hname,
"hTrackerPxBToF");
384 sprintf(htitle,
"Pixel barrel hits, ToF/ns");
386 hTrackerPxBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
390 sprintf(hname,
"hTrackerPxBR");
392 sprintf(htitle,
"Pixel barrel hits, R/cm");
398 sprintf(hname,
"hTrackerPxFToF");
400 sprintf(htitle,
"Pixel forward hits, ToF/ns");
402 hTrackerPxFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
406 sprintf(hname,
"hTrackerPxFZ");
408 sprintf(htitle,
"Pixel forward hits, Z/cm");
409 hTrackerPxFZ =
new TH1F(hname, htitle, 200, -100., 100.);
414 sprintf(hname,
"hTrackerSi1");
416 sprintf(htitle,
"Silicon hits");
417 hTrackerSi[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
418 sprintf(hname,
"hTrackerSi2");
420 hTrackerSi[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
421 for (Int_t
i = 0;
i < 2; ++
i) {
422 hTrackerSi[
i]->GetXaxis()->SetTitle(
"Number of Silicon Hits");
427 sprintf(hname,
"hTrackerSiPhi");
429 sprintf(htitle,
"Silicon hits phi/rad");
435 sprintf(hname,
"hTrackerSiEta");
437 sprintf(htitle,
"Silicon hits eta");
443 sprintf(hname,
"hTrackerSiBToF");
445 sprintf(htitle,
"Silicon barrel hits, ToF/ns");
447 hTrackerSiBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
451 sprintf(hname,
"hTrackerSiBR");
453 sprintf(htitle,
"Silicon barrel hits, R/cm");
459 sprintf(hname,
"hTrackerSiFToF");
461 sprintf(htitle,
"Silicon forward hits, ToF/ns");
463 hTrackerSiFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
467 sprintf(hname,
"hTrackerSiFZ");
469 sprintf(htitle,
"Silicon forward hits, Z/cm");
470 hTrackerSiFZ =
new TH1F(hname, htitle, 200, -300., 300.);
476 sprintf(hname,
"hMuon1");
478 sprintf(htitle,
"Muon hits");
479 hMuon[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
480 sprintf(hname,
"hMuon2");
482 hMuon[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
483 for (Int_t
i = 0;
i < 2; ++
i) {
484 hMuon[
i]->GetXaxis()->SetTitle(
"Number of Muon Hits");
485 hMuon[
i]->GetYaxis()->SetTitle(
"Count");
489 sprintf(hname,
"hMuonPhi");
491 sprintf(htitle,
"Muon hits phi/rad");
492 hMuonPhi =
new TH1F(hname, htitle, 100, -3.2, 3.2);
493 hMuonPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
494 hMuonPhi->GetYaxis()->SetTitle(
"Count");
497 sprintf(hname,
"hMuonEta");
499 sprintf(htitle,
"Muon hits eta");
500 hMuonEta =
new TH1F(hname, htitle, 100, -3.5, 3.5);
501 hMuonEta->GetXaxis()->SetTitle(
"Eta of Hits");
502 hMuonEta->GetYaxis()->SetTitle(
"Count");
505 sprintf(hname,
"hMuonCscToF1");
507 sprintf(htitle,
"Muon CSC hits, ToF/ns");
508 hMuonCscToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
509 sprintf(hname,
"hMuonCscToF2");
511 hMuonCscToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
512 for (Int_t
i = 0;
i < 2; ++
i) {
513 hMuonCscToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
518 sprintf(hname,
"hMuonCscZ");
520 sprintf(htitle,
"Muon CSC hits, Z/cm");
521 hMuonCscZ =
new TH1F(hname, htitle, 200, -1500., 1500.);
522 hMuonCscZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
523 hMuonCscZ->GetYaxis()->SetTitle(
"Count");
526 sprintf(hname,
"hMuonDtToF1");
528 sprintf(htitle,
"Muon DT hits, ToF/ns");
529 hMuonDtToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
530 sprintf(hname,
"hMuonDtToF2");
532 hMuonDtToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
533 for (Int_t
i = 0;
i < 2; ++
i) {
534 hMuonDtToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
539 sprintf(hname,
"hMuonDtR");
541 sprintf(htitle,
"Muon DT hits, R/cm");
542 hMuonDtR =
new TH1F(hname, htitle, 100, 0., 1500.);
543 hMuonDtR->GetXaxis()->SetTitle(
"R of Hits (cm)");
544 hMuonDtR->GetYaxis()->SetTitle(
"Count");
547 sprintf(hname,
"hMuonRpcFToF1");
549 sprintf(htitle,
"Muon RPC forward hits, ToF/ns");
550 hMuonRpcFToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
551 sprintf(hname,
"hMuonRpcFToF2");
553 hMuonRpcFToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
554 for (Int_t
i = 0;
i < 2; ++
i) {
555 hMuonRpcFToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
560 sprintf(hname,
"hMuonRpcFZ");
562 sprintf(htitle,
"Muon RPC forward hits, Z/cm");
563 hMuonRpcFZ =
new TH1F(hname, htitle, 201, -1500., 1500.);
564 hMuonRpcFZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
568 sprintf(hname,
"hMuonRpcBToF1");
570 sprintf(htitle,
"Muon RPC barrel hits, ToF/ns");
571 hMuonRpcBToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
572 sprintf(hname,
"hMuonRpcBToF2");
574 hMuonRpcBToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
575 for (Int_t
i = 0;
i < 2; ++
i) {
576 hMuonRpcBToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
581 sprintf(hname,
"hMuonRpcBR");
583 sprintf(htitle,
"Muon RPC barrel hits, R/cm");
584 hMuonRpcBR =
new TH1F(hname, htitle, 100, 0., 1500.);
585 hMuonRpcBR->GetXaxis()->SetTitle(
"R of Hits (cm)");
600 std::string MsgLoggerCat =
"GlobalHitsProdHist_endJob";
602 edm::LogInfo(MsgLoggerCat) <<
"Terminating having processed " <<
count <<
" events.";
607 std::string MsgLoggerCat =
"GlobalHitsProdHist_produce";
617 edm::LogInfo(MsgLoggerCat) <<
"Processing run " << nrun <<
", event " << nevt <<
" (" <<
count <<
" events total)";
619 if (nevt %
frequency == 0 || nevt == 1) {
620 edm::LogInfo(MsgLoggerCat) <<
"Processing run " << nrun <<
", event " << nevt <<
" (" <<
count 627 std::vector<const edm::StableProvenance *> AllProv;
631 edm::LogInfo(MsgLoggerCat) <<
"Number of Provenances = " << AllProv.size();
634 TString eventout(
"\nProvenance info:\n");
636 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
637 eventout +=
"\n ******************************";
638 eventout +=
"\n Module : ";
639 eventout += AllProv[
i]->moduleLabel();
640 eventout +=
"\n ProductID : ";
641 eventout += AllProv[
i]->productID().id();
642 eventout +=
"\n ClassName : ";
643 eventout += AllProv[
i]->className();
644 eventout +=
"\n InstanceName : ";
645 eventout += AllProv[
i]->productInstanceName();
646 eventout +=
"\n BranchName : ";
647 eventout += AllProv[
i]->branchName();
649 eventout +=
"\n ******************************\n";
669 edm::LogInfo(MsgLoggerCat) <<
"Done gathering data from event.";
675 std::string MsgLoggerCat =
"GlobalHitsProdHist_endRun";
679 bool warning =
false;
685 std::map<std::string, TH1F *>::iterator iter;
689 std::unique_ptr<TH1F> hist1D(iter->second);
690 eventout +=
"\n Storing histogram " +
histName_[
i];
694 eventoutw +=
"\n Unable to find histogram with name " +
histName_[
i];
708 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillG4MC";
712 eventout =
"\nGathering info:";
718 std::vector<edm::Handle<edm::HepMCProduct>> AllHepMCEvt;
723 for (
unsigned int i = 0;
i < AllHepMCEvt.size(); ++
i) {
724 HepMCEvt = AllHepMCEvt[
i];
730 edm::LogWarning(MsgLoggerCat) <<
"Unable to find HepMCProduct in event!";
733 eventout +=
"\n Using HepMCProduct: ";
740 eventout +=
"\n Number of Raw Particles collected:......... ";
747 hMCRGP[1]->Fill((
float)nRawGenPart);
761 if (!G4VtxContainer.
isValid()) {
766 edm::SimVertexContainer::const_iterator itVtx;
767 for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end(); ++itVtx) {
771 itVtx->position().x(), itVtx->position().y(), itVtx->position().z(), itVtx->position().e());
774 G4Vtx1.GetCoordinates(G4Vtx);
777 hGeantVtxX[0]->Fill((G4Vtx[0] * unit) / micrometer);
779 hGeantVtxX[1]->Fill((G4Vtx[0] * unit) / micrometer);
782 hGeantVtxY[0]->Fill((G4Vtx[1] * unit) / micrometer);
784 hGeantVtxY[1]->Fill((G4Vtx[1] * unit) / micrometer);
787 hGeantVtxZ[0]->Fill((G4Vtx[2] * unit) / millimeter);
789 hGeantVtxZ[1]->Fill((G4Vtx[2] * unit) / millimeter);
793 eventout +=
"\n Number of G4Vertices collected:............ ";
807 if (!G4TrkContainer.
isValid()) {
812 edm::SimTrackContainer::const_iterator itTrk;
813 for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end(); ++itTrk) {
817 itTrk->momentum().x(), itTrk->momentum().y(), itTrk->momentum().z(), itTrk->momentum().e());
819 G4Trk1.GetCoordinates(G4Trk);
828 eventout +=
"\n Number of G4Tracks collected:.............. ";
845 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillTrk";
849 eventout =
"\nGathering info:";
854 if (!theTrackerGeometry.
isValid()) {
855 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerDigiGeometryRecord in event!";
861 edm::PSimHitContainer::const_iterator itHit;
870 if (!PxlBrlLowContainer.
isValid()) {
871 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelBarrelLowTof in event!";
877 if (!PxlBrlHighContainer.
isValid()) {
878 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelBarrelHighTof in event!";
882 thePxlBrlHits.insert(thePxlBrlHits.end(), PxlBrlLowContainer->begin(), PxlBrlLowContainer->end());
883 thePxlBrlHits.insert(thePxlBrlHits.end(), PxlBrlHighContainer->begin(), PxlBrlHighContainer->end());
887 for (itHit = thePxlBrlHits.begin(); itHit != thePxlBrlHits.end(); ++itHit) {
891 DetId theDetUnitId(itHit->detUnitId());
901 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from PxlBrlHits for Hit " <<
i;
920 edm::LogWarning(MsgLoggerCat) <<
"PxlBrl PSimHit " << i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 921 <<
sdPxlBrl <<
"); value returned is: (" << detector <<
"," << subdetector <<
")";
927 eventout +=
"\n Number of Pixel Barrel Hits collected:..... ";
940 if (!PxlFwdLowContainer.
isValid()) {
941 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelEndcapLowTof in event!";
947 if (!PxlFwdHighContainer.
isValid()) {
948 edm::LogWarning(
"GlobalHitsProdHist_fillTrk") <<
"Unable to find TrackerHitsPixelEndcapHighTof in event!";
952 thePxlFwdHits.insert(thePxlFwdHits.end(), PxlFwdLowContainer->begin(), PxlFwdLowContainer->end());
953 thePxlFwdHits.insert(thePxlFwdHits.end(), PxlFwdHighContainer->begin(), PxlFwdHighContainer->end());
958 for (itHit = thePxlFwdHits.begin(); itHit != thePxlFwdHits.end(); ++itHit) {
962 DetId theDetUnitId(itHit->detUnitId());
972 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from PxlFwdHits for Hit " <<
i;
985 hTrackerPxFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
992 edm::LogWarning(MsgLoggerCat) <<
"PxlFwd PSimHit " << i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 993 <<
sdPxlFwd <<
"); value returned is: (" << detector <<
"," << subdetector <<
")";
999 eventout +=
"\n Number of Pixel Forward Hits collected:.... ";
1018 if (!SiTIBLowContainer.
isValid()) {
1019 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIBLowTof in event!";
1025 if (!SiTIBHighContainer.
isValid()) {
1026 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIBHighTof in event!";
1032 if (!SiTOBLowContainer.
isValid()) {
1033 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTOBLowTof in event!";
1039 if (!SiTOBHighContainer.
isValid()) {
1040 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTOBHighTof in event!";
1044 theSiBrlHits.insert(theSiBrlHits.end(), SiTIBLowContainer->begin(), SiTIBLowContainer->end());
1045 theSiBrlHits.insert(theSiBrlHits.end(), SiTIBHighContainer->begin(), SiTIBHighContainer->end());
1046 theSiBrlHits.insert(theSiBrlHits.end(), SiTOBLowContainer->begin(), SiTOBLowContainer->end());
1047 theSiBrlHits.insert(theSiBrlHits.end(), SiTOBHighContainer->begin(), SiTOBHighContainer->end());
1052 for (itHit = theSiBrlHits.begin(); itHit != theSiBrlHits.end(); ++itHit) {
1056 DetId theDetUnitId(itHit->detUnitId());
1066 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from SiBrlHits for Hit " <<
i;
1085 edm::LogWarning(MsgLoggerCat) <<
"SiBrl PSimHit " << i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1086 <<
sdSiTIB <<
" || " <<
sdSiTOB <<
"); value returned is: (" << detector <<
"," 1087 << subdetector <<
")";
1093 eventout +=
"\n Number of Silicon Barrel Hits collected:... ";
1106 if (!SiTIDLowContainer.
isValid()) {
1107 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIDLowTof in event!";
1113 if (!SiTIDHighContainer.
isValid()) {
1114 edm::LogWarning(
"GlobalHitsProdHist_fillTrk") <<
"Unable to find TrackerHitsTIDHighTof in event!";
1120 if (!SiTECLowContainer.
isValid()) {
1121 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTECLowTof in event!";
1127 if (!SiTECHighContainer.
isValid()) {
1128 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTECHighTof in event!";
1132 theSiFwdHits.insert(theSiFwdHits.end(), SiTIDLowContainer->begin(), SiTIDLowContainer->end());
1133 theSiFwdHits.insert(theSiFwdHits.end(), SiTIDHighContainer->begin(), SiTIDHighContainer->end());
1134 theSiFwdHits.insert(theSiFwdHits.end(), SiTECLowContainer->begin(), SiTECLowContainer->end());
1135 theSiFwdHits.insert(theSiFwdHits.end(), SiTECHighContainer->begin(), SiTECHighContainer->end());
1140 for (itHit = theSiFwdHits.begin(); itHit != theSiFwdHits.end(); ++itHit) {
1144 DetId theDetUnitId(itHit->detUnitId());
1154 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from SiFwdHits Hit " <<
i;
1166 hTrackerSiFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1173 edm::LogWarning(MsgLoggerCat) <<
"SiFwd PSimHit " << i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1174 <<
sdSiTOB <<
" || " <<
sdSiTEC <<
"); value returned is: (" << detector <<
"," 1175 << subdetector <<
")";
1181 eventout +=
"\n Number of Silicon Forward Hits collected:.. ";
1200 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillMuon";
1204 eventout =
"\nGathering info:";
1207 edm::PSimHitContainer::const_iterator itHit;
1215 if (!theCSCGeometry.
isValid()) {
1216 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the CSCGeometry in event!";
1224 if (!MuonCSCContainer.
isValid()) {
1225 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonCSCHits in event!";
1231 for (itHit = MuonCSCContainer->begin(); itHit != MuonCSCContainer->end(); ++itHit) {
1235 DetId theDetUnitId(itHit->detUnitId());
1245 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theCSCMuon for hit " <<
i;
1259 hMuonCscZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1261 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1263 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1266 edm::LogWarning(MsgLoggerCat) <<
"MuonCsc PSimHit " << i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1267 <<
sdMuonCSC <<
"); value returned is: (" << detector <<
"," << subdetector <<
")";
1273 eventout +=
"\n Number of CSC muon Hits collected:......... ";
1285 if (!theDTGeometry.
isValid()) {
1286 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the DTGeometry in event!";
1294 if (!MuonDtContainer.
isValid()) {
1295 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonDTHits in event!";
1301 for (itHit = MuonDtContainer->begin(); itHit != MuonDtContainer->end(); ++itHit) {
1305 DetId theDetUnitId(itHit->detUnitId());
1313 DTWireId wireId(itHit->detUnitId());
1316 const DTLayer *theDet = theDTMuon.
layer(wireId.layerId());
1319 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theDtMuon for hit " <<
i;
1326 const BoundPlane &bSurface = theDet->surface();
1333 hMuonDtR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1335 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1337 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1340 edm::LogWarning(MsgLoggerCat) <<
"MuonDt PSimHit " << i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1341 <<
sdMuonDT <<
"); value returned is: (" << detector <<
"," << subdetector <<
")";
1347 eventout +=
"\n Number of DT muon Hits collected:.......... ";
1360 if (!theRPCGeometry.
isValid()) {
1361 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the RPCGeometry in event!";
1369 if (!MuonRPCContainer.
isValid()) {
1370 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonRPCHits in event!";
1376 int RPCBrl = 0, RPCFwd = 0;
1377 for (itHit = MuonRPCContainer->begin(); itHit != MuonRPCContainer->end(); ++itHit) {
1381 DetId theDetUnitId(itHit->detUnitId());
1388 RPCDetId RPCId(itHit->detUnitId());
1391 int region = RPCId.
region();
1397 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theRPCMuon for hit " <<
i;
1415 hMuonRpcFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1417 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1419 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1429 hMuonRpcBR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1431 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1433 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1440 edm::LogWarning(MsgLoggerCat) <<
"MuonRpc PSimHit " << i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1441 <<
sdMuonRPC <<
"); value returned is: (" << detector <<
"," << subdetector <<
")";
1447 eventout +=
"\n Number of RPC muon Hits collected:......... ";
1449 eventout +=
"\n RPC Barrel muon Hits:............ ";
1451 eventout +=
"\n RPC Forward muon Hits:........... ";
1460 hMuon[1]->Fill((
float)nMuonHits);
1469 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillECal";
1473 eventout =
"\nGathering info:";
1478 if (!theCaloGeometry.
isValid()) {
1479 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CaloGeometryRecord in event!";
1485 edm::PCaloHitContainer::const_iterator itHit;
1495 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalHitsEB in event!";
1502 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalHitsEE in event!";
1506 theECalHits.insert(theECalHits.end(), EBContainer->begin(), EBContainer->end());
1507 theECalHits.insert(theECalHits.end(), EEContainer->begin(), EEContainer->end());
1511 for (itHit = theECalHits.begin(); itHit != theECalHits.end(); ++itHit) {
1515 DetId theDetUnitId(itHit->id());
1525 edm::LogWarning(MsgLoggerCat) <<
"Unable to get CaloCellGeometry from ECalHits for Hit " <<
i;
1532 const GlobalPoint &globalposition = theDet->getPosition();
1548 edm::LogWarning(MsgLoggerCat) <<
"ECal PCaloHit " << i <<
" is expected to be (det,subdet) = (" <<
dEcal <<
"," 1550 << subdetector <<
")";
1556 eventout +=
"\n Number of ECal Hits collected:............. ";
1571 if (!PreShContainer.
isValid()) {
1572 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalHitsES in event!";
1578 for (itHit = PreShContainer->begin(); itHit != PreShContainer->end(); ++itHit) {
1582 DetId theDetUnitId(itHit->id());
1592 edm::LogWarning(MsgLoggerCat) <<
"Unable to get CaloCellGeometry from PreShContainer for Hit " <<
i;
1599 const GlobalPoint &globalposition = theDet->getPosition();
1615 edm::LogWarning(MsgLoggerCat) <<
"PreSh PCaloHit " << i <<
" is expected to be (det,subdet) = (" <<
dEcal <<
"," 1616 <<
sdEcalPS <<
"); value returned is: (" << detector <<
"," << subdetector <<
")";
1622 eventout +=
"\n Number of PreSh Hits collected:............ ";
1638 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillHCal";
1642 eventout =
"\nGathering info:";
1647 if (!theCaloGeometry.
isValid()) {
1648 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CaloGeometryRecord in event!";
1654 edm::PCaloHitContainer::const_iterator itHit;
1662 if (!HCalContainer.
isValid()) {
1669 for (itHit = HCalContainer->begin(); itHit != HCalContainer->end(); ++itHit) {
1673 DetId theDetUnitId(itHit->id());
1684 edm::LogWarning(MsgLoggerCat) <<
"Unable to get HcalGeometry from HCalContainer for Hit " <<
i;
1707 edm::LogWarning(MsgLoggerCat) <<
"HCal PCaloHit " << i <<
" is expected to be (det,subdet) = (" <<
dHcal <<
"," 1709 <<
"); value returned is: (" << detector <<
"," << subdetector <<
")";
1715 eventout +=
"\n Number of HCal Hits collected:............. ";
edm::InputTag SiTECHighSrc_
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
EventNumber_t event() const
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdHighSrc_Token_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::PSimHitContainer > SiTECHighSrc_Token_
edm::InputTag SiTIDLowSrc_
std::vector< PCaloHit > PCaloHitContainer
~GlobalHitsProdHist() override
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
static const int sdMuonRPCRgnFwdn
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlHighSrc_Token_
static const int sdHcalOut
static const int sdMuonDT
edm::InputTag SiTECLowSrc_
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlLowSrc_Token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBHighSrc_Token_
Geom::Phi< T > phi() const
edm::InputTag MuonRpcSrc_
unsigned long long EventNumber_t
static const int sdEcalPS
void getManyByType(std::vector< Handle< PROD >> &results) const
static const int sdMuonRPC
edm::EDGetTokenT< edm::PSimHitContainer > MuonRpcSrc_Token_
edm::InputTag MuonCscSrc_
CaloGeometry const * getGeometry()
const Plane & surface() const
The nominal surface of the GeomDet.
void fillHCal(edm::Event &, const edm::EventSetup &)
edm::InputTag SiTIBLowSrc_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::map< std::string, TH1F * > histMap_
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
edm::EDGetTokenT< edm::PCaloHitContainer > ECalESSrc_Token_
std::vector< std::string > histName_
void fillG4MC(edm::Event &)
edm::InputTag PxlFwdHighSrc_
static const int sdPxlBrl
static const int sdMuonCSC
static const int sdEcalFwd
void endRunProduce(edm::Run &, const edm::EventSetup &) override
edm::InputTag SiTOBHighSrc_
void produce(edm::Event &, const edm::EventSetup &) override
static const int sdEcalBrl
edm::EDGetTokenT< edm::SimTrackContainer > G4TrkSrc_Token_
static const int sdMuonRPCRgnFwdp
void fillTrk(edm::Event &, const edm::EventSetup &)
static const int sdMuonRPCRgnBrl
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDLowSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDHighSrc_Token_
GlobalPoint getPosition(const DetId &id) const
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBLowSrc_Token_
edm::InputTag SiTIBHighSrc_
edm::EDGetTokenT< edm::PCaloHitContainer > ECalEBSrc_Token_
edm::EDGetTokenT< edm::PCaloHitContainer > ECalEESrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > SiTIBHighSrc_Token_
const HepMC::GenEvent * GetEvent() const
BranchDescription const & branchDescription() const
edm::EDGetTokenT< edm::PSimHitContainer > SiTIBLowSrc_Token_
edm::InputTag PxlFwdLowSrc_
std::vector< SimVertex > SimVertexContainer
static const int sdHcalFwd
void put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
void fillECal(edm::Event &, const edm::EventSetup &)
static const int sdHcalBrl
edm::EDGetTokenT< edm::PSimHitContainer > SiTECLowSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > MuonCscSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > MuonDtSrc_Token_
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
edm::EDGetTokenT< edm::SimVertexContainer > G4VtxSrc_Token_
T perp() const
Magnitude of transverse component.
edm::InputTag PxlBrlHighSrc_
void fillMuon(edm::Event &, const edm::EventSetup &)
edm::InputTag PxlBrlLowSrc_
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
edm::InputTag SiTOBLowSrc_
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdLowSrc_Token_
GlobalHitsProdHist(const edm::ParameterSet &)
std::vector< SimTrack > SimTrackContainer
static const int sdHcalEC
edm::InputTag SiTIDHighSrc_
Provenance const * provenance() const
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.