13 fName(
""),
verbosity(0), frequency(0), vtxunit(0),
14 getAllProvenances(
false), printProvenanceInfo(
false),
19 std::string MsgLoggerCat =
"GlobalHitsProdHist_GlobalHitsProdHist";
29 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
31 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
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()
74 <<
":" << PxlBrlLowSrc_.instance() <<
"\n" 75 <<
" PxlBrlHighSrc = " << PxlBrlHighSrc_.
label()
76 <<
":" << PxlBrlHighSrc_.
instance() <<
"\n" 77 <<
" PxlFwdLowSrc = " << PxlFwdLowSrc_.
label()
78 <<
":" << PxlBrlLowSrc_.instance() <<
"\n" 79 <<
" PxlFwdHighSrc = " << PxlFwdHighSrc_.
label()
80 <<
":" << PxlBrlHighSrc_.
instance() <<
"\n" 81 <<
" SiTIBLowSrc = " << SiTIBLowSrc_.
label()
82 <<
":" << SiTIBLowSrc_.
instance() <<
"\n" 83 <<
" SiTIBHighSrc = " << SiTIBHighSrc_.
label()
84 <<
":" << SiTIBHighSrc_.
instance() <<
"\n" 85 <<
" SiTOBLowSrc = " << SiTOBLowSrc_.
label()
86 <<
":" << SiTOBLowSrc_.
instance() <<
"\n" 87 <<
" SiTOBHighSrc = " << SiTOBHighSrc_.
label()
88 <<
":" << SiTOBHighSrc_.
instance() <<
"\n" 89 <<
" SiTIDLowSrc = " << SiTIDLowSrc_.
label()
90 <<
":" << SiTIDLowSrc_.
instance() <<
"\n" 91 <<
" SiTIDHighSrc = " << SiTIDHighSrc_.
label()
92 <<
":" << SiTIDHighSrc_.
instance() <<
"\n" 93 <<
" SiTECLowSrc = " << SiTECLowSrc_.
label()
94 <<
":" << SiTECLowSrc_.
instance() <<
"\n" 95 <<
" SiTECHighSrc = " << SiTECHighSrc_.
label()
96 <<
":" << SiTECHighSrc_.
instance() <<
"\n" 97 <<
" MuonCscSrc = " << MuonCscSrc_.
label()
98 <<
":" << MuonCscSrc_.
instance() <<
"\n" 99 <<
" MuonDtSrc = " << MuonDtSrc_.
label()
100 <<
":" << MuonDtSrc_.
instance() <<
"\n" 101 <<
" MuonRpcSrc = " << MuonRpcSrc_.
label()
102 <<
":" << MuonRpcSrc_.
instance() <<
"\n" 103 <<
" ECalEBSrc = " << ECalEBSrc_.
label()
104 <<
":" << ECalEBSrc_.
instance() <<
"\n" 105 <<
" ECalEESrc = " << ECalEESrc_.
label()
106 <<
":" << ECalEESrc_.
instance() <<
"\n" 107 <<
" ECalESSrc = " << ECalESSrc_.
label()
108 <<
":" << ECalESSrc_.
instance() <<
"\n" 109 <<
" HCalSrc = " << HCalSrc_.
label()
110 <<
":" << HCalSrc_.
instance() <<
"\n" 111 <<
"===============================\n";
119 sprintf(hname,
"hMCRGP1");
121 sprintf(htitle,
"RawGenParticles");
122 hMCRGP[0] =
new TH1F(hname,htitle,100,0.,5000.);
123 sprintf(hname,
"hMCRGP2");
125 hMCRGP[1] =
new TH1F(hname,htitle,100,0.,500.);
126 for (Int_t
i = 0;
i < 2; ++
i) {
127 hMCRGP[
i]->GetXaxis()->SetTitle(
"Number of Raw Generated Particles");
128 hMCRGP[
i]->GetYaxis()->SetTitle(
"Count");
132 sprintf(hname,
"hMCG4Vtx1");
134 sprintf(htitle,
"G4 Vertices");
135 hMCG4Vtx[0] =
new TH1F(hname,htitle,100,0.,50000.);
136 sprintf(hname,
"hMCG4Vtx2");
138 hMCG4Vtx[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
139 for (Int_t
i = 0;
i < 2; ++
i) {
140 hMCG4Vtx[
i]->GetXaxis()->SetTitle(
"Number of Vertices");
141 hMCG4Vtx[
i]->GetYaxis()->SetTitle(
"Count");
145 sprintf(hname,
"hMCG4Trk1");
147 sprintf(htitle,
"G4 Tracks");
148 hMCG4Trk[0] =
new TH1F(hname,htitle,150,0.,15000.);
149 sprintf(hname,
"hMCG4Trk2");
151 hMCG4Trk[1] =
new TH1F(hname,htitle,150,-0.5,99.5);
152 for (Int_t
i = 0;
i < 2; ++
i) {
153 hMCG4Trk[
i]->GetXaxis()->SetTitle(
"Number of Tracks");
154 hMCG4Trk[
i]->GetYaxis()->SetTitle(
"Count");
158 sprintf(hname,
"hGeantVtxX1");
160 sprintf(htitle,
"Geant vertex x/micrometer");
161 hGeantVtxX[0] =
new TH1F(hname,htitle,100,-8000000.,8000000.);
162 sprintf(hname,
"hGeantVtxX2");
164 hGeantVtxX[1] =
new TH1F(hname,htitle,100,-50.,50.);
165 for (Int_t
i = 0;
i < 2; ++
i) {
166 hGeantVtxX[
i]->GetXaxis()->SetTitle(
"x of Vertex (um)");
171 sprintf(hname,
"hGeantVtxY1");
173 sprintf(htitle,
"Geant vertex y/micrometer");
174 hGeantVtxY[0] =
new TH1F(hname,htitle,100,-8000000,8000000.);
175 sprintf(hname,
"hGeantVtxY2");
177 hGeantVtxY[1] =
new TH1F(hname,htitle,100,-50.,50.);
178 for (Int_t
i = 0;
i < 2; ++
i) {
179 hGeantVtxY[
i]->GetXaxis()->SetTitle(
"y of Vertex (um)");
184 sprintf(hname,
"hGeantVtxZ1");
186 sprintf(htitle,
"Geant vertex z/millimeter");
187 hGeantVtxZ[0] =
new TH1F(hname,htitle,100,-11000.,11000.);
188 sprintf(hname,
"hGeantVtxZ2");
190 hGeantVtxZ[1] =
new TH1F(hname,htitle,100,-250.,250.);
191 for (Int_t
i = 0;
i < 2; ++
i) {
192 hGeantVtxZ[
i]->GetXaxis()->SetTitle(
"z of Vertex (mm)");
197 sprintf(hname,
"hGeantTrkPt");
199 sprintf(htitle,
"Geant track pt/GeV");
201 hGeantTrkPt->GetXaxis()->SetTitle(
"pT of Track (GeV)");
205 sprintf(hname,
"hGeantTrkE");
207 sprintf(htitle,
"Geant track E/GeV");
208 hGeantTrkE =
new TH1F(hname,htitle,100,0.,5000.);
209 hGeantTrkE->GetXaxis()->SetTitle(
"E of Track (GeV)");
214 sprintf(hname,
"hCaloEcal1");
216 sprintf(htitle,
"Ecal hits");
217 hCaloEcal[0] =
new TH1F(hname,htitle,100,0.,10000.);
218 sprintf(hname,
"hCaloEcal2");
220 hCaloEcal[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
222 sprintf(hname,
"hCaloEcalE1");
224 sprintf(htitle,
"Ecal hits, energy/GeV");
225 hCaloEcalE[0] =
new TH1F(hname,htitle,100,0.,10.);
226 sprintf(hname,
"hCaloEcalE2");
228 hCaloEcalE[1] =
new TH1F(hname,htitle,100,0.,0.1);
230 sprintf(hname,
"hCaloEcalToF1");
232 sprintf(htitle,
"Ecal hits, ToF/ns");
234 sprintf(hname,
"hCaloEcalToF2");
238 for (Int_t
i = 0;
i < 2; ++
i) {
239 hCaloEcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
242 hCaloEcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
245 hCaloEcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
250 sprintf(hname,
"hCaloEcalPhi");
252 sprintf(htitle,
"Ecal hits, phi/rad");
254 hCaloEcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
258 sprintf(hname,
"hCaloEcalEta");
260 sprintf(htitle,
"Ecal hits, eta");
266 sprintf(hname,
"hCaloPreSh1");
268 sprintf(htitle,
"PreSh hits");
269 hCaloPreSh[0] =
new TH1F(hname,htitle,100,0.,10000.);
270 sprintf(hname,
"hCaloPreSh2");
272 hCaloPreSh[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
274 sprintf(hname,
"hCaloPreShE1");
276 sprintf(htitle,
"PreSh hits, energy/GeV");
277 hCaloPreShE[0] =
new TH1F(hname,htitle,100,0.,10.);
278 sprintf(hname,
"hCaloPreShE2");
280 hCaloPreShE[1] =
new TH1F(hname,htitle,100,0.,0.1);
282 sprintf(hname,
"hCaloPreShToF1");
284 sprintf(htitle,
"PreSh hits, ToF/ns");
286 sprintf(hname,
"hCaloPreShToF2");
290 for (Int_t
i = 0;
i < 2; ++
i) {
291 hCaloPreSh[
i]->GetXaxis()->SetTitle(
"Number of Hits");
294 hCaloPreShE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
297 hCaloPreShToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
302 sprintf(hname,
"hCaloPreShPhi");
304 sprintf(htitle,
"PreSh hits, phi/rad");
310 sprintf(hname,
"hCaloPreShEta");
312 sprintf(htitle,
"PreSh hits, eta");
319 sprintf(hname,
"hCaloHcal1");
321 sprintf(htitle,
"Hcal hits");
322 hCaloHcal[0] =
new TH1F(hname,htitle,100,0.,10000.);
323 sprintf(hname,
"hCaloHcal2");
325 hCaloHcal[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
327 sprintf(hname,
"hCaloHcalE1");
329 sprintf(htitle,
"Hcal hits, energy/GeV");
330 hCaloHcalE[0] =
new TH1F(hname,htitle,100,0.,10.);
331 sprintf(hname,
"hCaloHcalE2");
333 hCaloHcalE[1] =
new TH1F(hname,htitle,100,0.,0.1);
335 sprintf(hname,
"hCaloHcalToF1");
337 sprintf(htitle,
"Hcal hits, ToF/ns");
339 sprintf(hname,
"hCaloHcalToF2");
343 for (Int_t
i = 0;
i < 2; ++
i) {
344 hCaloHcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
347 hCaloHcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
350 hCaloHcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
355 sprintf(hname,
"hCaloHcalPhi");
357 sprintf(htitle,
"Hcal hits, phi/rad");
359 hCaloHcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
363 sprintf(hname,
"hCaloHcalEta");
365 sprintf(htitle,
"Hcal hits, eta");
372 sprintf(hname,
"hTrackerPx1");
374 sprintf(htitle,
"Pixel hits");
375 hTrackerPx[0] =
new TH1F(hname,htitle,100,0.,10000.);
376 sprintf(hname,
"hTrackerPx2");
378 hTrackerPx[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
379 for (Int_t
i = 0;
i < 2; ++
i) {
380 hTrackerPx[
i]->GetXaxis()->SetTitle(
"Number of Pixel Hits");
385 sprintf(hname,
"hTrackerPxPhi");
387 sprintf(htitle,
"Pixel hits phi/rad");
393 sprintf(hname,
"hTrackerPxEta");
395 sprintf(htitle,
"Pixel hits eta");
401 sprintf(hname,
"hTrackerPxBToF");
403 sprintf(htitle,
"Pixel barrel hits, ToF/ns");
405 hTrackerPxBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
409 sprintf(hname,
"hTrackerPxBR");
411 sprintf(htitle,
"Pixel barrel hits, R/cm");
417 sprintf(hname,
"hTrackerPxFToF");
419 sprintf(htitle,
"Pixel forward hits, ToF/ns");
421 hTrackerPxFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
425 sprintf(hname,
"hTrackerPxFZ");
427 sprintf(htitle,
"Pixel forward hits, Z/cm");
433 sprintf(hname,
"hTrackerSi1");
435 sprintf(htitle,
"Silicon hits");
436 hTrackerSi[0] =
new TH1F(hname,htitle,100,0.,10000.);
437 sprintf(hname,
"hTrackerSi2");
439 hTrackerSi[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
440 for (Int_t
i = 0;
i < 2; ++
i) {
441 hTrackerSi[
i]->GetXaxis()->SetTitle(
"Number of Silicon Hits");
446 sprintf(hname,
"hTrackerSiPhi");
448 sprintf(htitle,
"Silicon hits phi/rad");
454 sprintf(hname,
"hTrackerSiEta");
456 sprintf(htitle,
"Silicon hits eta");
462 sprintf(hname,
"hTrackerSiBToF");
464 sprintf(htitle,
"Silicon barrel hits, ToF/ns");
466 hTrackerSiBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
470 sprintf(hname,
"hTrackerSiBR");
472 sprintf(htitle,
"Silicon barrel hits, R/cm");
478 sprintf(hname,
"hTrackerSiFToF");
480 sprintf(htitle,
"Silicon forward hits, ToF/ns");
482 hTrackerSiFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
486 sprintf(hname,
"hTrackerSiFZ");
488 sprintf(htitle,
"Silicon forward hits, Z/cm");
495 sprintf(hname,
"hMuon1");
497 sprintf(htitle,
"Muon hits");
498 hMuon[0] =
new TH1F(hname,htitle,100,0.,10000.);
499 sprintf(hname,
"hMuon2");
501 hMuon[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
502 for (Int_t
i = 0;
i < 2; ++
i) {
503 hMuon[
i]->GetXaxis()->SetTitle(
"Number of Muon Hits");
504 hMuon[
i]->GetYaxis()->SetTitle(
"Count");
508 sprintf(hname,
"hMuonPhi");
510 sprintf(htitle,
"Muon hits phi/rad");
511 hMuonPhi =
new TH1F(hname,htitle,100,-3.2,3.2);
512 hMuonPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
513 hMuonPhi->GetYaxis()->SetTitle(
"Count");
516 sprintf(hname,
"hMuonEta");
518 sprintf(htitle,
"Muon hits eta");
519 hMuonEta =
new TH1F(hname,htitle,100,-3.5,3.5);
520 hMuonEta->GetXaxis()->SetTitle(
"Eta of Hits");
521 hMuonEta->GetYaxis()->SetTitle(
"Count");
524 sprintf(hname,
"hMuonCscToF1");
526 sprintf(htitle,
"Muon CSC hits, ToF/ns");
527 hMuonCscToF[0] =
new TH1F(hname,htitle,100,0.,250.);
528 sprintf(hname,
"hMuonCscToF2");
530 hMuonCscToF[1] =
new TH1F(hname,htitle,100,0.,50.);
531 for (Int_t
i = 0;
i < 2; ++
i) {
532 hMuonCscToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
537 sprintf(hname,
"hMuonCscZ");
539 sprintf(htitle,
"Muon CSC hits, Z/cm");
540 hMuonCscZ =
new TH1F(hname,htitle,200,-1500.,1500.);
541 hMuonCscZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
542 hMuonCscZ->GetYaxis()->SetTitle(
"Count");
545 sprintf(hname,
"hMuonDtToF1");
547 sprintf(htitle,
"Muon DT hits, ToF/ns");
548 hMuonDtToF[0] =
new TH1F(hname,htitle,100,0.,250.);
549 sprintf(hname,
"hMuonDtToF2");
551 hMuonDtToF[1] =
new TH1F(hname,htitle,100,0.,50.);
552 for (Int_t
i = 0;
i < 2; ++
i) {
553 hMuonDtToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
558 sprintf(hname,
"hMuonDtR");
560 sprintf(htitle,
"Muon DT hits, R/cm");
561 hMuonDtR =
new TH1F(hname,htitle,100,0.,1500.);
562 hMuonDtR->GetXaxis()->SetTitle(
"R of Hits (cm)");
563 hMuonDtR->GetYaxis()->SetTitle(
"Count");
566 sprintf(hname,
"hMuonRpcFToF1");
568 sprintf(htitle,
"Muon RPC forward hits, ToF/ns");
570 sprintf(hname,
"hMuonRpcFToF2");
573 for (Int_t
i = 0;
i < 2; ++
i) {
574 hMuonRpcFToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
579 sprintf(hname,
"hMuonRpcFZ");
581 sprintf(htitle,
"Muon RPC forward hits, Z/cm");
582 hMuonRpcFZ =
new TH1F(hname,htitle,201,-1500.,1500.);
583 hMuonRpcFZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
587 sprintf(hname,
"hMuonRpcBToF1");
589 sprintf(htitle,
"Muon RPC barrel hits, ToF/ns");
591 sprintf(hname,
"hMuonRpcBToF2");
594 for (Int_t
i = 0;
i < 2; ++
i) {
595 hMuonRpcBToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
600 sprintf(hname,
"hMuonRpcBR");
602 sprintf(htitle,
"Muon RPC barrel hits, R/cm");
603 hMuonRpcBR =
new TH1F(hname,htitle,100,0.,1500.);
604 hMuonRpcBR->GetXaxis()->SetTitle(
"R of Hits (cm)");
625 std::string MsgLoggerCat =
"GlobalHitsProdHist_endJob";
628 <<
"Terminating having processed " <<
count <<
" events.";
635 std::string MsgLoggerCat =
"GlobalHitsProdHist_produce";
646 <<
"Processing run " << nrun <<
", event " << nevt
647 <<
" (" <<
count <<
" events total)";
651 <<
"Processing run " << nrun <<
", event " << nevt
652 <<
" (" <<
count <<
" events total)";
659 std::vector<const edm::StableProvenance*> AllProv;
664 <<
"Number of Provenances = " << AllProv.size();
667 TString eventout(
"\nProvenance info:\n");
669 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
670 eventout +=
"\n ******************************";
671 eventout +=
"\n Module : ";
672 eventout += AllProv[
i]->moduleLabel();
673 eventout +=
"\n ProductID : ";
674 eventout += AllProv[
i]->productID().id();
675 eventout +=
"\n ClassName : ";
676 eventout += AllProv[
i]->className();
677 eventout +=
"\n InstanceName : ";
678 eventout += AllProv[
i]->productInstanceName();
679 eventout +=
"\n BranchName : ";
680 eventout += AllProv[
i]->branchName();
682 eventout +=
"\n ******************************\n";
703 <<
"Done gathering data from event.";
711 std::string MsgLoggerCat =
"GlobalHitsProdHist_endRun";
715 bool warning =
false;
719 <<
"\nStoring histograms.";
722 std::map<std::string, TH1F*>::iterator iter;
726 std::unique_ptr<TH1F> hist1D(iter->second);
727 eventout +=
"\n Storing histogram " +
histName_[
i];
731 eventoutw +=
"\n Unable to find histogram with name " +
histName_[
i];
747 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillG4MC";
751 eventout =
"\nGathering info:";
757 std::vector<edm::Handle<edm::HepMCProduct> > AllHepMCEvt;
762 for (
unsigned int i = 0;
i < AllHepMCEvt.size(); ++
i) {
763 HepMCEvt = AllHepMCEvt[
i];
770 <<
"Unable to find HepMCProduct in event!";
773 eventout +=
"\n Using HepMCProduct: ";
780 eventout +=
"\n Number of Raw Particles collected:......... ";
797 if (!G4VtxContainer.
isValid()) {
799 <<
"Unable to find SimVertex in event!";
803 edm::SimVertexContainer::const_iterator itVtx;
804 for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end();
810 itVtx->position().y(),
811 itVtx->position().z(),
812 itVtx->position().e());
815 G4Vtx1.GetCoordinates(G4Vtx);
829 eventout +=
"\n Number of G4Vertices collected:............ ";
841 if (!G4TrkContainer.
isValid()) {
843 <<
"Unable to find SimTrack in event!";
847 edm::SimTrackContainer::const_iterator itTrk;
848 for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end();
854 itTrk->momentum().y(),
855 itTrk->momentum().z(),
856 itTrk->momentum().e());
858 G4Trk1.GetCoordinates(G4Trk);
861 Fill(
sqrt(G4Trk[0]*G4Trk[0]+G4Trk[1]*G4Trk[1]));
866 eventout +=
"\n Number of G4Tracks collected:.............. ";
884 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillTrk";
888 eventout =
"\nGathering info:";
893 if (!theTrackerGeometry.
isValid()) {
895 <<
"Unable to find TrackerDigiGeometryRecord in event!";
901 edm::PSimHitContainer::const_iterator itHit;
910 if (!PxlBrlLowContainer.
isValid()) {
912 <<
"Unable to find TrackerHitsPixelBarrelLowTof in event!";
918 if (!PxlBrlHighContainer.
isValid()) {
920 <<
"Unable to find TrackerHitsPixelBarrelHighTof in event!";
924 thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlLowContainer->begin(),
925 PxlBrlLowContainer->end());
926 thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlHighContainer->begin(),
927 PxlBrlHighContainer->end());
931 for (itHit = thePxlBrlHits.begin(); itHit != thePxlBrlHits.end(); ++itHit) {
936 DetId theDetUnitId(itHit->detUnitId());
948 <<
"Unable to get GeomDetUnit from PxlBrlHits for Hit " <<
i;
967 <<
"PxlBrl PSimHit " << i
968 <<
" is expected to be (det,subdet) = (" 970 <<
"); value returned is: (" 971 << detector <<
"," << subdetector <<
")";
977 eventout +=
"\n Number of Pixel Barrel Hits collected:..... ";
990 if (!PxlFwdLowContainer.
isValid()) {
992 <<
"Unable to find TrackerHitsPixelEndcapLowTof in event!";
998 if (!PxlFwdHighContainer.
isValid()) {
1000 <<
"Unable to find TrackerHitsPixelEndcapHighTof in event!";
1004 thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdLowContainer->begin(),
1005 PxlFwdLowContainer->end());
1006 thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdHighContainer->begin(),
1007 PxlFwdHighContainer->end());
1011 for (itHit = thePxlFwdHits.begin(); itHit != thePxlFwdHits.end(); ++itHit) {
1016 DetId theDetUnitId(itHit->detUnitId());
1028 <<
"Unable to get GeomDetUnit from PxlFwdHits for Hit " <<
i;;
1039 hTrackerPxFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1047 <<
"PxlFwd PSimHit " << i
1048 <<
" is expected to be (det,subdet) = (" 1050 <<
"); value returned is: (" 1051 << detector <<
"," << subdetector <<
")";
1057 eventout +=
"\n Number of Pixel Forward Hits collected:.... ";
1074 if (!SiTIBLowContainer.
isValid()) {
1076 <<
"Unable to find TrackerHitsTIBLowTof in event!";
1082 if (!SiTIBHighContainer.
isValid()) {
1084 <<
"Unable to find TrackerHitsTIBHighTof in event!";
1090 if (!SiTOBLowContainer.
isValid()) {
1092 <<
"Unable to find TrackerHitsTOBLowTof in event!";
1098 if (!SiTOBHighContainer.
isValid()) {
1100 <<
"Unable to find TrackerHitsTOBHighTof in event!";
1104 theSiBrlHits.insert(theSiBrlHits.end(),SiTIBLowContainer->begin(),
1105 SiTIBLowContainer->end());
1106 theSiBrlHits.insert(theSiBrlHits.end(),SiTIBHighContainer->begin(),
1107 SiTIBHighContainer->end());
1108 theSiBrlHits.insert(theSiBrlHits.end(),SiTOBLowContainer->begin(),
1109 SiTOBLowContainer->end());
1110 theSiBrlHits.insert(theSiBrlHits.end(),SiTOBHighContainer->begin(),
1111 SiTOBHighContainer->end());
1115 for (itHit = theSiBrlHits.begin(); itHit != theSiBrlHits.end(); ++itHit) {
1120 DetId theDetUnitId(itHit->detUnitId());
1125 if ((detector ==
dTrk) &&
1134 <<
"Unable to get GeomDetUnit from SiBrlHits for Hit " <<
i;
1153 <<
"SiBrl PSimHit " << i
1154 <<
" is expected to be (det,subdet) = (" 1156 <<
" || " <<
sdSiTOB <<
"); value returned is: (" 1157 << detector <<
"," << subdetector <<
")";
1163 eventout +=
"\n Number of Silicon Barrel Hits collected:... ";
1176 if (!SiTIDLowContainer.
isValid()) {
1178 <<
"Unable to find TrackerHitsTIDLowTof in event!";
1184 if (!SiTIDHighContainer.
isValid()) {
1186 <<
"Unable to find TrackerHitsTIDHighTof in event!";
1192 if (!SiTECLowContainer.
isValid()) {
1194 <<
"Unable to find TrackerHitsTECLowTof in event!";
1200 if (!SiTECHighContainer.
isValid()) {
1202 <<
"Unable to find TrackerHitsTECHighTof in event!";
1206 theSiFwdHits.insert(theSiFwdHits.end(),SiTIDLowContainer->begin(),
1207 SiTIDLowContainer->end());
1208 theSiFwdHits.insert(theSiFwdHits.end(),SiTIDHighContainer->begin(),
1209 SiTIDHighContainer->end());
1210 theSiFwdHits.insert(theSiFwdHits.end(),SiTECLowContainer->begin(),
1211 SiTECLowContainer->end());
1212 theSiFwdHits.insert(theSiFwdHits.end(),SiTECHighContainer->begin(),
1213 SiTECHighContainer->end());
1217 for (itHit = theSiFwdHits.begin(); itHit != theSiFwdHits.end(); ++itHit) {
1222 DetId theDetUnitId(itHit->detUnitId());
1227 if ((detector ==
dTrk) &&
1236 <<
"Unable to get GeomDetUnit from SiFwdHits Hit " <<
i;
1247 hTrackerSiFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1255 <<
"SiFwd PSimHit " << i
1256 <<
" is expected to be (det,subdet) = (" 1258 <<
" || " <<
sdSiTEC <<
"); value returned is: (" 1259 << detector <<
"," << subdetector <<
")";
1265 eventout +=
"\n Number of Silicon Forward Hits collected:.. ";
1284 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillMuon";
1288 eventout =
"\nGathering info:";
1291 edm::PSimHitContainer::const_iterator itHit;
1299 if (!theCSCGeometry.
isValid()) {
1301 <<
"Unable to find MuonGeometryRecord for the CSCGeometry in event!";
1309 if (!MuonCSCContainer.
isValid()) {
1311 <<
"Unable to find MuonCSCHits in event!";
1317 for (itHit = MuonCSCContainer->begin(); itHit != MuonCSCContainer->end();
1323 DetId theDetUnitId(itHit->detUnitId());
1328 if ((detector ==
dMuon) &&
1336 <<
"Unable to get GeomDetUnit from theCSCMuon for hit " <<
i;
1348 hMuonCscZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1350 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1352 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1356 <<
"MuonCsc PSimHit " << i
1357 <<
" is expected to be (det,subdet) = (" 1359 <<
"); value returned is: (" 1360 << detector <<
"," << subdetector <<
")";
1366 eventout +=
"\n Number of CSC muon Hits collected:......... ";
1378 if (!theDTGeometry.
isValid()) {
1380 <<
"Unable to find MuonGeometryRecord for the DTGeometry in event!";
1388 if (!MuonDtContainer.
isValid()) {
1390 <<
"Unable to find MuonDTHits in event!";
1396 for (itHit = MuonDtContainer->begin(); itHit != MuonDtContainer->end();
1402 DetId theDetUnitId(itHit->detUnitId());
1407 if ((detector ==
dMuon) &&
1412 DTWireId wireId(itHit->detUnitId());
1415 const DTLayer *theDet = theDTMuon.
layer(wireId.layerId());
1419 <<
"Unable to get GeomDetUnit from theDtMuon for hit " <<
i;
1426 const BoundPlane& bSurface = theDet->surface();
1431 hMuonDtR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1433 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1435 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1439 <<
"MuonDt PSimHit " << i
1440 <<
" is expected to be (det,subdet) = (" 1442 <<
"); value returned is: (" 1443 << detector <<
"," << subdetector <<
")";
1449 eventout +=
"\n Number of DT muon Hits collected:.......... ";
1462 if (!theRPCGeometry.
isValid()) {
1464 <<
"Unable to find MuonGeometryRecord for the RPCGeometry in event!";
1472 if (!MuonRPCContainer.
isValid()) {
1474 <<
"Unable to find MuonRPCHits in event!";
1480 int RPCBrl =0, RPCFwd = 0;
1481 for (itHit = MuonRPCContainer->begin(); itHit != MuonRPCContainer->end();
1487 DetId theDetUnitId(itHit->detUnitId());
1492 if ((detector ==
dMuon) &&
1496 RPCDetId RPCId(itHit->detUnitId());
1499 int region = RPCId.
region();
1506 <<
"Unable to get GeomDetUnit from theRPCMuon for hit " <<
i;
1522 hMuonRpcFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1524 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1526 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1534 hMuonRpcBR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1536 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1538 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1542 <<
"Invalid region for RPC Muon hit" <<
i;
1547 <<
"MuonRpc PSimHit " << i
1548 <<
" is expected to be (det,subdet) = (" 1550 <<
"); value returned is: (" 1551 << detector <<
"," << subdetector <<
")";
1557 eventout +=
"\n Number of RPC muon Hits collected:......... ";
1559 eventout +=
"\n RPC Barrel muon Hits:............ ";
1561 eventout +=
"\n RPC Forward muon Hits:........... ";
1568 if (
hMuon[1])
hMuon[1]->Fill((
float)nMuonHits);
1579 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillECal";
1583 eventout =
"\nGathering info:";
1588 if (!theCaloGeometry.
isValid()) {
1590 <<
"Unable to find CaloGeometryRecord in event!";
1596 edm::PCaloHitContainer::const_iterator itHit;
1607 <<
"Unable to find EcalHitsEB in event!";
1615 <<
"Unable to find EcalHitsEE in event!";
1619 theECalHits.insert(theECalHits.end(),EBContainer->begin(),
1620 EBContainer->end());
1621 theECalHits.insert(theECalHits.end(),EEContainer->begin(),
1622 EEContainer->end());
1626 for (itHit = theECalHits.begin(); itHit != theECalHits.end(); ++itHit) {
1631 DetId theDetUnitId(itHit->id());
1636 if ((detector ==
dEcal) &&
1642 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1646 <<
"Unable to get CaloCellGeometry from ECalHits for Hit " <<
i;
1664 <<
"ECal PCaloHit " << i
1665 <<
" is expected to be (det,subdet) = (" 1667 <<
" || " <<
sdEcalFwd <<
"); value returned is: (" 1668 << detector <<
"," << subdetector <<
")";
1674 eventout +=
"\n Number of ECal Hits collected:............. ";
1687 if (!PreShContainer.
isValid()) {
1689 <<
"Unable to find EcalHitsES in event!";
1695 for (itHit = PreShContainer->begin();
1696 itHit != PreShContainer->end(); ++itHit) {
1701 DetId theDetUnitId(itHit->id());
1706 if ((detector ==
dEcal) &&
1711 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1715 <<
"Unable to get CaloCellGeometry from PreShContainer for Hit " 1734 <<
"PreSh PCaloHit " << i
1735 <<
" is expected to be (det,subdet) = (" 1737 <<
"); value returned is: (" 1738 << detector <<
"," << subdetector <<
")";
1744 eventout +=
"\n Number of PreSh Hits collected:............ ";
1760 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillHCal";
1764 eventout =
"\nGathering info:";
1769 if (!theCaloGeometry.
isValid()) {
1771 <<
"Unable to find CaloGeometryRecord in event!";
1777 edm::PCaloHitContainer::const_iterator itHit;
1785 if (!HCalContainer.
isValid()) {
1787 <<
"Unable to find HCalHits in event!";
1793 for (itHit = HCalContainer->begin();
1794 itHit != HCalContainer->end(); ++itHit) {
1799 DetId theDetUnitId(itHit->id());
1804 if ((detector ==
dHcal) &&
1816 <<
"Unable to get HcalGeometry from HCalContainer for Hit " <<
i;
1834 <<
"HCal PCaloHit " << i
1835 <<
" is expected to be (det,subdet) = (" 1838 <<
"); value returned is: (" 1839 << detector <<
"," << subdetector <<
")";
1845 eventout +=
"\n Number of HCal Hits collected:............. ";
edm::InputTag SiTECHighSrc_
void getManyByType(std::vector< Handle< PROD > > &results) const
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::map< std::string, TH1F * > histMap_
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_
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Geom::Phi< T > phi() const
edm::InputTag MuonRpcSrc_
unsigned long long EventNumber_t
static const int sdEcalPS
static const int sdMuonRPC
edm::EDGetTokenT< edm::PSimHitContainer > MuonRpcSrc_Token_
edm::InputTag MuonCscSrc_
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.
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
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
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 &)
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
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.