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" 87 <<
" Verbosity = " << verbosity <<
"\n" 88 <<
" Frequency = " << frequency <<
"\n" 89 <<
" Label = " << label <<
"\n" 90 <<
" GetProv = " << getAllProvenances <<
"\n" 91 <<
" PrintProv = " << printProvenanceInfo <<
"\n" 92 <<
" ECalEBSrc = " << ECalEBSrc_.label() <<
":" << ECalEBSrc_.instance() <<
"\n" 93 <<
" ECalUncalEBSrc = " << ECalUncalEBSrc_.
label() <<
":" 94 << ECalUncalEBSrc_.
instance() <<
"\n" 95 <<
" ECalEESrc = " << ECalEESrc_.
label() <<
":" << ECalUncalEESrc_.
instance()
97 <<
" ECalUncalEESrc = " << ECalUncalEESrc_.
label() <<
":" << ECalEESrc_.
instance()
99 <<
" ECalESSrc = " << ECalESSrc_.
label() <<
":" << ECalESSrc_.
instance() <<
"\n" 100 <<
" HCalSrc = " << HCalSrc_.
label() <<
":" << HCalSrc_.
instance() <<
"\n" 101 <<
" SiStripSrc = " << SiStripSrc_.
label() <<
":" << SiStripSrc_.
instance()
103 <<
" SiPixelSrc = " << SiPxlSrc_.
label() <<
":" << SiPxlSrc_.
instance() <<
"\n" 104 <<
" MuDTSrc = " << MuDTSrc_.
label() <<
":" << MuDTSrc_.
instance() <<
"\n" 105 <<
" MuDTSimSrc = " << MuDTSimSrc_.
label() <<
":" << MuDTSimSrc_.
instance()
107 <<
" MuCSCSrc = " << MuCSCSrc_.
label() <<
":" << MuCSCSrc_.
instance() <<
"\n" 108 <<
" MuRPCSrc = " << MuRPCSrc_.
label() <<
":" << MuRPCSrc_.
instance() <<
"\n" 109 <<
" MuRPCSimSrc = " << MuRPCSimSrc_.
label() <<
":" << MuRPCSimSrc_.
instance()
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)";
145 if (nevt %
frequency == 0 || nevt == 1) {
146 edm::LogInfo(MsgLoggerCat) <<
"Processing run " << nrun <<
", event " << nevt <<
" (" <<
count 156 std::vector<const edm::StableProvenance*> 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();
285 uncalibRecHit != EBUncalibRecHit->
end();
291 if (myRecHit != EBRecHit->
end()) {
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();
346 uncalibRecHit != EEUncalibRecHit->
end();
352 if (myRecHit != EERecHit->
end()) {
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;
642 for (ihf = hf.begin(); ihf != hf.end(); ++
ihf) {
649 double fEta = cellGeometry->getPosition().eta();
650 double fPhi = cellGeometry->getPosition().phi();
651 if ((jhf->energy()) > maxHFEnergy) {
652 maxHFEnergy = jhf->energy();
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) {
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!";
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) {
1082 if (!matched.empty()) {
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()) {
1664 simHits = mapItr->second;
1667 if (simHits.size() == 1) {
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) {
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();
1741 if (ptype == 13 || ptype == -13) {
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);
1994 float scale = -localHit.
z() / dir.
z();
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;
2042 for (
typename std::vector<type>::const_iterator
recHit = recHits.begin();
recHit != recHits.end();
recHit++) {
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);
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 &)
LocalPoint localPosition() const override
Return the 3-dimensional local position.
edm::InputTag ECalUncalEESrc_
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
EventNumber_t event() const
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
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)
std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
void putHFCalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
std::vector< PCaloHit > PCaloHitContainer
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
TrackerHitAssociator::Config trackerHitAssociatorConfig_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
unsigned int tibLayer(const DetId &id) const
void putHECalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
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_
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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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)
unsigned int pxfDisk(const DetId &id) const
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 &)
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void putEECalRecHits(const std::vector< float > &re, const std::vector< float > &she)
void putTECW5RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
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)
Geom::Phi< T > phi() 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)
constexpr uint32_t rawId() const
get the raw id
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
virtual float strip(const LocalPoint &) const =0
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)
unsigned int tidWheel(const DetId &id) const
void getManyByType(std::vector< Handle< PROD >> &results) const
void storeMuon(PGlobalRecHit &)
LocalPoint localPosition() const override
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
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)
C::const_iterator const_iterator
constant access iterator type
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const DTTopology & specificTopology() const
Local3DPoint exitPoint() const
Exit point in the local Det frame.
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)
const CSCChamberSpecs * specs() const
static const int sdPxlBrl
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
Local3DPoint localPosition() const
virtual float stripAngle(float strip) const =0
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_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
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_
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
GlobalPoint getPosition(const DetId &id) const
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
void storeTrk(PGlobalRecHit &)
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
unsigned int pxbLayer(const DetId &id) const
const_iterator end() const
void putTIBL4RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
int wire() const
Return the wire number.
void putESCalRecHits(const std::vector< float > &re, const std::vector< float > &she)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
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 &)
T const * product() const
void putDTRecHits(const std::vector< float > &rhd, const std::vector< float > &shd)
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
std::map< uint32_t, float, std::less< uint32_t > > MapType
static const int sdHcalFwd
static const int sdHcalBrl
const_iterator find(id_type i, bool update=false) const
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)
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
~GlobalRecHitsProducer() override
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
static int position[264][3]
const TrackerGeomDet * idToDet(DetId) const override
unsigned int pxfSide(const DetId &id) const
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
LocalPoint localPosition() const final
LocalPoint localPosition() const override
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
DetId geographicalId() const
void fillTrk(edm::Event &, const edm::EventSetup &)
unsigned int tecWheel(const DetId &id) const
T const * product() const
Local3DPoint entryPoint() const
Entry point in the local Det frame.
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
const CSCChamber * chamber() const
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)
const GeomDetUnit * stereoDet() const
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
const_iterator begin() const
void putTIDW3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
unsigned int tobLayer(const DetId &id) const
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)
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
DTWireId wireId() const
Return the wireId.