19 getAllProvenances(
false),
20 printProvenanceInfo(
false),
21 trackerHitAssociatorConfig_(iPSet, consumesCollector()),
29 std::string MsgLoggerCat =
"GlobalRecHitsProducer_GlobalRecHitsProducer";
86 produces<PGlobalRecHit>(
label);
90 edm::LogInfo(MsgLoggerCat) <<
"\n===============================\n" 91 <<
"Initialized as EDProducer with parameter values:\n" 92 <<
" Name = " <<
fName <<
"\n" 95 <<
" Label = " <<
label <<
"\n" 117 <<
"===============================\n";
124 std::string MsgLoggerCat =
"GlobalRecHitsProducer_beginJob";
132 std::string MsgLoggerCat =
"GlobalRecHitsProducer_endJob";
134 edm::LogInfo(MsgLoggerCat) <<
"Terminating having processed " <<
count <<
" events.";
139 std::string MsgLoggerCat =
"GlobalRecHitsProducer_produce";
149 edm::LogInfo(MsgLoggerCat) <<
"Processing run " << nrun <<
", event " <<
nevt <<
" (" <<
count <<
" events total)";
162 std::vector<const edm::StableProvenance*> AllProv;
163 iEvent.getAllStableProvenance(AllProv);
166 edm::LogInfo(MsgLoggerCat) <<
"Number of Provenances = " << AllProv.size();
169 TString eventout(
"\nProvenance info:\n");
171 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
172 eventout +=
"\n ******************************";
173 eventout +=
"\n Module : ";
175 eventout += AllProv[
i]->moduleLabel();
176 eventout +=
"\n ProductID : ";
178 eventout += AllProv[
i]->productID().id();
179 eventout +=
"\n ClassName : ";
181 eventout += AllProv[
i]->className();
182 eventout +=
"\n InstanceName : ";
184 eventout += AllProv[
i]->productInstanceName();
185 eventout +=
"\n BranchName : ";
187 eventout += AllProv[
i]->branchName();
189 eventout +=
"\n ******************************\n";
207 edm::LogInfo(MsgLoggerCat) <<
"Done gathering data from event.";
232 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillECal";
236 eventout =
"\nGathering info:";
253 if (!EcalUncalibRecHitEB.
isValid()) {
254 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalUncalRecHitEB in event!";
261 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalRecHitEB in event!";
267 if (!crossingFrame.
isValid()) {
268 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal barrel crossingFrame in event!";
281 uint32_t crystid = ebid.
rawId();
282 ebSimMap[crystid] += hitItr->energy();
299 EBRE.push_back(myRecHit->energy());
305 eventout +=
"\n Number of EBRecHits collected:............ ";
306 eventout += nEBRecHits;
314 if (!EcalUncalibRecHitEE.
isValid()) {
315 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalUncalRecHitEE in event!";
322 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalRecHitEE in event!";
328 if (!crossingFrame.
isValid()) {
329 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal endcap crossingFrame in event!";
342 uint32_t crystid = eeid.
rawId();
343 eeSimMap[crystid] += hitItr->energy();
360 EERE.push_back(myRecHit->energy());
366 eventout +=
"\n Number of EERecHits collected:............ ";
367 eventout += nEERecHits;
376 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalRecHitES in event!";
382 if (!crossingFrame.
isValid()) {
383 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal preshower crossingFrame in event!";
396 uint32_t crystid = esid.
rawId();
397 esSimMap[crystid] += hitItr->energy();
412 eventout +=
"\n Number of ESRecHits collected:............ ";
413 eventout += nESRecHits;
423 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeECal";
426 TString eventout(
"\n nEBRecHits = ");
427 eventout +=
EBRE.size();
428 for (
unsigned int i = 0;
i <
EBRE.size(); ++
i) {
429 eventout +=
"\n (RE, SHE) = (";
435 eventout +=
"\n nEERecHits = ";
436 eventout +=
EERE.size();
437 for (
unsigned int i = 0;
i <
EERE.size(); ++
i) {
438 eventout +=
"\n (RE, SHE) = (";
444 eventout +=
"\n nESRecHits = ";
445 eventout +=
ESRE.size();
446 for (
unsigned int i = 0;
i <
ESRE.size(); ++
i) {
447 eventout +=
"\n (RE, SHE) = (";
464 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillHCal";
468 eventout =
"\nGathering info:";
473 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CaloGeometry in event!";
492 for (std::vector<PCaloHit>::const_iterator
simhits = simhitResult->begin();
simhits != simhitResult->end();
495 uint32_t cellid =
detId.rawId();
498 fHBEnergySimHits[cellid] +=
simhits->energy();
501 fHEEnergySimHits[cellid] +=
simhits->energy();
504 fHOEnergySimHits[cellid] +=
simhits->energy();
507 fHFEnergySimHits[cellid] +=
simhits->energy();
512 Double_t maxHBEnergy = 0.;
513 Double_t maxHEEnergy = 0.;
514 Double_t maxHFEnergy = 0.;
516 Double_t maxHBPhi = -1000.;
517 Double_t maxHEPhi = -1000.;
518 Double_t maxHOPhi = -1000.;
519 Double_t maxHFPhi = -1000.;
521 Double_t maxHBEta = -1000.;
522 Double_t maxHEEta = -1000.;
523 Double_t maxHOEta = -1000.;
524 Double_t maxHFEta = -1000.;
526 Double_t
PI = 3.141592653589;
531 std::vector<edm::Handle<HBHERecHitCollection>>
hbhe;
534 edm::LogWarning(MsgLoggerCat) <<
"Unable to find any HBHERecHitCollections in event!";
537 std::vector<edm::Handle<HBHERecHitCollection>>::iterator ihbhe;
542 for (ihbhe =
hbhe.begin(); ihbhe !=
hbhe.end(); ++ihbhe) {
552 if ((jhbhe->energy()) > maxHBEnergy) {
553 maxHBEnergy = jhbhe->energy();
566 if ((jhbhe->energy()) > maxHEEnergy) {
567 maxHEEnergy = jhbhe->energy();
585 float deltaphi = maxHBPhi - fPhi;
586 if (fPhi > maxHBPhi) {
587 deltaphi = fPhi - maxHBPhi;
590 deltaphi = 2.0 *
PI - deltaphi;
592 float deltaeta = fEta - maxHBEta;
593 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
595 HBCalREC.push_back(jhbhe->energy());
597 HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
608 float deltaphi = maxHEPhi - fPhi;
609 if (fPhi > maxHEPhi) {
610 deltaphi = fPhi - maxHEPhi;
613 deltaphi = 2.0 *
PI - deltaphi;
615 float deltaeta = fEta - maxHEEta;
616 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
618 HECalREC.push_back(jhbhe->energy());
620 HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
626 eventout +=
"\n Number of HBRecHits collected:............ ";
631 eventout +=
"\n Number of HERecHits collected:............ ";
638 std::vector<edm::Handle<HFRecHitCollection>>
hf;
641 edm::LogWarning(MsgLoggerCat) <<
"Unable to find any HFRecHitCollections in event!";
644 std::vector<edm::Handle<HFRecHitCollection>>::iterator ihf;
647 for (ihf =
hf.begin(); ihf !=
hf.end(); ++ihf) {
653 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
654 double fEta = cellGeometry->getPosition().eta();
655 double fPhi = cellGeometry->getPosition().phi();
656 if ((jhf->energy()) > maxHFEnergy) {
657 maxHFEnergy = jhf->energy();
670 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
671 double fEta = cellGeometry->getPosition().eta();
672 double fPhi = cellGeometry->getPosition().phi();
674 float deltaphi = maxHBPhi - fPhi;
675 if (fPhi > maxHFPhi) {
676 deltaphi = fPhi - maxHFPhi;
679 deltaphi = 2.0 *
PI - deltaphi;
681 float deltaeta = fEta - maxHFEta;
682 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
686 HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
692 eventout +=
"\n Number of HFDigis collected:.............. ";
699 std::vector<edm::Handle<HORecHitCollection>>
ho;
702 edm::LogWarning(MsgLoggerCat) <<
"Unable to find any HORecHitCollections in event!";
705 std::vector<edm::Handle<HORecHitCollection>>::iterator iho;
708 for (iho =
ho.begin(); iho !=
ho.end(); ++iho) {
715 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
716 double fEta = cellGeometry->getPosition().eta();
717 double fPhi = cellGeometry->getPosition().phi();
719 float deltaphi = maxHOPhi - fPhi;
720 if (fPhi > maxHOPhi) {
721 deltaphi = fPhi - maxHOPhi;
724 deltaphi = 2.0 *
PI - deltaphi;
726 float deltaeta = fEta - maxHOEta;
727 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
731 HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
737 eventout +=
"\n Number of HODigis collected:.............. ";
748 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeHCal";
751 TString eventout(
"\n nHBRecHits = ");
753 for (
unsigned int i = 0;
i <
HBCalREC.size(); ++
i) {
754 eventout +=
"\n (REC, R, SHE) = (";
762 eventout +=
"\n nHERecHits = ";
764 for (
unsigned int i = 0;
i <
HECalREC.size(); ++
i) {
765 eventout +=
"\n (REC, R, SHE) = (";
773 eventout +=
"\n nHFRecHits = ";
775 for (
unsigned int i = 0;
i <
HFCalREC.size(); ++
i) {
776 eventout +=
"\n (REC, R, SHE) = (";
784 eventout +=
"\n nHORecHits = ";
786 for (
unsigned int i = 0;
i <
HOCalREC.size(); ++
i) {
787 eventout +=
"\n (REC, R, SHE) = (";
811 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillTrk";
814 eventout =
"\nGathering info:";
819 if (!rechitsmatched.
isValid()) {
820 edm::LogWarning(MsgLoggerCat) <<
"Unable to find stripmatchedrechits in event!";
827 if (!tGeomHandle.isValid()) {
828 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerDigiGeometry in event!";
833 int nStripBrl = 0, nStripFwd = 0;
836 for (TrackerGeometry::DetContainer::const_iterator it = tGeomHandle->dets().begin(); it != tGeomHandle->dets().end();
838 uint32_t myid = ((*it)->geographicalId()).
rawId();
839 DetId detid = ((*it)->geographicalId());
844 if (rechitmatchedMatch != rechitsmatched->
end()) {
847 rechitmatchedRange.
begin();
851 for (itermatched = rechitmatchedRangeIteratorBegin; itermatched != rechitmatchedRangeIteratorEnd; ++itermatched) {
855 float mindist = 999999.;
856 float distx = 999999.;
857 float disty = 999999.;
858 float dist = 999999.;
859 std::pair<LocalPoint, LocalVector> closestPair;
862 float rechitmatchedx =
position.x();
863 float rechitmatchedy =
position.y();
871 std::pair<LocalPoint, LocalVector> hitPair;
873 for (std::vector<PSimHit>::const_iterator
m =
matched.begin();
m !=
matched.end();
m++) {
876 distx = fabs(rechitmatchedx - hitPair.first.x());
877 disty = fabs(rechitmatchedy - hitPair.first.y());
878 dist =
sqrt(distx * distx + disty * disty);
880 if (dist < mindist) {
882 closestPair = hitPair;
891 TIBL1RX.push_back(rechitmatchedx);
892 TIBL1RY.push_back(rechitmatchedy);
893 TIBL1SX.push_back(closestPair.first.x());
894 TIBL1SY.push_back(closestPair.first.y());
897 TIBL2RX.push_back(rechitmatchedx);
898 TIBL2RY.push_back(rechitmatchedy);
899 TIBL2SX.push_back(closestPair.first.x());
900 TIBL2SY.push_back(closestPair.first.y());
903 TIBL3RX.push_back(rechitmatchedx);
904 TIBL3RY.push_back(rechitmatchedy);
905 TIBL3SX.push_back(closestPair.first.x());
906 TIBL3SY.push_back(closestPair.first.y());
909 TIBL4RX.push_back(rechitmatchedx);
910 TIBL4RY.push_back(rechitmatchedy);
911 TIBL4SX.push_back(closestPair.first.x());
912 TIBL4SY.push_back(closestPair.first.y());
921 TOBL1RX.push_back(rechitmatchedx);
922 TOBL1RY.push_back(rechitmatchedy);
923 TOBL1SX.push_back(closestPair.first.x());
924 TOBL1SY.push_back(closestPair.first.y());
927 TOBL2RX.push_back(rechitmatchedx);
928 TOBL2RY.push_back(rechitmatchedy);
929 TOBL2SX.push_back(closestPair.first.x());
930 TOBL2SY.push_back(closestPair.first.y());
933 TOBL3RX.push_back(rechitmatchedx);
934 TOBL3RY.push_back(rechitmatchedy);
935 TOBL3SX.push_back(closestPair.first.x());
936 TOBL3SY.push_back(closestPair.first.y());
939 TOBL4RX.push_back(rechitmatchedx);
940 TOBL4RY.push_back(rechitmatchedy);
941 TOBL4SX.push_back(closestPair.first.x());
942 TOBL4SY.push_back(closestPair.first.y());
951 TIDW1RX.push_back(rechitmatchedx);
952 TIDW1RY.push_back(rechitmatchedy);
953 TIDW1SX.push_back(closestPair.first.x());
954 TIDW1SY.push_back(closestPair.first.y());
957 TIDW2RX.push_back(rechitmatchedx);
958 TIDW2RY.push_back(rechitmatchedy);
959 TIDW2SX.push_back(closestPair.first.x());
960 TIDW2SY.push_back(closestPair.first.y());
963 TIDW3RX.push_back(rechitmatchedx);
964 TIDW3RY.push_back(rechitmatchedy);
965 TIDW3SX.push_back(closestPair.first.x());
966 TIDW3SY.push_back(closestPair.first.y());
975 TECW1RX.push_back(rechitmatchedx);
976 TECW1RY.push_back(rechitmatchedy);
977 TECW1SX.push_back(closestPair.first.x());
978 TECW1SY.push_back(closestPair.first.y());
981 TECW2RX.push_back(rechitmatchedx);
982 TECW2RY.push_back(rechitmatchedy);
983 TECW2SX.push_back(closestPair.first.x());
984 TECW2SY.push_back(closestPair.first.y());
987 TECW3RX.push_back(rechitmatchedx);
988 TECW3RY.push_back(rechitmatchedy);
989 TECW3SX.push_back(closestPair.first.x());
990 TECW3SY.push_back(closestPair.first.y());
993 TECW4RX.push_back(rechitmatchedx);
994 TECW4RY.push_back(rechitmatchedy);
995 TECW4SX.push_back(closestPair.first.x());
996 TECW4SY.push_back(closestPair.first.y());
999 TECW5RX.push_back(rechitmatchedx);
1000 TECW5RY.push_back(rechitmatchedy);
1001 TECW5SX.push_back(closestPair.first.x());
1002 TECW5SY.push_back(closestPair.first.y());
1005 TECW6RX.push_back(rechitmatchedx);
1006 TECW6RY.push_back(rechitmatchedy);
1007 TECW6SX.push_back(closestPair.first.x());
1008 TECW6SY.push_back(closestPair.first.y());
1011 TECW7RX.push_back(rechitmatchedx);
1012 TECW7RY.push_back(rechitmatchedy);
1013 TECW7SX.push_back(closestPair.first.x());
1014 TECW7SY.push_back(closestPair.first.y());
1017 TECW8RX.push_back(rechitmatchedx);
1018 TECW8RY.push_back(rechitmatchedy);
1019 TECW8SX.push_back(closestPair.first.x());
1020 TECW8SY.push_back(closestPair.first.y());
1030 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1031 eventout += nStripBrl;
1035 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1036 eventout += nStripFwd;
1044 edm::LogWarning(MsgLoggerCat) <<
"Unable to find SiPixelRecHitCollection in event!";
1048 int nPxlBrl = 0, nPxlFwd = 0;
1050 for (TrackerGeometry::DetContainer::const_iterator it = tGeomHandle->dets().begin(); it != tGeomHandle->dets().end();
1052 uint32_t myid = ((*it)->geographicalId()).
rawId();
1054 int subid =
detId.subdetId();
1063 if (pixeldet == recHitColl->
end())
1072 for (; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1080 float rechit_x = lp.
x();
1081 float rechit_y = lp.
y();
1087 for (std::vector<PSimHit>::const_iterator
m =
matched.begin();
m !=
matched.end(); ++
m) {
1088 float sim_x1 = (*m).entryPoint().x();
1089 float sim_x2 = (*m).exitPoint().x();
1090 float sim_xpos = 0.5 * (sim_x1 + sim_x2);
1092 float sim_y1 = (*m).entryPoint().y();
1093 float sim_y2 = (*m).exitPoint().y();
1094 float sim_ypos = 0.5 * (sim_y1 + sim_y2);
1096 float x_res = fabs(sim_xpos - rechit_x);
1097 float y_res = fabs(sim_ypos - rechit_y);
1099 float dist =
sqrt(x_res * x_res + y_res * y_res);
1113 BRL1RX.push_back(rechit_x);
1114 BRL1RY.push_back(rechit_y);
1119 BRL2RX.push_back(rechit_x);
1120 BRL2RY.push_back(rechit_y);
1125 BRL3RX.push_back(rechit_x);
1126 BRL3RY.push_back(rechit_y);
1136 if (tTopo->
pxfDisk(myid) == 1) {
1137 if (tTopo->
pxfSide(myid) == 1) {
1143 if (tTopo->
pxfSide(myid) == 2) {
1150 if (tTopo->
pxfDisk(myid) == 2) {
1151 if (tTopo->
pxfSide(myid) == 1) {
1157 if (tTopo->
pxfSide(myid) == 2) {
1170 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1171 eventout += nPxlBrl;
1175 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1176 eventout += nPxlFwd;
1186 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeTrk";
1190 TString eventout(
"\n nTIBL1 = ");
1192 for (
unsigned int i = 0;
i <
TIBL1RX.size(); ++
i) {
1193 eventout +=
"\n (RX, RY, SX, SY) = (";
1203 eventout +=
"\n nTIBL2 = ";
1205 for (
unsigned int i = 0;
i <
TIBL2RX.size(); ++
i) {
1206 eventout +=
"\n (RX, RY, SX, SY) = (";
1216 eventout +=
"\n nTIBL3 = ";
1218 for (
unsigned int i = 0;
i <
TIBL3RX.size(); ++
i) {
1219 eventout +=
"\n (RX, RY, SX, SY) = (";
1229 eventout +=
"\n nTIBL4 = ";
1231 for (
unsigned int i = 0;
i <
TIBL4RX.size(); ++
i) {
1232 eventout +=
"\n (RX, RY, SX, SY) = (";
1242 eventout +=
"\n nTOBL1 = ";
1244 for (
unsigned int i = 0;
i <
TOBL1RX.size(); ++
i) {
1245 eventout +=
"\n (RX, RY, SX, SY) = (";
1255 eventout +=
"\n nTOBL2 = ";
1257 for (
unsigned int i = 0;
i <
TOBL2RX.size(); ++
i) {
1258 eventout +=
"\n (RX, RY, SX, SY) = (";
1268 eventout +=
"\n nTOBL3 = ";
1270 for (
unsigned int i = 0;
i <
TOBL3RX.size(); ++
i) {
1271 eventout +=
"\n (RX, RY, SX, SY) = (";
1281 eventout +=
"\n nTOBL4 = ";
1283 for (
unsigned int i = 0;
i <
TOBL4RX.size(); ++
i) {
1284 eventout +=
"\n (RX, RY, SX, SY) = (";
1294 eventout +=
"\n nTIDW1 = ";
1296 for (
unsigned int i = 0;
i <
TIDW1RX.size(); ++
i) {
1297 eventout +=
"\n (RX, RY, SX, SY) = (";
1307 eventout +=
"\n nTIDW2 = ";
1309 for (
unsigned int i = 0;
i <
TIDW2RX.size(); ++
i) {
1310 eventout +=
"\n (RX, RY, SX, SY) = (";
1320 eventout +=
"\n nTIDW3 = ";
1322 for (
unsigned int i = 0;
i <
TIDW3RX.size(); ++
i) {
1323 eventout +=
"\n (RX, RY, SX, SY) = (";
1333 eventout +=
"\n nTECW1 = ";
1335 for (
unsigned int i = 0;
i <
TECW1RX.size(); ++
i) {
1336 eventout +=
"\n (RX, RY, SX, SY) = (";
1346 eventout +=
"\n nTECW2 = ";
1348 for (
unsigned int i = 0;
i <
TECW2RX.size(); ++
i) {
1349 eventout +=
"\n (RX, RY, SX, SY) = (";
1359 eventout +=
"\n nTECW3 = ";
1361 for (
unsigned int i = 0;
i <
TECW3RX.size(); ++
i) {
1362 eventout +=
"\n (RX, RY, SX, SY) = (";
1372 eventout +=
"\n nTECW4 = ";
1374 for (
unsigned int i = 0;
i <
TECW4RX.size(); ++
i) {
1375 eventout +=
"\n (RX, RY, SX, SY) = (";
1385 eventout +=
"\n nTECW5 = ";
1387 for (
unsigned int i = 0;
i <
TECW5RX.size(); ++
i) {
1388 eventout +=
"\n (RX, RY, SX, SY) = (";
1398 eventout +=
"\n nTECW6 = ";
1400 for (
unsigned int i = 0;
i <
TECW6RX.size(); ++
i) {
1401 eventout +=
"\n (RX, RY, SX, SY) = (";
1411 eventout +=
"\n nTECW7 = ";
1413 for (
unsigned int i = 0;
i <
TECW7RX.size(); ++
i) {
1414 eventout +=
"\n (RX, RY, SX, SY) = (";
1424 eventout +=
"\n nTECW8 = ";
1426 for (
unsigned int i = 0;
i <
TECW8RX.size(); ++
i) {
1427 eventout +=
"\n (RX, RY, SX, SY) = (";
1439 eventout +=
"\n nBRL1 = ";
1440 eventout +=
BRL1RX.size();
1441 for (
unsigned int i = 0;
i <
BRL1RX.size(); ++
i) {
1442 eventout +=
"\n (RX, RY, SX, SY) = (";
1452 eventout +=
"\n nBRL2 = ";
1453 eventout +=
BRL2RX.size();
1454 for (
unsigned int i = 0;
i <
BRL2RX.size(); ++
i) {
1455 eventout +=
"\n (RX, RY, SX, SY) = (";
1465 eventout +=
"\n nBRL3 = ";
1466 eventout +=
BRL3RX.size();
1467 for (
unsigned int i = 0;
i <
BRL3RX.size(); ++
i) {
1468 eventout +=
"\n (RX, RY, SX, SY) = (";
1478 eventout +=
"\n nFWD1p = ";
1480 for (
unsigned int i = 0;
i <
FWD1pRX.size(); ++
i) {
1481 eventout +=
"\n (RX, RY, SX, SY) = (";
1491 eventout +=
"\n nFWD1n = ";
1493 for (
unsigned int i = 0;
i <
FWD1nRX.size(); ++
i) {
1494 eventout +=
"\n (RX, RY, SX, SY) = (";
1504 eventout +=
"\n nFWD2p = ";
1506 for (
unsigned int i = 0;
i <
FWD2pRX.size(); ++
i) {
1507 eventout +=
"\n (RX, RY, SX, SY) = (";
1517 eventout +=
"\n nFWD2p = ";
1519 for (
unsigned int i = 0;
i <
FWD2nRX.size(); ++
i) {
1520 eventout +=
"\n (RX, RY, SX, SY) = (";
1568 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillMuon";
1572 eventout =
"\nGathering info:";
1576 if (!dtGeom.isValid()) {
1577 edm::LogWarning(MsgLoggerCat) <<
"Unable to find DTMuonGeometryRecord in event!";
1584 edm::LogWarning(MsgLoggerCat) <<
"Unable to find dtsimHits in event!";
1588 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1594 edm::LogWarning(MsgLoggerCat) <<
"Unable to find dtRecHits in event!";
1600 int nDt =
compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, 1);
1603 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1621 edm::LogWarning(MsgLoggerCat) <<
"Unable to find muo CSC crossingFrame in event!";
1628 theMap[hitItr->detUnitId()].push_back(*hitItr);
1633 if (!hGeom.isValid()) {
1634 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CSCMuonGeometryRecord in event!";
1643 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CSC RecHits in event!";
1651 int detId = (*recHitItr).cscDetId().rawId();
1654 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
theMap.find(
detId);
1655 if (mapItr !=
theMap.end()) {
1671 eventout +=
"\n Number of CSCRecHits collected:........... ";
1676 std::map<double, int> mapsim, maprec;
1677 std::map<int, double> nmapsim, nmaprec;
1680 if (!rpcGeom.isValid()) {
1681 edm::LogWarning(MsgLoggerCat) <<
"Unable to find RPCMuonGeometryRecord in event!";
1688 edm::LogWarning(MsgLoggerCat) <<
"Unable to find RPCSimHit in event!";
1695 edm::LogWarning(MsgLoggerCat) <<
"Unable to find RPCRecHit in event!";
1702 for (recIt =
recHit->begin(); recIt !=
recHit->end(); ++recIt) {
1705 if (
roll->isForward()) {
1707 eventout +=
"\n Number of RPCRecHits collected:........... ";
1716 LocalPoint rhitlocal = (*recIt).localPosition();
1717 double rhitlocalx = rhitlocal.
x();
1718 maprec[rhitlocalx] = nrec;
1722 for (std::map<double, int>::iterator iter = maprec.begin(); iter != maprec.end(); ++iter) {
1724 nmaprec[
i] = (*iter).first;
1727 edm::PSimHitContainer::const_iterator simIt;
1729 for (simIt =
simHit->begin(); simIt !=
simHit->end(); simIt++) {
1730 int ptype = (*simIt).particleType();
1734 LocalPoint shitlocal = (*simIt).localPosition();
1735 double shitlocalx = shitlocal.
x();
1736 mapsim[shitlocalx] = nsim;
1741 for (std::map<double, int>::iterator iter = mapsim.begin(); iter != mapsim.end(); ++iter) {
1743 nmapsim[
i] = (*iter).first;
1747 for (
int r = 0;
r < nsim;
r++) {
1749 RPCRHX.push_back(nmaprec[
r + 1]);
1750 RPCSHX.push_back(nmapsim[
r + 1]);
1755 eventout +=
"\n Number of RPCRecHits collected:........... ";
1766 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeMuon";
1770 TString eventout(
"\n nDT = ");
1771 eventout +=
DTRHD.size();
1772 for (
unsigned int i = 0;
i <
DTRHD.size(); ++
i) {
1773 eventout +=
"\n (RHD, SHD) = (";
1781 eventout +=
"\n nCSC = ";
1783 for (
unsigned int i = 0;
i <
CSCRHPHI.size(); ++
i) {
1784 eventout +=
"\n (rhphi, rhperp, shphi) = (";
1794 eventout +=
"\n nRPC = ";
1795 eventout +=
RPCRHX.size();
1796 for (
unsigned int i = 0;
i <
RPCRHX.size(); ++
i) {
1797 eventout +=
"\n (rhx, shx) = (";
1817 std::string MsgLoggerCat =
"GlobalRecHitsProducer_clear";
1820 edm::LogInfo(MsgLoggerCat) <<
"Clearing event holders";
1978 LocalPoint localHit = plane.toLocal(globalpos);
1996 return std::pair<LocalPoint, LocalVector>(projectedPos, localStripDir);
2002 std::map<DTWireId, std::vector<DTRecHit1DPair>>
ret;
2006 ret[(*rechit).wireId()].push_back(*rechit);
2014 float xwire =
layer->specificTopology().wirePosition(wireId.
wire());
2017 float xEntry = entryP.
x() - xwire;
2018 float xExit = exitP.
x() - xwire;
2021 return fabs(xEntry - (entryP.
z() * (xExit - xEntry)) / (exitP.
z() - entryP.
z()));
2025 template <
typename type>
2028 const std::vector<type>&
recHits,
2029 const float simHitDist) {
2031 const type* theBestRecHit =
nullptr;
2035 if (fabs(distTmp - simHitDist) <
res) {
2036 res = fabs(distTmp - simHitDist);
2037 theBestRecHit = &(*recHit);
2041 return theBestRecHit;
2052 return fabs(
recHit.localPosition().x() -
layer->specificTopology().wirePosition(
recHit.wireId().wire()));
2055 template <
typename type>
2060 std::map<DTWireId, std::vector<PSimHit>> simHitsPerWire = _simHitsPerWire;
2061 std::map<DTWireId, std::vector<type>> recHitsPerWire = _recHitsPerWire;
2064 for (
std::map<
DTWireId, std::vector<PSimHit>>::const_iterator wireAndSHits = simHitsPerWire.begin();
2065 wireAndSHits != simHitsPerWire.end();
2067 DTWireId wireId = (*wireAndSHits).first;
2068 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
2075 if (muSimHit ==
nullptr) {
2082 if (simHitWireDist > 2.1) {
2088 if (recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
2092 std::vector<type>
recHits = recHitsPerWire[wireId];
2101 DTRHD.push_back(recHitWireDist);
2102 DTSHD.push_back(simHitWireDist);
void putTIBL1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
GlobalRecHitsProducer(const edm::ParameterSet &)
edm::InputTag ECalUncalEESrc_
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
T getParameter(std::string const &) const
unsigned int tobLayer(const DetId &id) const
std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
unsigned int pxbLayer(const DetId &id) const
void putHFCalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
std::vector< PCaloHit > PCaloHitContainer
TrackerHitAssociator::Config trackerHitAssociatorConfig_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
void putHECalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
virtual float stripAngle(float strip) const =0
void putFWD1nRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTOBL4RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
static const int sdHcalOut
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
int wire() const
Return the wire number.
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit >> &simHitsPerWire, const std::map< DTWireId, std::vector< type >> &recHitsPerWire, int step)
void putHBCalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
ret
prodAgent to be discontinued
std::vector< PSimHit > matched
void putTECW6RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putBRL1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTECW8RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void fillHCal(edm::Event &, const edm::EventSetup &)
Geom::Phi< T > phi() const
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
int closest(std::vector< int > const &vec, int value)
void putEECalRecHits(const std::vector< float > &re, const std::vector< float > &she)
unsigned int tidWheel(const DetId &id) const
void putTECW5RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
unsigned int tecWheel(const DetId &id) const
edm::EDGetTokenT< EERecHitCollection > ECalEESrc_Token_
Sin< T >::type sin(const T &t)
void putTECW7RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
T const * product() const
void putCSCRecHits(const std::vector< float > &rhphi, const std::vector< float > &rhperp, const std::vector< float > &shphi)
void putTECW2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
std::vector< T >::const_iterator const_iterator
void putTIDW1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
unsigned long long EventNumber_t
void putRPCRecHits(const std::vector< float > &rhx, const std::vector< float > &shx)
void putTECW1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
LocalPoint localPosition() const override
void storeMuon(PGlobalRecHit &)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
edm::InputTag MuRPCSimSrc_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
void produce(edm::Event &, const edm::EventSetup &) override
void storeECal(PGlobalRecHit &)
std::map< int, edm::PSimHitContainer > theMap
void putBRL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
const_iterator end(bool update=false) const
virtual float strip(const LocalPoint &) const =0
T getUntrackedParameter(std::string const &, T const &) const
C::const_iterator const_iterator
constant access iterator type
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
void putTOBL1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTIDW2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
edm::InputTag SiStripSrc_
void putFWD2nRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
static const int sdPxlBrl
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
void putHOCalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
void putTECW3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTOBL3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTIBL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
Cos< T >::type cos(const T &t)
edm::InputTag ECalUncalEBSrc_
unsigned int pxfDisk(const DetId &id) const
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
const_iterator begin() const
const PSimHit * findMuSimHit(const edm::PSimHitContainer &hits)
Select the SimHit from a muon in a vector of SimHits.
void putEBCalRecHits(const std::vector< float > &re, const std::vector< float > &she)
void putBRL3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
edm::InputTag MuDTSimSrc_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
void storeTrk(PGlobalRecHit &)
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
const_iterator end() const
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
void putTIBL4RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putESCalRecHits(const std::vector< float > &re, const std::vector< float > &she)
Log< level::Info, false > LogInfo
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
unsigned int pxfSide(const DetId &id) const
void putFWD1pRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void fillMuon(edm::Event &, const edm::EventSetup &)
const Plane & surface() const
The nominal surface of the GeomDet.
DetId geographicalId() const
void putDTRecHits(const std::vector< float > &rhd, const std::vector< float > &shd)
constexpr uint32_t rawId() const
get the raw id
std::map< uint32_t, float, std::less< uint32_t > > MapType
static const int sdHcalFwd
const GeomDetUnit * stereoDet() const
static const int sdHcalBrl
void storeHCal(PGlobalRecHit &)
void putTOBL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
~GlobalRecHitsProducer() override
const_iterator find(id_type i, bool update=false) const
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
LocalPoint localPosition() const override
GlobalPoint getPosition(const DetId &id) const
static int position[264][3]
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
std::vector< PSimHit > PSimHitContainer
unsigned int tibLayer(const DetId &id) const
static const int sdPxlFwd
Log< level::Warning, false > LogWarning
void fillTrk(edm::Event &, const edm::EventSetup &)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
void putTECW4RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
static const int sdHcalEC
edm::EDGetTokenT< EBRecHitCollection > ECalEBSrc_Token_
void fillECal(edm::Event &, const edm::EventSetup &)
void putFWD2pRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTIDW3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTIBL3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.