12 using CLHEP::micrometer;
13 using CLHEP::millimeter;
20 getAllProvenances(
false),
21 printProvenanceInfo(
false),
30 std::string MsgLoggerCat =
"GlobalHitsProdHist_GlobalHitsProdHist";
73 <<
"\n===============================\n" 74 <<
"Initialized as EDProducer with parameter values:\n" 75 <<
" Name = " <<
fName <<
"\n" 78 <<
" VtxUnit = " <<
vtxunit <<
"\n" 100 <<
"===============================\n";
108 sprintf(hname,
"hMCRGP1");
110 sprintf(htitle,
"RawGenParticles");
111 hMCRGP[0] =
new TH1F(hname, htitle, 100, 0., 5000.);
112 sprintf(hname,
"hMCRGP2");
114 hMCRGP[1] =
new TH1F(hname, htitle, 100, 0., 500.);
115 for (Int_t
i = 0;
i < 2; ++
i) {
116 hMCRGP[
i]->GetXaxis()->SetTitle(
"Number of Raw Generated Particles");
117 hMCRGP[
i]->GetYaxis()->SetTitle(
"Count");
121 sprintf(hname,
"hMCG4Vtx1");
123 sprintf(htitle,
"G4 Vertices");
124 hMCG4Vtx[0] =
new TH1F(hname, htitle, 100, 0., 50000.);
125 sprintf(hname,
"hMCG4Vtx2");
127 hMCG4Vtx[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
128 for (Int_t
i = 0;
i < 2; ++
i) {
129 hMCG4Vtx[
i]->GetXaxis()->SetTitle(
"Number of Vertices");
130 hMCG4Vtx[
i]->GetYaxis()->SetTitle(
"Count");
134 sprintf(hname,
"hMCG4Trk1");
136 sprintf(htitle,
"G4 Tracks");
137 hMCG4Trk[0] =
new TH1F(hname, htitle, 150, 0., 15000.);
138 sprintf(hname,
"hMCG4Trk2");
140 hMCG4Trk[1] =
new TH1F(hname, htitle, 150, -0.5, 99.5);
141 for (Int_t
i = 0;
i < 2; ++
i) {
142 hMCG4Trk[
i]->GetXaxis()->SetTitle(
"Number of Tracks");
143 hMCG4Trk[
i]->GetYaxis()->SetTitle(
"Count");
147 sprintf(hname,
"hGeantVtxX1");
149 sprintf(htitle,
"Geant vertex x/micrometer");
150 hGeantVtxX[0] =
new TH1F(hname, htitle, 100, -8000000., 8000000.);
151 sprintf(hname,
"hGeantVtxX2");
153 hGeantVtxX[1] =
new TH1F(hname, htitle, 100, -50., 50.);
154 for (Int_t
i = 0;
i < 2; ++
i) {
155 hGeantVtxX[
i]->GetXaxis()->SetTitle(
"x of Vertex (um)");
160 sprintf(hname,
"hGeantVtxY1");
162 sprintf(htitle,
"Geant vertex y/micrometer");
163 hGeantVtxY[0] =
new TH1F(hname, htitle, 100, -8000000, 8000000.);
164 sprintf(hname,
"hGeantVtxY2");
166 hGeantVtxY[1] =
new TH1F(hname, htitle, 100, -50., 50.);
167 for (Int_t
i = 0;
i < 2; ++
i) {
168 hGeantVtxY[
i]->GetXaxis()->SetTitle(
"y of Vertex (um)");
173 sprintf(hname,
"hGeantVtxZ1");
175 sprintf(htitle,
"Geant vertex z/millimeter");
176 hGeantVtxZ[0] =
new TH1F(hname, htitle, 100, -11000., 11000.);
177 sprintf(hname,
"hGeantVtxZ2");
179 hGeantVtxZ[1] =
new TH1F(hname, htitle, 100, -250., 250.);
180 for (Int_t
i = 0;
i < 2; ++
i) {
181 hGeantVtxZ[
i]->GetXaxis()->SetTitle(
"z of Vertex (mm)");
186 sprintf(hname,
"hGeantTrkPt");
188 sprintf(htitle,
"Geant track pt/GeV");
189 hGeantTrkPt =
new TH1F(hname, htitle, 100, 0., 200.);
190 hGeantTrkPt->GetXaxis()->SetTitle(
"pT of Track (GeV)");
194 sprintf(hname,
"hGeantTrkE");
196 sprintf(htitle,
"Geant track E/GeV");
197 hGeantTrkE =
new TH1F(hname, htitle, 100, 0., 5000.);
198 hGeantTrkE->GetXaxis()->SetTitle(
"E of Track (GeV)");
203 sprintf(hname,
"hCaloEcal1");
205 sprintf(htitle,
"Ecal hits");
206 hCaloEcal[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
207 sprintf(hname,
"hCaloEcal2");
209 hCaloEcal[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
211 sprintf(hname,
"hCaloEcalE1");
213 sprintf(htitle,
"Ecal hits, energy/GeV");
214 hCaloEcalE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
215 sprintf(hname,
"hCaloEcalE2");
217 hCaloEcalE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
219 sprintf(hname,
"hCaloEcalToF1");
221 sprintf(htitle,
"Ecal hits, ToF/ns");
222 hCaloEcalToF[0] =
new TH1F(hname, htitle, 100, 0., 1000.);
223 sprintf(hname,
"hCaloEcalToF2");
225 hCaloEcalToF[1] =
new TH1F(hname, htitle, 100, 0., 100.);
227 for (Int_t
i = 0;
i < 2; ++
i) {
228 hCaloEcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
231 hCaloEcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
234 hCaloEcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
239 sprintf(hname,
"hCaloEcalPhi");
241 sprintf(htitle,
"Ecal hits, phi/rad");
243 hCaloEcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
247 sprintf(hname,
"hCaloEcalEta");
249 sprintf(htitle,
"Ecal hits, eta");
255 sprintf(hname,
"hCaloPreSh1");
257 sprintf(htitle,
"PreSh hits");
258 hCaloPreSh[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
259 sprintf(hname,
"hCaloPreSh2");
261 hCaloPreSh[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
263 sprintf(hname,
"hCaloPreShE1");
265 sprintf(htitle,
"PreSh hits, energy/GeV");
266 hCaloPreShE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
267 sprintf(hname,
"hCaloPreShE2");
269 hCaloPreShE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
271 sprintf(hname,
"hCaloPreShToF1");
273 sprintf(htitle,
"PreSh hits, ToF/ns");
275 sprintf(hname,
"hCaloPreShToF2");
279 for (Int_t
i = 0;
i < 2; ++
i) {
280 hCaloPreSh[
i]->GetXaxis()->SetTitle(
"Number of Hits");
283 hCaloPreShE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
286 hCaloPreShToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
291 sprintf(hname,
"hCaloPreShPhi");
293 sprintf(htitle,
"PreSh hits, phi/rad");
299 sprintf(hname,
"hCaloPreShEta");
301 sprintf(htitle,
"PreSh hits, eta");
308 sprintf(hname,
"hCaloHcal1");
310 sprintf(htitle,
"Hcal hits");
311 hCaloHcal[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
312 sprintf(hname,
"hCaloHcal2");
314 hCaloHcal[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
316 sprintf(hname,
"hCaloHcalE1");
318 sprintf(htitle,
"Hcal hits, energy/GeV");
319 hCaloHcalE[0] =
new TH1F(hname, htitle, 100, 0., 10.);
320 sprintf(hname,
"hCaloHcalE2");
322 hCaloHcalE[1] =
new TH1F(hname, htitle, 100, 0., 0.1);
324 sprintf(hname,
"hCaloHcalToF1");
326 sprintf(htitle,
"Hcal hits, ToF/ns");
327 hCaloHcalToF[0] =
new TH1F(hname, htitle, 100, 0., 1000.);
328 sprintf(hname,
"hCaloHcalToF2");
330 hCaloHcalToF[1] =
new TH1F(hname, htitle, 100, 0., 100.);
332 for (Int_t
i = 0;
i < 2; ++
i) {
333 hCaloHcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
336 hCaloHcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
339 hCaloHcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
344 sprintf(hname,
"hCaloHcalPhi");
346 sprintf(htitle,
"Hcal hits, phi/rad");
348 hCaloHcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
352 sprintf(hname,
"hCaloHcalEta");
354 sprintf(htitle,
"Hcal hits, eta");
361 sprintf(hname,
"hTrackerPx1");
363 sprintf(htitle,
"Pixel hits");
364 hTrackerPx[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
365 sprintf(hname,
"hTrackerPx2");
367 hTrackerPx[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
368 for (Int_t
i = 0;
i < 2; ++
i) {
369 hTrackerPx[
i]->GetXaxis()->SetTitle(
"Number of Pixel Hits");
374 sprintf(hname,
"hTrackerPxPhi");
376 sprintf(htitle,
"Pixel hits phi/rad");
382 sprintf(hname,
"hTrackerPxEta");
384 sprintf(htitle,
"Pixel hits eta");
390 sprintf(hname,
"hTrackerPxBToF");
392 sprintf(htitle,
"Pixel barrel hits, ToF/ns");
394 hTrackerPxBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
398 sprintf(hname,
"hTrackerPxBR");
400 sprintf(htitle,
"Pixel barrel hits, R/cm");
406 sprintf(hname,
"hTrackerPxFToF");
408 sprintf(htitle,
"Pixel forward hits, ToF/ns");
410 hTrackerPxFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
414 sprintf(hname,
"hTrackerPxFZ");
416 sprintf(htitle,
"Pixel forward hits, Z/cm");
417 hTrackerPxFZ =
new TH1F(hname, htitle, 200, -100., 100.);
422 sprintf(hname,
"hTrackerSi1");
424 sprintf(htitle,
"Silicon hits");
425 hTrackerSi[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
426 sprintf(hname,
"hTrackerSi2");
428 hTrackerSi[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
429 for (Int_t
i = 0;
i < 2; ++
i) {
430 hTrackerSi[
i]->GetXaxis()->SetTitle(
"Number of Silicon Hits");
435 sprintf(hname,
"hTrackerSiPhi");
437 sprintf(htitle,
"Silicon hits phi/rad");
443 sprintf(hname,
"hTrackerSiEta");
445 sprintf(htitle,
"Silicon hits eta");
451 sprintf(hname,
"hTrackerSiBToF");
453 sprintf(htitle,
"Silicon barrel hits, ToF/ns");
455 hTrackerSiBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
459 sprintf(hname,
"hTrackerSiBR");
461 sprintf(htitle,
"Silicon barrel hits, R/cm");
467 sprintf(hname,
"hTrackerSiFToF");
469 sprintf(htitle,
"Silicon forward hits, ToF/ns");
471 hTrackerSiFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
475 sprintf(hname,
"hTrackerSiFZ");
477 sprintf(htitle,
"Silicon forward hits, Z/cm");
478 hTrackerSiFZ =
new TH1F(hname, htitle, 200, -300., 300.);
484 sprintf(hname,
"hMuon1");
486 sprintf(htitle,
"Muon hits");
487 hMuon[0] =
new TH1F(hname, htitle, 100, 0., 10000.);
488 sprintf(hname,
"hMuon2");
490 hMuon[1] =
new TH1F(hname, htitle, 100, -0.5, 99.5);
491 for (Int_t
i = 0;
i < 2; ++
i) {
492 hMuon[
i]->GetXaxis()->SetTitle(
"Number of Muon Hits");
493 hMuon[
i]->GetYaxis()->SetTitle(
"Count");
497 sprintf(hname,
"hMuonPhi");
499 sprintf(htitle,
"Muon hits phi/rad");
500 hMuonPhi =
new TH1F(hname, htitle, 100, -3.2, 3.2);
501 hMuonPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
502 hMuonPhi->GetYaxis()->SetTitle(
"Count");
505 sprintf(hname,
"hMuonEta");
507 sprintf(htitle,
"Muon hits eta");
508 hMuonEta =
new TH1F(hname, htitle, 100, -3.5, 3.5);
509 hMuonEta->GetXaxis()->SetTitle(
"Eta of Hits");
510 hMuonEta->GetYaxis()->SetTitle(
"Count");
513 sprintf(hname,
"hMuonCscToF1");
515 sprintf(htitle,
"Muon CSC hits, ToF/ns");
516 hMuonCscToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
517 sprintf(hname,
"hMuonCscToF2");
519 hMuonCscToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
520 for (Int_t
i = 0;
i < 2; ++
i) {
521 hMuonCscToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
526 sprintf(hname,
"hMuonCscZ");
528 sprintf(htitle,
"Muon CSC hits, Z/cm");
529 hMuonCscZ =
new TH1F(hname, htitle, 200, -1500., 1500.);
530 hMuonCscZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
531 hMuonCscZ->GetYaxis()->SetTitle(
"Count");
534 sprintf(hname,
"hMuonDtToF1");
536 sprintf(htitle,
"Muon DT hits, ToF/ns");
537 hMuonDtToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
538 sprintf(hname,
"hMuonDtToF2");
540 hMuonDtToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
541 for (Int_t
i = 0;
i < 2; ++
i) {
542 hMuonDtToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
547 sprintf(hname,
"hMuonDtR");
549 sprintf(htitle,
"Muon DT hits, R/cm");
550 hMuonDtR =
new TH1F(hname, htitle, 100, 0., 1500.);
551 hMuonDtR->GetXaxis()->SetTitle(
"R of Hits (cm)");
552 hMuonDtR->GetYaxis()->SetTitle(
"Count");
555 sprintf(hname,
"hMuonRpcFToF1");
557 sprintf(htitle,
"Muon RPC forward hits, ToF/ns");
558 hMuonRpcFToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
559 sprintf(hname,
"hMuonRpcFToF2");
561 hMuonRpcFToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
562 for (Int_t
i = 0;
i < 2; ++
i) {
563 hMuonRpcFToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
568 sprintf(hname,
"hMuonRpcFZ");
570 sprintf(htitle,
"Muon RPC forward hits, Z/cm");
571 hMuonRpcFZ =
new TH1F(hname, htitle, 201, -1500., 1500.);
572 hMuonRpcFZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
576 sprintf(hname,
"hMuonRpcBToF1");
578 sprintf(htitle,
"Muon RPC barrel hits, ToF/ns");
579 hMuonRpcBToF[0] =
new TH1F(hname, htitle, 100, 0., 250.);
580 sprintf(hname,
"hMuonRpcBToF2");
582 hMuonRpcBToF[1] =
new TH1F(hname, htitle, 100, 0., 50.);
583 for (Int_t
i = 0;
i < 2; ++
i) {
584 hMuonRpcBToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
589 sprintf(hname,
"hMuonRpcBR");
591 sprintf(htitle,
"Muon RPC barrel hits, R/cm");
592 hMuonRpcBR =
new TH1F(hname, htitle, 100, 0., 1500.);
593 hMuonRpcBR->GetXaxis()->SetTitle(
"R of Hits (cm)");
608 std::string MsgLoggerCat =
"GlobalHitsProdHist_endJob";
610 edm::LogInfo(MsgLoggerCat) <<
"Terminating having processed " <<
count <<
" events.";
615 std::string MsgLoggerCat =
"GlobalHitsProdHist_produce";
625 edm::LogInfo(MsgLoggerCat) <<
"Processing run " << nrun <<
", event " <<
nevt <<
" (" <<
count <<
" events total)";
635 std::vector<const edm::StableProvenance *> AllProv;
636 iEvent.getAllStableProvenance(AllProv);
639 edm::LogInfo(MsgLoggerCat) <<
"Number of Provenances = " << AllProv.size();
642 TString eventout(
"\nProvenance info:\n");
644 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
645 eventout +=
"\n ******************************";
646 eventout +=
"\n Module : ";
647 eventout += AllProv[
i]->moduleLabel();
648 eventout +=
"\n ProductID : ";
649 eventout += AllProv[
i]->productID().id();
650 eventout +=
"\n ClassName : ";
651 eventout += AllProv[
i]->className();
652 eventout +=
"\n InstanceName : ";
653 eventout += AllProv[
i]->productInstanceName();
654 eventout +=
"\n BranchName : ";
655 eventout += AllProv[
i]->branchName();
657 eventout +=
"\n ******************************\n";
677 edm::LogInfo(MsgLoggerCat) <<
"Done gathering data from event.";
683 std::string MsgLoggerCat =
"GlobalHitsProdHist_endRun";
693 std::map<std::string, TH1F *>::iterator iter;
697 std::unique_ptr<TH1F> hist1D(iter->second);
698 eventout +=
"\n Storing histogram " +
histName_[
i];
702 eventoutw +=
"\n Unable to find histogram with name " +
histName_[
i];
716 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillG4MC";
720 eventout =
"\nGathering info:";
726 std::vector<edm::Handle<edm::HepMCProduct>> AllHepMCEvt;
729 throw cms::Exception(
"UnsupportedFunction") <<
"GlobalHitsProdHist::fillG4MC: " 730 <<
"getManyByType has not been supported by the Framework since 2015. " 731 <<
"This module has been broken since then. Maybe it should be deleted. " 732 <<
"Another possibility is to upgrade to use GetterOfProducts instead.";
736 for (
unsigned int i = 0;
i < AllHepMCEvt.size(); ++
i) {
737 HepMCEvt = AllHepMCEvt[
i];
743 edm::LogWarning(MsgLoggerCat) <<
"Unable to find HepMCProduct in event!";
746 eventout +=
"\n Using HepMCProduct: ";
753 eventout +=
"\n Number of Raw Particles collected:......... ";
774 if (!G4VtxContainer.
isValid()) {
779 edm::SimVertexContainer::const_iterator itVtx;
780 for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end(); ++itVtx) {
784 itVtx->position().x(), itVtx->position().y(), itVtx->position().z(), itVtx->position().e());
787 G4Vtx1.GetCoordinates(G4Vtx);
806 eventout +=
"\n Number of G4Vertices collected:............ ";
820 if (!G4TrkContainer.
isValid()) {
825 edm::SimTrackContainer::const_iterator itTrk;
826 for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end(); ++itTrk) {
830 itTrk->momentum().x(), itTrk->momentum().y(), itTrk->momentum().z(), itTrk->momentum().e());
832 G4Trk1.GetCoordinates(G4Trk);
841 eventout +=
"\n Number of G4Tracks collected:.............. ";
858 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillTrk";
862 eventout =
"\nGathering info:";
866 if (!theTrackerGeometry.isValid()) {
867 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerDigiGeometryRecord in event!";
873 edm::PSimHitContainer::const_iterator itHit;
882 if (!PxlBrlLowContainer.
isValid()) {
883 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelBarrelLowTof in event!";
889 if (!PxlBrlHighContainer.
isValid()) {
890 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelBarrelHighTof in event!";
894 thePxlBrlHits.insert(thePxlBrlHits.end(), PxlBrlLowContainer->begin(), PxlBrlLowContainer->end());
895 thePxlBrlHits.insert(thePxlBrlHits.end(), PxlBrlHighContainer->begin(), PxlBrlHighContainer->end());
899 for (itHit = thePxlBrlHits.begin(); itHit != thePxlBrlHits.end(); ++itHit) {
903 DetId theDetUnitId(itHit->detUnitId());
913 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from PxlBrlHits for Hit " <<
i;
932 edm::LogWarning(MsgLoggerCat) <<
"PxlBrl PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 939 eventout +=
"\n Number of Pixel Barrel Hits collected:..... ";
952 if (!PxlFwdLowContainer.
isValid()) {
953 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsPixelEndcapLowTof in event!";
959 if (!PxlFwdHighContainer.
isValid()) {
960 edm::LogWarning(
"GlobalHitsProdHist_fillTrk") <<
"Unable to find TrackerHitsPixelEndcapHighTof in event!";
964 thePxlFwdHits.insert(thePxlFwdHits.end(), PxlFwdLowContainer->begin(), PxlFwdLowContainer->end());
965 thePxlFwdHits.insert(thePxlFwdHits.end(), PxlFwdHighContainer->begin(), PxlFwdHighContainer->end());
970 for (itHit = thePxlFwdHits.begin(); itHit != thePxlFwdHits.end(); ++itHit) {
974 DetId theDetUnitId(itHit->detUnitId());
984 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from PxlFwdHits for Hit " <<
i;
997 hTrackerPxFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1004 edm::LogWarning(MsgLoggerCat) <<
"PxlFwd PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1011 eventout +=
"\n Number of Pixel Forward Hits collected:.... ";
1030 if (!SiTIBLowContainer.
isValid()) {
1031 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIBLowTof in event!";
1037 if (!SiTIBHighContainer.
isValid()) {
1038 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIBHighTof in event!";
1044 if (!SiTOBLowContainer.
isValid()) {
1045 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTOBLowTof in event!";
1051 if (!SiTOBHighContainer.
isValid()) {
1052 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTOBHighTof in event!";
1056 theSiBrlHits.insert(theSiBrlHits.end(), SiTIBLowContainer->begin(), SiTIBLowContainer->end());
1057 theSiBrlHits.insert(theSiBrlHits.end(), SiTIBHighContainer->begin(), SiTIBHighContainer->end());
1058 theSiBrlHits.insert(theSiBrlHits.end(), SiTOBLowContainer->begin(), SiTOBLowContainer->end());
1059 theSiBrlHits.insert(theSiBrlHits.end(), SiTOBHighContainer->begin(), SiTOBHighContainer->end());
1064 for (itHit = theSiBrlHits.begin(); itHit != theSiBrlHits.end(); ++itHit) {
1068 DetId theDetUnitId(itHit->detUnitId());
1078 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from SiBrlHits for Hit " <<
i;
1097 edm::LogWarning(MsgLoggerCat) <<
"SiBrl PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1105 eventout +=
"\n Number of Silicon Barrel Hits collected:... ";
1118 if (!SiTIDLowContainer.
isValid()) {
1119 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTIDLowTof in event!";
1125 if (!SiTIDHighContainer.
isValid()) {
1126 edm::LogWarning(
"GlobalHitsProdHist_fillTrk") <<
"Unable to find TrackerHitsTIDHighTof in event!";
1132 if (!SiTECLowContainer.
isValid()) {
1133 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTECLowTof in event!";
1139 if (!SiTECHighContainer.
isValid()) {
1140 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerHitsTECHighTof in event!";
1144 theSiFwdHits.insert(theSiFwdHits.end(), SiTIDLowContainer->begin(), SiTIDLowContainer->end());
1145 theSiFwdHits.insert(theSiFwdHits.end(), SiTIDHighContainer->begin(), SiTIDHighContainer->end());
1146 theSiFwdHits.insert(theSiFwdHits.end(), SiTECLowContainer->begin(), SiTECLowContainer->end());
1147 theSiFwdHits.insert(theSiFwdHits.end(), SiTECHighContainer->begin(), SiTECHighContainer->end());
1152 for (itHit = theSiFwdHits.begin(); itHit != theSiFwdHits.end(); ++itHit) {
1156 DetId theDetUnitId(itHit->detUnitId());
1166 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from SiFwdHits Hit " <<
i;
1178 hTrackerSiFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1185 edm::LogWarning(MsgLoggerCat) <<
"SiFwd PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dTrk <<
"," 1193 eventout +=
"\n Number of Silicon Forward Hits collected:.. ";
1212 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillMuon";
1216 eventout =
"\nGathering info:";
1219 edm::PSimHitContainer::const_iterator itHit;
1226 if (!theCSCGeometry.isValid()) {
1227 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the CSCGeometry in event!";
1235 if (!MuonCSCContainer.
isValid()) {
1236 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonCSCHits in event!";
1242 for (itHit = MuonCSCContainer->begin(); itHit != MuonCSCContainer->end(); ++itHit) {
1246 DetId theDetUnitId(itHit->detUnitId());
1256 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theCSCMuon for hit " <<
i;
1270 hMuonCscZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1272 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1274 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1277 edm::LogWarning(MsgLoggerCat) <<
"MuonCsc PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1284 eventout +=
"\n Number of CSC muon Hits collected:......... ";
1295 if (!theDTGeometry.isValid()) {
1296 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the DTGeometry in event!";
1304 if (!MuonDtContainer.
isValid()) {
1305 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonDTHits in event!";
1311 for (itHit = MuonDtContainer->begin(); itHit != MuonDtContainer->end(); ++itHit) {
1315 DetId theDetUnitId(itHit->detUnitId());
1323 DTWireId wireId(itHit->detUnitId());
1326 const DTLayer *theDet = theDTMuon.
layer(wireId.layerId());
1329 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theDtMuon for hit " <<
i;
1336 const BoundPlane &bSurface = theDet->surface();
1343 hMuonDtR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1345 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1347 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1350 edm::LogWarning(MsgLoggerCat) <<
"MuonDt PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1357 eventout +=
"\n Number of DT muon Hits collected:.......... ";
1369 if (!theRPCGeometry.isValid()) {
1370 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonGeometryRecord for the RPCGeometry in event!";
1378 if (!MuonRPCContainer.
isValid()) {
1379 edm::LogWarning(MsgLoggerCat) <<
"Unable to find MuonRPCHits in event!";
1385 int RPCBrl = 0, RPCFwd = 0;
1386 for (itHit = MuonRPCContainer->begin(); itHit != MuonRPCContainer->end(); ++itHit) {
1390 DetId theDetUnitId(itHit->detUnitId());
1397 RPCDetId RPCId(itHit->detUnitId());
1400 int region = RPCId.region();
1406 edm::LogWarning(MsgLoggerCat) <<
"Unable to get GeomDetUnit from theRPCMuon for hit " <<
i;
1424 hMuonRpcFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1426 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1428 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1438 hMuonRpcBR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1440 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1442 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1449 edm::LogWarning(MsgLoggerCat) <<
"MuonRpc PSimHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dMuon <<
"," 1456 eventout +=
"\n Number of RPC muon Hits collected:......... ";
1458 eventout +=
"\n RPC Barrel muon Hits:............ ";
1460 eventout +=
"\n RPC Forward muon Hits:........... ";
1478 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillECal";
1482 eventout =
"\nGathering info:";
1486 if (!theCaloGeometry.isValid()) {
1487 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CaloGeometryRecord in event!";
1493 edm::PCaloHitContainer::const_iterator itHit;
1503 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalHitsEB in event!";
1510 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalHitsEE in event!";
1514 theECalHits.insert(theECalHits.end(), EBContainer->begin(), EBContainer->end());
1515 theECalHits.insert(theECalHits.end(), EEContainer->begin(), EEContainer->end());
1519 for (itHit = theECalHits.begin(); itHit != theECalHits.end(); ++itHit) {
1523 DetId theDetUnitId(itHit->id());
1533 edm::LogWarning(MsgLoggerCat) <<
"Unable to get CaloCellGeometry from ECalHits for Hit " <<
i;
1540 const GlobalPoint &globalposition = theDet->getPosition();
1556 edm::LogWarning(MsgLoggerCat) <<
"ECal PCaloHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dEcal <<
"," 1564 eventout +=
"\n Number of ECal Hits collected:............. ";
1579 if (!PreShContainer.
isValid()) {
1580 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalHitsES in event!";
1586 for (itHit = PreShContainer->begin(); itHit != PreShContainer->end(); ++itHit) {
1590 DetId theDetUnitId(itHit->id());
1600 edm::LogWarning(MsgLoggerCat) <<
"Unable to get CaloCellGeometry from PreShContainer for Hit " <<
i;
1607 const GlobalPoint &globalposition = theDet->getPosition();
1623 edm::LogWarning(MsgLoggerCat) <<
"PreSh PCaloHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dEcal <<
"," 1630 eventout +=
"\n Number of PreSh Hits collected:............ ";
1646 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillHCal";
1650 eventout =
"\nGathering info:";
1654 if (!theCaloGeometry.isValid()) {
1655 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CaloGeometryRecord in event!";
1661 edm::PCaloHitContainer::const_iterator itHit;
1669 if (!HCalContainer.
isValid()) {
1676 for (itHit = HCalContainer->begin(); itHit != HCalContainer->end(); ++itHit) {
1680 DetId theDetUnitId(itHit->id());
1691 edm::LogWarning(MsgLoggerCat) <<
"Unable to get HcalGeometry from HCalContainer for Hit " <<
i;
1714 edm::LogWarning(MsgLoggerCat) <<
"HCal PCaloHit " <<
i <<
" is expected to be (det,subdet) = (" <<
dHcal <<
"," 1722 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.