14 fName(
""),
verbosity(0), frequency(0), vtxunit(0),
15 getAllProvenances(
false), printProvenanceInfo(
false),
16 G4VtxSrc_(iPSet.getParameter<edm::InputTag>(
"G4VtxSrc")),
17 G4TrkSrc_(iPSet.getParameter<edm::InputTag>(
"G4TrkSrc")),
20 std::string MsgLoggerCat =
"GlobalHitsProdHist_GlobalHitsProdHist";
30 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
32 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
66 <<
"\n===============================\n"
67 <<
"Initialized as EDProducer with parameter values:\n"
68 <<
" Name = " <<
fName <<
"\n"
69 <<
" Verbosity = " << verbosity <<
"\n"
70 <<
" Frequency = " << frequency <<
"\n"
71 <<
" VtxUnit = " << vtxunit <<
"\n"
72 <<
" GetProv = " << getAllProvenances <<
"\n"
73 <<
" PrintProv = " << printProvenanceInfo <<
"\n"
74 <<
" PxlBrlLowSrc = " << PxlBrlLowSrc_.label()
75 <<
":" << PxlBrlLowSrc_.instance() <<
"\n"
76 <<
" PxlBrlHighSrc = " << PxlBrlHighSrc_.
label()
77 <<
":" << PxlBrlHighSrc_.
instance() <<
"\n"
78 <<
" PxlFwdLowSrc = " << PxlFwdLowSrc_.
label()
79 <<
":" << PxlBrlLowSrc_.instance() <<
"\n"
80 <<
" PxlFwdHighSrc = " << PxlFwdHighSrc_.
label()
81 <<
":" << PxlBrlHighSrc_.
instance() <<
"\n"
82 <<
" SiTIBLowSrc = " << SiTIBLowSrc_.
label()
83 <<
":" << SiTIBLowSrc_.
instance() <<
"\n"
84 <<
" SiTIBHighSrc = " << SiTIBHighSrc_.
label()
85 <<
":" << SiTIBHighSrc_.
instance() <<
"\n"
86 <<
" SiTOBLowSrc = " << SiTOBLowSrc_.
label()
87 <<
":" << SiTOBLowSrc_.
instance() <<
"\n"
88 <<
" SiTOBHighSrc = " << SiTOBHighSrc_.
label()
89 <<
":" << SiTOBHighSrc_.
instance() <<
"\n"
90 <<
" SiTIDLowSrc = " << SiTIDLowSrc_.
label()
91 <<
":" << SiTIDLowSrc_.
instance() <<
"\n"
92 <<
" SiTIDHighSrc = " << SiTIDHighSrc_.
label()
93 <<
":" << SiTIDHighSrc_.
instance() <<
"\n"
94 <<
" SiTECLowSrc = " << SiTECLowSrc_.
label()
95 <<
":" << SiTECLowSrc_.
instance() <<
"\n"
96 <<
" SiTECHighSrc = " << SiTECHighSrc_.
label()
97 <<
":" << SiTECHighSrc_.
instance() <<
"\n"
98 <<
" MuonCscSrc = " << MuonCscSrc_.
label()
99 <<
":" << MuonCscSrc_.
instance() <<
"\n"
100 <<
" MuonDtSrc = " << MuonDtSrc_.
label()
101 <<
":" << MuonDtSrc_.
instance() <<
"\n"
102 <<
" MuonRpcSrc = " << MuonRpcSrc_.
label()
103 <<
":" << MuonRpcSrc_.
instance() <<
"\n"
104 <<
" ECalEBSrc = " << ECalEBSrc_.
label()
105 <<
":" << ECalEBSrc_.
instance() <<
"\n"
106 <<
" ECalEESrc = " << ECalEESrc_.
label()
107 <<
":" << ECalEESrc_.
instance() <<
"\n"
108 <<
" ECalESSrc = " << ECalESSrc_.
label()
109 <<
":" << ECalESSrc_.
instance() <<
"\n"
110 <<
" HCalSrc = " << HCalSrc_.
label()
111 <<
":" << HCalSrc_.
instance() <<
"\n"
112 <<
"===============================\n";
120 sprintf(hname,
"hMCRGP1");
122 sprintf(htitle,
"RawGenParticles");
123 hMCRGP[0] =
new TH1F(hname,htitle,100,0.,5000.);
124 sprintf(hname,
"hMCRGP2");
126 hMCRGP[1] =
new TH1F(hname,htitle,100,0.,500.);
127 for (Int_t
i = 0;
i < 2; ++
i) {
128 hMCRGP[
i]->GetXaxis()->SetTitle(
"Number of Raw Generated Particles");
129 hMCRGP[
i]->GetYaxis()->SetTitle(
"Count");
133 sprintf(hname,
"hMCG4Vtx1");
135 sprintf(htitle,
"G4 Vertices");
136 hMCG4Vtx[0] =
new TH1F(hname,htitle,100,0.,50000.);
137 sprintf(hname,
"hMCG4Vtx2");
139 hMCG4Vtx[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
140 for (Int_t
i = 0;
i < 2; ++
i) {
141 hMCG4Vtx[
i]->GetXaxis()->SetTitle(
"Number of Vertices");
142 hMCG4Vtx[
i]->GetYaxis()->SetTitle(
"Count");
146 sprintf(hname,
"hMCG4Trk1");
148 sprintf(htitle,
"G4 Tracks");
149 hMCG4Trk[0] =
new TH1F(hname,htitle,150,0.,15000.);
150 sprintf(hname,
"hMCG4Trk2");
152 hMCG4Trk[1] =
new TH1F(hname,htitle,150,-0.5,99.5);
153 for (Int_t
i = 0;
i < 2; ++
i) {
154 hMCG4Trk[
i]->GetXaxis()->SetTitle(
"Number of Tracks");
155 hMCG4Trk[
i]->GetYaxis()->SetTitle(
"Count");
159 sprintf(hname,
"hGeantVtxX1");
161 sprintf(htitle,
"Geant vertex x/micrometer");
162 hGeantVtxX[0] =
new TH1F(hname,htitle,100,-8000000.,8000000.);
163 sprintf(hname,
"hGeantVtxX2");
165 hGeantVtxX[1] =
new TH1F(hname,htitle,100,-50.,50.);
166 for (Int_t
i = 0;
i < 2; ++
i) {
167 hGeantVtxX[
i]->GetXaxis()->SetTitle(
"x of Vertex (um)");
172 sprintf(hname,
"hGeantVtxY1");
174 sprintf(htitle,
"Geant vertex y/micrometer");
175 hGeantVtxY[0] =
new TH1F(hname,htitle,100,-8000000,8000000.);
176 sprintf(hname,
"hGeantVtxY2");
178 hGeantVtxY[1] =
new TH1F(hname,htitle,100,-50.,50.);
179 for (Int_t
i = 0;
i < 2; ++
i) {
180 hGeantVtxY[
i]->GetXaxis()->SetTitle(
"y of Vertex (um)");
185 sprintf(hname,
"hGeantVtxZ1");
187 sprintf(htitle,
"Geant vertex z/millimeter");
188 hGeantVtxZ[0] =
new TH1F(hname,htitle,100,-11000.,11000.);
189 sprintf(hname,
"hGeantVtxZ2");
191 hGeantVtxZ[1] =
new TH1F(hname,htitle,100,-250.,250.);
192 for (Int_t
i = 0;
i < 2; ++
i) {
193 hGeantVtxZ[
i]->GetXaxis()->SetTitle(
"z of Vertex (mm)");
198 sprintf(hname,
"hGeantTrkPt");
200 sprintf(htitle,
"Geant track pt/GeV");
202 hGeantTrkPt->GetXaxis()->SetTitle(
"pT of Track (GeV)");
206 sprintf(hname,
"hGeantTrkE");
208 sprintf(htitle,
"Geant track E/GeV");
209 hGeantTrkE =
new TH1F(hname,htitle,100,0.,5000.);
210 hGeantTrkE->GetXaxis()->SetTitle(
"E of Track (GeV)");
215 sprintf(hname,
"hCaloEcal1");
217 sprintf(htitle,
"Ecal hits");
218 hCaloEcal[0] =
new TH1F(hname,htitle,100,0.,10000.);
219 sprintf(hname,
"hCaloEcal2");
221 hCaloEcal[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
223 sprintf(hname,
"hCaloEcalE1");
225 sprintf(htitle,
"Ecal hits, energy/GeV");
226 hCaloEcalE[0] =
new TH1F(hname,htitle,100,0.,10.);
227 sprintf(hname,
"hCaloEcalE2");
229 hCaloEcalE[1] =
new TH1F(hname,htitle,100,0.,0.1);
231 sprintf(hname,
"hCaloEcalToF1");
233 sprintf(htitle,
"Ecal hits, ToF/ns");
235 sprintf(hname,
"hCaloEcalToF2");
239 for (Int_t
i = 0;
i < 2; ++
i) {
240 hCaloEcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
243 hCaloEcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
246 hCaloEcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
251 sprintf(hname,
"hCaloEcalPhi");
253 sprintf(htitle,
"Ecal hits, phi/rad");
255 hCaloEcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
259 sprintf(hname,
"hCaloEcalEta");
261 sprintf(htitle,
"Ecal hits, eta");
267 sprintf(hname,
"hCaloPreSh1");
269 sprintf(htitle,
"PreSh hits");
270 hCaloPreSh[0] =
new TH1F(hname,htitle,100,0.,10000.);
271 sprintf(hname,
"hCaloPreSh2");
273 hCaloPreSh[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
275 sprintf(hname,
"hCaloPreShE1");
277 sprintf(htitle,
"PreSh hits, energy/GeV");
278 hCaloPreShE[0] =
new TH1F(hname,htitle,100,0.,10.);
279 sprintf(hname,
"hCaloPreShE2");
281 hCaloPreShE[1] =
new TH1F(hname,htitle,100,0.,0.1);
283 sprintf(hname,
"hCaloPreShToF1");
285 sprintf(htitle,
"PreSh hits, ToF/ns");
287 sprintf(hname,
"hCaloPreShToF2");
291 for (Int_t
i = 0;
i < 2; ++
i) {
292 hCaloPreSh[
i]->GetXaxis()->SetTitle(
"Number of Hits");
295 hCaloPreShE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
298 hCaloPreShToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
303 sprintf(hname,
"hCaloPreShPhi");
305 sprintf(htitle,
"PreSh hits, phi/rad");
311 sprintf(hname,
"hCaloPreShEta");
313 sprintf(htitle,
"PreSh hits, eta");
320 sprintf(hname,
"hCaloHcal1");
322 sprintf(htitle,
"Hcal hits");
323 hCaloHcal[0] =
new TH1F(hname,htitle,100,0.,10000.);
324 sprintf(hname,
"hCaloHcal2");
326 hCaloHcal[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
328 sprintf(hname,
"hCaloHcalE1");
330 sprintf(htitle,
"Hcal hits, energy/GeV");
331 hCaloHcalE[0] =
new TH1F(hname,htitle,100,0.,10.);
332 sprintf(hname,
"hCaloHcalE2");
334 hCaloHcalE[1] =
new TH1F(hname,htitle,100,0.,0.1);
336 sprintf(hname,
"hCaloHcalToF1");
338 sprintf(htitle,
"Hcal hits, ToF/ns");
340 sprintf(hname,
"hCaloHcalToF2");
344 for (Int_t
i = 0;
i < 2; ++
i) {
345 hCaloHcal[
i]->GetXaxis()->SetTitle(
"Number of Hits");
348 hCaloHcalE[
i]->GetXaxis()->SetTitle(
"Energy of Hits (GeV)");
351 hCaloHcalToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
356 sprintf(hname,
"hCaloHcalPhi");
358 sprintf(htitle,
"Hcal hits, phi/rad");
360 hCaloHcalPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
364 sprintf(hname,
"hCaloHcalEta");
366 sprintf(htitle,
"Hcal hits, eta");
373 sprintf(hname,
"hTrackerPx1");
375 sprintf(htitle,
"Pixel hits");
376 hTrackerPx[0] =
new TH1F(hname,htitle,100,0.,10000.);
377 sprintf(hname,
"hTrackerPx2");
379 hTrackerPx[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
380 for (Int_t
i = 0;
i < 2; ++
i) {
381 hTrackerPx[
i]->GetXaxis()->SetTitle(
"Number of Pixel Hits");
386 sprintf(hname,
"hTrackerPxPhi");
388 sprintf(htitle,
"Pixel hits phi/rad");
394 sprintf(hname,
"hTrackerPxEta");
396 sprintf(htitle,
"Pixel hits eta");
402 sprintf(hname,
"hTrackerPxBToF");
404 sprintf(htitle,
"Pixel barrel hits, ToF/ns");
406 hTrackerPxBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
410 sprintf(hname,
"hTrackerPxBR");
412 sprintf(htitle,
"Pixel barrel hits, R/cm");
418 sprintf(hname,
"hTrackerPxFToF");
420 sprintf(htitle,
"Pixel forward hits, ToF/ns");
422 hTrackerPxFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
426 sprintf(hname,
"hTrackerPxFZ");
428 sprintf(htitle,
"Pixel forward hits, Z/cm");
434 sprintf(hname,
"hTrackerSi1");
436 sprintf(htitle,
"Silicon hits");
437 hTrackerSi[0] =
new TH1F(hname,htitle,100,0.,10000.);
438 sprintf(hname,
"hTrackerSi2");
440 hTrackerSi[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
441 for (Int_t
i = 0;
i < 2; ++
i) {
442 hTrackerSi[
i]->GetXaxis()->SetTitle(
"Number of Silicon Hits");
447 sprintf(hname,
"hTrackerSiPhi");
449 sprintf(htitle,
"Silicon hits phi/rad");
455 sprintf(hname,
"hTrackerSiEta");
457 sprintf(htitle,
"Silicon hits eta");
463 sprintf(hname,
"hTrackerSiBToF");
465 sprintf(htitle,
"Silicon barrel hits, ToF/ns");
467 hTrackerSiBToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
471 sprintf(hname,
"hTrackerSiBR");
473 sprintf(htitle,
"Silicon barrel hits, R/cm");
479 sprintf(hname,
"hTrackerSiFToF");
481 sprintf(htitle,
"Silicon forward hits, ToF/ns");
483 hTrackerSiFToF->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
487 sprintf(hname,
"hTrackerSiFZ");
489 sprintf(htitle,
"Silicon forward hits, Z/cm");
496 sprintf(hname,
"hMuon1");
498 sprintf(htitle,
"Muon hits");
499 hMuon[0] =
new TH1F(hname,htitle,100,0.,10000.);
500 sprintf(hname,
"hMuon2");
502 hMuon[1] =
new TH1F(hname,htitle,100,-0.5,99.5);
503 for (Int_t
i = 0;
i < 2; ++
i) {
504 hMuon[
i]->GetXaxis()->SetTitle(
"Number of Muon Hits");
505 hMuon[
i]->GetYaxis()->SetTitle(
"Count");
509 sprintf(hname,
"hMuonPhi");
511 sprintf(htitle,
"Muon hits phi/rad");
512 hMuonPhi =
new TH1F(hname,htitle,100,-3.2,3.2);
513 hMuonPhi->GetXaxis()->SetTitle(
"Phi of Hits (rad)");
514 hMuonPhi->GetYaxis()->SetTitle(
"Count");
517 sprintf(hname,
"hMuonEta");
519 sprintf(htitle,
"Muon hits eta");
520 hMuonEta =
new TH1F(hname,htitle,100,-3.5,3.5);
521 hMuonEta->GetXaxis()->SetTitle(
"Eta of Hits");
522 hMuonEta->GetYaxis()->SetTitle(
"Count");
525 sprintf(hname,
"hMuonCscToF1");
527 sprintf(htitle,
"Muon CSC hits, ToF/ns");
528 hMuonCscToF[0] =
new TH1F(hname,htitle,100,0.,250.);
529 sprintf(hname,
"hMuonCscToF2");
531 hMuonCscToF[1] =
new TH1F(hname,htitle,100,0.,50.);
532 for (Int_t
i = 0;
i < 2; ++
i) {
533 hMuonCscToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
538 sprintf(hname,
"hMuonCscZ");
540 sprintf(htitle,
"Muon CSC hits, Z/cm");
541 hMuonCscZ =
new TH1F(hname,htitle,200,-1500.,1500.);
542 hMuonCscZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
543 hMuonCscZ->GetYaxis()->SetTitle(
"Count");
546 sprintf(hname,
"hMuonDtToF1");
548 sprintf(htitle,
"Muon DT hits, ToF/ns");
549 hMuonDtToF[0] =
new TH1F(hname,htitle,100,0.,250.);
550 sprintf(hname,
"hMuonDtToF2");
552 hMuonDtToF[1] =
new TH1F(hname,htitle,100,0.,50.);
553 for (Int_t
i = 0;
i < 2; ++
i) {
554 hMuonDtToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
559 sprintf(hname,
"hMuonDtR");
561 sprintf(htitle,
"Muon DT hits, R/cm");
562 hMuonDtR =
new TH1F(hname,htitle,100,0.,1500.);
563 hMuonDtR->GetXaxis()->SetTitle(
"R of Hits (cm)");
564 hMuonDtR->GetYaxis()->SetTitle(
"Count");
567 sprintf(hname,
"hMuonRpcFToF1");
569 sprintf(htitle,
"Muon RPC forward hits, ToF/ns");
571 sprintf(hname,
"hMuonRpcFToF2");
574 for (Int_t
i = 0;
i < 2; ++
i) {
575 hMuonRpcFToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
580 sprintf(hname,
"hMuonRpcFZ");
582 sprintf(htitle,
"Muon RPC forward hits, Z/cm");
583 hMuonRpcFZ =
new TH1F(hname,htitle,201,-1500.,1500.);
584 hMuonRpcFZ->GetXaxis()->SetTitle(
"Z of Hits (cm)");
588 sprintf(hname,
"hMuonRpcBToF1");
590 sprintf(htitle,
"Muon RPC barrel hits, ToF/ns");
592 sprintf(hname,
"hMuonRpcBToF2");
595 for (Int_t
i = 0;
i < 2; ++
i) {
596 hMuonRpcBToF[
i]->GetXaxis()->SetTitle(
"Time of Flight of Hits (ns)");
601 sprintf(hname,
"hMuonRpcBR");
603 sprintf(htitle,
"Muon RPC barrel hits, R/cm");
604 hMuonRpcBR =
new TH1F(hname,htitle,100,0.,1500.);
605 hMuonRpcBR->GetXaxis()->SetTitle(
"R of Hits (cm)");
626 std::string MsgLoggerCat =
"GlobalHitsProdHist_endJob";
629 <<
"Terminating having processed " <<
count <<
" events.";
636 std::string MsgLoggerCat =
"GlobalHitsProdHist_produce";
642 int nrun = iEvent.
id().
run();
647 <<
"Processing run " << nrun <<
", event " << nevt
648 <<
" (" <<
count <<
" events total)";
652 <<
"Processing run " << nrun <<
", event " << nevt
653 <<
" (" <<
count <<
" events total)";
660 std::vector<const edm::Provenance*> AllProv;
665 <<
"Number of Provenances = " << AllProv.size();
668 TString eventout(
"\nProvenance info:\n");
670 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
671 eventout +=
"\n ******************************";
672 eventout +=
"\n Module : ";
673 eventout += AllProv[
i]->moduleLabel();
674 eventout +=
"\n ProductID : ";
675 eventout += AllProv[
i]->productID().id();
676 eventout +=
"\n ClassName : ";
677 eventout += AllProv[
i]->className();
678 eventout +=
"\n InstanceName : ";
679 eventout += AllProv[
i]->productInstanceName();
680 eventout +=
"\n BranchName : ";
681 eventout += AllProv[
i]->branchName();
683 eventout +=
"\n ******************************\n";
704 <<
"Done gathering data from event.";
712 std::string MsgLoggerCat =
"GlobalHitsProdHist_endRun";
720 <<
"\nStoring histograms.";
723 std::map<std::string, TH1F*>::iterator iter;
727 std::auto_ptr<TH1F> hist1D(iter->second);
728 eventout +=
"\n Storing histogram " +
histName_[
i];
732 eventoutw +=
"\n Unable to find histogram with name " +
histName_[
i];
748 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillG4MC";
752 eventout =
"\nGathering info:";
758 std::vector<edm::Handle<edm::HepMCProduct> > AllHepMCEvt;
763 for (
unsigned int i = 0;
i < AllHepMCEvt.size(); ++
i) {
764 HepMCEvt = AllHepMCEvt[
i];
771 <<
"Unable to find HepMCProduct in event!";
774 eventout +=
"\n Using HepMCProduct: ";
777 const HepMC::GenEvent* MCEvt = HepMCEvt->GetEvent();
781 eventout +=
"\n Number of Raw Particles collected:......... ";
798 if (!G4VtxContainer.
isValid()) {
800 <<
"Unable to find SimVertex in event!";
804 edm::SimVertexContainer::const_iterator itVtx;
805 for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end();
811 itVtx->position().y(),
812 itVtx->position().z(),
813 itVtx->position().e());
816 G4Vtx1.GetCoordinates(G4Vtx);
830 eventout +=
"\n Number of G4Vertices collected:............ ";
842 if (!G4TrkContainer.
isValid()) {
844 <<
"Unable to find SimTrack in event!";
848 edm::SimTrackContainer::const_iterator itTrk;
849 for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end();
855 itTrk->momentum().y(),
856 itTrk->momentum().z(),
857 itTrk->momentum().e());
859 G4Trk1.GetCoordinates(G4Trk);
862 Fill(
sqrt(G4Trk[0]*G4Trk[0]+G4Trk[1]*G4Trk[1]));
867 eventout +=
"\n Number of G4Tracks collected:.............. ";
885 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillTrk";
889 eventout =
"\nGathering info:";
894 if (!theTrackerGeometry.
isValid()) {
896 <<
"Unable to find TrackerDigiGeometryRecord in event!";
902 edm::PSimHitContainer::const_iterator itHit;
911 if (!PxlBrlLowContainer.
isValid()) {
913 <<
"Unable to find TrackerHitsPixelBarrelLowTof in event!";
919 if (!PxlBrlHighContainer.
isValid()) {
921 <<
"Unable to find TrackerHitsPixelBarrelHighTof in event!";
925 thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlLowContainer->begin(),
926 PxlBrlLowContainer->end());
927 thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlHighContainer->begin(),
928 PxlBrlHighContainer->end());
932 for (itHit = thePxlBrlHits.begin(); itHit != thePxlBrlHits.end(); ++itHit) {
937 DetId theDetUnitId(itHit->detUnitId());
938 int detector = theDetUnitId.
det();
939 int subdetector = theDetUnitId.subdetId();
949 <<
"Unable to get GeomDetUnit from PxlBrlHits for Hit " <<
i;
968 <<
"PxlBrl PSimHit " << i
969 <<
" is expected to be (det,subdet) = ("
971 <<
"); value returned is: ("
972 << detector <<
"," << subdetector <<
")";
978 eventout +=
"\n Number of Pixel Barrel Hits collected:..... ";
991 if (!PxlFwdLowContainer.
isValid()) {
993 <<
"Unable to find TrackerHitsPixelEndcapLowTof in event!";
999 if (!PxlFwdHighContainer.
isValid()) {
1001 <<
"Unable to find TrackerHitsPixelEndcapHighTof in event!";
1005 thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdLowContainer->begin(),
1006 PxlFwdLowContainer->end());
1007 thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdHighContainer->begin(),
1008 PxlFwdHighContainer->end());
1012 for (itHit = thePxlFwdHits.begin(); itHit != thePxlFwdHits.end(); ++itHit) {
1017 DetId theDetUnitId(itHit->detUnitId());
1018 int detector = theDetUnitId.
det();
1019 int subdetector = theDetUnitId.subdetId();
1029 <<
"Unable to get GeomDetUnit from PxlFwdHits for Hit " <<
i;;
1040 hTrackerPxFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1048 <<
"PxlFwd PSimHit " << i
1049 <<
" is expected to be (det,subdet) = ("
1051 <<
"); value returned is: ("
1052 << detector <<
"," << subdetector <<
")";
1058 eventout +=
"\n Number of Pixel Forward Hits collected:.... ";
1075 if (!SiTIBLowContainer.
isValid()) {
1077 <<
"Unable to find TrackerHitsTIBLowTof in event!";
1083 if (!SiTIBHighContainer.
isValid()) {
1085 <<
"Unable to find TrackerHitsTIBHighTof in event!";
1091 if (!SiTOBLowContainer.
isValid()) {
1093 <<
"Unable to find TrackerHitsTOBLowTof in event!";
1099 if (!SiTOBHighContainer.
isValid()) {
1101 <<
"Unable to find TrackerHitsTOBHighTof in event!";
1105 theSiBrlHits.insert(theSiBrlHits.end(),SiTIBLowContainer->begin(),
1106 SiTIBLowContainer->end());
1107 theSiBrlHits.insert(theSiBrlHits.end(),SiTIBHighContainer->begin(),
1108 SiTIBHighContainer->end());
1109 theSiBrlHits.insert(theSiBrlHits.end(),SiTOBLowContainer->begin(),
1110 SiTOBLowContainer->end());
1111 theSiBrlHits.insert(theSiBrlHits.end(),SiTOBHighContainer->begin(),
1112 SiTOBHighContainer->end());
1116 for (itHit = theSiBrlHits.begin(); itHit != theSiBrlHits.end(); ++itHit) {
1121 DetId theDetUnitId(itHit->detUnitId());
1122 int detector = theDetUnitId.
det();
1123 int subdetector = theDetUnitId.subdetId();
1126 if ((detector ==
dTrk) &&
1135 <<
"Unable to get GeomDetUnit from SiBrlHits for Hit " <<
i;
1154 <<
"SiBrl PSimHit " << i
1155 <<
" is expected to be (det,subdet) = ("
1157 <<
" || " <<
sdSiTOB <<
"); value returned is: ("
1158 << detector <<
"," << subdetector <<
")";
1164 eventout +=
"\n Number of Silicon Barrel Hits collected:... ";
1177 if (!SiTIDLowContainer.
isValid()) {
1179 <<
"Unable to find TrackerHitsTIDLowTof in event!";
1185 if (!SiTIDHighContainer.
isValid()) {
1187 <<
"Unable to find TrackerHitsTIDHighTof in event!";
1193 if (!SiTECLowContainer.
isValid()) {
1195 <<
"Unable to find TrackerHitsTECLowTof in event!";
1201 if (!SiTECHighContainer.
isValid()) {
1203 <<
"Unable to find TrackerHitsTECHighTof in event!";
1207 theSiFwdHits.insert(theSiFwdHits.end(),SiTIDLowContainer->begin(),
1208 SiTIDLowContainer->end());
1209 theSiFwdHits.insert(theSiFwdHits.end(),SiTIDHighContainer->begin(),
1210 SiTIDHighContainer->end());
1211 theSiFwdHits.insert(theSiFwdHits.end(),SiTECLowContainer->begin(),
1212 SiTECLowContainer->end());
1213 theSiFwdHits.insert(theSiFwdHits.end(),SiTECHighContainer->begin(),
1214 SiTECHighContainer->end());
1218 for (itHit = theSiFwdHits.begin(); itHit != theSiFwdHits.end(); ++itHit) {
1223 DetId theDetUnitId(itHit->detUnitId());
1224 int detector = theDetUnitId.
det();
1225 int subdetector = theDetUnitId.subdetId();
1228 if ((detector ==
dTrk) &&
1237 <<
"Unable to get GeomDetUnit from SiFwdHits Hit " <<
i;
1248 hTrackerSiFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1256 <<
"SiFwd PSimHit " << i
1257 <<
" is expected to be (det,subdet) = ("
1259 <<
" || " <<
sdSiTEC <<
"); value returned is: ("
1260 << detector <<
"," << subdetector <<
")";
1266 eventout +=
"\n Number of Silicon Forward Hits collected:.. ";
1285 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillMuon";
1289 eventout =
"\nGathering info:";
1292 edm::PSimHitContainer::const_iterator itHit;
1300 if (!theCSCGeometry.
isValid()) {
1302 <<
"Unable to find MuonGeometryRecord for the CSCGeometry in event!";
1310 if (!MuonCSCContainer.
isValid()) {
1312 <<
"Unable to find MuonCSCHits in event!";
1318 for (itHit = MuonCSCContainer->begin(); itHit != MuonCSCContainer->end();
1324 DetId theDetUnitId(itHit->detUnitId());
1325 int detector = theDetUnitId.
det();
1326 int subdetector = theDetUnitId.subdetId();
1329 if ((detector ==
dMuon) &&
1337 <<
"Unable to get GeomDetUnit from theCSCMuon for hit " <<
i;
1349 hMuonCscZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1351 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1353 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1357 <<
"MuonCsc PSimHit " << i
1358 <<
" is expected to be (det,subdet) = ("
1360 <<
"); value returned is: ("
1361 << detector <<
"," << subdetector <<
")";
1367 eventout +=
"\n Number of CSC muon Hits collected:......... ";
1379 if (!theDTGeometry.
isValid()) {
1381 <<
"Unable to find MuonGeometryRecord for the DTGeometry in event!";
1389 if (!MuonDtContainer.
isValid()) {
1391 <<
"Unable to find MuonDTHits in event!";
1397 for (itHit = MuonDtContainer->begin(); itHit != MuonDtContainer->end();
1403 DetId theDetUnitId(itHit->detUnitId());
1404 int detector = theDetUnitId.
det();
1405 int subdetector = theDetUnitId.subdetId();
1408 if ((detector ==
dMuon) &&
1413 DTWireId wireId(itHit->detUnitId());
1416 const DTLayer *theDet = theDTMuon.
layer(wireId.layerId());
1420 <<
"Unable to get GeomDetUnit from theDtMuon for hit " <<
i;
1427 const BoundPlane& bSurface = theDet->surface();
1432 hMuonDtR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1434 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1436 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1440 <<
"MuonDt PSimHit " << i
1441 <<
" is expected to be (det,subdet) = ("
1443 <<
"); value returned is: ("
1444 << detector <<
"," << subdetector <<
")";
1450 eventout +=
"\n Number of DT muon Hits collected:.......... ";
1463 if (!theRPCGeometry.
isValid()) {
1465 <<
"Unable to find MuonGeometryRecord for the RPCGeometry in event!";
1473 if (!MuonRPCContainer.
isValid()) {
1475 <<
"Unable to find MuonRPCHits in event!";
1481 int RPCBrl =0, RPCFwd = 0;
1482 for (itHit = MuonRPCContainer->begin(); itHit != MuonRPCContainer->end();
1488 DetId theDetUnitId(itHit->detUnitId());
1489 int detector = theDetUnitId.
det();
1490 int subdetector = theDetUnitId.subdetId();
1493 if ((detector ==
dMuon) &&
1497 RPCDetId RPCId(itHit->detUnitId());
1500 int region = RPCId.
region();
1507 <<
"Unable to get GeomDetUnit from theRPCMuon for hit " <<
i;
1523 hMuonRpcFZ->Fill(bSurface.toGlobal(itHit->localPosition()).
z());
1525 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1527 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1535 hMuonRpcBR->Fill(bSurface.toGlobal(itHit->localPosition()).
perp());
1537 hMuonPhi->Fill(bSurface.toGlobal(itHit->localPosition()).
phi());
1539 hMuonEta->Fill(bSurface.toGlobal(itHit->localPosition()).
eta());
1543 <<
"Invalid region for RPC Muon hit" <<
i;
1548 <<
"MuonRpc PSimHit " << i
1549 <<
" is expected to be (det,subdet) = ("
1551 <<
"); value returned is: ("
1552 << detector <<
"," << subdetector <<
")";
1558 eventout +=
"\n Number of RPC muon Hits collected:......... ";
1560 eventout +=
"\n RPC Barrel muon Hits:............ ";
1562 eventout +=
"\n RPC Forward muon Hits:........... ";
1569 if (
hMuon[1])
hMuon[1]->Fill((
float)nMuonHits);
1580 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillECal";
1584 eventout =
"\nGathering info:";
1589 if (!theCaloGeometry.
isValid()) {
1591 <<
"Unable to find CaloGeometryRecord in event!";
1597 edm::PCaloHitContainer::const_iterator itHit;
1608 <<
"Unable to find EcalHitsEB in event!";
1616 <<
"Unable to find EcalHitsEE in event!";
1620 theECalHits.insert(theECalHits.end(),EBContainer->begin(),
1621 EBContainer->end());
1622 theECalHits.insert(theECalHits.end(),EEContainer->begin(),
1623 EEContainer->end());
1627 for (itHit = theECalHits.begin(); itHit != theECalHits.end(); ++itHit) {
1632 DetId theDetUnitId(itHit->id());
1633 int detector = theDetUnitId.
det();
1634 int subdetector = theDetUnitId.subdetId();
1637 if ((detector ==
dEcal) &&
1643 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1647 <<
"Unable to get CaloCellGeometry from ECalHits for Hit " <<
i;
1665 <<
"ECal PCaloHit " << i
1666 <<
" is expected to be (det,subdet) = ("
1668 <<
" || " <<
sdEcalFwd <<
"); value returned is: ("
1669 << detector <<
"," << subdetector <<
")";
1675 eventout +=
"\n Number of ECal Hits collected:............. ";
1688 if (!PreShContainer.
isValid()) {
1690 <<
"Unable to find EcalHitsES in event!";
1696 for (itHit = PreShContainer->begin();
1697 itHit != PreShContainer->end(); ++itHit) {
1702 DetId theDetUnitId(itHit->id());
1703 int detector = theDetUnitId.
det();
1704 int subdetector = theDetUnitId.subdetId();
1707 if ((detector ==
dEcal) &&
1712 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1716 <<
"Unable to get CaloCellGeometry from PreShContainer for Hit "
1735 <<
"PreSh PCaloHit " << i
1736 <<
" is expected to be (det,subdet) = ("
1738 <<
"); value returned is: ("
1739 << detector <<
"," << subdetector <<
")";
1745 eventout +=
"\n Number of PreSh Hits collected:............ ";
1761 std::string MsgLoggerCat =
"GlobalHitsProdHist_fillHCal";
1765 eventout =
"\nGathering info:";
1770 if (!theCaloGeometry.
isValid()) {
1772 <<
"Unable to find CaloGeometryRecord in event!";
1778 edm::PCaloHitContainer::const_iterator itHit;
1786 if (!HCalContainer.
isValid()) {
1788 <<
"Unable to find HCalHits in event!";
1794 for (itHit = HCalContainer->begin();
1795 itHit != HCalContainer->end(); ++itHit) {
1800 DetId theDetUnitId(itHit->id());
1801 int detector = theDetUnitId.
det();
1802 int subdetector = theDetUnitId.subdetId();
1805 if ((detector ==
dHcal) &&
1813 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1817 <<
"Unable to get CaloCellGeometry from HCalContainer for Hit " <<
i;
1835 <<
"HCal PCaloHit " << i
1836 <<
" is expected to be (det,subdet) = ("
1839 <<
"); value returned is: ("
1840 << detector <<
"," << subdetector <<
")";
1846 eventout +=
"\n Number of HCal Hits collected:............. ";
edm::InputTag SiTECHighSrc_
void getManyByType(std::vector< Handle< PROD > > &results) 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 beginJob() override
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_
Geom::Phi< T > phi() const
edm::InputTag MuonRpcSrc_
static const int sdEcalPS
static const int sdMuonRPC
edm::InputTag MuonCscSrc_
const Plane & surface() const
The nominal surface of the GeomDet.
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
virtual void endRunProduce(edm::Run &, const edm::EventSetup &) override
edm::InputTag SiTOBHighSrc_
virtual void produce(edm::Event &, const edm::EventSetup &) override
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 void endJob() override
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_
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 &)
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
static const int sdHcalEC
edm::InputTag SiTIDHighSrc_
Provenance const * provenance() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.