14 getAllProvenances(
false), printProvenanceInfo(
false),
15 G4VtxSrc_Token_( consumes<edm::
SimVertexContainer>((iPSet.getParameter<edm::InputTag>(
"G4VtxSrc"))) ),
16 G4TrkSrc_Token_( consumes<edm::
SimTrackContainer>(iPSet.getParameter<edm::InputTag>(
"G4TrkSrc")) ),
19 std::string MsgLoggerCat =
"GlobalHitsAnalyzer_GlobalHitsAnalyzer";
29 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
31 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
113 if (verbosity >= 0) {
115 <<
"\n===============================\n"
116 <<
"Initialized as EDAnalyzer with parameter values:\n"
117 <<
" Name = " <<
fName <<
"\n"
118 <<
" Verbosity = " << verbosity <<
"\n"
119 <<
" Frequency = " << frequency <<
"\n"
120 <<
" VtxUnit = " << vtxunit <<
"\n"
121 <<
" GetProv = " << getAllProvenances <<
"\n"
122 <<
" PrintProv = " << printProvenanceInfo <<
"\n"
123 <<
" PxlBrlLowSrc = " << PxlBrlLowSrc_.label()
124 <<
":" << PxlBrlLowSrc_.instance() <<
"\n"
125 <<
" PxlBrlHighSrc = " << PxlBrlHighSrc_.
label()
126 <<
":" << PxlBrlHighSrc_.
instance() <<
"\n"
127 <<
" PxlFwdLowSrc = " << PxlFwdLowSrc_.
label()
128 <<
":" << PxlBrlLowSrc_.instance() <<
"\n"
129 <<
" PxlFwdHighSrc = " << PxlFwdHighSrc_.
label()
130 <<
":" << PxlBrlHighSrc_.
instance() <<
"\n"
131 <<
" SiTIBLowSrc = " << SiTIBLowSrc_.
label()
132 <<
":" << SiTIBLowSrc_.
instance() <<
"\n"
133 <<
" SiTIBHighSrc = " << SiTIBHighSrc_.
label()
134 <<
":" << SiTIBHighSrc_.
instance() <<
"\n"
135 <<
" SiTOBLowSrc = " << SiTOBLowSrc_.
label()
136 <<
":" << SiTOBLowSrc_.
instance() <<
"\n"
137 <<
" SiTOBHighSrc = " << SiTOBHighSrc_.
label()
138 <<
":" << SiTOBHighSrc_.
instance() <<
"\n"
139 <<
" SiTIDLowSrc = " << SiTIDLowSrc_.
label()
140 <<
":" << SiTIDLowSrc_.
instance() <<
"\n"
141 <<
" SiTIDHighSrc = " << SiTIDHighSrc_.
label()
142 <<
":" << SiTIDHighSrc_.
instance() <<
"\n"
143 <<
" SiTECLowSrc = " << SiTECLowSrc_.
label()
144 <<
":" << SiTECLowSrc_.
instance() <<
"\n"
145 <<
" SiTECHighSrc = " << SiTECHighSrc_.
label()
146 <<
":" << SiTECHighSrc_.
instance() <<
"\n"
147 <<
" MuonCscSrc = " << MuonCscSrc_.
label()
148 <<
":" << MuonCscSrc_.
instance() <<
"\n"
149 <<
" MuonDtSrc = " << MuonDtSrc_.
label()
150 <<
":" << MuonDtSrc_.
instance() <<
"\n"
151 <<
" MuonRpcSrc = " << MuonRpcSrc_.
label()
152 <<
":" << MuonRpcSrc_.
instance() <<
"\n"
153 <<
" ECalEBSrc = " << ECalEBSrc_.
label()
154 <<
":" << ECalEBSrc_.
instance() <<
"\n"
155 <<
" ECalEESrc = " << ECalEESrc_.
label()
156 <<
":" << ECalEESrc_.
instance() <<
"\n"
157 <<
" ECalESSrc = " << ECalESSrc_.
label()
158 <<
":" << ECalESSrc_.
instance() <<
"\n"
159 <<
" HCalSrc = " << HCalSrc_.
label()
160 <<
":" << HCalSrc_.
instance() <<
"\n"
162 <<
" validHepMCevt = "
164 <<
" validG4VtxContainer = "
165 <<
":" << validG4VtxContainer <<
"\n"
166 <<
" validG4trkContainer = "
167 <<
":" << validG4trkContainer <<
"\n"
168 <<
" validPxlBrlLow = "
169 <<
":" << validPxlBrlLow <<
"\n"
170 <<
" validPxlBrlHigh = "
171 <<
":" << validPxlBrlHigh <<
"\n"
172 <<
" validPxlFwdLow = "
173 <<
":" << validPxlFwdLow <<
"\n"
174 <<
" validPxlFwdHigh = "
175 <<
":" << validPxlFwdHigh <<
"\n"
176 <<
" validSiTIBLow = "
177 <<
":" << validSiTIBLow <<
"\n"
178 <<
" validSiTIBHigh = "
179 <<
":" << validSiTIBHigh <<
"\n"
180 <<
" validSiTOBLow = "
181 <<
":" << validSiTOBLow <<
"\n"
182 <<
" validSiTOBHigh = "
183 <<
":" << validSiTOBHigh <<
"\n"
184 <<
" validSiTIDLow = "
185 <<
":" << validSiTIDLow <<
"\n"
186 <<
" validSiTIDHigh = "
187 <<
":" << validSiTIDHigh <<
"\n"
188 <<
" validSiTECLow = "
189 <<
":" << validSiTECLow <<
"\n"
190 <<
" validSiTECHigh = "
191 <<
":" << validSiTECHigh <<
"\n"
192 <<
" validMuonCSC = "
193 <<
":" << validMuonCSC <<
"\n"
195 <<
":" << validMuonDt <<
"\n"
196 <<
" validMuonRPC = "
197 <<
":" << validMuonRPC <<
"\n"
199 <<
":" << validEB <<
"\n"
201 <<
":" << validEE <<
"\n"
203 <<
":" << validPresh <<
"\n"
205 <<
":" << validHcal <<
"\n"
206 <<
"===============================\n";
213 if (verbosity > 0 ) {
225 for (Int_t
i = 0;
i < 2; ++
i) {
287 sprintf(hname,
"hMCRGP1");
288 sprintf(htitle,
"RawGenParticles");
290 sprintf(hname,
"hMCRGP2");
292 for (Int_t
i = 0;
i < 2; ++
i) {
297 sprintf(hname,
"hMCG4Vtx1");
298 sprintf(htitle,
"G4 Vertices");
300 sprintf(hname,
"hMCG4Vtx2");
302 for (Int_t
i = 0;
i < 2; ++
i) {
307 sprintf(hname,
"hMCG4Trk1");
308 sprintf(htitle,
"G4 Tracks");
310 sprintf(hname,
"hMCG4Trk2");
312 for (Int_t
i = 0;
i < 2; ++
i) {
317 sprintf(hname,
"hGeantVtxX1");
318 sprintf(htitle,
"Geant vertex x/micrometer");
320 sprintf(hname,
"hGeantVtxX2");
322 for (Int_t
i = 0;
i < 2; ++
i) {
327 sprintf(hname,
"hGeantVtxY1");
328 sprintf(htitle,
"Geant vertex y/micrometer");
330 sprintf(hname,
"hGeantVtxY2");
332 for (Int_t
i = 0;
i < 2; ++
i) {
337 sprintf(hname,
"hGeantVtxZ1");
338 sprintf(htitle,
"Geant vertex z/millimeter");
340 sprintf(hname,
"hGeantVtxZ2");
343 for (Int_t
i = 0;
i < 2; ++
i) {
348 sprintf(hname,
"hGeantTrkPt");
349 sprintf(htitle,
"Log10 Geant track pt/GeV");
354 sprintf(hname,
"hGeantTrkE");
355 sprintf(htitle,
"Log10 Geant track E/GeV");
360 sprintf(hname,
"hGeantVtxEta");
361 sprintf(htitle,
"Geant vertices eta");
366 sprintf(hname,
"hGeantVtxPhi");
367 sprintf(htitle,
"Geant vertices phi/rad");
372 sprintf(hname,
"hGeantVtxRad1");
373 sprintf(htitle,
"Geant vertices radius/cm");
375 sprintf(hname,
"hGeantVtxRad2");
377 for (Int_t
i = 0;
i < 2; ++
i) {
382 sprintf(hname,
"hGeantVtxMulti");
383 sprintf(htitle,
"Geant vertices outgoing multiplicity");
390 sprintf(hname,
"hCaloEcal1");
391 sprintf(htitle,
"Ecal hits");
393 sprintf(hname,
"hCaloEcal2");
396 sprintf(hname,
"hCaloEcalE1");
397 sprintf(htitle,
"Ecal hits, energy/GeV");
399 sprintf(hname,
"hCaloEcalE2");
401 sprintf(hname,
"hCaloEcalToF1");
402 sprintf(htitle,
"Ecal hits, ToF/ns");
404 sprintf(hname,
"hCaloEcalToF2");
407 for (Int_t
i = 0;
i < 2; ++
i) {
416 sprintf(hname,
"hCaloEcalPhi");
417 sprintf(htitle,
"Ecal hits, phi/rad");
422 sprintf(hname,
"hCaloEcalEta");
423 sprintf(htitle,
"Ecal hits, eta");
428 sprintf(hname,
"hCaloPreSh1");
429 sprintf(htitle,
"PreSh hits");
431 sprintf(hname,
"hCaloPreSh2");
434 sprintf(hname,
"hCaloPreShE1");
435 sprintf(htitle,
"PreSh hits, energy/GeV");
437 sprintf(hname,
"hCaloPreShE2");
440 sprintf(hname,
"hCaloPreShToF1");
441 sprintf(htitle,
"PreSh hits, ToF/ns");
443 sprintf(hname,
"hCaloPreShToF2");
446 for (Int_t
i = 0;
i < 2; ++
i) {
455 sprintf(hname,
"hCaloPreShPhi");
456 sprintf(htitle,
"PreSh hits, phi/rad");
461 sprintf(hname,
"hCaloPreShEta");
462 sprintf(htitle,
"PreSh hits, eta");
469 sprintf(hname,
"hCaloHcal1");
470 sprintf(htitle,
"Hcal hits");
472 sprintf(hname,
"hCaloHcal2");
475 sprintf(hname,
"hCaloHcalE1");
476 sprintf(htitle,
"Hcal hits, energy/GeV");
478 sprintf(hname,
"hCaloHcalE2");
481 sprintf(hname,
"hCaloHcalToF1");
482 sprintf(htitle,
"Hcal hits, ToF/ns");
484 sprintf(hname,
"hCaloHcalToF2");
487 for (Int_t
i = 0;
i < 2; ++
i) {
496 sprintf(hname,
"hCaloHcalPhi");
497 sprintf(htitle,
"Hcal hits, phi/rad");
502 sprintf(hname,
"hCaloHcalEta");
503 sprintf(htitle,
"Hcal hits, eta");
510 sprintf(hname,
"hTrackerPx1");
511 sprintf(htitle,
"Pixel hits");
513 sprintf(hname,
"hTrackerPx2");
515 for (Int_t
i = 0;
i < 2; ++
i) {
520 sprintf(hname,
"hTrackerPxPhi");
521 sprintf(htitle,
"Pixel hits phi/rad");
526 sprintf(hname,
"hTrackerPxEta");
527 sprintf(htitle,
"Pixel hits eta");
532 sprintf(hname,
"hTrackerPxBToF");
533 sprintf(htitle,
"Pixel barrel hits, ToF/ns");
538 sprintf(hname,
"hTrackerPxBR");
539 sprintf(htitle,
"Pixel barrel hits, R/cm");
544 sprintf(hname,
"hTrackerPxFToF");
545 sprintf(htitle,
"Pixel forward hits, ToF/ns");
550 sprintf(hname,
"hTrackerPxFZ");
551 sprintf(htitle,
"Pixel forward hits, Z/cm");
553 dbe->
book1D(hname,htitle,200,-100.,100.);
559 sprintf(hname,
"hTrackerSi1");
560 sprintf(htitle,
"Silicon hits");
562 sprintf(hname,
"hTrackerSi2");
564 for (Int_t
i = 0;
i < 2; ++
i) {
569 sprintf(hname,
"hTrackerSiPhi");
570 sprintf(htitle,
"Silicon hits phi/rad");
575 sprintf(hname,
"hTrackerSiEta");
576 sprintf(htitle,
"Silicon hits eta");
581 sprintf(hname,
"hTrackerSiBToF");
582 sprintf(htitle,
"Silicon barrel hits, ToF/ns");
587 sprintf(hname,
"hTrackerSiBR");
588 sprintf(htitle,
"Silicon barrel hits, R/cm");
593 sprintf(hname,
"hTrackerSiFToF");
594 sprintf(htitle,
"Silicon forward hits, ToF/ns");
599 sprintf(hname,
"hTrackerSiFZ");
600 sprintf(htitle,
"Silicon forward hits, Z/cm");
607 sprintf(hname,
"hMuon1");
608 sprintf(htitle,
"Muon hits");
610 sprintf(hname,
"hMuon2");
612 for (Int_t
i = 0;
i < 2; ++
i) {
617 sprintf(hname,
"hMuonPhi");
618 sprintf(htitle,
"Muon hits phi/rad");
623 sprintf(hname,
"hMuonEta");
624 sprintf(htitle,
"Muon hits eta");
629 sprintf(hname,
"hMuonCscToF1");
630 sprintf(htitle,
"Muon CSC hits, ToF/ns");
632 sprintf(hname,
"hMuonCscToF2");
634 for (Int_t
i = 0;
i < 2; ++
i) {
639 sprintf(hname,
"hMuonCscZ");
640 sprintf(htitle,
"Muon CSC hits, Z/cm");
645 sprintf(hname,
"hMuonDtToF1");
646 sprintf(htitle,
"Muon DT hits, ToF/ns");
648 sprintf(hname,
"hMuonDtToF2");
650 for (Int_t
i = 0;
i < 2; ++
i) {
655 sprintf(hname,
"hMuonDtR");
656 sprintf(htitle,
"Muon DT hits, R/cm");
661 sprintf(hname,
"hMuonRpcFToF1");
662 sprintf(htitle,
"Muon RPC forward hits, ToF/ns");
664 sprintf(hname,
"hMuonRpcFToF2");
666 for (Int_t
i = 0;
i < 2; ++
i) {
670 sprintf(hname,
"hMuonRpcFZ");
671 sprintf(htitle,
"Muon RPC forward hits, Z/cm");
676 sprintf(hname,
"hMuonRpcBToF1");
677 sprintf(htitle,
"Muon RPC barrel hits, ToF/ns");
679 sprintf(hname,
"hMuonRpcBToF2");
681 for (Int_t
i = 0;
i < 2; ++
i) {
686 sprintf(hname,
"hMuonRpcBR");
687 sprintf(htitle,
"Muon RPC barrel hits, R/cm");
703 std::string MsgLoggerCat =
"GlobalHitsAnalyzer_endJob";
706 <<
"Terminating having processed " <<
count <<
" events.";
713 std::string MsgLoggerCat =
"GlobalHitsAnalyzer_analyze";
719 int nrun = iEvent.
id().
run();
724 <<
"Processing run " << nrun <<
", event " << nevt
725 <<
" (" <<
count <<
" events total)";
729 <<
"Processing run " << nrun <<
", event " << nevt
730 <<
" (" <<
count <<
" events total)";
737 std::vector<const edm::Provenance*> AllProv;
742 <<
"Number of Provenances = " << AllProv.size();
745 TString eventout(
"\nProvenance info:\n");
747 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
748 eventout +=
"\n ******************************";
749 eventout +=
"\n Module : ";
750 eventout += AllProv[
i]->moduleLabel();
751 eventout +=
"\n ProductID : ";
752 eventout += AllProv[
i]->productID().id();
753 eventout +=
"\n ClassName : ";
754 eventout += AllProv[
i]->className();
755 eventout +=
"\n InstanceName : ";
756 eventout += AllProv[
i]->productInstanceName();
757 eventout +=
"\n BranchName : ";
758 eventout += AllProv[
i]->branchName();
760 eventout +=
"\n ******************************\n";
781 <<
"Done gathering data from event.";
790 std::string MsgLoggerCat =
"GlobalHitsAnalyzer_fillG4MC";
794 eventout =
"\nGathering info:";
800 std::vector<edm::Handle<edm::HepMCProduct> > AllHepMCEvt;
805 for (
unsigned int i = 0;
i < AllHepMCEvt.size(); ++
i) {
806 HepMCEvt = AllHepMCEvt[
i];
813 <<
"Unable to find HepMCProduct in event!";
816 eventout +=
"\n Using HepMCProduct: ";
820 const HepMC::GenEvent* MCEvt = HepMCEvt->GetEvent();
825 eventout +=
"\n Number of Raw Particles collected:......... ";
849 if (!G4VtxContainer.
isValid()) {
851 <<
"Unable to find SimVertex in event!";
856 edm::SimVertexContainer::const_iterator itVtx;
857 for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end();
863 itVtx->position().y(),
864 itVtx->position().z(),
865 itVtx->position().e());
868 G4Vtx1.GetCoordinates(G4Vtx);
886 if ( G4TrkContainer.
isValid() ) {
887 edm::SimTrackContainer::const_iterator itTrk;
888 for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end();
890 if ( (*itTrk).vertIndex() ==
i ) { multi++; }
899 eventout +=
"\n Number of G4Vertices collected:............ ";
911 if (!G4TrkContainer.
isValid()) {
913 <<
"Unable to find SimTrack in event!";
918 edm::SimTrackContainer::const_iterator itTrk;
919 for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end();
925 itTrk->momentum().y(),
926 itTrk->momentum().z(),
927 itTrk->momentum().e());
929 G4Trk1.GetCoordinates(G4Trk);
937 eventout +=
"\n Number of G4Tracks collected:.............. ";
956 std::string MsgLoggerCat =
"GlobalHitsAnalyzer_fillTrk";
960 eventout =
"\nGathering info:";
965 if (!theTrackerGeometry.
isValid()) {
967 <<
"Unable to find TrackerDigiGeometryRecord in event!";
973 edm::PSimHitContainer::const_iterator itHit;
982 if (!PxlBrlLowContainer.
isValid()) {
984 <<
"Unable to find TrackerHitsPixelBarrelLowTof in event!";
990 if (!PxlBrlHighContainer.
isValid()) {
992 <<
"Unable to find TrackerHitsPixelBarrelHighTof in event!";
997 thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlLowContainer->begin(),
998 PxlBrlLowContainer->end());
1000 thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlHighContainer->begin(),
1001 PxlBrlHighContainer->end());
1005 for (itHit = thePxlBrlHits.begin(); itHit != thePxlBrlHits.end(); ++itHit) {
1010 DetId theDetUnitId(itHit->detUnitId());
1011 int detector = theDetUnitId.
det();
1012 int subdetector = theDetUnitId.subdetId();
1022 <<
"Unable to get GeomDetUnit from PxlBrlHits for Hit " <<
i;
1041 <<
"PxlBrl PSimHit " << i
1042 <<
" is expected to be (det,subdet) = ("
1044 <<
"); value returned is: ("
1045 << detector <<
"," << subdetector <<
")";
1051 eventout +=
"\n Number of Pixel Barrel Hits collected:..... ";
1064 if (!PxlFwdLowContainer.
isValid()) {
1066 <<
"Unable to find TrackerHitsPixelEndcapLowTof in event!";
1072 if (!PxlFwdHighContainer.
isValid()) {
1073 LogDebug(
"GlobalHitsAnalyzer_fillTrk")
1074 <<
"Unable to find TrackerHitsPixelEndcapHighTof in event!";
1079 thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdLowContainer->begin(),
1080 PxlFwdLowContainer->end());
1082 thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdHighContainer->begin(),
1083 PxlFwdHighContainer->end());
1087 for (itHit = thePxlFwdHits.begin(); itHit != thePxlFwdHits.end(); ++itHit) {
1092 DetId theDetUnitId(itHit->detUnitId());
1093 int detector = theDetUnitId.
det();
1094 int subdetector = theDetUnitId.subdetId();
1104 <<
"Unable to get GeomDetUnit from PxlFwdHits for Hit " <<
i;;
1123 <<
"PxlFwd PSimHit " << i
1124 <<
" is expected to be (det,subdet) = ("
1126 <<
"); value returned is: ("
1127 << detector <<
"," << subdetector <<
")";
1133 eventout +=
"\n Number of Pixel Forward Hits collected:.... ";
1150 if (!SiTIBLowContainer.
isValid()) {
1152 <<
"Unable to find TrackerHitsTIBLowTof in event!";
1158 if (!SiTIBHighContainer.
isValid()) {
1160 <<
"Unable to find TrackerHitsTIBHighTof in event!";
1166 if (!SiTOBLowContainer.
isValid()) {
1168 <<
"Unable to find TrackerHitsTOBLowTof in event!";
1174 if (!SiTOBHighContainer.
isValid()) {
1176 <<
"Unable to find TrackerHitsTOBHighTof in event!";
1181 theSiBrlHits.insert(theSiBrlHits.end(),SiTIBLowContainer->begin(),
1182 SiTIBLowContainer->end());
1184 theSiBrlHits.insert(theSiBrlHits.end(),SiTIBHighContainer->begin(),
1185 SiTIBHighContainer->end());
1187 theSiBrlHits.insert(theSiBrlHits.end(),SiTOBLowContainer->begin(),
1188 SiTOBLowContainer->end());
1190 theSiBrlHits.insert(theSiBrlHits.end(),SiTOBHighContainer->begin(),
1191 SiTOBHighContainer->end());
1195 for (itHit = theSiBrlHits.begin(); itHit != theSiBrlHits.end(); ++itHit) {
1200 DetId theDetUnitId(itHit->detUnitId());
1201 int detector = theDetUnitId.
det();
1202 int subdetector = theDetUnitId.subdetId();
1205 if ((detector ==
dTrk) &&
1214 <<
"Unable to get GeomDetUnit from SiBrlHits for Hit " <<
i;
1233 <<
"SiBrl PSimHit " << i
1234 <<
" is expected to be (det,subdet) = ("
1236 <<
" || " <<
sdSiTOB <<
"); value returned is: ("
1237 << detector <<
"," << subdetector <<
")";
1243 eventout +=
"\n Number of Silicon Barrel Hits collected:... ";
1256 if (!SiTIDLowContainer.
isValid()) {
1258 <<
"Unable to find TrackerHitsTIDLowTof in event!";
1264 if (!SiTIDHighContainer.
isValid()) {
1265 LogDebug(
"GlobalHitsAnalyzer_fillTrk")
1266 <<
"Unable to find TrackerHitsTIDHighTof in event!";
1272 if (!SiTECLowContainer.
isValid()) {
1274 <<
"Unable to find TrackerHitsTECLowTof in event!";
1280 if (!SiTECHighContainer.
isValid()) {
1282 <<
"Unable to find TrackerHitsTECHighTof in event!";
1287 theSiFwdHits.insert(theSiFwdHits.end(),SiTIDLowContainer->begin(),
1288 SiTIDLowContainer->end());
1290 theSiFwdHits.insert(theSiFwdHits.end(),SiTIDHighContainer->begin(),
1291 SiTIDHighContainer->end());
1293 theSiFwdHits.insert(theSiFwdHits.end(),SiTECLowContainer->begin(),
1294 SiTECLowContainer->end());
1296 theSiFwdHits.insert(theSiFwdHits.end(),SiTECHighContainer->begin(),
1297 SiTECHighContainer->end());
1301 for (itHit = theSiFwdHits.begin(); itHit != theSiFwdHits.end(); ++itHit) {
1306 DetId theDetUnitId(itHit->detUnitId());
1307 int detector = theDetUnitId.
det();
1308 int subdetector = theDetUnitId.subdetId();
1311 if ((detector ==
dTrk) &&
1320 <<
"Unable to get GeomDetUnit from SiFwdHits Hit " <<
i;
1339 <<
"SiFwd PSimHit " << i
1340 <<
" is expected to be (det,subdet) = ("
1342 <<
" || " <<
sdSiTEC <<
"); value returned is: ("
1343 << detector <<
"," << subdetector <<
")";
1349 eventout +=
"\n Number of Silicon Forward Hits collected:.. ";
1368 std::string MsgLoggerCat =
"GlobalHitsAnalyzer_fillMuon";
1372 eventout =
"\nGathering info:";
1375 edm::PSimHitContainer::const_iterator itHit;
1383 if (!theCSCGeometry.
isValid()) {
1385 <<
"Unable to find MuonGeometryRecord for the CSCGeometry in event!";
1393 if (!MuonCSCContainer.
isValid()) {
1395 <<
"Unable to find MuonCSCHits in event!";
1402 for (itHit = MuonCSCContainer->begin(); itHit != MuonCSCContainer->end();
1408 DetId theDetUnitId(itHit->detUnitId());
1409 int detector = theDetUnitId.
det();
1410 int subdetector = theDetUnitId.subdetId();
1413 if ((detector ==
dMuon) &&
1421 <<
"Unable to get GeomDetUnit from theCSCMuon for hit " <<
i;
1441 <<
"MuonCsc PSimHit " << i
1442 <<
" is expected to be (det,subdet) = ("
1444 <<
"); value returned is: ("
1445 << detector <<
"," << subdetector <<
")";
1451 eventout +=
"\n Number of CSC muon Hits collected:......... ";
1464 if (!theDTGeometry.
isValid()) {
1466 <<
"Unable to find MuonGeometryRecord for the DTGeometry in event!";
1474 if (!MuonDtContainer.
isValid()) {
1476 <<
"Unable to find MuonDTHits in event!";
1483 for (itHit = MuonDtContainer->begin(); itHit != MuonDtContainer->end();
1489 DetId theDetUnitId(itHit->detUnitId());
1490 int detector = theDetUnitId.
det();
1491 int subdetector = theDetUnitId.subdetId();
1494 if ((detector ==
dMuon) &&
1499 DTWireId wireId(itHit->detUnitId());
1502 const DTLayer *theDet = theDTMuon.
layer(wireId.layerId());
1506 <<
"Unable to get GeomDetUnit from theDtMuon for hit " <<
i;
1513 const BoundPlane& bSurface = theDet->surface();
1526 <<
"MuonDt PSimHit " << i
1527 <<
" is expected to be (det,subdet) = ("
1529 <<
"); value returned is: ("
1530 << detector <<
"," << subdetector <<
")";
1536 eventout +=
"\n Number of DT muon Hits collected:.......... ";
1550 if (!theRPCGeometry.
isValid()) {
1552 <<
"Unable to find MuonGeometryRecord for the RPCGeometry in event!";
1560 if (!MuonRPCContainer.
isValid()) {
1562 <<
"Unable to find MuonRPCHits in event!";
1569 int RPCBrl =0, RPCFwd = 0;
1570 for (itHit = MuonRPCContainer->begin(); itHit != MuonRPCContainer->end();
1576 DetId theDetUnitId(itHit->detUnitId());
1577 int detector = theDetUnitId.
det();
1578 int subdetector = theDetUnitId.subdetId();
1581 if ((detector ==
dMuon) &&
1585 RPCDetId RPCId(itHit->detUnitId());
1588 int region = RPCId.
region();
1595 <<
"Unable to get GeomDetUnit from theRPCMuon for hit " <<
i;
1624 localPosition()).perp());
1632 <<
"Invalid region for RPC Muon hit" <<
i;
1637 <<
"MuonRpc PSimHit " << i
1638 <<
" is expected to be (det,subdet) = ("
1640 <<
"); value returned is: ("
1641 << detector <<
"," << subdetector <<
")";
1647 eventout +=
"\n Number of RPC muon Hits collected:......... ";
1649 eventout +=
"\n RPC Barrel muon Hits:............ ";
1651 eventout +=
"\n RPC Forward muon Hits:........... ";
1670 std::string MsgLoggerCat =
"GlobalHitsAnalyzer_fillECal";
1674 eventout =
"\nGathering info:";
1679 if (!theCaloGeometry.
isValid()) {
1681 <<
"Unable to find CaloGeometryRecord in event!";
1687 edm::PCaloHitContainer::const_iterator itHit;
1698 <<
"Unable to find EcalHitsEB in event!";
1706 <<
"Unable to find EcalHitsEE in event!";
1711 theECalHits.insert(theECalHits.end(),EBContainer->begin(),
1712 EBContainer->end());
1714 theECalHits.insert(theECalHits.end(),EEContainer->begin(),
1715 EEContainer->end());
1719 for (itHit = theECalHits.begin(); itHit != theECalHits.end(); ++itHit) {
1724 DetId theDetUnitId(itHit->id());
1725 int detector = theDetUnitId.
det();
1726 int subdetector = theDetUnitId.subdetId();
1729 if ((detector ==
dEcal) &&
1735 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1739 <<
"Unable to get CaloCellGeometry from ECalHits for Hit " <<
i;
1757 <<
"ECal PCaloHit " << i
1758 <<
" is expected to be (det,subdet) = ("
1760 <<
" || " <<
sdEcalFwd <<
"); value returned is: ("
1761 << detector <<
"," << subdetector <<
")";
1767 eventout +=
"\n Number of ECal Hits collected:............. ";
1780 if (!PreShContainer.
isValid()) {
1782 <<
"Unable to find EcalHitsES in event!";
1789 for (itHit = PreShContainer->begin();
1790 itHit != PreShContainer->end(); ++itHit) {
1795 DetId theDetUnitId(itHit->id());
1796 int detector = theDetUnitId.
det();
1797 int subdetector = theDetUnitId.subdetId();
1800 if ((detector ==
dEcal) &&
1805 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1809 <<
"Unable to get CaloCellGeometry from PreShContainer for Hit "
1828 <<
"PreSh PCaloHit " << i
1829 <<
" is expected to be (det,subdet) = ("
1831 <<
"); value returned is: ("
1832 << detector <<
"," << subdetector <<
")";
1838 eventout +=
"\n Number of PreSh Hits collected:............ ";
1855 std::string MsgLoggerCat =
"GlobalHitsAnalyzer_fillHCal";
1859 eventout =
"\nGathering info:";
1864 if (!theCaloGeometry.
isValid()) {
1866 <<
"Unable to find CaloGeometryRecord in event!";
1872 edm::PCaloHitContainer::const_iterator itHit;
1880 if (!HCalContainer.
isValid()) {
1882 <<
"Unable to find HCalHits in event!";
1889 for (itHit = HCalContainer->begin();
1890 itHit != HCalContainer->end(); ++itHit) {
1895 DetId theDetUnitId(itHit->id());
1896 int detector = theDetUnitId.
det();
1897 int subdetector = theDetUnitId.subdetId();
1900 if ((detector ==
dHcal) &&
1908 getSubdetectorGeometry(theDetUnitId)->
getGeometry(theDetUnitId);
1912 <<
"Unable to get CaloCellGeometry from HCalContainer for Hit "
1931 <<
"HCal PCaloHit " << i
1932 <<
" is expected to be (det,subdet) = ("
1935 <<
"); value returned is: ("
1936 << detector <<
"," << subdetector <<
")";
1942 eventout +=
"\n Number of HCal Hits collected:............. ";
MonitorElement * meTrackerSiPhi
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
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDLowSrc_Token_
void getAllProvenance(std::vector< Provenance const * > &provenances) const
void fillG4MC(const edm::Event &)
std::vector< PCaloHit > PCaloHitContainer
edm::InputTag SiTECLowSrc_
edm::EDGetTokenT< edm::PSimHitContainer > SiTECHighSrc_Token_
virtual ~GlobalHitsAnalyzer()
edm::InputTag PxlBrlLowSrc_
static const int sdMuonRPCRgnFwdn
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
static const int sdHcalOut
MonitorElement * meMuonDtToF[2]
static const int sdMuonDT
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * meGeantVtxRad[2]
MonitorElement * meCaloHcal[2]
MonitorElement * meMCG4Trk[2]
MonitorElement * meTrackerPxPhi
Geom::Phi< T > phi() const
MonitorElement * meCaloHcalToF[2]
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDHighSrc_Token_
MonitorElement * meCaloPreSh[2]
static const int sdEcalPS
edm::EDGetTokenT< edm::PCaloHitContainer > ECalEESrc_Token_
MonitorElement * meTrackerSiEta
void fillHCal(const edm::Event &, const edm::EventSetup &)
MonitorElement * meTrackerSiBToF
static const int sdMuonRPC
MonitorElement * meTrackerSi[2]
edm::EDGetTokenT< edm::SimTrackContainer > G4TrkSrc_Token_
const Plane & surface() const
The nominal surface of the GeomDet.
edm::EDGetTokenT< edm::PSimHitContainer > SiTIBHighSrc_Token_
MonitorElement * meMCG4Vtx[2]
edm::InputTag SiTIBHighSrc_
MonitorElement * meGeantVtxY[2]
MonitorElement * meGeantVtxMulti
MonitorElement * meTrackerPxFZ
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
edm::InputTag MuonCscSrc_
edm::InputTag PxlBrlHighSrc_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * meMuonCscToF[2]
MonitorElement * meCaloPreShPhi
MonitorElement * meGeantTrkE
MonitorElement * meCaloEcalEta
static const int sdPxlBrl
MonitorElement * meTrackerPxBR
const T & max(const T &a, const T &b)
MonitorElement * meCaloPreShE[2]
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::InputTag PxlFwdLowSrc_
static const int sdMuonCSC
MonitorElement * meTrackerPxBToF
static const int sdEcalFwd
MonitorElement * meGeantVtxPhi
edm::InputTag SiTIDLowSrc_
MonitorElement * meCaloEcalPhi
edm::EDGetTokenT< edm::PSimHitContainer > SiTIBLowSrc_Token_
MonitorElement * meTrackerPx[2]
MonitorElement * meGeantTrkPt
MonitorElement * meGeantVtxEta
edm::InputTag PxlFwdHighSrc_
MonitorElement * meMuonRpcFZ
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlHighSrc_Token_
static const int sdEcalBrl
void setVerbose(unsigned level)
BranchDescription const & product() const
edm::InputTag SiTECHighSrc_
static const int sdMuonRPCRgnFwdp
static const int sdMuonRPCRgnBrl
edm::EDGetTokenT< edm::PCaloHitContainer > ECalEBSrc_Token_
void fillTrk(const edm::Event &, const edm::EventSetup &)
MonitorElement * meMCRGP[2]
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlLowSrc_Token_
MonitorElement * meMuonRpcBToF[2]
MonitorElement * meCaloHcalE[2]
MonitorElement * meMuonCscZ
MonitorElement * meGeantVtxX[2]
void fillMuon(const edm::Event &, const edm::EventSetup &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBLowSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > MuonRpcSrc_Token_
MonitorElement * meCaloEcal[2]
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdLowSrc_Token_
MonitorElement * meTrackerSiFZ
MonitorElement * meGeantVtxZ[2]
MonitorElement * meCaloEcalToF[2]
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBHighSrc_Token_
std::vector< SimVertex > SimVertexContainer
static const int sdHcalFwd
edm::EDGetTokenT< edm::PSimHitContainer > MuonCscSrc_Token_
void fillECal(const edm::Event &, const edm::EventSetup &)
edm::InputTag SiTIDHighSrc_
MonitorElement * meMuon[2]
static const int sdHcalBrl
MonitorElement * meMuonRpcFToF[2]
MonitorElement * meCaloPreShToF[2]
MonitorElement * meCaloPreShEta
MonitorElement * meTrackerSiFToF
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
MonitorElement * meTrackerPxFToF
edm::InputTag MuonRpcSrc_
edm::EDGetTokenT< edm::SimVertexContainer > G4VtxSrc_Token_
T perp() const
Magnitude of transverse component.
MonitorElement * meMuonEta
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
edm::InputTag SiTOBLowSrc_
edm::InputTag SiTOBHighSrc_
MonitorElement * meMuonDtR
virtual const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
std::vector< PSimHit > PSimHitContainer
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdHighSrc_Token_
static const int sdPxlFwd
edm::InputTag SiTIBLowSrc_
volatile std::atomic< bool > shutdown_flag false
void showDirStructure(void) const
MonitorElement * meCaloHcalPhi
Detector det() const
get the detector field from this detid
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
MonitorElement * meMuonRpcBR
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * meTrackerPxEta
edm::EDGetTokenT< edm::PCaloHitContainer > ECalESSrc_Token_
std::vector< SimTrack > SimTrackContainer
MonitorElement * meCaloHcalEta
virtual void beginJob(void)
static const int sdHcalEC
MonitorElement * meMuonPhi
void setCurrentFolder(const std::string &fullpath)
GlobalHitsAnalyzer(const edm::ParameterSet &)
edm::EDGetTokenT< edm::PSimHitContainer > MuonDtSrc_Token_
Provenance const * provenance() const
edm::EDGetTokenT< edm::PSimHitContainer > SiTECLowSrc_Token_
MonitorElement * meTrackerSiBR
virtual const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
MonitorElement * meCaloEcalE[2]