20 getAllProvenances(
false),
21 printProvenanceInfo(
false),
22 trackerHitAssociatorConfig_(iPSet, consumesCollector()),
30 std::string MsgLoggerCat =
"GlobalRecHitsProducer_GlobalRecHitsProducer";
87 produces<PGlobalRecHit>(
label);
91 edm::LogInfo(MsgLoggerCat) <<
"\n===============================\n" 92 <<
"Initialized as EDProducer with parameter values:\n" 93 <<
" Name = " <<
fName <<
"\n" 96 <<
" Label = " <<
label <<
"\n" 118 <<
"===============================\n";
125 std::string MsgLoggerCat =
"GlobalRecHitsProducer_beginJob";
133 std::string MsgLoggerCat =
"GlobalRecHitsProducer_endJob";
135 edm::LogInfo(MsgLoggerCat) <<
"Terminating having processed " <<
count <<
" events.";
140 std::string MsgLoggerCat =
"GlobalRecHitsProducer_produce";
150 edm::LogInfo(MsgLoggerCat) <<
"Processing run " << nrun <<
", event " <<
nevt <<
" (" <<
count <<
" events total)";
163 std::vector<const edm::StableProvenance*> AllProv;
164 iEvent.getAllStableProvenance(AllProv);
167 edm::LogInfo(MsgLoggerCat) <<
"Number of Provenances = " << AllProv.size();
170 TString eventout(
"\nProvenance info:\n");
172 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
173 eventout +=
"\n ******************************";
174 eventout +=
"\n Module : ";
176 eventout += AllProv[
i]->moduleLabel();
177 eventout +=
"\n ProductID : ";
179 eventout += AllProv[
i]->productID().id();
180 eventout +=
"\n ClassName : ";
182 eventout += AllProv[
i]->className();
183 eventout +=
"\n InstanceName : ";
185 eventout += AllProv[
i]->productInstanceName();
186 eventout +=
"\n BranchName : ";
188 eventout += AllProv[
i]->branchName();
190 eventout +=
"\n ******************************\n";
208 edm::LogInfo(MsgLoggerCat) <<
"Done gathering data from event.";
233 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillECal";
237 eventout =
"\nGathering info:";
254 if (!EcalUncalibRecHitEB.
isValid()) {
255 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalUncalRecHitEB in event!";
262 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalRecHitEB in event!";
268 if (!crossingFrame.
isValid()) {
269 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal barrel crossingFrame in event!";
282 uint32_t crystid = ebid.
rawId();
283 ebSimMap[crystid] += hitItr->energy();
300 EBRE.push_back(myRecHit->energy());
306 eventout +=
"\n Number of EBRecHits collected:............ ";
307 eventout += nEBRecHits;
315 if (!EcalUncalibRecHitEE.
isValid()) {
316 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalUncalRecHitEE in event!";
323 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalRecHitEE in event!";
329 if (!crossingFrame.
isValid()) {
330 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal endcap crossingFrame in event!";
343 uint32_t crystid = eeid.
rawId();
344 eeSimMap[crystid] += hitItr->energy();
361 EERE.push_back(myRecHit->energy());
367 eventout +=
"\n Number of EERecHits collected:............ ";
368 eventout += nEERecHits;
377 edm::LogWarning(MsgLoggerCat) <<
"Unable to find EcalRecHitES in event!";
383 if (!crossingFrame.
isValid()) {
384 edm::LogWarning(MsgLoggerCat) <<
"Unable to find cal preshower crossingFrame in event!";
397 uint32_t crystid = esid.
rawId();
398 esSimMap[crystid] += hitItr->energy();
413 eventout +=
"\n Number of ESRecHits collected:............ ";
414 eventout += nESRecHits;
424 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeECal";
427 TString eventout(
"\n nEBRecHits = ");
428 eventout +=
EBRE.size();
429 for (
unsigned int i = 0;
i <
EBRE.size(); ++
i) {
430 eventout +=
"\n (RE, SHE) = (";
436 eventout +=
"\n nEERecHits = ";
437 eventout +=
EERE.size();
438 for (
unsigned int i = 0;
i <
EERE.size(); ++
i) {
439 eventout +=
"\n (RE, SHE) = (";
445 eventout +=
"\n nESRecHits = ";
446 eventout +=
ESRE.size();
447 for (
unsigned int i = 0;
i <
ESRE.size(); ++
i) {
448 eventout +=
"\n (RE, SHE) = (";
465 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillHCal";
469 eventout =
"\nGathering info:";
474 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CaloGeometry in event!";
493 for (std::vector<PCaloHit>::const_iterator
simhits = simhitResult->begin();
simhits != simhitResult->end();
496 uint32_t cellid =
detId.rawId();
499 fHBEnergySimHits[cellid] +=
simhits->energy();
502 fHEEnergySimHits[cellid] +=
simhits->energy();
505 fHOEnergySimHits[cellid] +=
simhits->energy();
508 fHFEnergySimHits[cellid] +=
simhits->energy();
513 Double_t maxHBEnergy = 0.;
514 Double_t maxHEEnergy = 0.;
515 Double_t maxHFEnergy = 0.;
517 Double_t maxHBPhi = -1000.;
518 Double_t maxHEPhi = -1000.;
519 Double_t maxHOPhi = -1000.;
520 Double_t maxHFPhi = -1000.;
522 Double_t maxHBEta = -1000.;
523 Double_t maxHEEta = -1000.;
524 Double_t maxHOEta = -1000.;
525 Double_t maxHFEta = -1000.;
527 Double_t
PI = 3.141592653589;
532 std::vector<edm::Handle<HBHERecHitCollection>>
hbhe;
535 throw cms::Exception(
"UnsupportedFunction") <<
"GlobalRecHitsProducer::fillHCal: " 536 <<
"getManyByType has not been supported by the Framework since 2015. " 537 <<
"This module has been broken since then. Maybe it should be deleted. " 538 <<
"Another possibility is to upgrade to use GetterOfProducts instead.";
541 edm::LogWarning(MsgLoggerCat) <<
"Unable to find any HBHERecHitCollections in event!";
544 std::vector<edm::Handle<HBHERecHitCollection>>::iterator ihbhe;
549 for (ihbhe =
hbhe.begin(); ihbhe !=
hbhe.end(); ++ihbhe) {
559 if ((jhbhe->energy()) > maxHBEnergy) {
560 maxHBEnergy = jhbhe->energy();
573 if ((jhbhe->energy()) > maxHEEnergy) {
574 maxHEEnergy = jhbhe->energy();
592 float deltaphi = maxHBPhi - fPhi;
593 if (fPhi > maxHBPhi) {
594 deltaphi = fPhi - maxHBPhi;
597 deltaphi = 2.0 *
PI - deltaphi;
599 float deltaeta = fEta - maxHBEta;
600 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
602 HBCalREC.push_back(jhbhe->energy());
604 HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
615 float deltaphi = maxHEPhi - fPhi;
616 if (fPhi > maxHEPhi) {
617 deltaphi = fPhi - maxHEPhi;
620 deltaphi = 2.0 *
PI - deltaphi;
622 float deltaeta = fEta - maxHEEta;
623 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
625 HECalREC.push_back(jhbhe->energy());
627 HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
633 eventout +=
"\n Number of HBRecHits collected:............ ";
638 eventout +=
"\n Number of HERecHits collected:............ ";
645 std::vector<edm::Handle<HFRecHitCollection>>
hf;
648 throw cms::Exception(
"UnsupportedFunction") <<
"GlobalRecHitsProducer::fillHCal: " 649 <<
"getManyByType has not been supported by the Framework since 2015. " 650 <<
"This module has been broken since then. Maybe it should be deleted. " 651 <<
"Another possibility is to upgrade to use GetterOfProducts instead.";
654 edm::LogWarning(MsgLoggerCat) <<
"Unable to find any HFRecHitCollections in event!";
657 std::vector<edm::Handle<HFRecHitCollection>>::iterator ihf;
660 for (ihf =
hf.begin(); ihf !=
hf.end(); ++ihf) {
666 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
667 double fEta = cellGeometry->getPosition().eta();
668 double fPhi = cellGeometry->getPosition().phi();
669 if ((jhf->energy()) > maxHFEnergy) {
670 maxHFEnergy = jhf->energy();
683 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
684 double fEta = cellGeometry->getPosition().eta();
685 double fPhi = cellGeometry->getPosition().phi();
687 float deltaphi = maxHBPhi - fPhi;
688 if (fPhi > maxHFPhi) {
689 deltaphi = fPhi - maxHFPhi;
692 deltaphi = 2.0 *
PI - deltaphi;
694 float deltaeta = fEta - maxHFEta;
695 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
699 HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
705 eventout +=
"\n Number of HFDigis collected:.............. ";
712 std::vector<edm::Handle<HORecHitCollection>>
ho;
715 throw cms::Exception(
"UnsupportedFunction") <<
"GlobalRecHitsProducer::fillHCal: " 716 <<
"getManyByType has not been supported by the Framework since 2015. " 717 <<
"This module has been broken since then. Maybe it should be deleted. " 718 <<
"Another possibility is to upgrade to use GetterOfProducts instead.";
721 edm::LogWarning(MsgLoggerCat) <<
"Unable to find any HORecHitCollections in event!";
724 std::vector<edm::Handle<HORecHitCollection>>::iterator iho;
727 for (iho =
ho.begin(); iho !=
ho.end(); ++iho) {
734 auto cellGeometry =
geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
735 double fEta = cellGeometry->getPosition().eta();
736 double fPhi = cellGeometry->getPosition().phi();
738 float deltaphi = maxHOPhi - fPhi;
739 if (fPhi > maxHOPhi) {
740 deltaphi = fPhi - maxHOPhi;
743 deltaphi = 2.0 *
PI - deltaphi;
745 float deltaeta = fEta - maxHOEta;
746 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
750 HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
756 eventout +=
"\n Number of HODigis collected:.............. ";
767 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeHCal";
770 TString eventout(
"\n nHBRecHits = ");
772 for (
unsigned int i = 0;
i <
HBCalREC.size(); ++
i) {
773 eventout +=
"\n (REC, R, SHE) = (";
781 eventout +=
"\n nHERecHits = ";
783 for (
unsigned int i = 0;
i <
HECalREC.size(); ++
i) {
784 eventout +=
"\n (REC, R, SHE) = (";
792 eventout +=
"\n nHFRecHits = ";
794 for (
unsigned int i = 0;
i <
HFCalREC.size(); ++
i) {
795 eventout +=
"\n (REC, R, SHE) = (";
803 eventout +=
"\n nHORecHits = ";
805 for (
unsigned int i = 0;
i <
HOCalREC.size(); ++
i) {
806 eventout +=
"\n (REC, R, SHE) = (";
830 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillTrk";
833 eventout =
"\nGathering info:";
838 if (!rechitsmatched.
isValid()) {
839 edm::LogWarning(MsgLoggerCat) <<
"Unable to find stripmatchedrechits in event!";
846 if (!tGeomHandle.isValid()) {
847 edm::LogWarning(MsgLoggerCat) <<
"Unable to find TrackerDigiGeometry in event!";
852 int nStripBrl = 0, nStripFwd = 0;
855 for (TrackerGeometry::DetContainer::const_iterator it = tGeomHandle->dets().begin(); it != tGeomHandle->dets().end();
857 uint32_t myid = ((*it)->geographicalId()).
rawId();
858 DetId detid = ((*it)->geographicalId());
863 if (rechitmatchedMatch != rechitsmatched->
end()) {
866 rechitmatchedRange.
begin();
870 for (itermatched = rechitmatchedRangeIteratorBegin; itermatched != rechitmatchedRangeIteratorEnd; ++itermatched) {
874 float mindist = 999999.;
875 float distx = 999999.;
876 float disty = 999999.;
877 float dist = 999999.;
878 std::pair<LocalPoint, LocalVector> closestPair;
881 float rechitmatchedx =
position.x();
882 float rechitmatchedy =
position.y();
890 std::pair<LocalPoint, LocalVector> hitPair;
892 for (std::vector<PSimHit>::const_iterator
m =
matched.begin();
m !=
matched.end();
m++) {
895 distx = fabs(rechitmatchedx - hitPair.first.x());
896 disty = fabs(rechitmatchedy - hitPair.first.y());
897 dist =
sqrt(distx * distx + disty * disty);
899 if (dist < mindist) {
901 closestPair = hitPair;
910 TIBL1RX.push_back(rechitmatchedx);
911 TIBL1RY.push_back(rechitmatchedy);
912 TIBL1SX.push_back(closestPair.first.x());
913 TIBL1SY.push_back(closestPair.first.y());
916 TIBL2RX.push_back(rechitmatchedx);
917 TIBL2RY.push_back(rechitmatchedy);
918 TIBL2SX.push_back(closestPair.first.x());
919 TIBL2SY.push_back(closestPair.first.y());
922 TIBL3RX.push_back(rechitmatchedx);
923 TIBL3RY.push_back(rechitmatchedy);
924 TIBL3SX.push_back(closestPair.first.x());
925 TIBL3SY.push_back(closestPair.first.y());
928 TIBL4RX.push_back(rechitmatchedx);
929 TIBL4RY.push_back(rechitmatchedy);
930 TIBL4SX.push_back(closestPair.first.x());
931 TIBL4SY.push_back(closestPair.first.y());
940 TOBL1RX.push_back(rechitmatchedx);
941 TOBL1RY.push_back(rechitmatchedy);
942 TOBL1SX.push_back(closestPair.first.x());
943 TOBL1SY.push_back(closestPair.first.y());
946 TOBL2RX.push_back(rechitmatchedx);
947 TOBL2RY.push_back(rechitmatchedy);
948 TOBL2SX.push_back(closestPair.first.x());
949 TOBL2SY.push_back(closestPair.first.y());
952 TOBL3RX.push_back(rechitmatchedx);
953 TOBL3RY.push_back(rechitmatchedy);
954 TOBL3SX.push_back(closestPair.first.x());
955 TOBL3SY.push_back(closestPair.first.y());
958 TOBL4RX.push_back(rechitmatchedx);
959 TOBL4RY.push_back(rechitmatchedy);
960 TOBL4SX.push_back(closestPair.first.x());
961 TOBL4SY.push_back(closestPair.first.y());
970 TIDW1RX.push_back(rechitmatchedx);
971 TIDW1RY.push_back(rechitmatchedy);
972 TIDW1SX.push_back(closestPair.first.x());
973 TIDW1SY.push_back(closestPair.first.y());
976 TIDW2RX.push_back(rechitmatchedx);
977 TIDW2RY.push_back(rechitmatchedy);
978 TIDW2SX.push_back(closestPair.first.x());
979 TIDW2SY.push_back(closestPair.first.y());
982 TIDW3RX.push_back(rechitmatchedx);
983 TIDW3RY.push_back(rechitmatchedy);
984 TIDW3SX.push_back(closestPair.first.x());
985 TIDW3SY.push_back(closestPair.first.y());
994 TECW1RX.push_back(rechitmatchedx);
995 TECW1RY.push_back(rechitmatchedy);
996 TECW1SX.push_back(closestPair.first.x());
997 TECW1SY.push_back(closestPair.first.y());
1000 TECW2RX.push_back(rechitmatchedx);
1001 TECW2RY.push_back(rechitmatchedy);
1002 TECW2SX.push_back(closestPair.first.x());
1003 TECW2SY.push_back(closestPair.first.y());
1006 TECW3RX.push_back(rechitmatchedx);
1007 TECW3RY.push_back(rechitmatchedy);
1008 TECW3SX.push_back(closestPair.first.x());
1009 TECW3SY.push_back(closestPair.first.y());
1012 TECW4RX.push_back(rechitmatchedx);
1013 TECW4RY.push_back(rechitmatchedy);
1014 TECW4SX.push_back(closestPair.first.x());
1015 TECW4SY.push_back(closestPair.first.y());
1018 TECW5RX.push_back(rechitmatchedx);
1019 TECW5RY.push_back(rechitmatchedy);
1020 TECW5SX.push_back(closestPair.first.x());
1021 TECW5SY.push_back(closestPair.first.y());
1024 TECW6RX.push_back(rechitmatchedx);
1025 TECW6RY.push_back(rechitmatchedy);
1026 TECW6SX.push_back(closestPair.first.x());
1027 TECW6SY.push_back(closestPair.first.y());
1030 TECW7RX.push_back(rechitmatchedx);
1031 TECW7RY.push_back(rechitmatchedy);
1032 TECW7SX.push_back(closestPair.first.x());
1033 TECW7SY.push_back(closestPair.first.y());
1036 TECW8RX.push_back(rechitmatchedx);
1037 TECW8RY.push_back(rechitmatchedy);
1038 TECW8SX.push_back(closestPair.first.x());
1039 TECW8SY.push_back(closestPair.first.y());
1049 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1050 eventout += nStripBrl;
1054 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1055 eventout += nStripFwd;
1063 edm::LogWarning(MsgLoggerCat) <<
"Unable to find SiPixelRecHitCollection in event!";
1067 int nPxlBrl = 0, nPxlFwd = 0;
1069 for (TrackerGeometry::DetContainer::const_iterator it = tGeomHandle->dets().begin(); it != tGeomHandle->dets().end();
1071 uint32_t myid = ((*it)->geographicalId()).
rawId();
1073 int subid =
detId.subdetId();
1082 if (pixeldet == recHitColl->
end())
1091 for (; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1099 float rechit_x = lp.
x();
1100 float rechit_y = lp.
y();
1106 for (std::vector<PSimHit>::const_iterator
m =
matched.begin();
m !=
matched.end(); ++
m) {
1107 float sim_x1 = (*m).entryPoint().x();
1108 float sim_x2 = (*m).exitPoint().x();
1109 float sim_xpos = 0.5 * (sim_x1 + sim_x2);
1111 float sim_y1 = (*m).entryPoint().y();
1112 float sim_y2 = (*m).exitPoint().y();
1113 float sim_ypos = 0.5 * (sim_y1 + sim_y2);
1115 float x_res = fabs(sim_xpos - rechit_x);
1116 float y_res = fabs(sim_ypos - rechit_y);
1118 float dist =
sqrt(x_res * x_res + y_res * y_res);
1132 BRL1RX.push_back(rechit_x);
1133 BRL1RY.push_back(rechit_y);
1138 BRL2RX.push_back(rechit_x);
1139 BRL2RY.push_back(rechit_y);
1144 BRL3RX.push_back(rechit_x);
1145 BRL3RY.push_back(rechit_y);
1155 if (tTopo->
pxfDisk(myid) == 1) {
1156 if (tTopo->
pxfSide(myid) == 1) {
1162 if (tTopo->
pxfSide(myid) == 2) {
1169 if (tTopo->
pxfDisk(myid) == 2) {
1170 if (tTopo->
pxfSide(myid) == 1) {
1176 if (tTopo->
pxfSide(myid) == 2) {
1189 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1190 eventout += nPxlBrl;
1194 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1195 eventout += nPxlFwd;
1205 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeTrk";
1209 TString eventout(
"\n nTIBL1 = ");
1211 for (
unsigned int i = 0;
i <
TIBL1RX.size(); ++
i) {
1212 eventout +=
"\n (RX, RY, SX, SY) = (";
1222 eventout +=
"\n nTIBL2 = ";
1224 for (
unsigned int i = 0;
i <
TIBL2RX.size(); ++
i) {
1225 eventout +=
"\n (RX, RY, SX, SY) = (";
1235 eventout +=
"\n nTIBL3 = ";
1237 for (
unsigned int i = 0;
i <
TIBL3RX.size(); ++
i) {
1238 eventout +=
"\n (RX, RY, SX, SY) = (";
1248 eventout +=
"\n nTIBL4 = ";
1250 for (
unsigned int i = 0;
i <
TIBL4RX.size(); ++
i) {
1251 eventout +=
"\n (RX, RY, SX, SY) = (";
1261 eventout +=
"\n nTOBL1 = ";
1263 for (
unsigned int i = 0;
i <
TOBL1RX.size(); ++
i) {
1264 eventout +=
"\n (RX, RY, SX, SY) = (";
1274 eventout +=
"\n nTOBL2 = ";
1276 for (
unsigned int i = 0;
i <
TOBL2RX.size(); ++
i) {
1277 eventout +=
"\n (RX, RY, SX, SY) = (";
1287 eventout +=
"\n nTOBL3 = ";
1289 for (
unsigned int i = 0;
i <
TOBL3RX.size(); ++
i) {
1290 eventout +=
"\n (RX, RY, SX, SY) = (";
1300 eventout +=
"\n nTOBL4 = ";
1302 for (
unsigned int i = 0;
i <
TOBL4RX.size(); ++
i) {
1303 eventout +=
"\n (RX, RY, SX, SY) = (";
1313 eventout +=
"\n nTIDW1 = ";
1315 for (
unsigned int i = 0;
i <
TIDW1RX.size(); ++
i) {
1316 eventout +=
"\n (RX, RY, SX, SY) = (";
1326 eventout +=
"\n nTIDW2 = ";
1328 for (
unsigned int i = 0;
i <
TIDW2RX.size(); ++
i) {
1329 eventout +=
"\n (RX, RY, SX, SY) = (";
1339 eventout +=
"\n nTIDW3 = ";
1341 for (
unsigned int i = 0;
i <
TIDW3RX.size(); ++
i) {
1342 eventout +=
"\n (RX, RY, SX, SY) = (";
1352 eventout +=
"\n nTECW1 = ";
1354 for (
unsigned int i = 0;
i <
TECW1RX.size(); ++
i) {
1355 eventout +=
"\n (RX, RY, SX, SY) = (";
1365 eventout +=
"\n nTECW2 = ";
1367 for (
unsigned int i = 0;
i <
TECW2RX.size(); ++
i) {
1368 eventout +=
"\n (RX, RY, SX, SY) = (";
1378 eventout +=
"\n nTECW3 = ";
1380 for (
unsigned int i = 0;
i <
TECW3RX.size(); ++
i) {
1381 eventout +=
"\n (RX, RY, SX, SY) = (";
1391 eventout +=
"\n nTECW4 = ";
1393 for (
unsigned int i = 0;
i <
TECW4RX.size(); ++
i) {
1394 eventout +=
"\n (RX, RY, SX, SY) = (";
1404 eventout +=
"\n nTECW5 = ";
1406 for (
unsigned int i = 0;
i <
TECW5RX.size(); ++
i) {
1407 eventout +=
"\n (RX, RY, SX, SY) = (";
1417 eventout +=
"\n nTECW6 = ";
1419 for (
unsigned int i = 0;
i <
TECW6RX.size(); ++
i) {
1420 eventout +=
"\n (RX, RY, SX, SY) = (";
1430 eventout +=
"\n nTECW7 = ";
1432 for (
unsigned int i = 0;
i <
TECW7RX.size(); ++
i) {
1433 eventout +=
"\n (RX, RY, SX, SY) = (";
1443 eventout +=
"\n nTECW8 = ";
1445 for (
unsigned int i = 0;
i <
TECW8RX.size(); ++
i) {
1446 eventout +=
"\n (RX, RY, SX, SY) = (";
1458 eventout +=
"\n nBRL1 = ";
1459 eventout +=
BRL1RX.size();
1460 for (
unsigned int i = 0;
i <
BRL1RX.size(); ++
i) {
1461 eventout +=
"\n (RX, RY, SX, SY) = (";
1471 eventout +=
"\n nBRL2 = ";
1472 eventout +=
BRL2RX.size();
1473 for (
unsigned int i = 0;
i <
BRL2RX.size(); ++
i) {
1474 eventout +=
"\n (RX, RY, SX, SY) = (";
1484 eventout +=
"\n nBRL3 = ";
1485 eventout +=
BRL3RX.size();
1486 for (
unsigned int i = 0;
i <
BRL3RX.size(); ++
i) {
1487 eventout +=
"\n (RX, RY, SX, SY) = (";
1497 eventout +=
"\n nFWD1p = ";
1499 for (
unsigned int i = 0;
i <
FWD1pRX.size(); ++
i) {
1500 eventout +=
"\n (RX, RY, SX, SY) = (";
1510 eventout +=
"\n nFWD1n = ";
1512 for (
unsigned int i = 0;
i <
FWD1nRX.size(); ++
i) {
1513 eventout +=
"\n (RX, RY, SX, SY) = (";
1523 eventout +=
"\n nFWD2p = ";
1525 for (
unsigned int i = 0;
i <
FWD2pRX.size(); ++
i) {
1526 eventout +=
"\n (RX, RY, SX, SY) = (";
1536 eventout +=
"\n nFWD2p = ";
1538 for (
unsigned int i = 0;
i <
FWD2nRX.size(); ++
i) {
1539 eventout +=
"\n (RX, RY, SX, SY) = (";
1587 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillMuon";
1591 eventout =
"\nGathering info:";
1595 if (!dtGeom.isValid()) {
1596 edm::LogWarning(MsgLoggerCat) <<
"Unable to find DTMuonGeometryRecord in event!";
1603 edm::LogWarning(MsgLoggerCat) <<
"Unable to find dtsimHits in event!";
1607 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1613 edm::LogWarning(MsgLoggerCat) <<
"Unable to find dtRecHits in event!";
1619 int nDt =
compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, 1);
1622 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1640 edm::LogWarning(MsgLoggerCat) <<
"Unable to find muo CSC crossingFrame in event!";
1647 theMap[hitItr->detUnitId()].push_back(*hitItr);
1652 if (!hGeom.isValid()) {
1653 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CSCMuonGeometryRecord in event!";
1662 edm::LogWarning(MsgLoggerCat) <<
"Unable to find CSC RecHits in event!";
1670 int detId = (*recHitItr).cscDetId().rawId();
1673 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
theMap.find(
detId);
1674 if (mapItr !=
theMap.end()) {
1690 eventout +=
"\n Number of CSCRecHits collected:........... ";
1695 std::map<double, int> mapsim, maprec;
1696 std::map<int, double> nmapsim, nmaprec;
1699 if (!rpcGeom.isValid()) {
1700 edm::LogWarning(MsgLoggerCat) <<
"Unable to find RPCMuonGeometryRecord in event!";
1707 edm::LogWarning(MsgLoggerCat) <<
"Unable to find RPCSimHit in event!";
1714 edm::LogWarning(MsgLoggerCat) <<
"Unable to find RPCRecHit in event!";
1721 for (recIt =
recHit->begin(); recIt !=
recHit->end(); ++recIt) {
1724 if (
roll->isForward()) {
1726 eventout +=
"\n Number of RPCRecHits collected:........... ";
1735 LocalPoint rhitlocal = (*recIt).localPosition();
1736 double rhitlocalx = rhitlocal.
x();
1737 maprec[rhitlocalx] = nrec;
1741 for (std::map<double, int>::iterator iter = maprec.begin(); iter != maprec.end(); ++iter) {
1743 nmaprec[
i] = (*iter).first;
1746 edm::PSimHitContainer::const_iterator simIt;
1748 for (simIt =
simHit->begin(); simIt !=
simHit->end(); simIt++) {
1749 int ptype = (*simIt).particleType();
1753 LocalPoint shitlocal = (*simIt).localPosition();
1754 double shitlocalx = shitlocal.
x();
1755 mapsim[shitlocalx] = nsim;
1760 for (std::map<double, int>::iterator iter = mapsim.begin(); iter != mapsim.end(); ++iter) {
1762 nmapsim[
i] = (*iter).first;
1766 for (
int r = 0;
r < nsim;
r++) {
1768 RPCRHX.push_back(nmaprec[
r + 1]);
1769 RPCSHX.push_back(nmapsim[
r + 1]);
1774 eventout +=
"\n Number of RPCRecHits collected:........... ";
1785 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeMuon";
1789 TString eventout(
"\n nDT = ");
1790 eventout +=
DTRHD.size();
1791 for (
unsigned int i = 0;
i <
DTRHD.size(); ++
i) {
1792 eventout +=
"\n (RHD, SHD) = (";
1800 eventout +=
"\n nCSC = ";
1802 for (
unsigned int i = 0;
i <
CSCRHPHI.size(); ++
i) {
1803 eventout +=
"\n (rhphi, rhperp, shphi) = (";
1813 eventout +=
"\n nRPC = ";
1814 eventout +=
RPCRHX.size();
1815 for (
unsigned int i = 0;
i <
RPCRHX.size(); ++
i) {
1816 eventout +=
"\n (rhx, shx) = (";
1836 std::string MsgLoggerCat =
"GlobalRecHitsProducer_clear";
1839 edm::LogInfo(MsgLoggerCat) <<
"Clearing event holders";
1997 LocalPoint localHit = plane.toLocal(globalpos);
2015 return std::pair<LocalPoint, LocalVector>(projectedPos, localStripDir);
2021 std::map<DTWireId, std::vector<DTRecHit1DPair>>
ret;
2025 ret[(*rechit).wireId()].push_back(*rechit);
2033 float xwire =
layer->specificTopology().wirePosition(wireId.
wire());
2036 float xEntry = entryP.
x() - xwire;
2037 float xExit = exitP.
x() - xwire;
2040 return fabs(xEntry - (entryP.
z() * (xExit - xEntry)) / (exitP.
z() - entryP.
z()));
2044 template <
typename type>
2047 const std::vector<type>&
recHits,
2048 const float simHitDist) {
2050 const type* theBestRecHit =
nullptr;
2054 if (fabs(distTmp - simHitDist) <
res) {
2055 res = fabs(distTmp - simHitDist);
2056 theBestRecHit = &(*recHit);
2060 return theBestRecHit;
2071 return fabs(
recHit.localPosition().x() -
layer->specificTopology().wirePosition(
recHit.wireId().wire()));
2074 template <
typename type>
2079 std::map<DTWireId, std::vector<PSimHit>> simHitsPerWire = _simHitsPerWire;
2080 std::map<DTWireId, std::vector<type>> recHitsPerWire = _recHitsPerWire;
2083 for (
std::map<
DTWireId, std::vector<PSimHit>>::const_iterator wireAndSHits = simHitsPerWire.begin();
2084 wireAndSHits != simHitsPerWire.end();
2086 DTWireId wireId = (*wireAndSHits).first;
2087 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
2094 if (muSimHit ==
nullptr) {
2101 if (simHitWireDist > 2.1) {
2107 if (recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
2111 std::vector<type>
recHits = recHitsPerWire[wireId];
2120 DTRHD.push_back(recHitWireDist);
2121 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.