19 getAllProvenances(
false),
20 printProvenanceInfo(
false),
21 trackerHitAssociatorConfig_(iPSet, consumesCollector()),
23 std::string MsgLoggerCat =
"GlobalRecHitsProducer_GlobalRecHitsProducer";
80 produces<PGlobalRecHit>(
label);
84 edm::LogInfo(MsgLoggerCat) <<
"\n===============================\n"
85 <<
"Initialized as EDProducer with parameter values:\n"
86 <<
" Name = " <<
fName <<
"\n"
89 <<
" Label = " <<
label <<
"\n"
111 <<
"===============================\n";
118 std::string MsgLoggerCat =
"GlobalRecHitsProducer_beginJob";
126 std::string MsgLoggerCat =
"GlobalRecHitsProducer_endJob";
128 edm::LogInfo(MsgLoggerCat) <<
"Terminating having processed " <<
count <<
" events.";
133 std::string MsgLoggerCat =
"GlobalRecHitsProducer_produce";
143 edm::LogInfo(MsgLoggerCat) <<
"Processing run " << nrun <<
", event " <<
nevt <<
" (" <<
count <<
" events total)";
156 std::vector<const edm::StableProvenance*> AllProv;
157 iEvent.getAllStableProvenance(AllProv);
160 edm::LogInfo(MsgLoggerCat) <<
"Number of Provenances = " << AllProv.size();
163 TString eventout(
"\nProvenance info:\n");
165 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
166 eventout +=
"\n ******************************";
167 eventout +=
"\n Module : ";
169 eventout += AllProv[
i]->moduleLabel();
170 eventout +=
"\n ProductID : ";
172 eventout += AllProv[
i]->productID().id();
173 eventout +=
"\n ClassName : ";
175 eventout += AllProv[
i]->className();
176 eventout +=
"\n InstanceName : ";
178 eventout += AllProv[
i]->productInstanceName();
179 eventout +=
"\n BranchName : ";
181 eventout += AllProv[
i]->branchName();
183 eventout +=
"\n ******************************\n";
201 edm::LogInfo(MsgLoggerCat) <<
"Done gathering data from event.";
226 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillECal";
230 eventout =
"\nGathering info:";
247 if (!EcalUncalibRecHitEB.
isValid()) {
248 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalUncalRecHitEB in event!";
255 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalRecHitEB in event!";
261 if (!crossingFrame.
isValid()) {
262 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal barrel crossingFrame in event!";
275 uint32_t crystid = ebid.
rawId();
276 ebSimMap[crystid] += hitItr->energy();
293 EBRE.push_back(myRecHit->energy());
299 eventout +=
"\n Number of EBRecHits collected:............ ";
300 eventout += nEBRecHits;
308 if (!EcalUncalibRecHitEE.
isValid()) {
309 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalUncalRecHitEE in event!";
316 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalRecHitEE in event!";
322 if (!crossingFrame.
isValid()) {
323 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal endcap crossingFrame in event!";
336 uint32_t crystid = eeid.
rawId();
337 eeSimMap[crystid] += hitItr->energy();
354 EERE.push_back(myRecHit->energy());
360 eventout +=
"\n Number of EERecHits collected:............ ";
361 eventout += nEERecHits;
370 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalRecHitES in event!";
376 if (!crossingFrame.
isValid()) {
377 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal preshower crossingFrame in event!";
390 uint32_t crystid = esid.
rawId();
391 esSimMap[crystid] += hitItr->energy();
406 eventout +=
"\n Number of ESRecHits collected:............ ";
407 eventout += nESRecHits;
417 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeECal";
420 TString eventout(
"\n nEBRecHits = ");
421 eventout +=
EBRE.size();
422 for (
unsigned int i = 0;
i <
EBRE.size(); ++
i) {
423 eventout +=
"\n (RE, SHE) = (";
429 eventout +=
"\n nEERecHits = ";
430 eventout +=
EERE.size();
431 for (
unsigned int i = 0;
i <
EERE.size(); ++
i) {
432 eventout +=
"\n (RE, SHE) = (";
438 eventout +=
"\n nESRecHits = ";
439 eventout +=
ESRE.size();
440 for (
unsigned int i = 0;
i <
ESRE.size(); ++
i) {
441 eventout +=
"\n (RE, SHE) = (";
458 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillHCal";
462 eventout =
"\nGathering info:";
468 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CaloGeometry in event!";
487 for (std::vector<PCaloHit>::const_iterator
simhits = simhitResult->begin();
simhits != simhitResult->end();
490 uint32_t cellid = detId.
rawId();
493 fHBEnergySimHits[cellid] +=
simhits->energy();
496 fHEEnergySimHits[cellid] +=
simhits->energy();
499 fHOEnergySimHits[cellid] +=
simhits->energy();
502 fHFEnergySimHits[cellid] +=
simhits->energy();
507 Double_t maxHBEnergy = 0.;
508 Double_t maxHEEnergy = 0.;
509 Double_t maxHFEnergy = 0.;
511 Double_t maxHBPhi = -1000.;
512 Double_t maxHEPhi = -1000.;
513 Double_t maxHOPhi = -1000.;
514 Double_t maxHFPhi = -1000.;
516 Double_t maxHBEta = -1000.;
517 Double_t maxHEEta = -1000.;
518 Double_t maxHOEta = -1000.;
519 Double_t maxHFEta = -1000.;
521 Double_t
PI = 3.141592653589;
526 std::vector<edm::Handle<HBHERecHitCollection>>
hbhe;
528 if (!
hbhe[0].isValid()) {
529 edm::LogWarning(MsgLoggerCat) <<
"Unable to find any HBHERecHitCollections in event!";
532 std::vector<edm::Handle<HBHERecHitCollection>>::iterator ihbhe;
537 for (ihbhe =
hbhe.begin(); ihbhe !=
hbhe.end(); ++ihbhe) {
547 if ((jhbhe->energy()) > maxHBEnergy) {
548 maxHBEnergy = jhbhe->energy();
561 if ((jhbhe->energy()) > maxHEEnergy) {
562 maxHEEnergy = jhbhe->energy();
580 float deltaphi = maxHBPhi - fPhi;
581 if (fPhi > maxHBPhi) {
582 deltaphi = fPhi - maxHBPhi;
585 deltaphi = 2.0 *
PI - deltaphi;
587 float deltaeta = fEta - maxHBEta;
588 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
590 HBCalREC.push_back(jhbhe->energy());
592 HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
603 float deltaphi = maxHEPhi - fPhi;
604 if (fPhi > maxHEPhi) {
605 deltaphi = fPhi - maxHEPhi;
608 deltaphi = 2.0 *
PI - deltaphi;
610 float deltaeta = fEta - maxHEEta;
611 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
613 HECalREC.push_back(jhbhe->energy());
615 HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
621 eventout +=
"\n Number of HBRecHits collected:............ ";
626 eventout +=
"\n Number of HERecHits collected:............ ";
633 std::vector<edm::Handle<HFRecHitCollection>>
hf;
635 if (!
hf[0].isValid()) {
636 edm::LogWarning(MsgLoggerCat) <<
"Unable to find any HFRecHitCollections in event!";
639 std::vector<edm::Handle<HFRecHitCollection>>::iterator
ihf;
648 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
649 double fEta = cellGeometry->getPosition().eta();
650 double fPhi = cellGeometry->getPosition().phi();
651 if ((jhf->energy()) > maxHFEnergy) {
652 maxHFEnergy = jhf->energy();
665 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
666 double fEta = cellGeometry->getPosition().eta();
667 double fPhi = cellGeometry->getPosition().phi();
669 float deltaphi = maxHBPhi - fPhi;
670 if (fPhi > maxHFPhi) {
671 deltaphi = fPhi - maxHFPhi;
674 deltaphi = 2.0 *
PI - deltaphi;
676 float deltaeta = fEta - maxHFEta;
677 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
681 HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
687 eventout +=
"\n Number of HFDigis collected:.............. ";
694 std::vector<edm::Handle<HORecHitCollection>>
ho;
696 if (!
ho[0].isValid()) {
697 edm::LogWarning(MsgLoggerCat) <<
"Unable to find any HORecHitCollections in event!";
700 std::vector<edm::Handle<HORecHitCollection>>::iterator iho;
703 for (iho =
ho.begin(); iho !=
ho.end(); ++iho) {
710 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
711 double fEta = cellGeometry->getPosition().eta();
712 double fPhi = cellGeometry->getPosition().phi();
714 float deltaphi = maxHOPhi - fPhi;
715 if (fPhi > maxHOPhi) {
716 deltaphi = fPhi - maxHOPhi;
719 deltaphi = 2.0 *
PI - deltaphi;
721 float deltaeta = fEta - maxHOEta;
722 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
726 HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
732 eventout +=
"\n Number of HODigis collected:.............. ";
743 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeHCal";
746 TString eventout(
"\n nHBRecHits = ");
748 for (
unsigned int i = 0;
i <
HBCalREC.size(); ++
i) {
749 eventout +=
"\n (REC, R, SHE) = (";
757 eventout +=
"\n nHERecHits = ";
759 for (
unsigned int i = 0;
i <
HECalREC.size(); ++
i) {
760 eventout +=
"\n (REC, R, SHE) = (";
768 eventout +=
"\n nHFRecHits = ";
770 for (
unsigned int i = 0;
i <
HFCalREC.size(); ++
i) {
771 eventout +=
"\n (REC, R, SHE) = (";
779 eventout +=
"\n nHORecHits = ";
781 for (
unsigned int i = 0;
i <
HOCalREC.size(); ++
i) {
782 eventout +=
"\n (REC, R, SHE) = (";
808 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillTrk";
812 eventout =
"\nGathering info:";
817 if (!rechitsmatched.
isValid()) {
818 edm::LogWarning(MsgLoggerCat) <<
"Unable to find stripmatchedrechits in event!";
827 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerDigiGeometry in event!";
832 int nStripBrl = 0, nStripFwd = 0;
835 for (TrackerGeometry::DetContainer::const_iterator it = pDD->
dets().begin(); it != pDD->
dets().end(); ++it) {
836 uint32_t myid = ((*it)->geographicalId()).rawId();
837 DetId detid = ((*it)->geographicalId());
842 if (rechitmatchedMatch != rechitsmatched->
end()) {
845 rechitmatchedRange.
begin();
849 for (itermatched = rechitmatchedRangeIteratorBegin; itermatched != rechitmatchedRangeIteratorEnd; ++itermatched) {
853 float mindist = 999999.;
854 float distx = 999999.;
855 float disty = 999999.;
856 float dist = 999999.;
857 std::pair<LocalPoint, LocalVector> closestPair;
860 float rechitmatchedx =
position.x();
861 float rechitmatchedy =
position.y();
869 std::pair<LocalPoint, LocalVector> hitPair;
871 for (std::vector<PSimHit>::const_iterator
m =
matched.begin();
m !=
matched.end();
m++) {
874 distx = fabs(rechitmatchedx - hitPair.first.x());
875 disty = fabs(rechitmatchedy - hitPair.first.y());
876 dist =
sqrt(distx * distx + disty * disty);
878 if (dist < mindist) {
880 closestPair = hitPair;
889 TIBL1RX.push_back(rechitmatchedx);
890 TIBL1RY.push_back(rechitmatchedy);
891 TIBL1SX.push_back(closestPair.first.x());
892 TIBL1SY.push_back(closestPair.first.y());
895 TIBL2RX.push_back(rechitmatchedx);
896 TIBL2RY.push_back(rechitmatchedy);
897 TIBL2SX.push_back(closestPair.first.x());
898 TIBL2SY.push_back(closestPair.first.y());
901 TIBL3RX.push_back(rechitmatchedx);
902 TIBL3RY.push_back(rechitmatchedy);
903 TIBL3SX.push_back(closestPair.first.x());
904 TIBL3SY.push_back(closestPair.first.y());
907 TIBL4RX.push_back(rechitmatchedx);
908 TIBL4RY.push_back(rechitmatchedy);
909 TIBL4SX.push_back(closestPair.first.x());
910 TIBL4SY.push_back(closestPair.first.y());
919 TOBL1RX.push_back(rechitmatchedx);
920 TOBL1RY.push_back(rechitmatchedy);
921 TOBL1SX.push_back(closestPair.first.x());
922 TOBL1SY.push_back(closestPair.first.y());
925 TOBL2RX.push_back(rechitmatchedx);
926 TOBL2RY.push_back(rechitmatchedy);
927 TOBL2SX.push_back(closestPair.first.x());
928 TOBL2SY.push_back(closestPair.first.y());
931 TOBL3RX.push_back(rechitmatchedx);
932 TOBL3RY.push_back(rechitmatchedy);
933 TOBL3SX.push_back(closestPair.first.x());
934 TOBL3SY.push_back(closestPair.first.y());
937 TOBL4RX.push_back(rechitmatchedx);
938 TOBL4RY.push_back(rechitmatchedy);
939 TOBL4SX.push_back(closestPair.first.x());
940 TOBL4SY.push_back(closestPair.first.y());
949 TIDW1RX.push_back(rechitmatchedx);
950 TIDW1RY.push_back(rechitmatchedy);
951 TIDW1SX.push_back(closestPair.first.x());
952 TIDW1SY.push_back(closestPair.first.y());
955 TIDW2RX.push_back(rechitmatchedx);
956 TIDW2RY.push_back(rechitmatchedy);
957 TIDW2SX.push_back(closestPair.first.x());
958 TIDW2SY.push_back(closestPair.first.y());
961 TIDW3RX.push_back(rechitmatchedx);
962 TIDW3RY.push_back(rechitmatchedy);
963 TIDW3SX.push_back(closestPair.first.x());
964 TIDW3SY.push_back(closestPair.first.y());
973 TECW1RX.push_back(rechitmatchedx);
974 TECW1RY.push_back(rechitmatchedy);
975 TECW1SX.push_back(closestPair.first.x());
976 TECW1SY.push_back(closestPair.first.y());
979 TECW2RX.push_back(rechitmatchedx);
980 TECW2RY.push_back(rechitmatchedy);
981 TECW2SX.push_back(closestPair.first.x());
982 TECW2SY.push_back(closestPair.first.y());
985 TECW3RX.push_back(rechitmatchedx);
986 TECW3RY.push_back(rechitmatchedy);
987 TECW3SX.push_back(closestPair.first.x());
988 TECW3SY.push_back(closestPair.first.y());
991 TECW4RX.push_back(rechitmatchedx);
992 TECW4RY.push_back(rechitmatchedy);
993 TECW4SX.push_back(closestPair.first.x());
994 TECW4SY.push_back(closestPair.first.y());
997 TECW5RX.push_back(rechitmatchedx);
998 TECW5RY.push_back(rechitmatchedy);
999 TECW5SX.push_back(closestPair.first.x());
1000 TECW5SY.push_back(closestPair.first.y());
1003 TECW6RX.push_back(rechitmatchedx);
1004 TECW6RY.push_back(rechitmatchedy);
1005 TECW6SX.push_back(closestPair.first.x());
1006 TECW6SY.push_back(closestPair.first.y());
1009 TECW7RX.push_back(rechitmatchedx);
1010 TECW7RY.push_back(rechitmatchedy);
1011 TECW7SX.push_back(closestPair.first.x());
1012 TECW7SY.push_back(closestPair.first.y());
1015 TECW8RX.push_back(rechitmatchedx);
1016 TECW8RY.push_back(rechitmatchedy);
1017 TECW8SX.push_back(closestPair.first.x());
1018 TECW8SY.push_back(closestPair.first.y());
1028 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1029 eventout += nStripBrl;
1033 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1034 eventout += nStripFwd;
1042 edm::LogWarning(MsgLoggerCat) <<
"Unable to find SiPixelRecHitCollection in event!";
1049 if (!
geom.isValid()) {
1050 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerDigiGeometry in event!";
1055 int nPxlBrl = 0, nPxlFwd = 0;
1057 for (TrackerGeometry::DetContainer::const_iterator it =
geom->dets().begin(); it !=
geom->dets().end(); ++it) {
1058 uint32_t myid = ((*it)->geographicalId()).rawId();
1059 DetId detId = ((*it)->geographicalId());
1069 if (pixeldet == recHitColl->
end())
1078 for (; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1083 float closest = 9999.9;
1086 float rechit_x = lp.
x();
1087 float rechit_y = lp.
y();
1093 for (std::vector<PSimHit>::const_iterator
m =
matched.begin();
m !=
matched.end(); ++
m) {
1094 float sim_x1 = (*m).entryPoint().x();
1095 float sim_x2 = (*m).exitPoint().x();
1096 float sim_xpos = 0.5 * (sim_x1 + sim_x2);
1098 float sim_y1 = (*m).entryPoint().y();
1099 float sim_y2 = (*m).exitPoint().y();
1100 float sim_ypos = 0.5 * (sim_y1 + sim_y2);
1102 float x_res = fabs(sim_xpos - rechit_x);
1103 float y_res = fabs(sim_ypos - rechit_y);
1105 float dist =
sqrt(x_res * x_res + y_res * y_res);
1107 if (dist < closest) {
1119 BRL1RX.push_back(rechit_x);
1120 BRL1RY.push_back(rechit_y);
1125 BRL2RX.push_back(rechit_x);
1126 BRL2RY.push_back(rechit_y);
1131 BRL3RX.push_back(rechit_x);
1132 BRL3RY.push_back(rechit_y);
1142 if (tTopo->
pxfDisk(myid) == 1) {
1143 if (tTopo->
pxfSide(myid) == 1) {
1149 if (tTopo->
pxfSide(myid) == 2) {
1156 if (tTopo->
pxfDisk(myid) == 2) {
1157 if (tTopo->
pxfSide(myid) == 1) {
1163 if (tTopo->
pxfSide(myid) == 2) {
1176 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1177 eventout += nPxlBrl;
1181 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1182 eventout += nPxlFwd;
1192 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeTrk";
1196 TString eventout(
"\n nTIBL1 = ");
1198 for (
unsigned int i = 0;
i <
TIBL1RX.size(); ++
i) {
1199 eventout +=
"\n (RX, RY, SX, SY) = (";
1209 eventout +=
"\n nTIBL2 = ";
1211 for (
unsigned int i = 0;
i <
TIBL2RX.size(); ++
i) {
1212 eventout +=
"\n (RX, RY, SX, SY) = (";
1222 eventout +=
"\n nTIBL3 = ";
1224 for (
unsigned int i = 0;
i <
TIBL3RX.size(); ++
i) {
1225 eventout +=
"\n (RX, RY, SX, SY) = (";
1235 eventout +=
"\n nTIBL4 = ";
1237 for (
unsigned int i = 0;
i <
TIBL4RX.size(); ++
i) {
1238 eventout +=
"\n (RX, RY, SX, SY) = (";
1248 eventout +=
"\n nTOBL1 = ";
1250 for (
unsigned int i = 0;
i <
TOBL1RX.size(); ++
i) {
1251 eventout +=
"\n (RX, RY, SX, SY) = (";
1261 eventout +=
"\n nTOBL2 = ";
1263 for (
unsigned int i = 0;
i <
TOBL2RX.size(); ++
i) {
1264 eventout +=
"\n (RX, RY, SX, SY) = (";
1274 eventout +=
"\n nTOBL3 = ";
1276 for (
unsigned int i = 0;
i <
TOBL3RX.size(); ++
i) {
1277 eventout +=
"\n (RX, RY, SX, SY) = (";
1287 eventout +=
"\n nTOBL4 = ";
1289 for (
unsigned int i = 0;
i <
TOBL4RX.size(); ++
i) {
1290 eventout +=
"\n (RX, RY, SX, SY) = (";
1300 eventout +=
"\n nTIDW1 = ";
1302 for (
unsigned int i = 0;
i <
TIDW1RX.size(); ++
i) {
1303 eventout +=
"\n (RX, RY, SX, SY) = (";
1313 eventout +=
"\n nTIDW2 = ";
1315 for (
unsigned int i = 0;
i <
TIDW2RX.size(); ++
i) {
1316 eventout +=
"\n (RX, RY, SX, SY) = (";
1326 eventout +=
"\n nTIDW3 = ";
1328 for (
unsigned int i = 0;
i <
TIDW3RX.size(); ++
i) {
1329 eventout +=
"\n (RX, RY, SX, SY) = (";
1339 eventout +=
"\n nTECW1 = ";
1341 for (
unsigned int i = 0;
i <
TECW1RX.size(); ++
i) {
1342 eventout +=
"\n (RX, RY, SX, SY) = (";
1352 eventout +=
"\n nTECW2 = ";
1354 for (
unsigned int i = 0;
i <
TECW2RX.size(); ++
i) {
1355 eventout +=
"\n (RX, RY, SX, SY) = (";
1365 eventout +=
"\n nTECW3 = ";
1367 for (
unsigned int i = 0;
i <
TECW3RX.size(); ++
i) {
1368 eventout +=
"\n (RX, RY, SX, SY) = (";
1378 eventout +=
"\n nTECW4 = ";
1380 for (
unsigned int i = 0;
i <
TECW4RX.size(); ++
i) {
1381 eventout +=
"\n (RX, RY, SX, SY) = (";
1391 eventout +=
"\n nTECW5 = ";
1393 for (
unsigned int i = 0;
i <
TECW5RX.size(); ++
i) {
1394 eventout +=
"\n (RX, RY, SX, SY) = (";
1404 eventout +=
"\n nTECW6 = ";
1406 for (
unsigned int i = 0;
i <
TECW6RX.size(); ++
i) {
1407 eventout +=
"\n (RX, RY, SX, SY) = (";
1417 eventout +=
"\n nTECW7 = ";
1419 for (
unsigned int i = 0;
i <
TECW7RX.size(); ++
i) {
1420 eventout +=
"\n (RX, RY, SX, SY) = (";
1430 eventout +=
"\n nTECW8 = ";
1432 for (
unsigned int i = 0;
i <
TECW8RX.size(); ++
i) {
1433 eventout +=
"\n (RX, RY, SX, SY) = (";
1445 eventout +=
"\n nBRL1 = ";
1446 eventout +=
BRL1RX.size();
1447 for (
unsigned int i = 0;
i <
BRL1RX.size(); ++
i) {
1448 eventout +=
"\n (RX, RY, SX, SY) = (";
1458 eventout +=
"\n nBRL2 = ";
1459 eventout +=
BRL2RX.size();
1460 for (
unsigned int i = 0;
i <
BRL2RX.size(); ++
i) {
1461 eventout +=
"\n (RX, RY, SX, SY) = (";
1471 eventout +=
"\n nBRL3 = ";
1472 eventout +=
BRL3RX.size();
1473 for (
unsigned int i = 0;
i <
BRL3RX.size(); ++
i) {
1474 eventout +=
"\n (RX, RY, SX, SY) = (";
1484 eventout +=
"\n nFWD1p = ";
1486 for (
unsigned int i = 0;
i <
FWD1pRX.size(); ++
i) {
1487 eventout +=
"\n (RX, RY, SX, SY) = (";
1497 eventout +=
"\n nFWD1n = ";
1499 for (
unsigned int i = 0;
i <
FWD1nRX.size(); ++
i) {
1500 eventout +=
"\n (RX, RY, SX, SY) = (";
1510 eventout +=
"\n nFWD2p = ";
1512 for (
unsigned int i = 0;
i <
FWD2pRX.size(); ++
i) {
1513 eventout +=
"\n (RX, RY, SX, SY) = (";
1523 eventout +=
"\n nFWD2p = ";
1525 for (
unsigned int i = 0;
i <
FWD2nRX.size(); ++
i) {
1526 eventout +=
"\n (RX, RY, SX, SY) = (";
1574 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillMuon";
1578 eventout =
"\nGathering info:";
1584 edm::LogWarning(MsgLoggerCat) <<
"Unable to find DTMuonGeometryRecord in event!";
1591 edm::LogWarning(MsgLoggerCat) <<
"Unable to find dtsimHits in event!";
1595 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1601 edm::LogWarning(MsgLoggerCat) <<
"Unable to find dtRecHits in event!";
1607 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1610 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1628 edm::LogWarning(MsgLoggerCat) <<
"Unable to find muo CSC crossingFrame in event!";
1635 theMap[hitItr->detUnitId()].push_back(*hitItr);
1642 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CSCMuonGeometryRecord in event!";
1651 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CSC RecHits in event!";
1659 int detId = (*recHitItr).cscDetId().rawId();
1662 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
theMap.find(detId);
1663 if (mapItr !=
theMap.end()) {
1671 const CSCLayer* layer = dynamic_cast<const CSCLayer*>(detUnit);
1679 eventout +=
"\n Number of CSCRecHits collected:........... ";
1684 std::map<double, int> mapsim, maprec;
1685 std::map<int, double> nmapsim, nmaprec;
1690 edm::LogWarning(MsgLoggerCat) <<
"Unable to find RPCMuonGeometryRecord in event!";
1697 edm::LogWarning(MsgLoggerCat) <<
"Unable to find RPCSimHit in event!";
1704 edm::LogWarning(MsgLoggerCat) <<
"Unable to find RPCRecHit in event!";
1711 for (recIt =
recHit->begin(); recIt !=
recHit->end(); ++recIt) {
1713 const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->
roll(Rid));
1716 eventout +=
"\n Number of RPCRecHits collected:........... ";
1725 LocalPoint rhitlocal = (*recIt).localPosition();
1726 double rhitlocalx = rhitlocal.
x();
1727 maprec[rhitlocalx] = nrec;
1731 for (std::map<double, int>::iterator iter = maprec.begin(); iter != maprec.end(); ++iter) {
1733 nmaprec[
i] = (*iter).first;
1736 edm::PSimHitContainer::const_iterator simIt;
1738 for (simIt =
simHit->begin(); simIt !=
simHit->end(); simIt++) {
1739 int ptype = (*simIt).particleType();
1743 LocalPoint shitlocal = (*simIt).localPosition();
1744 double shitlocalx = shitlocal.
x();
1745 mapsim[shitlocalx] = nsim;
1750 for (std::map<double, int>::iterator iter = mapsim.begin(); iter != mapsim.end(); ++iter) {
1752 nmapsim[
i] = (*iter).first;
1756 for (
int r = 0;
r < nsim;
r++) {
1758 RPCRHX.push_back(nmaprec[
r + 1]);
1759 RPCSHX.push_back(nmapsim[
r + 1]);
1764 eventout +=
"\n Number of RPCRecHits collected:........... ";
1775 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeMuon";
1779 TString eventout(
"\n nDT = ");
1780 eventout +=
DTRHD.size();
1781 for (
unsigned int i = 0;
i <
DTRHD.size(); ++
i) {
1782 eventout +=
"\n (RHD, SHD) = (";
1790 eventout +=
"\n nCSC = ";
1792 for (
unsigned int i = 0;
i <
CSCRHPHI.size(); ++
i) {
1793 eventout +=
"\n (rhphi, rhperp, shphi) = (";
1803 eventout +=
"\n nRPC = ";
1804 eventout +=
RPCRHX.size();
1805 for (
unsigned int i = 0;
i <
RPCRHX.size(); ++
i) {
1806 eventout +=
"\n (rhx, shx) = (";
1826 std::string MsgLoggerCat =
"GlobalRecHitsProducer_clear";
1829 edm::LogInfo(MsgLoggerCat) <<
"Clearing event holders";
1987 LocalPoint localHit = plane.toLocal(globalpos);
2005 return std::pair<LocalPoint, LocalVector>(projectedPos, localStripDir);
2011 std::map<DTWireId, std::vector<DTRecHit1DPair>>
ret;
2015 ret[(*rechit).wireId()].push_back(*rechit);
2026 float xEntry = entryP.
x() - xwire;
2027 float xExit = exitP.
x() - xwire;
2030 return fabs(xEntry - (entryP.
z() * (xExit - xEntry)) / (exitP.
z() - entryP.
z()));
2034 template <
typename type>
2037 const std::vector<type>&
recHits,
2038 const float simHitDist) {
2040 const type* theBestRecHit =
nullptr;
2044 if (fabs(distTmp - simHitDist) <
res) {
2045 res = fabs(distTmp - simHitDist);
2046 theBestRecHit = &(*recHit);
2050 return theBestRecHit;
2064 template <
typename type>
2069 std::map<DTWireId, std::vector<PSimHit>> simHitsPerWire = _simHitsPerWire;
2070 std::map<DTWireId, std::vector<type>> recHitsPerWire = _recHitsPerWire;
2073 for (
std::map<
DTWireId, std::vector<PSimHit>>::const_iterator wireAndSHits = simHitsPerWire.begin();
2074 wireAndSHits != simHitsPerWire.end();
2076 DTWireId wireId = (*wireAndSHits).first;
2077 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
2084 if (muSimHit ==
nullptr) {
2091 if (simHitWireDist > 2.1) {
2097 if (recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
2101 std::vector<type>
recHits = recHitsPerWire[wireId];
2110 DTRHD.push_back(recHitWireDist);
2111 DTSHD.push_back(simHitWireDist);