14 fName(
""),
verbosity(0), frequency(0), vtxunit(0),
17 std::string MsgLoggerCat =
"GlobalHitsProdHist_GlobalHitsProdHist";
27 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
29 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
63 <<
"\n===============================\n"
64 <<
"Initialized as EDProducer with parameter values:\n"
65 <<
" Name = " <<
fName <<
"\n"
66 <<
" Verbosity = " << verbosity <<
"\n"
67 <<
" Frequency = " << frequency <<
"\n"
68 <<
" VtxUnit = " << vtxunit <<
"\n"
69 <<
" GetProv = " << getAllProvenances <<
"\n"
70 <<
" PrintProv = " << printProvenanceInfo <<
"\n"
71 <<
" PxlBrlLowSrc = " << PxlBrlLowSrc_.label()
72 <<
":" << PxlBrlLowSrc_.instance() <<
"\n"
73 <<
" PxlBrlHighSrc = " << PxlBrlHighSrc_.
label()
74 <<
":" << PxlBrlHighSrc_.
instance() <<
"\n"
75 <<
" PxlFwdLowSrc = " << PxlFwdLowSrc_.
label()
76 <<
":" << PxlBrlLowSrc_.instance() <<
"\n"
77 <<
" PxlFwdHighSrc = " << PxlFwdHighSrc_.
label()
78 <<
":" << PxlBrlHighSrc_.
instance() <<
"\n"
79 <<
" SiTIBLowSrc = " << SiTIBLowSrc_.
label()
80 <<
":" << SiTIBLowSrc_.
instance() <<
"\n"
81 <<
" SiTIBHighSrc = " << SiTIBHighSrc_.
label()
82 <<
":" << SiTIBHighSrc_.
instance() <<
"\n"
83 <<
" SiTOBLowSrc = " << SiTOBLowSrc_.
label()
84 <<
":" << SiTOBLowSrc_.
instance() <<
"\n"
85 <<
" SiTOBHighSrc = " << SiTOBHighSrc_.
label()
86 <<
":" << SiTOBHighSrc_.
instance() <<
"\n"
87 <<
" SiTIDLowSrc = " << SiTIDLowSrc_.
label()
88 <<
":" << SiTIDLowSrc_.
instance() <<
"\n"
89 <<
" SiTIDHighSrc = " << SiTIDHighSrc_.
label()
90 <<
":" << SiTIDHighSrc_.
instance() <<
"\n"
91 <<
" SiTECLowSrc = " << SiTECLowSrc_.
label()
92 <<
":" << SiTECLowSrc_.
instance() <<
"\n"
93 <<
" SiTECHighSrc = " << SiTECHighSrc_.
label()
94 <<
":" << SiTECHighSrc_.
instance() <<
"\n"
95 <<
" MuonCscSrc = " << MuonCscSrc_.
label()
96 <<
":" << MuonCscSrc_.
instance() <<
"\n"
97 <<
" MuonDtSrc = " << MuonDtSrc_.
label()
98 <<
":" << MuonDtSrc_.
instance() <<
"\n"
99 <<
" MuonRpcSrc = " << MuonRpcSrc_.
label()
100 <<
":" << MuonRpcSrc_.
instance() <<
"\n"
101 <<
" ECalEBSrc = " << ECalEBSrc_.
label()
102 <<
":" << ECalEBSrc_.
instance() <<
"\n"
103 <<
" ECalEESrc = " << ECalEESrc_.
label()
104 <<
":" << ECalEESrc_.
instance() <<
"\n"
105 <<
" ECalESSrc = " << ECalESSrc_.
label()
106 <<
":" << ECalESSrc_.
instance() <<
"\n"
107 <<
" HCalSrc = " << HCalSrc_.
label()
108 <<
":" << HCalSrc_.
instance() <<
"\n"
109 <<
"===============================\n";
117 sprintf(hname,
"hMCRGP1");
119 sprintf(htitle,
"RawGenParticles");
120 hMCRGP[0] =
new TH1F(hname,htitle,100,0.,5000.);
121 sprintf(hname,
"hMCRGP2");
123 hMCRGP[1] =
new TH1F(hname,htitle,100,0.,500.);
124 for (Int_t
i = 0;
i < 2; ++
i) {
125 hMCRGP[
i]->GetXaxis()->SetTitle(
"Number of Raw Generated Particles");
126 hMCRGP[
i]->GetYaxis()->SetTitle(
"Count");
130 sprintf(hname,
"hMCG4Vtx1");
132 sprintf(htitle,
"G4 Vertices");
133 hMCG4Vtx[0] =
new TH1F(hname,htitle,100,0.,50000.);
134 sprintf(hname,
"hMCG4Vtx2");
136 hMCG4Vtx[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
137 for (Int_t
i = 0;
i < 2; ++
i) {
138 hMCG4Vtx[
i]->GetXaxis()->SetTitle(
"Number of Vertices");
139 hMCG4Vtx[
i]->GetYaxis()->SetTitle(
"Count");
143 sprintf(hname,
"hMCG4Trk1");
145 sprintf(htitle,
"G4 Tracks");
146 hMCG4Trk[0] =
new TH1F(hname,htitle,150,0.,15000.);
147 sprintf(hname,
"hMCG4Trk2");
149 hMCG4Trk[1] =
new TH1F(hname,htitle,150,-0.5,99.5);
150 for (Int_t
i = 0;
i < 2; ++
i) {
151 hMCG4Trk[
i]->GetXaxis()->SetTitle(
"Number of Tracks");
152 hMCG4Trk[
i]->GetYaxis()->SetTitle(
"Count");
156 sprintf(hname,
"hGeantVtxX1");
158 sprintf(htitle,
"Geant vertex x/micrometer");
159 hGeantVtxX[0] =
new TH1F(hname,htitle,100,-8000000.,8000000.);
160 sprintf(hname,
"hGeantVtxX2");
162 hGeantVtxX[1] =
new TH1F(hname,htitle,100,-50.,50.);
163 for (Int_t
i = 0;
i < 2; ++
i) {
164 hGeantVtxX[
i]->GetXaxis()->SetTitle(
"x of Vertex (um)");
169 sprintf(hname,
"hGeantVtxY1");
171 sprintf(htitle,
"Geant vertex y/micrometer");
172 hGeantVtxY[0] =
new TH1F(hname,htitle,100,-8000000,8000000.);
173 sprintf(hname,
"hGeantVtxY2");
175 hGeantVtxY[1] =
new TH1F(hname,htitle,100,-50.,50.);
176 for (Int_t
i = 0;
i < 2; ++
i) {
177 hGeantVtxY[
i]->GetXaxis()->SetTitle(
"y of Vertex (um)");
182 sprintf(hname,
"hGeantVtxZ1");
184 sprintf(htitle,
"Geant vertex z/millimeter");
185 hGeantVtxZ[0] =
new TH1F(hname,htitle,100,-11000.,11000.);
186 sprintf(hname,
"hGeantVtxZ2");
188 hGeantVtxZ[1] =
new TH1F(hname,htitle,100,-250.,250.);
189 for (Int_t
i = 0;
i < 2; ++
i) {
190 hGeantVtxZ[
i]->GetXaxis()->SetTitle(
"z of Vertex (mm)");
195 sprintf(hname,
"hGeantTrkPt");
197 sprintf(htitle,
"Geant track pt/GeV");
199 hGeantTrkPt->GetXaxis()->SetTitle(
"pT of Track (GeV)");
203 sprintf(hname,
"hGeantTrkE");
205 sprintf(htitle,
"Geant track E/GeV");
206 hGeantTrkE =
new TH1F(hname,htitle,100,0.,5000.);
207 hGeantTrkE->GetXaxis()->SetTitle(
"E of Track (GeV)");
212 sprintf(hname,
"hCaloEcal1");
214 sprintf(htitle,
"Ecal hits");
215 hCaloEcal[0] =
new TH1F(hname,htitle,100,0.,10000.);
216 sprintf(hname,
"hCaloEcal2");
218 hCaloEcal[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
220 sprintf(hname,
"hCaloEcalE1");
222 sprintf(htitle,
"Ecal hits, energy/GeV");
223 hCaloEcalE[0] =
new TH1F(hname,htitle,100,0.,10.);
224 sprintf(hname,
"hCaloEcalE2");
226 hCaloEcalE[1] =
new TH1F(hname,htitle,100,0.,0.1);
228 sprintf(hname,
"hCaloEcalToF1");
230 sprintf(htitle,
"Ecal hits, ToF/ns");
232 sprintf(hname,
"hCaloEcalToF2");
236 for (Int_t
i = 0;
i < 2; ++
i) {
237 hCaloEcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
240 hCaloEcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
243 hCaloEcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
248 sprintf(hname,
"hCaloEcalPhi");
250 sprintf(htitle,
"Ecal hits, phi/rad");
252 hCaloEcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
256 sprintf(hname,
"hCaloEcalEta");
258 sprintf(htitle,
"Ecal hits, eta");
264 sprintf(hname,
"hCaloPreSh1");
266 sprintf(htitle,
"PreSh hits");
267 hCaloPreSh[0] =
new TH1F(hname,htitle,100,0.,10000.);
268 sprintf(hname,
"hCaloPreSh2");
270 hCaloPreSh[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
272 sprintf(hname,
"hCaloPreShE1");
274 sprintf(htitle,
"PreSh hits, energy/GeV");
275 hCaloPreShE[0] =
new TH1F(hname,htitle,100,0.,10.);
276 sprintf(hname,
"hCaloPreShE2");
278 hCaloPreShE[1] =
new TH1F(hname,htitle,100,0.,0.1);
280 sprintf(hname,
"hCaloPreShToF1");
282 sprintf(htitle,
"PreSh hits, ToF/ns");
284 sprintf(hname,
"hCaloPreShToF2");
288 for (Int_t
i = 0;
i < 2; ++
i) {
289 hCaloPreSh[
i]->GetXaxis()->SetTitle(
"Number of Hits");
292 hCaloPreShE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
295 hCaloPreShToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
300 sprintf(hname,
"hCaloPreShPhi");
302 sprintf(htitle,
"PreSh hits, phi/rad");
308 sprintf(hname,
"hCaloPreShEta");
310 sprintf(htitle,
"PreSh hits, eta");
317 sprintf(hname,
"hCaloHcal1");
319 sprintf(htitle,
"Hcal hits");
320 hCaloHcal[0] =
new TH1F(hname,htitle,100,0.,10000.);
321 sprintf(hname,
"hCaloHcal2");
323 hCaloHcal[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
325 sprintf(hname,
"hCaloHcalE1");
327 sprintf(htitle,
"Hcal hits, energy/GeV");
328 hCaloHcalE[0] =
new TH1F(hname,htitle,100,0.,10.);
329 sprintf(hname,
"hCaloHcalE2");
331 hCaloHcalE[1] =
new TH1F(hname,htitle,100,0.,0.1);
333 sprintf(hname,
"hCaloHcalToF1");
335 sprintf(htitle,
"Hcal hits, ToF/ns");
337 sprintf(hname,
"hCaloHcalToF2");
341 for (Int_t
i = 0;
i < 2; ++
i) {
342 hCaloHcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
345 hCaloHcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
348 hCaloHcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
353 sprintf(hname,
"hCaloHcalPhi");
355 sprintf(htitle,
"Hcal hits, phi/rad");
357 hCaloHcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
361 sprintf(hname,
"hCaloHcalEta");
363 sprintf(htitle,
"Hcal hits, eta");
370 sprintf(hname,
"hTrackerPx1");
372 sprintf(htitle,
"Pixel hits");
373 hTrackerPx[0] =
new TH1F(hname,htitle,100,0.,10000.);
374 sprintf(hname,
"hTrackerPx2");
376 hTrackerPx[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
377 for (Int_t
i = 0;
i < 2; ++
i) {
378 hTrackerPx[
i]->GetXaxis()->SetTitle(
"Number of Pixel Hits");
383 sprintf(hname,
"hTrackerPxPhi");
385 sprintf(htitle,
"Pixel hits phi/rad");
391 sprintf(hname,
"hTrackerPxEta");
393 sprintf(htitle,
"Pixel hits eta");
399 sprintf(hname,
"hTrackerPxBToF");
401 sprintf(htitle,
"Pixel barrel hits, ToF/ns");
403 hTrackerPxBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
407 sprintf(hname,
"hTrackerPxBR");
409 sprintf(htitle,
"Pixel barrel hits, R/cm");
415 sprintf(hname,
"hTrackerPxFToF");
417 sprintf(htitle,
"Pixel forward hits, ToF/ns");
419 hTrackerPxFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
423 sprintf(hname,
"hTrackerPxFZ");
425 sprintf(htitle,
"Pixel forward hits, Z/cm");
431 sprintf(hname,
"hTrackerSi1");
433 sprintf(htitle,
"Silicon hits");
434 hTrackerSi[0] =
new TH1F(hname,htitle,100,0.,10000.);
435 sprintf(hname,
"hTrackerSi2");
437 hTrackerSi[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
438 for (Int_t
i = 0;
i < 2; ++
i) {
439 hTrackerSi[
i]->GetXaxis()->SetTitle(
"Number of Silicon Hits");
444 sprintf(hname,
"hTrackerSiPhi");
446 sprintf(htitle,
"Silicon hits phi/rad");
452 sprintf(hname,
"hTrackerSiEta");
454 sprintf(htitle,
"Silicon hits eta");
460 sprintf(hname,
"hTrackerSiBToF");
462 sprintf(htitle,
"Silicon barrel hits, ToF/ns");
464 hTrackerSiBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
468 sprintf(hname,
"hTrackerSiBR");
470 sprintf(htitle,
"Silicon barrel hits, R/cm");
476 sprintf(hname,
"hTrackerSiFToF");
478 sprintf(htitle,
"Silicon forward hits, ToF/ns");
480 hTrackerSiFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
484 sprintf(hname,
"hTrackerSiFZ");
486 sprintf(htitle,
"Silicon forward hits, Z/cm");
493 sprintf(hname,
"hMuon1");
495 sprintf(htitle,
"Muon hits");
496 hMuon[0] =
new TH1F(hname,htitle,100,0.,10000.);
497 sprintf(hname,
"hMuon2");
499 hMuon[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
500 for (Int_t
i = 0;
i < 2; ++
i) {
501 hMuon[
i]->GetXaxis()->SetTitle(
"Number of Muon Hits");
502 hMuon[
i]->GetYaxis()->SetTitle(
"Count");
506 sprintf(hname,
"hMuonPhi");
508 sprintf(htitle,
"Muon hits phi/rad");
509 hMuonPhi =
new TH1F(hname,htitle,100,-3.2,3.2);
510 hMuonPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
511 hMuonPhi->GetYaxis()->SetTitle(
"Count");
514 sprintf(hname,
"hMuonEta");
516 sprintf(htitle,
"Muon hits eta");
517 hMuonEta =
new TH1F(hname,htitle,100,-3.5,3.5);
518 hMuonEta->GetXaxis()->SetTitle(
"Eta of Hits");
519 hMuonEta->GetYaxis()->SetTitle(
"Count");
522 sprintf(hname,
"hMuonCscToF1");
524 sprintf(htitle,
"Muon CSC hits, ToF/ns");
525 hMuonCscToF[0] =
new TH1F(hname,htitle,100,0.,250.);
526 sprintf(hname,
"hMuonCscToF2");
528 hMuonCscToF[1] =
new TH1F(hname,htitle,100,0.,50.);
529 for (Int_t
i = 0;
i < 2; ++
i) {
530 hMuonCscToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
535 sprintf(hname,
"hMuonCscZ");
537 sprintf(htitle,
"Muon CSC hits, Z/cm");
538 hMuonCscZ =
new TH1F(hname,htitle,200,-1500.,1500.);
539 hMuonCscZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
540 hMuonCscZ->GetYaxis()->SetTitle(
"Count");
543 sprintf(hname,
"hMuonDtToF1");
545 sprintf(htitle,
"Muon DT hits, ToF/ns");
546 hMuonDtToF[0] =
new TH1F(hname,htitle,100,0.,250.);
547 sprintf(hname,
"hMuonDtToF2");
549 hMuonDtToF[1] =
new TH1F(hname,htitle,100,0.,50.);
550 for (Int_t
i = 0;
i < 2; ++
i) {
551 hMuonDtToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
556 sprintf(hname,
"hMuonDtR");
558 sprintf(htitle,
"Muon DT hits, R/cm");
559 hMuonDtR =
new TH1F(hname,htitle,100,0.,1500.);
560 hMuonDtR->GetXaxis()->SetTitle(
"R of Hits (cm)");
561 hMuonDtR->GetYaxis()->SetTitle(
"Count");
564 sprintf(hname,
"hMuonRpcFToF1");
566 sprintf(htitle,
"Muon RPC forward hits, ToF/ns");
568 sprintf(hname,
"hMuonRpcFToF2");
571 for (Int_t
i = 0;
i < 2; ++
i) {
572 hMuonRpcFToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
577 sprintf(hname,
"hMuonRpcFZ");
579 sprintf(htitle,
"Muon RPC forward hits, Z/cm");
580 hMuonRpcFZ =
new TH1F(hname,htitle,201,-1500.,1500.);
581 hMuonRpcFZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
585 sprintf(hname,
"hMuonRpcBToF1");
587 sprintf(htitle,
"Muon RPC barrel hits, ToF/ns");
589 sprintf(hname,
"hMuonRpcBToF2");
592 for (Int_t
i = 0;
i < 2; ++
i) {
593 hMuonRpcBToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
598 sprintf(hname,
"hMuonRpcBR");
600 sprintf(htitle,
"Muon RPC barrel hits, R/cm");
601 hMuonRpcBR =
new TH1F(hname,htitle,100,0.,1500.);
602 hMuonRpcBR->GetXaxis()->SetTitle(
"R of Hits (cm)");
623 std::string MsgLoggerCat =
"GlobalHitsProdHist_endJob";
626 <<
"Terminating having processed " <<
count <<
" events.";
633 std::string MsgLoggerCat =
"GlobalHitsProdHist_produce";
639 int nrun = iEvent.
id().
run();
644 <<
"Processing run " << nrun <<
", event " << nevt
645 <<
" (" <<
count <<
" events total)";
649 <<
"Processing run " << nrun <<
", event " << nevt
650 <<
" (" <<
count <<
" events total)";
657 std::vector<const edm::Provenance*> AllProv;
662 <<
"Number of Provenances = " << AllProv.size();
665 TString eventout(
"\nProvenance info:\n");
667 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
668 eventout +=
"\n ******************************";
669 eventout +=
"\n Module : ";
670 eventout += AllProv[
i]->moduleLabel();
671 eventout +=
"\n ProductID : ";
672 eventout += AllProv[
i]->productID().id();
673 eventout +=
"\n ClassName : ";
674 eventout += AllProv[
i]->className();
675 eventout +=
"\n InstanceName : ";
676 eventout += AllProv[
i]->productInstanceName();
677 eventout +=
"\n BranchName : ";
678 eventout += AllProv[
i]->branchName();
680 eventout +=
"\n ******************************\n";
701 <<
"Done gathering data from event.";
709 std::string MsgLoggerCat =
"GlobalHitsProdHist_endRun";
717 <<
"\nStoring histograms.";
720 std::map<std::string, TH1F*>::iterator iter;
724 std::auto_ptr<TH1F> hist1D(iter->second);
725 eventout +=
"\n Storing histogram " +
histName_[
i];
729 eventoutw +=
"\n Unable to find histogram with name " +
histName_[
i];
745 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillG4MC";
749 eventout =
"\nGathering info:";
755 std::vector<edm::Handle<edm::HepMCProduct> > AllHepMCEvt;
760 for (
unsigned int i = 0;
i < AllHepMCEvt.size(); ++
i) {
761 HepMCEvt = AllHepMCEvt[
i];
768 <<
"Unable to find HepMCProduct in event!";
771 eventout +=
"\n Using HepMCProduct: ";
774 const HepMC::GenEvent* MCEvt = HepMCEvt->GetEvent();
778 eventout +=
"\n Number of Raw Particles collected:......... ";
795 if (!G4VtxContainer.
isValid()) {
797 <<
"Unable to find SimVertex in event!";
801 edm::SimVertexContainer::const_iterator itVtx;
802 for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end();
808 itVtx->position().y(),
809 itVtx->position().z(),
810 itVtx->position().e());
813 G4Vtx1.GetCoordinates(G4Vtx);
827 eventout +=
"\n Number of G4Vertices collected:............ ";
839 if (!G4TrkContainer.
isValid()) {
841 <<
"Unable to find SimTrack in event!";
845 edm::SimTrackContainer::const_iterator itTrk;
846 for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end();
852 itTrk->momentum().y(),
853 itTrk->momentum().z(),
854 itTrk->momentum().e());
856 G4Trk1.GetCoordinates(G4Trk);
859 Fill(
sqrt(G4Trk[0]*G4Trk[0]+G4Trk[1]*G4Trk[1]));
864 eventout +=
"\n Number of G4Tracks collected:.............. ";
882 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillTrk";
886 eventout =
"\nGathering info:";
891 if (!theTrackerGeometry.
isValid()) {
893 <<
"Unable to find TrackerDigiGeometryRecord in event!";
899 edm::PSimHitContainer::const_iterator itHit;
908 if (!PxlBrlLowContainer.
isValid()) {
910 <<
"Unable to find TrackerHitsPixelBarrelLowTof in event!";
916 if (!PxlBrlHighContainer.
isValid()) {
918 <<
"Unable to find TrackerHitsPixelBarrelHighTof in event!";
922 thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlLowContainer->begin(),
923 PxlBrlLowContainer->end());
924 thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlHighContainer->begin(),
925 PxlBrlHighContainer->end());
929 for (itHit = thePxlBrlHits.begin(); itHit != thePxlBrlHits.end(); ++itHit) {
934 DetId theDetUnitId(itHit->detUnitId());
935 int detector = theDetUnitId.
det();
936 int subdetector = theDetUnitId.subdetId();
946 <<
"Unable to get GeomDetUnit from PxlBrlHits for Hit " <<
i;
965 <<
"PxlBrl PSimHit " << i
966 <<
" is expected to be (det,subdet) = ("
968 <<
"); value returned is: ("
969 << detector <<
"," << subdetector <<
")";
975 eventout +=
"\n Number of Pixel Barrel Hits collected:..... ";
988 if (!PxlFwdLowContainer.
isValid()) {
990 <<
"Unable to find TrackerHitsPixelEndcapLowTof in event!";
996 if (!PxlFwdHighContainer.
isValid()) {
998 <<
"Unable to find TrackerHitsPixelEndcapHighTof in event!";
1002 thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdLowContainer->begin(),
1003 PxlFwdLowContainer->end());
1004 thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdHighContainer->begin(),
1005 PxlFwdHighContainer->end());
1009 for (itHit = thePxlFwdHits.begin(); itHit != thePxlFwdHits.end(); ++itHit) {
1014 DetId theDetUnitId(itHit->detUnitId());
1015 int detector = theDetUnitId.
det();
1016 int subdetector = theDetUnitId.subdetId();
1026 <<
"Unable to get GeomDetUnit from PxlFwdHits for Hit " <<
i;;
1045 <<
"PxlFwd PSimHit " << i
1046 <<
" is expected to be (det,subdet) = ("
1048 <<
"); value returned is: ("
1049 << detector <<
"," << subdetector <<
")";
1055 eventout +=
"\n Number of Pixel Forward Hits collected:.... ";
1072 if (!SiTIBLowContainer.
isValid()) {
1074 <<
"Unable to find TrackerHitsTIBLowTof in event!";
1080 if (!SiTIBHighContainer.
isValid()) {
1082 <<
"Unable to find TrackerHitsTIBHighTof in event!";
1088 if (!SiTOBLowContainer.
isValid()) {
1090 <<
"Unable to find TrackerHitsTOBLowTof in event!";
1096 if (!SiTOBHighContainer.
isValid()) {
1098 <<
"Unable to find TrackerHitsTOBHighTof in event!";
1102 theSiBrlHits.insert(theSiBrlHits.end(),SiTIBLowContainer->begin(),
1103 SiTIBLowContainer->end());
1104 theSiBrlHits.insert(theSiBrlHits.end(),SiTIBHighContainer->begin(),
1105 SiTIBHighContainer->end());
1106 theSiBrlHits.insert(theSiBrlHits.end(),SiTOBLowContainer->begin(),
1107 SiTOBLowContainer->end());
1108 theSiBrlHits.insert(theSiBrlHits.end(),SiTOBHighContainer->begin(),
1109 SiTOBHighContainer->end());
1113 for (itHit = theSiBrlHits.begin(); itHit != theSiBrlHits.end(); ++itHit) {
1118 DetId theDetUnitId(itHit->detUnitId());
1119 int detector = theDetUnitId.
det();
1120 int subdetector = theDetUnitId.subdetId();
1123 if ((detector ==
dTrk) &&
1132 <<
"Unable to get GeomDetUnit from SiBrlHits for Hit " <<
i;
1151 <<
"SiBrl PSimHit " << i
1152 <<
" is expected to be (det,subdet) = ("
1154 <<
" || " <<
sdSiTOB <<
"); value returned is: ("
1155 << detector <<
"," << subdetector <<
")";
1161 eventout +=
"\n Number of Silicon Barrel Hits collected:... ";
1174 if (!SiTIDLowContainer.
isValid()) {
1176 <<
"Unable to find TrackerHitsTIDLowTof in event!";
1182 if (!SiTIDHighContainer.
isValid()) {
1184 <<
"Unable to find TrackerHitsTIDHighTof in event!";
1190 if (!SiTECLowContainer.
isValid()) {
1192 <<
"Unable to find TrackerHitsTECLowTof in event!";
1198 if (!SiTECHighContainer.
isValid()) {
1200 <<
"Unable to find TrackerHitsTECHighTof in event!";
1204 theSiFwdHits.insert(theSiFwdHits.end(),SiTIDLowContainer->begin(),
1205 SiTIDLowContainer->end());
1206 theSiFwdHits.insert(theSiFwdHits.end(),SiTIDHighContainer->begin(),
1207 SiTIDHighContainer->end());
1208 theSiFwdHits.insert(theSiFwdHits.end(),SiTECLowContainer->begin(),
1209 SiTECLowContainer->end());
1210 theSiFwdHits.insert(theSiFwdHits.end(),SiTECHighContainer->begin(),
1211 SiTECHighContainer->end());
1215 for (itHit = theSiFwdHits.begin(); itHit != theSiFwdHits.end(); ++itHit) {
1220 DetId theDetUnitId(itHit->detUnitId());
1221 int detector = theDetUnitId.
det();
1222 int subdetector = theDetUnitId.subdetId();
1225 if ((detector ==
dTrk) &&
1234 <<
"Unable to get GeomDetUnit from SiFwdHits Hit " <<
i;
1253 <<
"SiFwd PSimHit " << i
1254 <<
" is expected to be (det,subdet) = ("
1256 <<
" || " <<
sdSiTEC <<
"); value returned is: ("
1257 << detector <<
"," << subdetector <<
")";
1263 eventout +=
"\n Number of Silicon Forward Hits collected:.. ";
1282 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillMuon";
1286 eventout =
"\nGathering info:";
1289 edm::PSimHitContainer::const_iterator itHit;
1297 if (!theCSCGeometry.
isValid()) {
1299 <<
"Unable to find MuonGeometryRecord for the CSCGeometry in event!";
1307 if (!MuonCSCContainer.
isValid()) {
1309 <<
"Unable to find MuonCSCHits in event!";
1315 for (itHit = MuonCSCContainer->begin(); itHit != MuonCSCContainer->end();
1321 DetId theDetUnitId(itHit->detUnitId());
1322 int detector = theDetUnitId.
det();
1323 int subdetector = theDetUnitId.subdetId();
1326 if ((detector ==
dMuon) &&
1334 <<
"Unable to get GeomDetUnit from theCSCMuon for hit " <<
i;
1354 <<
"MuonCsc PSimHit " << i
1355 <<
" is expected to be (det,subdet) = ("
1357 <<
"); value returned is: ("
1358 << detector <<
"," << subdetector <<
")";
1364 eventout +=
"\n Number of CSC muon Hits collected:......... ";
1376 if (!theDTGeometry.
isValid()) {
1378 <<
"Unable to find MuonGeometryRecord for the DTGeometry in event!";
1386 if (!MuonDtContainer.
isValid()) {
1388 <<
"Unable to find MuonDTHits in event!";
1394 for (itHit = MuonDtContainer->begin(); itHit != MuonDtContainer->end();
1400 DetId theDetUnitId(itHit->detUnitId());
1401 int detector = theDetUnitId.
det();
1402 int subdetector = theDetUnitId.subdetId();
1405 if ((detector ==
dMuon) &&
1410 DTWireId wireId(itHit->detUnitId());
1413 const DTLayer *theDet = theDTMuon.
layer(wireId.layerId());
1417 <<
"Unable to get GeomDetUnit from theDtMuon for hit " <<
i;
1424 const BoundPlane& bSurface = theDet->surface();
1437 <<
"MuonDt PSimHit " << i
1438 <<
" is expected to be (det,subdet) = ("
1440 <<
"); value returned is: ("
1441 << detector <<
"," << subdetector <<
")";
1447 eventout +=
"\n Number of DT muon Hits collected:.......... ";
1460 if (!theRPCGeometry.
isValid()) {
1462 <<
"Unable to find MuonGeometryRecord for the RPCGeometry in event!";
1470 if (!MuonRPCContainer.
isValid()) {
1472 <<
"Unable to find MuonRPCHits in event!";
1478 int RPCBrl =0, RPCFwd = 0;
1479 for (itHit = MuonRPCContainer->begin(); itHit != MuonRPCContainer->end();
1485 DetId theDetUnitId(itHit->detUnitId());
1486 int detector = theDetUnitId.
det();
1487 int subdetector = theDetUnitId.subdetId();
1490 if ((detector ==
dMuon) &&
1494 RPCDetId RPCId(itHit->detUnitId());
1497 int region = RPCId.
region();
1504 <<
"Unable to get GeomDetUnit from theRPCMuon for hit " <<
i;
1540 <<
"Invalid region for RPC Muon hit" <<
i;
1545 <<
"MuonRpc PSimHit " << i
1546 <<
" is expected to be (det,subdet) = ("
1548 <<
"); value returned is: ("
1549 << detector <<
"," << subdetector <<
")";
1555 eventout +=
"\n Number of RPC muon Hits collected:......... ";
1557 eventout +=
"\n RPC Barrel muon Hits:............ ";
1559 eventout +=
"\n RPC Forward muon Hits:........... ";
1566 if (
hMuon[1])
hMuon[1]->Fill((
float)nMuonHits);
1577 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillECal";
1581 eventout =
"\nGathering info:";
1586 if (!theCaloGeometry.
isValid()) {
1588 <<
"Unable to find CaloGeometryRecord in event!";
1594 edm::PCaloHitContainer::const_iterator itHit;
1605 <<
"Unable to find EcalHitsEB in event!";
1613 <<
"Unable to find EcalHitsEE in event!";
1617 theECalHits.insert(theECalHits.end(),EBContainer->begin(),
1618 EBContainer->end());
1619 theECalHits.insert(theECalHits.end(),EEContainer->begin(),
1620 EEContainer->end());
1624 for (itHit = theECalHits.begin(); itHit != theECalHits.end(); ++itHit) {
1629 DetId theDetUnitId(itHit->id());
1630 int detector = theDetUnitId.
det();
1631 int subdetector = theDetUnitId.subdetId();
1634 if ((detector ==
dEcal) &&
1640 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1644 <<
"Unable to get CaloCellGeometry from ECalHits for Hit " <<
i;
1662 <<
"ECal PCaloHit " << i
1663 <<
" is expected to be (det,subdet) = ("
1665 <<
" || " <<
sdEcalFwd <<
"); value returned is: ("
1666 << detector <<
"," << subdetector <<
")";
1672 eventout +=
"\n Number of ECal Hits collected:............. ";
1685 if (!PreShContainer.
isValid()) {
1687 <<
"Unable to find EcalHitsES in event!";
1693 for (itHit = PreShContainer->begin();
1694 itHit != PreShContainer->end(); ++itHit) {
1699 DetId theDetUnitId(itHit->id());
1700 int detector = theDetUnitId.
det();
1701 int subdetector = theDetUnitId.subdetId();
1704 if ((detector ==
dEcal) &&
1709 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1713 <<
"Unable to get CaloCellGeometry from PreShContainer for Hit "
1732 <<
"PreSh PCaloHit " << i
1733 <<
" is expected to be (det,subdet) = ("
1735 <<
"); value returned is: ("
1736 << detector <<
"," << subdetector <<
")";
1742 eventout +=
"\n Number of PreSh Hits collected:............ ";
1758 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillHCal";
1762 eventout =
"\nGathering info:";
1767 if (!theCaloGeometry.
isValid()) {
1769 <<
"Unable to find CaloGeometryRecord in event!";
1775 edm::PCaloHitContainer::const_iterator itHit;
1783 if (!HCalContainer.
isValid()) {
1785 <<
"Unable to find HCalHits in event!";
1791 for (itHit = HCalContainer->begin();
1792 itHit != HCalContainer->end(); ++itHit) {
1797 DetId theDetUnitId(itHit->id());
1798 int detector = theDetUnitId.
det();
1799 int subdetector = theDetUnitId.subdetId();
1802 if ((detector ==
dHcal) &&
1810 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1814 <<
"Unable to get CaloCellGeometry from HCalContainer for Hit " <<
i;
1832 <<
"HCal PCaloHit " << i
1833 <<
" is expected to be (det,subdet) = ("
1836 <<
"); value returned is: ("
1837 << detector <<
"," << subdetector <<
")";
1843 eventout +=
"\n Number of HCal Hits collected:............. ";
edm::InputTag SiTECHighSrc_
void getManyByType(std::vector< Handle< PROD > > &results) const
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
void getAllProvenance(std::vector< Provenance const * > &provenances) const
edm::InputTag SiTIDLowSrc_
std::map< std::string, TH1F * > histMap_
std::vector< PCaloHit > PCaloHitContainer
virtual void produce(edm::Event &, const edm::EventSetup &)
static const int sdMuonRPCRgnFwdn
static const int sdHcalOut
static const int sdMuonDT
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
edm::InputTag SiTECLowSrc_
virtual void endRun(edm::Run &, const edm::EventSetup &)
virtual void beginJob(void)
Geom::Phi< T > phi() const
edm::InputTag MuonRpcSrc_
static const int sdEcalPS
bool getByType(Handle< PROD > &result) const
static const int sdMuonRPC
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
edm::InputTag MuonCscSrc_
void fillHCal(edm::Event &, const edm::EventSetup &)
edm::InputTag SiTIBLowSrc_
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::vector< std::string > histName_
void fillG4MC(edm::Event &)
edm::InputTag PxlFwdHighSrc_
static const int sdPxlBrl
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
static const int sdMuonCSC
static const int sdEcalFwd
edm::InputTag SiTOBHighSrc_
virtual ~GlobalHitsProdHist()
static const int sdEcalBrl
BranchDescription const & product() const
static const int sdMuonRPCRgnFwdp
void fillTrk(edm::Event &, const edm::EventSetup &)
static const int sdMuonRPCRgnBrl
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag SiTIBHighSrc_
edm::InputTag PxlFwdLowSrc_
static const int sdHcalFwd
void fillECal(edm::Event &, const edm::EventSetup &)
static const int sdHcalBrl
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
T perp() const
Magnitude of transverse component.
edm::InputTag PxlBrlHighSrc_
const BoundPlane & surface() const
The nominal surface of the GeomDet.
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_
void put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
edm::InputTag SiTOBLowSrc_
Detector det() const
get the detector field from this detid
GlobalHitsProdHist(const edm::ParameterSet &)
static const int sdHcalEC
edm::InputTag SiTIDHighSrc_
Provenance const * provenance() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.