17 getAllProvenances(
false),
18 printProvenanceInfo(
false),
27 std::string MsgLoggerCat =
"GlobalHitsProdHist_GlobalHitsProdHist";
70 <<
"\n===============================\n" 71 <<
"Initialized as EDProducer with parameter values:\n" 72 <<
" Name = " <<
fName <<
"\n" 75 <<
" VtxUnit = " <<
vtxunit <<
"\n" 97 <<
"===============================\n";
105 sprintf(hname,
"hMCRGP1");
107 sprintf(htitle,
"RawGenParticles");
108 hMCRGP[0] =
new TH1F(hname, htitle, 100, 0., 5000.);
109 sprintf(hname,
"hMCRGP2");
111 hMCRGP[1] =
new TH1F(hname, htitle, 100, 0., 500.);
112 for (Int_t
i = 0;
i < 2; ++
i) {
113 hMCRGP[
i]->GetXaxis()->SetTitle(
"Number of Raw Generated Particles");
114 hMCRGP[
i]->GetYaxis()->SetTitle(
"Count");
118 sprintf(hname,
"hMCG4Vtx1");
120 sprintf(htitle,
"G4 Vertices");
121 hMCG4Vtx[0] =
new TH1F(hname, htitle, 100, 0., 50000.);
122 sprintf(hname,
"hMCG4Vtx2");
124 hMCG4Vtx[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
125 for (Int_t
i = 0;
i < 2; ++
i) {
126 hMCG4Vtx[
i]->GetXaxis()->SetTitle(
"Number of Vertices");
127 hMCG4Vtx[
i]->GetYaxis()->SetTitle(
"Count");
131 sprintf(hname,
"hMCG4Trk1");
133 sprintf(htitle,
"G4 Tracks");
134 hMCG4Trk[0] =
new TH1F(hname, htitle, 150, 0., 15000.);
135 sprintf(hname,
"hMCG4Trk2");
137 hMCG4Trk[1] =
new TH1F(hname, htitle, 150, -0.5, 99.5);
138 for (Int_t
i = 0;
i < 2; ++
i) {
139 hMCG4Trk[
i]->GetXaxis()->SetTitle(
"Number of Tracks");
140 hMCG4Trk[
i]->GetYaxis()->SetTitle(
"Count");
144 sprintf(hname,
"hGeantVtxX1");
146 sprintf(htitle,
"Geant vertex x/micrometer");
147 hGeantVtxX[0] =
new TH1F(hname, htitle, 100, -8000000., 8000000.);
148 sprintf(hname,
"hGeantVtxX2");
150 hGeantVtxX[1] =
new TH1F(hname, htitle, 100, -50., 50.);
151 for (Int_t
i = 0;
i < 2; ++
i) {
152 hGeantVtxX[
i]->GetXaxis()->SetTitle(
"x of Vertex (um)");
157 sprintf(hname,
"hGeantVtxY1");
159 sprintf(htitle,
"Geant vertex y/micrometer");
160 hGeantVtxY[0] =
new TH1F(hname, htitle, 100, -8000000, 8000000.);
161 sprintf(hname,
"hGeantVtxY2");
163 hGeantVtxY[1] =
new TH1F(hname, htitle, 100, -50., 50.);
164 for (Int_t
i = 0;
i < 2; ++
i) {
165 hGeantVtxY[
i]->GetXaxis()->SetTitle(
"y of Vertex (um)");
170 sprintf(hname,
"hGeantVtxZ1");
172 sprintf(htitle,
"Geant vertex z/millimeter");
173 hGeantVtxZ[0] =
new TH1F(hname, htitle, 100, -11000., 11000.);
174 sprintf(hname,
"hGeantVtxZ2");
176 hGeantVtxZ[1] =
new TH1F(hname, htitle, 100, -250., 250.);
177 for (Int_t
i = 0;
i < 2; ++
i) {
178 hGeantVtxZ[
i]->GetXaxis()->SetTitle(
"z of Vertex (mm)");
183 sprintf(hname,
"hGeantTrkPt");
185 sprintf(htitle,
"Geant track pt/GeV");
186 hGeantTrkPt =
new TH1F(hname, htitle, 100, 0., 200.);
187 hGeantTrkPt->GetXaxis()->SetTitle(
"pT of Track (GeV)");
191 sprintf(hname,
"hGeantTrkE");
193 sprintf(htitle,
"Geant track E/GeV");
194 hGeantTrkE =
new TH1F(hname, htitle, 100, 0., 5000.);
195 hGeantTrkE->GetXaxis()->SetTitle(
"E of Track (GeV)");
200 sprintf(hname,
"hCaloEcal1");
202 sprintf(htitle,
"Ecal hits");
203 hCaloEcal[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
204 sprintf(hname,
"hCaloEcal2");
206 hCaloEcal[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
208 sprintf(hname,
"hCaloEcalE1");
210 sprintf(htitle,
"Ecal hits, energy/GeV");
211 hCaloEcalE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
212 sprintf(hname,
"hCaloEcalE2");
214 hCaloEcalE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
216 sprintf(hname,
"hCaloEcalToF1");
218 sprintf(htitle,
"Ecal hits, ToF/ns");
219 hCaloEcalToF[0] =
new TH1F(hname, htitle, 100, 0., 1000.);
220 sprintf(hname,
"hCaloEcalToF2");
222 hCaloEcalToF[1] =
new TH1F(hname, htitle, 100, 0., 100.);
224 for (Int_t
i = 0;
i < 2; ++
i) {
225 hCaloEcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
228 hCaloEcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
231 hCaloEcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
236 sprintf(hname,
"hCaloEcalPhi");
238 sprintf(htitle,
"Ecal hits, phi/rad");
240 hCaloEcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
244 sprintf(hname,
"hCaloEcalEta");
246 sprintf(htitle,
"Ecal hits, eta");
252 sprintf(hname,
"hCaloPreSh1");
254 sprintf(htitle,
"PreSh hits");
255 hCaloPreSh[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
256 sprintf(hname,
"hCaloPreSh2");
258 hCaloPreSh[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
260 sprintf(hname,
"hCaloPreShE1");
262 sprintf(htitle,
"PreSh hits, energy/GeV");
263 hCaloPreShE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
264 sprintf(hname,
"hCaloPreShE2");
266 hCaloPreShE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
268 sprintf(hname,
"hCaloPreShToF1");
270 sprintf(htitle,
"PreSh hits, ToF/ns");
272 sprintf(hname,
"hCaloPreShToF2");
276 for (Int_t
i = 0;
i < 2; ++
i) {
277 hCaloPreSh[
i]->GetXaxis()->SetTitle(
"Number of Hits");
280 hCaloPreShE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
283 hCaloPreShToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
288 sprintf(hname,
"hCaloPreShPhi");
290 sprintf(htitle,
"PreSh hits, phi/rad");
296 sprintf(hname,
"hCaloPreShEta");
298 sprintf(htitle,
"PreSh hits, eta");
305 sprintf(hname,
"hCaloHcal1");
307 sprintf(htitle,
"Hcal hits");
308 hCaloHcal[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
309 sprintf(hname,
"hCaloHcal2");
311 hCaloHcal[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
313 sprintf(hname,
"hCaloHcalE1");
315 sprintf(htitle,
"Hcal hits, energy/GeV");
316 hCaloHcalE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
317 sprintf(hname,
"hCaloHcalE2");
319 hCaloHcalE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
321 sprintf(hname,
"hCaloHcalToF1");
323 sprintf(htitle,
"Hcal hits, ToF/ns");
324 hCaloHcalToF[0] =
new TH1F(hname, htitle, 100, 0., 1000.);
325 sprintf(hname,
"hCaloHcalToF2");
327 hCaloHcalToF[1] =
new TH1F(hname, htitle, 100, 0., 100.);
329 for (Int_t
i = 0;
i < 2; ++
i) {
330 hCaloHcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
333 hCaloHcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
336 hCaloHcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
341 sprintf(hname,
"hCaloHcalPhi");
343 sprintf(htitle,
"Hcal hits, phi/rad");
345 hCaloHcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
349 sprintf(hname,
"hCaloHcalEta");
351 sprintf(htitle,
"Hcal hits, eta");
358 sprintf(hname,
"hTrackerPx1");
360 sprintf(htitle,
"Pixel hits");
361 hTrackerPx[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
362 sprintf(hname,
"hTrackerPx2");
364 hTrackerPx[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
365 for (Int_t
i = 0;
i < 2; ++
i) {
366 hTrackerPx[
i]->GetXaxis()->SetTitle(
"Number of Pixel Hits");
371 sprintf(hname,
"hTrackerPxPhi");
373 sprintf(htitle,
"Pixel hits phi/rad");
379 sprintf(hname,
"hTrackerPxEta");
381 sprintf(htitle,
"Pixel hits eta");
387 sprintf(hname,
"hTrackerPxBToF");
389 sprintf(htitle,
"Pixel barrel hits, ToF/ns");
391 hTrackerPxBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
395 sprintf(hname,
"hTrackerPxBR");
397 sprintf(htitle,
"Pixel barrel hits, R/cm");
403 sprintf(hname,
"hTrackerPxFToF");
405 sprintf(htitle,
"Pixel forward hits, ToF/ns");
407 hTrackerPxFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
411 sprintf(hname,
"hTrackerPxFZ");
413 sprintf(htitle,
"Pixel forward hits, Z/cm");
414 hTrackerPxFZ =
new TH1F(hname, htitle, 200, -100., 100.);
419 sprintf(hname,
"hTrackerSi1");
421 sprintf(htitle,
"Silicon hits");
422 hTrackerSi[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
423 sprintf(hname,
"hTrackerSi2");
425 hTrackerSi[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
426 for (Int_t
i = 0;
i < 2; ++
i) {
427 hTrackerSi[
i]->GetXaxis()->SetTitle(
"Number of Silicon Hits");
432 sprintf(hname,
"hTrackerSiPhi");
434 sprintf(htitle,
"Silicon hits phi/rad");
440 sprintf(hname,
"hTrackerSiEta");
442 sprintf(htitle,
"Silicon hits eta");
448 sprintf(hname,
"hTrackerSiBToF");
450 sprintf(htitle,
"Silicon barrel hits, ToF/ns");
452 hTrackerSiBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
456 sprintf(hname,
"hTrackerSiBR");
458 sprintf(htitle,
"Silicon barrel hits, R/cm");
464 sprintf(hname,
"hTrackerSiFToF");
466 sprintf(htitle,
"Silicon forward hits, ToF/ns");
468 hTrackerSiFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
472 sprintf(hname,
"hTrackerSiFZ");
474 sprintf(htitle,
"Silicon forward hits, Z/cm");
475 hTrackerSiFZ =
new TH1F(hname, htitle, 200, -300., 300.);
481 sprintf(hname,
"hMuon1");
483 sprintf(htitle,
"Muon hits");
484 hMuon[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
485 sprintf(hname,
"hMuon2");
487 hMuon[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
488 for (Int_t
i = 0;
i < 2; ++
i) {
489 hMuon[
i]->GetXaxis()->SetTitle(
"Number of Muon Hits");
490 hMuon[
i]->GetYaxis()->SetTitle(
"Count");
494 sprintf(hname,
"hMuonPhi");
496 sprintf(htitle,
"Muon hits phi/rad");
497 hMuonPhi =
new TH1F(hname, htitle, 100, -3.2, 3.2);
498 hMuonPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
499 hMuonPhi->GetYaxis()->SetTitle(
"Count");
502 sprintf(hname,
"hMuonEta");
504 sprintf(htitle,
"Muon hits eta");
505 hMuonEta =
new TH1F(hname, htitle, 100, -3.5, 3.5);
506 hMuonEta->GetXaxis()->SetTitle(
"Eta of Hits");
507 hMuonEta->GetYaxis()->SetTitle(
"Count");
510 sprintf(hname,
"hMuonCscToF1");
512 sprintf(htitle,
"Muon CSC hits, ToF/ns");
513 hMuonCscToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
514 sprintf(hname,
"hMuonCscToF2");
516 hMuonCscToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
517 for (Int_t
i = 0;
i < 2; ++
i) {
518 hMuonCscToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
523 sprintf(hname,
"hMuonCscZ");
525 sprintf(htitle,
"Muon CSC hits, Z/cm");
526 hMuonCscZ =
new TH1F(hname, htitle, 200, -1500., 1500.);
527 hMuonCscZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
528 hMuonCscZ->GetYaxis()->SetTitle(
"Count");
531 sprintf(hname,
"hMuonDtToF1");
533 sprintf(htitle,
"Muon DT hits, ToF/ns");
534 hMuonDtToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
535 sprintf(hname,
"hMuonDtToF2");
537 hMuonDtToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
538 for (Int_t
i = 0;
i < 2; ++
i) {
539 hMuonDtToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
544 sprintf(hname,
"hMuonDtR");
546 sprintf(htitle,
"Muon DT hits, R/cm");
547 hMuonDtR =
new TH1F(hname, htitle, 100, 0., 1500.);
548 hMuonDtR->GetXaxis()->SetTitle(
"R of Hits (cm)");
549 hMuonDtR->GetYaxis()->SetTitle(
"Count");
552 sprintf(hname,
"hMuonRpcFToF1");
554 sprintf(htitle,
"Muon RPC forward hits, ToF/ns");
555 hMuonRpcFToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
556 sprintf(hname,
"hMuonRpcFToF2");
558 hMuonRpcFToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
559 for (Int_t
i = 0;
i < 2; ++
i) {
560 hMuonRpcFToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
565 sprintf(hname,
"hMuonRpcFZ");
567 sprintf(htitle,
"Muon RPC forward hits, Z/cm");
568 hMuonRpcFZ =
new TH1F(hname, htitle, 201, -1500., 1500.);
569 hMuonRpcFZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
573 sprintf(hname,
"hMuonRpcBToF1");
575 sprintf(htitle,
"Muon RPC barrel hits, ToF/ns");
576 hMuonRpcBToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
577 sprintf(hname,
"hMuonRpcBToF2");
579 hMuonRpcBToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
580 for (Int_t
i = 0;
i < 2; ++
i) {
581 hMuonRpcBToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
586 sprintf(hname,
"hMuonRpcBR");
588 sprintf(htitle,
"Muon RPC barrel hits, R/cm");
589 hMuonRpcBR =
new TH1F(hname, htitle, 100, 0., 1500.);
590 hMuonRpcBR->GetXaxis()->SetTitle(
"R of Hits (cm)");
605 std::string MsgLoggerCat =
"GlobalHitsProdHist_endJob";
607 edm::LogInfo(MsgLoggerCat) <<
"Terminating having processed " <<
count <<
" events.";
612 std::string MsgLoggerCat =
"GlobalHitsProdHist_produce";
622 edm::LogInfo(MsgLoggerCat) <<
"Processing run " << nrun <<
", event " <<
nevt <<
" (" <<
count <<
" events total)";
632 std::vector<const edm::StableProvenance *> AllProv;
633 iEvent.getAllStableProvenance(AllProv);
636 edm::LogInfo(MsgLoggerCat) <<
"Number of Provenances = " << AllProv.size();
639 TString eventout(
"\nProvenance info:\n");
641 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
642 eventout +=
"\n ******************************";
643 eventout +=
"\n Module : ";
644 eventout += AllProv[
i]->moduleLabel();
645 eventout +=
"\n ProductID : ";
646 eventout += AllProv[
i]->productID().id();
647 eventout +=
"\n ClassName : ";
648 eventout += AllProv[
i]->className();
649 eventout +=
"\n InstanceName : ";
650 eventout += AllProv[
i]->productInstanceName();
651 eventout +=
"\n BranchName : ";
652 eventout += AllProv[
i]->branchName();
654 eventout +=
"\n ******************************\n";
674 edm::LogInfo(MsgLoggerCat) <<
"Done gathering data from event.";
680 std::string MsgLoggerCat =
"GlobalHitsProdHist_endRun";
690 std::map<std::string, TH1F *>::iterator iter;
694 std::unique_ptr<TH1F> hist1D(iter->second);
695 eventout +=
"\n Storing histogram " +
histName_[
i];
699 eventoutw +=
"\n Unable to find histogram with name " +
histName_[
i];
713 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillG4MC";
717 eventout =
"\nGathering info:";
723 std::vector<edm::Handle<edm::HepMCProduct>> AllHepMCEvt;
724 iEvent.getManyByType(AllHepMCEvt);
728 for (
unsigned int i = 0;
i < AllHepMCEvt.size(); ++
i) {
729 HepMCEvt = AllHepMCEvt[
i];
735 edm::LogWarning(MsgLoggerCat) <<
"Unable to find HepMCProduct in event!";
738 eventout +=
"\n Using HepMCProduct: ";
745 eventout +=
"\n Number of Raw Particles collected:......... ";
766 if (!G4VtxContainer.
isValid()) {
771 edm::SimVertexContainer::const_iterator itVtx;
772 for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end(); ++itVtx) {
776 itVtx->position().x(), itVtx->position().y(), itVtx->position().z(), itVtx->position().e());
779 G4Vtx1.GetCoordinates(G4Vtx);
798 eventout +=
"\n Number of G4Vertices collected:............ ";
812 if (!G4TrkContainer.
isValid()) {
817 edm::SimTrackContainer::const_iterator itTrk;
818 for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end(); ++itTrk) {
822 itTrk->momentum().x(), itTrk->momentum().y(), itTrk->momentum().z(), itTrk->momentum().e());
824 G4Trk1.GetCoordinates(G4Trk);
833 eventout +=
"\n Number of G4Tracks collected:.............. ";
850 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillTrk";
854 eventout =
"\nGathering info:";
858 if (!theTrackerGeometry.isValid()) {
859 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerDigiGeometryRecord in event!";
865 edm::PSimHitContainer::const_iterator itHit;
874 if (!PxlBrlLowContainer.
isValid()) {
875 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelBarrelLowTof in event!";
881 if (!PxlBrlHighContainer.
isValid()) {
882 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelBarrelHighTof in event!";
886 thePxlBrlHits.insert(thePxlBrlHits.end(), PxlBrlLowContainer->begin(), PxlBrlLowContainer->end());
887 thePxlBrlHits.insert(thePxlBrlHits.end(), PxlBrlHighContainer->begin(), PxlBrlHighContainer->end());
891 for (itHit = thePxlBrlHits.begin(); itHit != thePxlBrlHits.end(); ++itHit) {
895 DetId theDetUnitId(itHit->detUnitId());
905 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from PxlBrlHits for Hit " <<
i;
924 edm::LogWarning(MsgLoggerCat) <<
"PxlBrl PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 931 eventout +=
"\n Number of Pixel Barrel Hits collected:..... ";
944 if (!PxlFwdLowContainer.
isValid()) {
945 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelEndcapLowTof in event!";
951 if (!PxlFwdHighContainer.
isValid()) {
952 edm::LogWarning(
"GlobalHitsProdHist_fillTrk") <<
"Unable to find TrackerHitsPixelEndcapHighTof in event!";
956 thePxlFwdHits.insert(thePxlFwdHits.end(), PxlFwdLowContainer->begin(), PxlFwdLowContainer->end());
957 thePxlFwdHits.insert(thePxlFwdHits.end(), PxlFwdHighContainer->begin(), PxlFwdHighContainer->end());
962 for (itHit = thePxlFwdHits.begin(); itHit != thePxlFwdHits.end(); ++itHit) {
966 DetId theDetUnitId(itHit->detUnitId());
976 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from PxlFwdHits for Hit " <<
i;
989 hTrackerPxFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
996 edm::LogWarning(MsgLoggerCat) <<
"PxlFwd PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1003 eventout +=
"\n Number of Pixel Forward Hits collected:.... ";
1022 if (!SiTIBLowContainer.
isValid()) {
1023 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIBLowTof in event!";
1029 if (!SiTIBHighContainer.
isValid()) {
1030 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIBHighTof in event!";
1036 if (!SiTOBLowContainer.
isValid()) {
1037 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTOBLowTof in event!";
1043 if (!SiTOBHighContainer.
isValid()) {
1044 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTOBHighTof in event!";
1048 theSiBrlHits.insert(theSiBrlHits.end(), SiTIBLowContainer->begin(), SiTIBLowContainer->end());
1049 theSiBrlHits.insert(theSiBrlHits.end(), SiTIBHighContainer->begin(), SiTIBHighContainer->end());
1050 theSiBrlHits.insert(theSiBrlHits.end(), SiTOBLowContainer->begin(), SiTOBLowContainer->end());
1051 theSiBrlHits.insert(theSiBrlHits.end(), SiTOBHighContainer->begin(), SiTOBHighContainer->end());
1056 for (itHit = theSiBrlHits.begin(); itHit != theSiBrlHits.end(); ++itHit) {
1060 DetId theDetUnitId(itHit->detUnitId());
1070 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from SiBrlHits for Hit " <<
i;
1089 edm::LogWarning(MsgLoggerCat) <<
"SiBrl PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1097 eventout +=
"\n Number of Silicon Barrel Hits collected:... ";
1110 if (!SiTIDLowContainer.
isValid()) {
1111 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIDLowTof in event!";
1117 if (!SiTIDHighContainer.
isValid()) {
1118 edm::LogWarning(
"GlobalHitsProdHist_fillTrk") <<
"Unable to find TrackerHitsTIDHighTof in event!";
1124 if (!SiTECLowContainer.
isValid()) {
1125 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTECLowTof in event!";
1131 if (!SiTECHighContainer.
isValid()) {
1132 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTECHighTof in event!";
1136 theSiFwdHits.insert(theSiFwdHits.end(), SiTIDLowContainer->begin(), SiTIDLowContainer->end());
1137 theSiFwdHits.insert(theSiFwdHits.end(), SiTIDHighContainer->begin(), SiTIDHighContainer->end());
1138 theSiFwdHits.insert(theSiFwdHits.end(), SiTECLowContainer->begin(), SiTECLowContainer->end());
1139 theSiFwdHits.insert(theSiFwdHits.end(), SiTECHighContainer->begin(), SiTECHighContainer->end());
1144 for (itHit = theSiFwdHits.begin(); itHit != theSiFwdHits.end(); ++itHit) {
1148 DetId theDetUnitId(itHit->detUnitId());
1158 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from SiFwdHits Hit " <<
i;
1170 hTrackerSiFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1177 edm::LogWarning(MsgLoggerCat) <<
"SiFwd PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1185 eventout +=
"\n Number of Silicon Forward Hits collected:.. ";
1204 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillMuon";
1208 eventout =
"\nGathering info:";
1211 edm::PSimHitContainer::const_iterator itHit;
1218 if (!theCSCGeometry.isValid()) {
1219 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the CSCGeometry in event!";
1227 if (!MuonCSCContainer.
isValid()) {
1228 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonCSCHits in event!";
1234 for (itHit = MuonCSCContainer->begin(); itHit != MuonCSCContainer->end(); ++itHit) {
1238 DetId theDetUnitId(itHit->detUnitId());
1248 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theCSCMuon for hit " <<
i;
1262 hMuonCscZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1264 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1266 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1269 edm::LogWarning(MsgLoggerCat) <<
"MuonCsc PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1276 eventout +=
"\n Number of CSC muon Hits collected:......... ";
1287 if (!theDTGeometry.isValid()) {
1288 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the DTGeometry in event!";
1296 if (!MuonDtContainer.
isValid()) {
1297 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonDTHits in event!";
1303 for (itHit = MuonDtContainer->begin(); itHit != MuonDtContainer->end(); ++itHit) {
1307 DetId theDetUnitId(itHit->detUnitId());
1315 DTWireId wireId(itHit->detUnitId());
1318 const DTLayer *theDet = theDTMuon.
layer(wireId.layerId());
1321 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theDtMuon for hit " <<
i;
1328 const BoundPlane &bSurface = theDet->surface();
1335 hMuonDtR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1337 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1339 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1342 edm::LogWarning(MsgLoggerCat) <<
"MuonDt PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1349 eventout +=
"\n Number of DT muon Hits collected:.......... ";
1361 if (!theRPCGeometry.isValid()) {
1362 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the RPCGeometry in event!";
1370 if (!MuonRPCContainer.
isValid()) {
1371 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonRPCHits in event!";
1377 int RPCBrl = 0, RPCFwd = 0;
1378 for (itHit = MuonRPCContainer->begin(); itHit != MuonRPCContainer->end(); ++itHit) {
1382 DetId theDetUnitId(itHit->detUnitId());
1389 RPCDetId RPCId(itHit->detUnitId());
1392 int region = RPCId.region();
1398 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theRPCMuon for hit " <<
i;
1416 hMuonRpcFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1418 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1420 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1430 hMuonRpcBR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1432 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1434 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1441 edm::LogWarning(MsgLoggerCat) <<
"MuonRpc PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1448 eventout +=
"\n Number of RPC muon Hits collected:......... ";
1450 eventout +=
"\n RPC Barrel muon Hits:............ ";
1452 eventout +=
"\n RPC Forward muon Hits:........... ";
1470 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillECal";
1474 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 <<
"," 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 <<
"," 1622 eventout +=
"\n Number of PreSh Hits collected:............ ";
1638 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillHCal";
1642 eventout =
"\nGathering info:";
1646 if (!theCaloGeometry.isValid()) {
1647 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CaloGeometryRecord in event!";
1653 edm::PCaloHitContainer::const_iterator itHit;
1661 if (!HCalContainer.
isValid()) {
1668 for (itHit = HCalContainer->begin(); itHit != HCalContainer->end(); ++itHit) {
1672 DetId theDetUnitId(itHit->id());
1683 edm::LogWarning(MsgLoggerCat) <<
"Unable to get HcalGeometry from HCalContainer for Hit " <<
i;
1706 edm::LogWarning(MsgLoggerCat) <<
"HCal PCaloHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dHcal <<
"," 1714 eventout +=
"\n Number of HCal Hits collected:............. ";
edm::InputTag SiTECHighSrc_
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdHighSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > SiTECHighSrc_Token_
edm::InputTag SiTIDLowSrc_
T getParameter(std::string const &) const
std::vector< PCaloHit > PCaloHitContainer
~GlobalHitsProdHist() override
static const int sdMuonRPCRgnFwdn
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlHighSrc_Token_
static const int sdHcalOut
static const int sdMuonDT
edm::InputTag SiTECLowSrc_
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlLowSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBHighSrc_Token_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
Geom::Phi< T > phi() const
edm::InputTag MuonRpcSrc_
unsigned long long EventNumber_t
static const int sdEcalPS
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
static const int sdMuonRPC
edm::EDGetTokenT< edm::PSimHitContainer > MuonRpcSrc_Token_
edm::InputTag MuonCscSrc_
Provenance const * provenance() const
void fillHCal(edm::Event &, const edm::EventSetup &)
edm::InputTag SiTIBLowSrc_
T getUntrackedParameter(std::string const &, T const &) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::map< std::string, TH1F * > histMap_
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
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
void endRunProduce(edm::Run &, const edm::EventSetup &) override
edm::InputTag SiTOBHighSrc_
void produce(edm::Event &, const edm::EventSetup &) override
BranchDescription const & branchDescription() const
static const int sdEcalBrl
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
edm::EDGetTokenT< edm::SimTrackContainer > G4TrkSrc_Token_
static const int sdMuonRPCRgnFwdp
void fillTrk(edm::Event &, const edm::EventSetup &)
static const int sdMuonRPCRgnBrl
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
T perp() const
Magnitude of transverse component.
Basic3DVector unit() const
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDLowSrc_Token_
const HepMC::GenEvent * GetEvent() const
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDHighSrc_Token_
Log< level::Info, false > LogInfo
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 Plane & surface() const
The nominal surface of the GeomDet.
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_
edm::EDGetTokenT< edm::SimVertexContainer > G4VtxSrc_Token_
edm::InputTag PxlBrlHighSrc_
void fillMuon(edm::Event &, const edm::EventSetup &)
GlobalPoint getPosition(const DetId &id) const
edm::InputTag PxlBrlLowSrc_
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
edm::InputTag SiTOBLowSrc_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdLowSrc_Token_
GlobalHitsProdHist(const edm::ParameterSet &)
std::vector< SimTrack > SimTrackContainer
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
static const int sdHcalEC
edm::InputTag SiTIDHighSrc_
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.