18 getAllProvenances(
false),
19 printProvenanceInfo(
false),
28 std::string MsgLoggerCat =
"GlobalHitsProdHist_GlobalHitsProdHist";
71 <<
"\n===============================\n" 72 <<
"Initialized as EDProducer with parameter values:\n" 73 <<
" Name = " <<
fName <<
"\n" 76 <<
" VtxUnit = " <<
vtxunit <<
"\n" 98 <<
"===============================\n";
106 sprintf(hname,
"hMCRGP1");
108 sprintf(htitle,
"RawGenParticles");
109 hMCRGP[0] =
new TH1F(hname, htitle, 100, 0., 5000.);
110 sprintf(hname,
"hMCRGP2");
112 hMCRGP[1] =
new TH1F(hname, htitle, 100, 0., 500.);
113 for (Int_t
i = 0;
i < 2; ++
i) {
114 hMCRGP[
i]->GetXaxis()->SetTitle(
"Number of Raw Generated Particles");
115 hMCRGP[
i]->GetYaxis()->SetTitle(
"Count");
119 sprintf(hname,
"hMCG4Vtx1");
121 sprintf(htitle,
"G4 Vertices");
122 hMCG4Vtx[0] =
new TH1F(hname, htitle, 100, 0., 50000.);
123 sprintf(hname,
"hMCG4Vtx2");
125 hMCG4Vtx[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
126 for (Int_t
i = 0;
i < 2; ++
i) {
127 hMCG4Vtx[
i]->GetXaxis()->SetTitle(
"Number of Vertices");
128 hMCG4Vtx[
i]->GetYaxis()->SetTitle(
"Count");
132 sprintf(hname,
"hMCG4Trk1");
134 sprintf(htitle,
"G4 Tracks");
135 hMCG4Trk[0] =
new TH1F(hname, htitle, 150, 0., 15000.);
136 sprintf(hname,
"hMCG4Trk2");
138 hMCG4Trk[1] =
new TH1F(hname, htitle, 150, -0.5, 99.5);
139 for (Int_t
i = 0;
i < 2; ++
i) {
140 hMCG4Trk[
i]->GetXaxis()->SetTitle(
"Number of Tracks");
141 hMCG4Trk[
i]->GetYaxis()->SetTitle(
"Count");
145 sprintf(hname,
"hGeantVtxX1");
147 sprintf(htitle,
"Geant vertex x/micrometer");
148 hGeantVtxX[0] =
new TH1F(hname, htitle, 100, -8000000., 8000000.);
149 sprintf(hname,
"hGeantVtxX2");
151 hGeantVtxX[1] =
new TH1F(hname, htitle, 100, -50., 50.);
152 for (Int_t
i = 0;
i < 2; ++
i) {
153 hGeantVtxX[
i]->GetXaxis()->SetTitle(
"x of Vertex (um)");
158 sprintf(hname,
"hGeantVtxY1");
160 sprintf(htitle,
"Geant vertex y/micrometer");
161 hGeantVtxY[0] =
new TH1F(hname, htitle, 100, -8000000, 8000000.);
162 sprintf(hname,
"hGeantVtxY2");
164 hGeantVtxY[1] =
new TH1F(hname, htitle, 100, -50., 50.);
165 for (Int_t
i = 0;
i < 2; ++
i) {
166 hGeantVtxY[
i]->GetXaxis()->SetTitle(
"y of Vertex (um)");
171 sprintf(hname,
"hGeantVtxZ1");
173 sprintf(htitle,
"Geant vertex z/millimeter");
174 hGeantVtxZ[0] =
new TH1F(hname, htitle, 100, -11000., 11000.);
175 sprintf(hname,
"hGeantVtxZ2");
177 hGeantVtxZ[1] =
new TH1F(hname, htitle, 100, -250., 250.);
178 for (Int_t
i = 0;
i < 2; ++
i) {
179 hGeantVtxZ[
i]->GetXaxis()->SetTitle(
"z of Vertex (mm)");
184 sprintf(hname,
"hGeantTrkPt");
186 sprintf(htitle,
"Geant track pt/GeV");
187 hGeantTrkPt =
new TH1F(hname, htitle, 100, 0., 200.);
188 hGeantTrkPt->GetXaxis()->SetTitle(
"pT of Track (GeV)");
192 sprintf(hname,
"hGeantTrkE");
194 sprintf(htitle,
"Geant track E/GeV");
195 hGeantTrkE =
new TH1F(hname, htitle, 100, 0., 5000.);
196 hGeantTrkE->GetXaxis()->SetTitle(
"E of Track (GeV)");
201 sprintf(hname,
"hCaloEcal1");
203 sprintf(htitle,
"Ecal hits");
204 hCaloEcal[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
205 sprintf(hname,
"hCaloEcal2");
207 hCaloEcal[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
209 sprintf(hname,
"hCaloEcalE1");
211 sprintf(htitle,
"Ecal hits, energy/GeV");
212 hCaloEcalE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
213 sprintf(hname,
"hCaloEcalE2");
215 hCaloEcalE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
217 sprintf(hname,
"hCaloEcalToF1");
219 sprintf(htitle,
"Ecal hits, ToF/ns");
220 hCaloEcalToF[0] =
new TH1F(hname, htitle, 100, 0., 1000.);
221 sprintf(hname,
"hCaloEcalToF2");
223 hCaloEcalToF[1] =
new TH1F(hname, htitle, 100, 0., 100.);
225 for (Int_t
i = 0;
i < 2; ++
i) {
226 hCaloEcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
229 hCaloEcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
232 hCaloEcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
237 sprintf(hname,
"hCaloEcalPhi");
239 sprintf(htitle,
"Ecal hits, phi/rad");
241 hCaloEcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
245 sprintf(hname,
"hCaloEcalEta");
247 sprintf(htitle,
"Ecal hits, eta");
253 sprintf(hname,
"hCaloPreSh1");
255 sprintf(htitle,
"PreSh hits");
256 hCaloPreSh[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
257 sprintf(hname,
"hCaloPreSh2");
259 hCaloPreSh[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
261 sprintf(hname,
"hCaloPreShE1");
263 sprintf(htitle,
"PreSh hits, energy/GeV");
264 hCaloPreShE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
265 sprintf(hname,
"hCaloPreShE2");
267 hCaloPreShE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
269 sprintf(hname,
"hCaloPreShToF1");
271 sprintf(htitle,
"PreSh hits, ToF/ns");
273 sprintf(hname,
"hCaloPreShToF2");
277 for (Int_t
i = 0;
i < 2; ++
i) {
278 hCaloPreSh[
i]->GetXaxis()->SetTitle(
"Number of Hits");
281 hCaloPreShE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
284 hCaloPreShToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
289 sprintf(hname,
"hCaloPreShPhi");
291 sprintf(htitle,
"PreSh hits, phi/rad");
297 sprintf(hname,
"hCaloPreShEta");
299 sprintf(htitle,
"PreSh hits, eta");
306 sprintf(hname,
"hCaloHcal1");
308 sprintf(htitle,
"Hcal hits");
309 hCaloHcal[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
310 sprintf(hname,
"hCaloHcal2");
312 hCaloHcal[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
314 sprintf(hname,
"hCaloHcalE1");
316 sprintf(htitle,
"Hcal hits, energy/GeV");
317 hCaloHcalE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
318 sprintf(hname,
"hCaloHcalE2");
320 hCaloHcalE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
322 sprintf(hname,
"hCaloHcalToF1");
324 sprintf(htitle,
"Hcal hits, ToF/ns");
325 hCaloHcalToF[0] =
new TH1F(hname, htitle, 100, 0., 1000.);
326 sprintf(hname,
"hCaloHcalToF2");
328 hCaloHcalToF[1] =
new TH1F(hname, htitle, 100, 0., 100.);
330 for (Int_t
i = 0;
i < 2; ++
i) {
331 hCaloHcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
334 hCaloHcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
337 hCaloHcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
342 sprintf(hname,
"hCaloHcalPhi");
344 sprintf(htitle,
"Hcal hits, phi/rad");
346 hCaloHcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
350 sprintf(hname,
"hCaloHcalEta");
352 sprintf(htitle,
"Hcal hits, eta");
359 sprintf(hname,
"hTrackerPx1");
361 sprintf(htitle,
"Pixel hits");
362 hTrackerPx[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
363 sprintf(hname,
"hTrackerPx2");
365 hTrackerPx[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
366 for (Int_t
i = 0;
i < 2; ++
i) {
367 hTrackerPx[
i]->GetXaxis()->SetTitle(
"Number of Pixel Hits");
372 sprintf(hname,
"hTrackerPxPhi");
374 sprintf(htitle,
"Pixel hits phi/rad");
380 sprintf(hname,
"hTrackerPxEta");
382 sprintf(htitle,
"Pixel hits eta");
388 sprintf(hname,
"hTrackerPxBToF");
390 sprintf(htitle,
"Pixel barrel hits, ToF/ns");
392 hTrackerPxBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
396 sprintf(hname,
"hTrackerPxBR");
398 sprintf(htitle,
"Pixel barrel hits, R/cm");
404 sprintf(hname,
"hTrackerPxFToF");
406 sprintf(htitle,
"Pixel forward hits, ToF/ns");
408 hTrackerPxFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
412 sprintf(hname,
"hTrackerPxFZ");
414 sprintf(htitle,
"Pixel forward hits, Z/cm");
415 hTrackerPxFZ =
new TH1F(hname, htitle, 200, -100., 100.);
420 sprintf(hname,
"hTrackerSi1");
422 sprintf(htitle,
"Silicon hits");
423 hTrackerSi[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
424 sprintf(hname,
"hTrackerSi2");
426 hTrackerSi[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
427 for (Int_t
i = 0;
i < 2; ++
i) {
428 hTrackerSi[
i]->GetXaxis()->SetTitle(
"Number of Silicon Hits");
433 sprintf(hname,
"hTrackerSiPhi");
435 sprintf(htitle,
"Silicon hits phi/rad");
441 sprintf(hname,
"hTrackerSiEta");
443 sprintf(htitle,
"Silicon hits eta");
449 sprintf(hname,
"hTrackerSiBToF");
451 sprintf(htitle,
"Silicon barrel hits, ToF/ns");
453 hTrackerSiBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
457 sprintf(hname,
"hTrackerSiBR");
459 sprintf(htitle,
"Silicon barrel hits, R/cm");
465 sprintf(hname,
"hTrackerSiFToF");
467 sprintf(htitle,
"Silicon forward hits, ToF/ns");
469 hTrackerSiFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
473 sprintf(hname,
"hTrackerSiFZ");
475 sprintf(htitle,
"Silicon forward hits, Z/cm");
476 hTrackerSiFZ =
new TH1F(hname, htitle, 200, -300., 300.);
482 sprintf(hname,
"hMuon1");
484 sprintf(htitle,
"Muon hits");
485 hMuon[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
486 sprintf(hname,
"hMuon2");
488 hMuon[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
489 for (Int_t
i = 0;
i < 2; ++
i) {
490 hMuon[
i]->GetXaxis()->SetTitle(
"Number of Muon Hits");
491 hMuon[
i]->GetYaxis()->SetTitle(
"Count");
495 sprintf(hname,
"hMuonPhi");
497 sprintf(htitle,
"Muon hits phi/rad");
498 hMuonPhi =
new TH1F(hname, htitle, 100, -3.2, 3.2);
499 hMuonPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
500 hMuonPhi->GetYaxis()->SetTitle(
"Count");
503 sprintf(hname,
"hMuonEta");
505 sprintf(htitle,
"Muon hits eta");
506 hMuonEta =
new TH1F(hname, htitle, 100, -3.5, 3.5);
507 hMuonEta->GetXaxis()->SetTitle(
"Eta of Hits");
508 hMuonEta->GetYaxis()->SetTitle(
"Count");
511 sprintf(hname,
"hMuonCscToF1");
513 sprintf(htitle,
"Muon CSC hits, ToF/ns");
514 hMuonCscToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
515 sprintf(hname,
"hMuonCscToF2");
517 hMuonCscToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
518 for (Int_t
i = 0;
i < 2; ++
i) {
519 hMuonCscToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
524 sprintf(hname,
"hMuonCscZ");
526 sprintf(htitle,
"Muon CSC hits, Z/cm");
527 hMuonCscZ =
new TH1F(hname, htitle, 200, -1500., 1500.);
528 hMuonCscZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
529 hMuonCscZ->GetYaxis()->SetTitle(
"Count");
532 sprintf(hname,
"hMuonDtToF1");
534 sprintf(htitle,
"Muon DT hits, ToF/ns");
535 hMuonDtToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
536 sprintf(hname,
"hMuonDtToF2");
538 hMuonDtToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
539 for (Int_t
i = 0;
i < 2; ++
i) {
540 hMuonDtToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
545 sprintf(hname,
"hMuonDtR");
547 sprintf(htitle,
"Muon DT hits, R/cm");
548 hMuonDtR =
new TH1F(hname, htitle, 100, 0., 1500.);
549 hMuonDtR->GetXaxis()->SetTitle(
"R of Hits (cm)");
550 hMuonDtR->GetYaxis()->SetTitle(
"Count");
553 sprintf(hname,
"hMuonRpcFToF1");
555 sprintf(htitle,
"Muon RPC forward hits, ToF/ns");
556 hMuonRpcFToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
557 sprintf(hname,
"hMuonRpcFToF2");
559 hMuonRpcFToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
560 for (Int_t
i = 0;
i < 2; ++
i) {
561 hMuonRpcFToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
566 sprintf(hname,
"hMuonRpcFZ");
568 sprintf(htitle,
"Muon RPC forward hits, Z/cm");
569 hMuonRpcFZ =
new TH1F(hname, htitle, 201, -1500., 1500.);
570 hMuonRpcFZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
574 sprintf(hname,
"hMuonRpcBToF1");
576 sprintf(htitle,
"Muon RPC barrel hits, ToF/ns");
577 hMuonRpcBToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
578 sprintf(hname,
"hMuonRpcBToF2");
580 hMuonRpcBToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
581 for (Int_t
i = 0;
i < 2; ++
i) {
582 hMuonRpcBToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
587 sprintf(hname,
"hMuonRpcBR");
589 sprintf(htitle,
"Muon RPC barrel hits, R/cm");
590 hMuonRpcBR =
new TH1F(hname, htitle, 100, 0., 1500.);
591 hMuonRpcBR->GetXaxis()->SetTitle(
"R of Hits (cm)");
606 std::string MsgLoggerCat =
"GlobalHitsProdHist_endJob";
608 edm::LogInfo(MsgLoggerCat) <<
"Terminating having processed " <<
count <<
" events.";
613 std::string MsgLoggerCat =
"GlobalHitsProdHist_produce";
623 edm::LogInfo(MsgLoggerCat) <<
"Processing run " << nrun <<
", event " <<
nevt <<
" (" <<
count <<
" events total)";
633 std::vector<const edm::StableProvenance *> AllProv;
634 iEvent.getAllStableProvenance(AllProv);
637 edm::LogInfo(MsgLoggerCat) <<
"Number of Provenances = " << AllProv.size();
640 TString eventout(
"\nProvenance info:\n");
642 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
643 eventout +=
"\n ******************************";
644 eventout +=
"\n Module : ";
645 eventout += AllProv[
i]->moduleLabel();
646 eventout +=
"\n ProductID : ";
647 eventout += AllProv[
i]->productID().id();
648 eventout +=
"\n ClassName : ";
649 eventout += AllProv[
i]->className();
650 eventout +=
"\n InstanceName : ";
651 eventout += AllProv[
i]->productInstanceName();
652 eventout +=
"\n BranchName : ";
653 eventout += AllProv[
i]->branchName();
655 eventout +=
"\n ******************************\n";
675 edm::LogInfo(MsgLoggerCat) <<
"Done gathering data from event.";
681 std::string MsgLoggerCat =
"GlobalHitsProdHist_endRun";
691 std::map<std::string, TH1F *>::iterator iter;
695 std::unique_ptr<TH1F> hist1D(iter->second);
696 eventout +=
"\n Storing histogram " +
histName_[
i];
700 eventoutw +=
"\n Unable to find histogram with name " +
histName_[
i];
714 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillG4MC";
718 eventout =
"\nGathering info:";
724 std::vector<edm::Handle<edm::HepMCProduct>> AllHepMCEvt;
727 throw cms::Exception(
"UnsupportedFunction") <<
"GlobalHitsProdHist::fillG4MC: " 728 <<
"getManyByType has not been supported by the Framework since 2015. " 729 <<
"This module has been broken since then. Maybe it should be deleted. " 730 <<
"Another possibility is to upgrade to use GetterOfProducts instead.";
734 for (
unsigned int i = 0;
i < AllHepMCEvt.size(); ++
i) {
735 HepMCEvt = AllHepMCEvt[
i];
741 edm::LogWarning(MsgLoggerCat) <<
"Unable to find HepMCProduct in event!";
744 eventout +=
"\n Using HepMCProduct: ";
751 eventout +=
"\n Number of Raw Particles collected:......... ";
772 if (!G4VtxContainer.
isValid()) {
777 edm::SimVertexContainer::const_iterator itVtx;
778 for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end(); ++itVtx) {
782 itVtx->position().x(), itVtx->position().y(), itVtx->position().z(), itVtx->position().e());
785 G4Vtx1.GetCoordinates(G4Vtx);
804 eventout +=
"\n Number of G4Vertices collected:............ ";
818 if (!G4TrkContainer.
isValid()) {
823 edm::SimTrackContainer::const_iterator itTrk;
824 for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end(); ++itTrk) {
828 itTrk->momentum().x(), itTrk->momentum().y(), itTrk->momentum().z(), itTrk->momentum().e());
830 G4Trk1.GetCoordinates(G4Trk);
839 eventout +=
"\n Number of G4Tracks collected:.............. ";
856 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillTrk";
860 eventout =
"\nGathering info:";
864 if (!theTrackerGeometry.isValid()) {
865 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerDigiGeometryRecord in event!";
871 edm::PSimHitContainer::const_iterator itHit;
880 if (!PxlBrlLowContainer.
isValid()) {
881 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelBarrelLowTof in event!";
887 if (!PxlBrlHighContainer.
isValid()) {
888 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelBarrelHighTof in event!";
892 thePxlBrlHits.insert(thePxlBrlHits.end(), PxlBrlLowContainer->begin(), PxlBrlLowContainer->end());
893 thePxlBrlHits.insert(thePxlBrlHits.end(), PxlBrlHighContainer->begin(), PxlBrlHighContainer->end());
897 for (itHit = thePxlBrlHits.begin(); itHit != thePxlBrlHits.end(); ++itHit) {
901 DetId theDetUnitId(itHit->detUnitId());
911 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from PxlBrlHits for Hit " <<
i;
930 edm::LogWarning(MsgLoggerCat) <<
"PxlBrl PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 937 eventout +=
"\n Number of Pixel Barrel Hits collected:..... ";
950 if (!PxlFwdLowContainer.
isValid()) {
951 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelEndcapLowTof in event!";
957 if (!PxlFwdHighContainer.
isValid()) {
958 edm::LogWarning(
"GlobalHitsProdHist_fillTrk") <<
"Unable to find TrackerHitsPixelEndcapHighTof in event!";
962 thePxlFwdHits.insert(thePxlFwdHits.end(), PxlFwdLowContainer->begin(), PxlFwdLowContainer->end());
963 thePxlFwdHits.insert(thePxlFwdHits.end(), PxlFwdHighContainer->begin(), PxlFwdHighContainer->end());
968 for (itHit = thePxlFwdHits.begin(); itHit != thePxlFwdHits.end(); ++itHit) {
972 DetId theDetUnitId(itHit->detUnitId());
982 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from PxlFwdHits for Hit " <<
i;
995 hTrackerPxFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1002 edm::LogWarning(MsgLoggerCat) <<
"PxlFwd PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1009 eventout +=
"\n Number of Pixel Forward Hits collected:.... ";
1028 if (!SiTIBLowContainer.
isValid()) {
1029 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIBLowTof in event!";
1035 if (!SiTIBHighContainer.
isValid()) {
1036 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIBHighTof in event!";
1042 if (!SiTOBLowContainer.
isValid()) {
1043 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTOBLowTof in event!";
1049 if (!SiTOBHighContainer.
isValid()) {
1050 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTOBHighTof in event!";
1054 theSiBrlHits.insert(theSiBrlHits.end(), SiTIBLowContainer->begin(), SiTIBLowContainer->end());
1055 theSiBrlHits.insert(theSiBrlHits.end(), SiTIBHighContainer->begin(), SiTIBHighContainer->end());
1056 theSiBrlHits.insert(theSiBrlHits.end(), SiTOBLowContainer->begin(), SiTOBLowContainer->end());
1057 theSiBrlHits.insert(theSiBrlHits.end(), SiTOBHighContainer->begin(), SiTOBHighContainer->end());
1062 for (itHit = theSiBrlHits.begin(); itHit != theSiBrlHits.end(); ++itHit) {
1066 DetId theDetUnitId(itHit->detUnitId());
1076 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from SiBrlHits for Hit " <<
i;
1095 edm::LogWarning(MsgLoggerCat) <<
"SiBrl PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1103 eventout +=
"\n Number of Silicon Barrel Hits collected:... ";
1116 if (!SiTIDLowContainer.
isValid()) {
1117 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIDLowTof in event!";
1123 if (!SiTIDHighContainer.
isValid()) {
1124 edm::LogWarning(
"GlobalHitsProdHist_fillTrk") <<
"Unable to find TrackerHitsTIDHighTof in event!";
1130 if (!SiTECLowContainer.
isValid()) {
1131 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTECLowTof in event!";
1137 if (!SiTECHighContainer.
isValid()) {
1138 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTECHighTof in event!";
1142 theSiFwdHits.insert(theSiFwdHits.end(), SiTIDLowContainer->begin(), SiTIDLowContainer->end());
1143 theSiFwdHits.insert(theSiFwdHits.end(), SiTIDHighContainer->begin(), SiTIDHighContainer->end());
1144 theSiFwdHits.insert(theSiFwdHits.end(), SiTECLowContainer->begin(), SiTECLowContainer->end());
1145 theSiFwdHits.insert(theSiFwdHits.end(), SiTECHighContainer->begin(), SiTECHighContainer->end());
1150 for (itHit = theSiFwdHits.begin(); itHit != theSiFwdHits.end(); ++itHit) {
1154 DetId theDetUnitId(itHit->detUnitId());
1164 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from SiFwdHits Hit " <<
i;
1176 hTrackerSiFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1183 edm::LogWarning(MsgLoggerCat) <<
"SiFwd PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1191 eventout +=
"\n Number of Silicon Forward Hits collected:.. ";
1210 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillMuon";
1214 eventout =
"\nGathering info:";
1217 edm::PSimHitContainer::const_iterator itHit;
1224 if (!theCSCGeometry.isValid()) {
1225 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the CSCGeometry in event!";
1233 if (!MuonCSCContainer.
isValid()) {
1234 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonCSCHits in event!";
1240 for (itHit = MuonCSCContainer->begin(); itHit != MuonCSCContainer->end(); ++itHit) {
1244 DetId theDetUnitId(itHit->detUnitId());
1254 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theCSCMuon for hit " <<
i;
1268 hMuonCscZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1270 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1272 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1275 edm::LogWarning(MsgLoggerCat) <<
"MuonCsc PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1282 eventout +=
"\n Number of CSC muon Hits collected:......... ";
1293 if (!theDTGeometry.isValid()) {
1294 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the DTGeometry in event!";
1302 if (!MuonDtContainer.
isValid()) {
1303 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonDTHits in event!";
1309 for (itHit = MuonDtContainer->begin(); itHit != MuonDtContainer->end(); ++itHit) {
1313 DetId theDetUnitId(itHit->detUnitId());
1321 DTWireId wireId(itHit->detUnitId());
1324 const DTLayer *theDet = theDTMuon.
layer(wireId.layerId());
1327 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theDtMuon for hit " <<
i;
1334 const BoundPlane &bSurface = theDet->surface();
1341 hMuonDtR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1343 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1345 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1348 edm::LogWarning(MsgLoggerCat) <<
"MuonDt PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1355 eventout +=
"\n Number of DT muon Hits collected:.......... ";
1367 if (!theRPCGeometry.isValid()) {
1368 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the RPCGeometry in event!";
1376 if (!MuonRPCContainer.
isValid()) {
1377 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonRPCHits in event!";
1383 int RPCBrl = 0, RPCFwd = 0;
1384 for (itHit = MuonRPCContainer->begin(); itHit != MuonRPCContainer->end(); ++itHit) {
1388 DetId theDetUnitId(itHit->detUnitId());
1395 RPCDetId RPCId(itHit->detUnitId());
1398 int region = RPCId.region();
1404 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theRPCMuon for hit " <<
i;
1422 hMuonRpcFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1424 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1426 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1436 hMuonRpcBR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1438 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1440 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1447 edm::LogWarning(MsgLoggerCat) <<
"MuonRpc PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1454 eventout +=
"\n Number of RPC muon Hits collected:......... ";
1456 eventout +=
"\n RPC Barrel muon Hits:............ ";
1458 eventout +=
"\n RPC Forward muon Hits:........... ";
1476 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillECal";
1480 eventout =
"\nGathering info:";
1484 if (!theCaloGeometry.isValid()) {
1485 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CaloGeometryRecord in event!";
1491 edm::PCaloHitContainer::const_iterator itHit;
1501 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalHitsEB in event!";
1508 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalHitsEE in event!";
1512 theECalHits.insert(theECalHits.end(), EBContainer->begin(), EBContainer->end());
1513 theECalHits.insert(theECalHits.end(), EEContainer->begin(), EEContainer->end());
1517 for (itHit = theECalHits.begin(); itHit != theECalHits.end(); ++itHit) {
1521 DetId theDetUnitId(itHit->id());
1531 edm::LogWarning(MsgLoggerCat) <<
"Unable to get CaloCellGeometry from ECalHits for Hit " <<
i;
1538 const GlobalPoint &globalposition = theDet->getPosition();
1554 edm::LogWarning(MsgLoggerCat) <<
"ECal PCaloHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dEcal <<
"," 1562 eventout +=
"\n Number of ECal Hits collected:............. ";
1577 if (!PreShContainer.
isValid()) {
1578 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalHitsES in event!";
1584 for (itHit = PreShContainer->begin(); itHit != PreShContainer->end(); ++itHit) {
1588 DetId theDetUnitId(itHit->id());
1598 edm::LogWarning(MsgLoggerCat) <<
"Unable to get CaloCellGeometry from PreShContainer for Hit " <<
i;
1605 const GlobalPoint &globalposition = theDet->getPosition();
1621 edm::LogWarning(MsgLoggerCat) <<
"PreSh PCaloHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dEcal <<
"," 1628 eventout +=
"\n Number of PreSh Hits collected:............ ";
1644 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillHCal";
1648 eventout =
"\nGathering info:";
1652 if (!theCaloGeometry.isValid()) {
1653 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CaloGeometryRecord in event!";
1659 edm::PCaloHitContainer::const_iterator itHit;
1667 if (!HCalContainer.
isValid()) {
1674 for (itHit = HCalContainer->begin(); itHit != HCalContainer->end(); ++itHit) {
1678 DetId theDetUnitId(itHit->id());
1689 edm::LogWarning(MsgLoggerCat) <<
"Unable to get HcalGeometry from HCalContainer for Hit " <<
i;
1712 edm::LogWarning(MsgLoggerCat) <<
"HCal PCaloHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dHcal <<
"," 1720 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.