16 printProvenanceInfo(
false), trackerHitAssociatorConfig_(iPSet, consumesCollector()),
count(0)
18 std::string MsgLoggerCat =
"GlobalRecHitsProducer_GlobalRecHitsProducer";
28 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
30 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
75 produces<PGlobalRecHit>(
label);
80 <<
"\n===============================\n" 81 <<
"Initialized as EDProducer with parameter values:\n" 82 <<
" Name = " <<
fName <<
"\n" 83 <<
" Verbosity = " << verbosity <<
"\n" 84 <<
" Frequency = " << frequency <<
"\n" 85 <<
" Label = " << label <<
"\n" 86 <<
" GetProv = " << getAllProvenances <<
"\n" 87 <<
" PrintProv = " << printProvenanceInfo <<
"\n" 88 <<
" ECalEBSrc = " << ECalEBSrc_.label()
89 <<
":" << ECalEBSrc_.instance() <<
"\n" 90 <<
" ECalUncalEBSrc = " << ECalUncalEBSrc_.
label()
91 <<
":" << ECalUncalEBSrc_.
instance() <<
"\n" 92 <<
" ECalEESrc = " << ECalEESrc_.
label()
93 <<
":" << ECalUncalEESrc_.
instance() <<
"\n" 94 <<
" ECalUncalEESrc = " << ECalUncalEESrc_.
label()
95 <<
":" << ECalEESrc_.
instance() <<
"\n" 96 <<
" ECalESSrc = " << ECalESSrc_.
label()
97 <<
":" << ECalESSrc_.
instance() <<
"\n" 98 <<
" HCalSrc = " << HCalSrc_.
label()
99 <<
":" << HCalSrc_.
instance() <<
"\n" 100 <<
" SiStripSrc = " << SiStripSrc_.
label()
101 <<
":" << SiStripSrc_.
instance() <<
"\n" 102 <<
" SiPixelSrc = " << SiPxlSrc_.
label()
103 <<
":" << SiPxlSrc_.
instance() <<
"\n" 104 <<
" MuDTSrc = " << MuDTSrc_.
label()
105 <<
":" << MuDTSrc_.
instance() <<
"\n" 106 <<
" MuDTSimSrc = " << MuDTSimSrc_.
label()
107 <<
":" << MuDTSimSrc_.
instance() <<
"\n" 108 <<
" MuCSCSrc = " << MuCSCSrc_.
label()
109 <<
":" << MuCSCSrc_.
instance() <<
"\n" 110 <<
" MuRPCSrc = " << MuRPCSrc_.
label()
111 <<
":" << MuRPCSrc_.
instance() <<
"\n" 112 <<
" MuRPCSimSrc = " << MuRPCSimSrc_.
label()
113 <<
":" << MuRPCSimSrc_.
instance() <<
"\n" 114 <<
"===============================\n";
124 std::string MsgLoggerCat =
"GlobalRecHitsProducer_beginJob";
133 std::string MsgLoggerCat =
"GlobalRecHitsProducer_endJob";
136 <<
"Terminating having processed " <<
count <<
" events.";
143 std::string MsgLoggerCat =
"GlobalRecHitsProducer_produce";
154 <<
"Processing run " << nrun <<
", event " << nevt
155 <<
" (" <<
count <<
" events total)";
159 <<
"Processing run " << nrun <<
", event " << nevt
160 <<
" (" <<
count <<
" events total)";
170 std::vector<const edm::StableProvenance*> AllProv;
175 <<
"Number of Provenances = " << AllProv.size();
178 TString eventout(
"\nProvenance info:\n");
180 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
181 eventout +=
"\n ******************************";
182 eventout +=
"\n Module : ";
184 eventout += AllProv[
i]->moduleLabel();
185 eventout +=
"\n ProductID : ";
187 eventout += AllProv[
i]->productID().id();
188 eventout +=
"\n ClassName : ";
190 eventout += AllProv[
i]->className();
191 eventout +=
"\n InstanceName : ";
193 eventout += AllProv[
i]->productInstanceName();
194 eventout +=
"\n BranchName : ";
196 eventout += AllProv[
i]->branchName();
198 eventout +=
"\n ******************************\n";
217 <<
"Done gathering data from event.";
224 <<
"Saving event contents:";
245 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillECal";
249 eventout =
"\nGathering info:";
266 if (!EcalUncalibRecHitEB.
isValid()) {
268 <<
"Unable to find EcalUncalRecHitEB in event!";
276 <<
"Unable to find EcalRecHitEB in event!";
282 if (!crossingFrame.
isValid()) {
284 <<
"Unable to find cal barrel crossingFrame in event!";
290 std::unique_ptr<MixCollection<PCaloHit> >
296 = barrelHits->begin();
297 hitItr != barrelHits->end();
302 uint32_t crystid = ebid.
rawId();
303 ebSimMap[crystid] += hitItr->energy();
313 EBUncalibRecHit->
begin();
314 uncalibRecHit != EBUncalibRecHit->
end();
321 if (myRecHit != EBRecHit->
end()) {
323 EBRE.push_back(myRecHit->energy());
329 eventout +=
"\n Number of EBRecHits collected:............ ";
330 eventout += nEBRecHits;
338 if (!EcalUncalibRecHitEE.
isValid()) {
340 <<
"Unable to find EcalUncalRecHitEE in event!";
348 <<
"Unable to find EcalRecHitEE in event!";
354 if (!crossingFrame.
isValid()) {
356 <<
"Unable to find cal endcap crossingFrame in event!";
362 std::unique_ptr<MixCollection<PCaloHit> >
368 = endcapHits->begin();
369 hitItr != endcapHits->end();
374 uint32_t crystid = eeid.
rawId();
375 eeSimMap[crystid] += hitItr->energy();
385 EEUncalibRecHit->
begin();
386 uncalibRecHit != EEUncalibRecHit->
end();
393 if (myRecHit != EERecHit->
end()) {
395 EERE.push_back(myRecHit->energy());
401 eventout +=
"\n Number of EERecHits collected:............ ";
402 eventout += nEERecHits;
412 <<
"Unable to find EcalRecHitES in event!";
418 if (!crossingFrame.
isValid()) {
420 <<
"Unable to find cal preshower crossingFrame in event!";
426 std::unique_ptr<MixCollection<PCaloHit> >
432 = preshowerHits->begin();
433 hitItr != preshowerHits->end();
438 uint32_t crystid = esid.
rawId();
439 esSimMap[crystid] += hitItr->energy();
458 eventout +=
"\n Number of ESRecHits collected:............ ";
459 eventout += nESRecHits;
470 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeECal";
473 TString eventout(
"\n nEBRecHits = ");
474 eventout +=
EBRE.size();
475 for (
unsigned int i = 0;
i <
EBRE.size(); ++
i) {
476 eventout +=
"\n (RE, SHE) = (";
482 eventout +=
"\n nEERecHits = ";
483 eventout +=
EERE.size();
484 for (
unsigned int i = 0;
i <
EERE.size(); ++
i) {
485 eventout +=
"\n (RE, SHE) = (";
491 eventout +=
"\n nESRecHits = ";
492 eventout +=
ESRE.size();
493 for (
unsigned int i = 0;
i <
ESRE.size(); ++
i) {
494 eventout +=
"\n (RE, SHE) = (";
513 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillHCal";
517 eventout =
"\nGathering info:";
524 <<
"Unable to find CaloGeometry in event!";
535 <<
"Unable to find hcalHits in event!";
544 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
545 simhits != simhitResult->end();
549 uint32_t cellid = detId.
rawId();
552 fHBEnergySimHits[cellid] += simhits->energy();
555 fHEEnergySimHits[cellid] += simhits->energy();
558 fHOEnergySimHits[cellid] += simhits->energy();
561 fHFEnergySimHits[cellid] += simhits->energy();
566 Double_t maxHBEnergy = 0.;
567 Double_t maxHEEnergy = 0.;
568 Double_t maxHFEnergy = 0.;
570 Double_t maxHBPhi = -1000.;
571 Double_t maxHEPhi = -1000.;
572 Double_t maxHOPhi = -1000.;
573 Double_t maxHFPhi = -1000.;
575 Double_t maxHBEta = -1000.;
576 Double_t maxHEEta = -1000.;
577 Double_t maxHOEta = -1000.;
578 Double_t maxHFEta = -1000.;
580 Double_t
PI = 3.141592653589;
585 std::vector<edm::Handle<HBHERecHitCollection> >
hbhe;
587 if (!hbhe[0].isValid()) {
589 <<
"Unable to find any HBHERecHitCollections in event!";
592 std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
597 for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
601 jhbhe != (*ihbhe)->end(); ++jhbhe) {
613 if ( (jhbhe->energy()) > maxHBEnergy ) {
614 maxHBEnergy = jhbhe->energy();
630 if ( (jhbhe->energy()) > maxHEEnergy ) {
631 maxHEEnergy = jhbhe->energy();
639 jhbhe != (*ihbhe)->end(); ++jhbhe) {
654 float deltaphi = maxHBPhi - fPhi;
655 if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
656 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
657 float deltaeta = fEta - maxHBEta;
658 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
660 HBCalREC.push_back(jhbhe->energy());
662 HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
676 float deltaphi = maxHEPhi - fPhi;
677 if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
678 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
679 float deltaeta = fEta - maxHEEta;
680 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
682 HECalREC.push_back(jhbhe->energy());
684 HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
691 eventout +=
"\n Number of HBRecHits collected:............ ";
696 eventout +=
"\n Number of HERecHits collected:............ ";
703 std::vector<edm::Handle<HFRecHitCollection> >
hf;
705 if (!hf[0].isValid()) {
707 <<
"Unable to find any HFRecHitCollections in event!";
710 std::vector<edm::Handle<HFRecHitCollection> >::iterator
ihf;
713 for (ihf = hf.begin(); ihf != hf.end(); ++
ihf) {
717 jhf != (*ihf)->end(); ++jhf) {
727 if ( (jhf->energy()) > maxHFEnergy ) {
728 maxHFEnergy = jhf->energy();
736 jhf != (*ihf)->end(); ++jhf) {
749 float deltaphi = maxHBPhi - fPhi;
750 if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
751 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
752 float deltaeta = fEta - maxHFEta;
753 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
757 HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
763 eventout +=
"\n Number of HFDigis collected:.............. ";
770 std::vector<edm::Handle<HORecHitCollection> >
ho;
772 if (!ho[0].isValid()) {
774 <<
"Unable to find any HORecHitCollections in event!";
777 std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
780 for (iho = ho.begin(); iho != ho.end(); ++iho) {
783 jho != (*iho)->end(); ++jho) {
796 float deltaphi = maxHOPhi - fPhi;
797 if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
798 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
799 float deltaeta = fEta - maxHOEta;
800 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
804 HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
810 eventout +=
"\n Number of HODigis collected:.............. ";
822 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeHCal";
825 TString eventout(
"\n nHBRecHits = ");
827 for (
unsigned int i = 0;
i <
HBCalREC.size(); ++
i) {
828 eventout +=
"\n (REC, R, SHE) = (";
836 eventout +=
"\n nHERecHits = ";
838 for (
unsigned int i = 0;
i <
HECalREC.size(); ++
i) {
839 eventout +=
"\n (REC, R, SHE) = (";
847 eventout +=
"\n nHFRecHits = ";
849 for (
unsigned int i = 0;
i <
HFCalREC.size(); ++
i) {
850 eventout +=
"\n (REC, R, SHE) = (";
858 eventout +=
"\n nHORecHits = ";
860 for (
unsigned int i = 0;
i <
HOCalREC.size(); ++
i) {
861 eventout +=
"\n (REC, R, SHE) = (";
890 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillTrk";
894 eventout =
"\nGathering info:";
899 if (!rechitsmatched.
isValid()) {
901 <<
"Unable to find stripmatchedrechits in event!";
911 <<
"Unable to find TrackerDigiGeometry in event!";
916 int nStripBrl = 0, nStripFwd = 0;
919 for (TrackerGeometry::DetContainer::const_iterator it = pDD->
dets().begin();
920 it != pDD->
dets().end(); ++it) {
922 uint32_t myid = ((*it)->geographicalId()).rawId();
923 DetId detid = ((*it)->geographicalId());
928 if (rechitmatchedMatch != rechitsmatched->
end()) {
934 for ( itermatched = rechitmatchedRangeIteratorBegin;
935 itermatched != rechitmatchedRangeIteratorEnd;
941 float mindist = 999999.;
942 float distx = 999999.;
943 float disty = 999999.;
944 float dist = 999999.;
945 std::pair<LocalPoint,LocalVector> closestPair;
948 float rechitmatchedx = position.
x();
949 float rechitmatchedy = position.
y();
959 std::pair<LocalPoint,LocalVector> hitPair;
961 for(std::vector<PSimHit>::const_iterator
m =
matched.begin();
965 distx = fabs(rechitmatchedx - hitPair.first.x());
966 disty = fabs(rechitmatchedy - hitPair.first.y());
967 dist =
sqrt(distx*distx+disty*disty);
971 closestPair = hitPair;
982 TIBL1RX.push_back(rechitmatchedx);
983 TIBL1RY.push_back(rechitmatchedy);
984 TIBL1SX.push_back(closestPair.first.x());
985 TIBL1SY.push_back(closestPair.first.y());
988 TIBL2RX.push_back(rechitmatchedx);
989 TIBL2RY.push_back(rechitmatchedy);
990 TIBL2SX.push_back(closestPair.first.x());
991 TIBL2SY.push_back(closestPair.first.y());
994 TIBL3RX.push_back(rechitmatchedx);
995 TIBL3RY.push_back(rechitmatchedy);
996 TIBL3SX.push_back(closestPair.first.x());
997 TIBL3SY.push_back(closestPair.first.y());
1000 TIBL4RX.push_back(rechitmatchedx);
1001 TIBL4RY.push_back(rechitmatchedy);
1002 TIBL4SX.push_back(closestPair.first.x());
1003 TIBL4SY.push_back(closestPair.first.y());
1014 TOBL1RX.push_back(rechitmatchedx);
1015 TOBL1RY.push_back(rechitmatchedy);
1016 TOBL1SX.push_back(closestPair.first.x());
1017 TOBL1SY.push_back(closestPair.first.y());
1020 TOBL2RX.push_back(rechitmatchedx);
1021 TOBL2RY.push_back(rechitmatchedy);
1022 TOBL2SX.push_back(closestPair.first.x());
1023 TOBL2SY.push_back(closestPair.first.y());
1026 TOBL3RX.push_back(rechitmatchedx);
1027 TOBL3RY.push_back(rechitmatchedy);
1028 TOBL3SX.push_back(closestPair.first.x());
1029 TOBL3SY.push_back(closestPair.first.y());
1032 TOBL4RX.push_back(rechitmatchedx);
1033 TOBL4RY.push_back(rechitmatchedy);
1034 TOBL4SX.push_back(closestPair.first.x());
1035 TOBL4SY.push_back(closestPair.first.y());
1046 TIDW1RX.push_back(rechitmatchedx);
1047 TIDW1RY.push_back(rechitmatchedy);
1048 TIDW1SX.push_back(closestPair.first.x());
1049 TIDW1SY.push_back(closestPair.first.y());
1052 TIDW2RX.push_back(rechitmatchedx);
1053 TIDW2RY.push_back(rechitmatchedy);
1054 TIDW2SX.push_back(closestPair.first.x());
1055 TIDW2SY.push_back(closestPair.first.y());
1058 TIDW3RX.push_back(rechitmatchedx);
1059 TIDW3RY.push_back(rechitmatchedy);
1060 TIDW3SX.push_back(closestPair.first.x());
1061 TIDW3SY.push_back(closestPair.first.y());
1072 TECW1RX.push_back(rechitmatchedx);
1073 TECW1RY.push_back(rechitmatchedy);
1074 TECW1SX.push_back(closestPair.first.x());
1075 TECW1SY.push_back(closestPair.first.y());
1078 TECW2RX.push_back(rechitmatchedx);
1079 TECW2RY.push_back(rechitmatchedy);
1080 TECW2SX.push_back(closestPair.first.x());
1081 TECW2SY.push_back(closestPair.first.y());
1084 TECW3RX.push_back(rechitmatchedx);
1085 TECW3RY.push_back(rechitmatchedy);
1086 TECW3SX.push_back(closestPair.first.x());
1087 TECW3SY.push_back(closestPair.first.y());
1090 TECW4RX.push_back(rechitmatchedx);
1091 TECW4RY.push_back(rechitmatchedy);
1092 TECW4SX.push_back(closestPair.first.x());
1093 TECW4SY.push_back(closestPair.first.y());
1096 TECW5RX.push_back(rechitmatchedx);
1097 TECW5RY.push_back(rechitmatchedy);
1098 TECW5SX.push_back(closestPair.first.x());
1099 TECW5SY.push_back(closestPair.first.y());
1102 TECW6RX.push_back(rechitmatchedx);
1103 TECW6RY.push_back(rechitmatchedy);
1104 TECW6SX.push_back(closestPair.first.x());
1105 TECW6SY.push_back(closestPair.first.y());
1108 TECW7RX.push_back(rechitmatchedx);
1109 TECW7RY.push_back(rechitmatchedy);
1110 TECW7SX.push_back(closestPair.first.x());
1111 TECW7SY.push_back(closestPair.first.y());
1114 TECW8RX.push_back(rechitmatchedx);
1115 TECW8RY.push_back(rechitmatchedy);
1116 TECW8SX.push_back(closestPair.first.x());
1117 TECW8SY.push_back(closestPair.first.y());
1127 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1128 eventout += nStripBrl;
1132 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1133 eventout += nStripFwd;
1142 <<
"Unable to find SiPixelRecHitCollection in event!";
1151 <<
"Unable to find TrackerDigiGeometry in event!";
1156 int nPxlBrl = 0, nPxlFwd = 0;
1158 for (TrackerGeometry::DetContainer::const_iterator it = geom->
dets().begin();
1159 it != geom->
dets().end(); ++it) {
1161 uint32_t myid = ((*it)->geographicalId()).rawId();
1162 DetId detId = ((*it)->geographicalId());
1171 if (pixeldet == recHitColl->
end())
continue;
1179 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1184 if ( !matched.empty() ) {
1186 float closest = 9999.9;
1189 float rechit_x = lp.
x();
1190 float rechit_y = lp.
y();
1196 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
1197 m != matched.end(); ++
m) {
1199 float sim_x1 = (*m).entryPoint().x();
1200 float sim_x2 = (*m).exitPoint().x();
1201 float sim_xpos = 0.5*(sim_x1+sim_x2);
1203 float sim_y1 = (*m).entryPoint().y();
1204 float sim_y2 = (*m).exitPoint().y();
1205 float sim_ypos = 0.5*(sim_y1+sim_y2);
1207 float x_res = fabs(sim_xpos - rechit_x);
1208 float y_res = fabs(sim_ypos - rechit_y);
1210 float dist =
sqrt(x_res*x_res + y_res*y_res);
1212 if ( dist < closest ) {
1225 BRL1RX.push_back(rechit_x);
1226 BRL1RY.push_back(rechit_y);
1231 BRL2RX.push_back(rechit_x);
1232 BRL2RY.push_back(rechit_y);
1237 BRL3RX.push_back(rechit_x);
1238 BRL3RY.push_back(rechit_y);
1249 if (tTopo->
pxfDisk(myid) == 1) {
1250 if (tTopo->
pxfSide(myid) == 1) {
1256 if (tTopo->
pxfSide(myid) == 2) {
1263 if (tTopo->
pxfDisk(myid) == 2) {
1264 if (tTopo->
pxfSide(myid) == 1) {
1270 if (tTopo->
pxfSide(myid) == 2) {
1284 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1285 eventout += nPxlBrl;
1289 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1290 eventout += nPxlFwd;
1301 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeTrk";
1306 TString eventout(
"\n nTIBL1 = ");
1308 for (
unsigned int i = 0;
i <
TIBL1RX.size(); ++
i) {
1309 eventout +=
"\n (RX, RY, SX, SY) = (";
1319 eventout +=
"\n nTIBL2 = ";
1321 for (
unsigned int i = 0;
i <
TIBL2RX.size(); ++
i) {
1322 eventout +=
"\n (RX, RY, SX, SY) = (";
1332 eventout +=
"\n nTIBL3 = ";
1334 for (
unsigned int i = 0;
i <
TIBL3RX.size(); ++
i) {
1335 eventout +=
"\n (RX, RY, SX, SY) = (";
1345 eventout +=
"\n nTIBL4 = ";
1347 for (
unsigned int i = 0;
i <
TIBL4RX.size(); ++
i) {
1348 eventout +=
"\n (RX, RY, SX, SY) = (";
1358 eventout +=
"\n nTOBL1 = ";
1360 for (
unsigned int i = 0;
i <
TOBL1RX.size(); ++
i) {
1361 eventout +=
"\n (RX, RY, SX, SY) = (";
1371 eventout +=
"\n nTOBL2 = ";
1373 for (
unsigned int i = 0;
i <
TOBL2RX.size(); ++
i) {
1374 eventout +=
"\n (RX, RY, SX, SY) = (";
1384 eventout +=
"\n nTOBL3 = ";
1386 for (
unsigned int i = 0;
i <
TOBL3RX.size(); ++
i) {
1387 eventout +=
"\n (RX, RY, SX, SY) = (";
1397 eventout +=
"\n nTOBL4 = ";
1399 for (
unsigned int i = 0;
i <
TOBL4RX.size(); ++
i) {
1400 eventout +=
"\n (RX, RY, SX, SY) = (";
1410 eventout +=
"\n nTIDW1 = ";
1412 for (
unsigned int i = 0;
i <
TIDW1RX.size(); ++
i) {
1413 eventout +=
"\n (RX, RY, SX, SY) = (";
1423 eventout +=
"\n nTIDW2 = ";
1425 for (
unsigned int i = 0;
i <
TIDW2RX.size(); ++
i) {
1426 eventout +=
"\n (RX, RY, SX, SY) = (";
1436 eventout +=
"\n nTIDW3 = ";
1438 for (
unsigned int i = 0;
i <
TIDW3RX.size(); ++
i) {
1439 eventout +=
"\n (RX, RY, SX, SY) = (";
1449 eventout +=
"\n nTECW1 = ";
1451 for (
unsigned int i = 0;
i <
TECW1RX.size(); ++
i) {
1452 eventout +=
"\n (RX, RY, SX, SY) = (";
1462 eventout +=
"\n nTECW2 = ";
1464 for (
unsigned int i = 0;
i <
TECW2RX.size(); ++
i) {
1465 eventout +=
"\n (RX, RY, SX, SY) = (";
1475 eventout +=
"\n nTECW3 = ";
1477 for (
unsigned int i = 0;
i <
TECW3RX.size(); ++
i) {
1478 eventout +=
"\n (RX, RY, SX, SY) = (";
1488 eventout +=
"\n nTECW4 = ";
1490 for (
unsigned int i = 0;
i <
TECW4RX.size(); ++
i) {
1491 eventout +=
"\n (RX, RY, SX, SY) = (";
1501 eventout +=
"\n nTECW5 = ";
1503 for (
unsigned int i = 0;
i <
TECW5RX.size(); ++
i) {
1504 eventout +=
"\n (RX, RY, SX, SY) = (";
1514 eventout +=
"\n nTECW6 = ";
1516 for (
unsigned int i = 0;
i <
TECW6RX.size(); ++
i) {
1517 eventout +=
"\n (RX, RY, SX, SY) = (";
1527 eventout +=
"\n nTECW7 = ";
1529 for (
unsigned int i = 0;
i <
TECW7RX.size(); ++
i) {
1530 eventout +=
"\n (RX, RY, SX, SY) = (";
1540 eventout +=
"\n nTECW8 = ";
1542 for (
unsigned int i = 0;
i <
TECW8RX.size(); ++
i) {
1543 eventout +=
"\n (RX, RY, SX, SY) = (";
1555 eventout +=
"\n nBRL1 = ";
1556 eventout +=
BRL1RX.size();
1557 for (
unsigned int i = 0;
i <
BRL1RX.size(); ++
i) {
1558 eventout +=
"\n (RX, RY, SX, SY) = (";
1568 eventout +=
"\n nBRL2 = ";
1569 eventout +=
BRL2RX.size();
1570 for (
unsigned int i = 0;
i <
BRL2RX.size(); ++
i) {
1571 eventout +=
"\n (RX, RY, SX, SY) = (";
1581 eventout +=
"\n nBRL3 = ";
1582 eventout +=
BRL3RX.size();
1583 for (
unsigned int i = 0;
i <
BRL3RX.size(); ++
i) {
1584 eventout +=
"\n (RX, RY, SX, SY) = (";
1594 eventout +=
"\n nFWD1p = ";
1596 for (
unsigned int i = 0;
i <
FWD1pRX.size(); ++
i) {
1597 eventout +=
"\n (RX, RY, SX, SY) = (";
1607 eventout +=
"\n nFWD1n = ";
1609 for (
unsigned int i = 0;
i <
FWD1nRX.size(); ++
i) {
1610 eventout +=
"\n (RX, RY, SX, SY) = (";
1620 eventout +=
"\n nFWD2p = ";
1622 for (
unsigned int i = 0;
i <
FWD2pRX.size(); ++
i) {
1623 eventout +=
"\n (RX, RY, SX, SY) = (";
1633 eventout +=
"\n nFWD2p = ";
1635 for (
unsigned int i = 0;
i <
FWD2nRX.size(); ++
i) {
1636 eventout +=
"\n (RX, RY, SX, SY) = (";
1686 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillMuon";
1690 eventout =
"\nGathering info:";
1697 <<
"Unable to find DTMuonGeometryRecord in event!";
1705 <<
"Unable to find dtsimHits in event!";
1709 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1716 <<
"Unable to find dtRecHits in event!";
1720 std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1724 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1727 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1746 <<
"Unable to find muo CSC crossingFrame in event!";
1753 hitItr !=
simHits.end(); ++hitItr)
1755 theMap[hitItr->detUnitId()].push_back(*hitItr);
1763 <<
"Unable to find CSCMuonGeometryRecord in event!";
1773 <<
"Unable to find CSC RecHits in event!";
1780 recHitItr != cscRecHits->end(); ++recHitItr) {
1782 int detId = (*recHitItr).cscDetId().rawId();
1785 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1787 if (mapItr !=
theMap.end()) {
1788 simHits = mapItr->second;
1791 if (simHits.size() == 1) {
1804 eventout +=
"\n Number of CSCRecHits collected:........... ";
1809 std::map<double, int> mapsim, maprec;
1810 std::map<int, double> nmapsim, nmaprec;
1816 <<
"Unable to find RPCMuonGeometryRecord in event!";
1824 <<
"Unable to find RPCSimHit in event!";
1832 <<
"Unable to find RPCRecHit in event!";
1839 for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1845 eventout +=
"\n Number of RPCRecHits collected:........... ";
1854 LocalPoint rhitlocal = (*recIt).localPosition();
1855 double rhitlocalx = rhitlocal.
x();
1856 maprec[rhitlocalx] = nrec;
1860 for (std::map<double,int>::iterator iter = maprec.begin();
1861 iter != maprec.end(); ++iter) {
1863 nmaprec[
i] = (*iter).first;
1866 edm::PSimHitContainer::const_iterator simIt;
1868 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1869 int ptype = (*simIt).particleType();
1871 if (ptype == 13 || ptype == -13) {
1873 LocalPoint shitlocal = (*simIt).localPosition();
1874 double shitlocalx = shitlocal.
x();
1875 mapsim[shitlocalx] = nsim;
1880 for (std::map<double,int>::iterator iter = mapsim.begin();
1881 iter != mapsim.end(); ++iter) {
1883 nmapsim[
i] = (*iter).first;
1887 for (
int r = 0;
r < nsim;
r++) {
1889 RPCRHX.push_back(nmaprec[
r+1]);
1890 RPCSHX.push_back(nmapsim[
r+1]);
1895 eventout +=
"\n Number of RPCRecHits collected:........... ";
1907 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeMuon";
1912 TString eventout(
"\n nDT = ");
1913 eventout +=
DTRHD.size();
1914 for (
unsigned int i = 0;
i <
DTRHD.size(); ++
i) {
1915 eventout +=
"\n (RHD, SHD) = (";
1923 eventout +=
"\n nCSC = ";
1925 for (
unsigned int i = 0;
i <
CSCRHPHI.size(); ++
i) {
1926 eventout +=
"\n (rhphi, rhperp, shphi) = (";
1936 eventout +=
"\n nRPC = ";
1937 eventout +=
RPCRHX.size();
1938 for (
unsigned int i = 0;
i <
RPCRHX.size(); ++
i) {
1939 eventout +=
"\n (rhx, shx) = (";
1960 std::string MsgLoggerCat =
"GlobalRecHitsProducer_clear";
1964 <<
"Clearing event holders";
2117 std::pair<LocalPoint,LocalVector>
2125 LocalPoint localHit = plane.toLocal(globalpos);
2132 float scale = -localHit.
z() / dir.
z();
2144 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
2148 std::map<DTWireId, std::vector<DTRecHit1DPair> >
2151 std::map<DTWireId, std::vector<DTRecHit1DPair> > ret;
2154 rechit != dt1DRecHitPairs->end(); rechit++) {
2155 ret[(*rechit).wireId()].push_back(*rechit);
2168 float xEntry = entryP.
x()-xwire;
2169 float xExit = exitP.
x()-xwire;
2172 return fabs(xEntry - (entryP.
z()*(xExit-xEntry))/(exitP.
z()-entryP.
z()));
2176 template <
typename type>
2180 const std::vector<type>& recHits,
2181 const float simHitDist) {
2183 const type* theBestRecHit = 0;
2185 for(
typename std::vector<type>::const_iterator
recHit = recHits.begin();
2189 if(fabs(distTmp-simHitDist) < res) {
2190 res = fabs(distTmp-simHitDist);
2191 theBestRecHit = &(*recHit);
2195 return theBestRecHit;
2215 template <
typename type>
2223 std::map<DTWireId, std::vector<PSimHit> > simHitsPerWire = _simHitsPerWire;
2224 std::map<DTWireId, std::vector<type> > recHitsPerWire = _recHitsPerWire;
2227 for(
std::map<
DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
2228 simHitsPerWire.begin();
2229 wireAndSHits != simHitsPerWire.end();
2231 DTWireId wireId = (*wireAndSHits).first;
2232 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
2246 if(simHitWireDist>2.1) {
2252 if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
2257 std::vector<type> recHits = recHitsPerWire[wireId];
2260 const type* theBestRecHit =
2267 DTRHD.push_back(recHitWireDist);
2268 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 &)
void getManyByType(std::vector< Handle< PROD > > &results) const
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)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
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)
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
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 &)
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
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)
std::vector< EcalUncalibratedRecHit >::const_iterator const_iterator
static const PSimHit * findMuSimHit(const edm::PSimHitContainer &hits)
Select the SimHit from a muon in a vector of SimHits.
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 storeMuon(PGlobalRecHit &)
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 storeECal(PGlobalRecHit &)
std::map< int, edm::PSimHitContainer > theMap
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
void putBRL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
virtual void produce(edm::Event &, const edm::EventSetup &)
uint32_t rawId() const
get the raw id
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_
std::map< uint32_t, float, std::less< uint32_t > > MapType
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
virtual LocalPoint localPosition() const final
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)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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_
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
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)
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 GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
T const * product() const
void putDTRecHits(const std::vector< float > &rhd, const std::vector< float > &shd)
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)
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
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
DetId geographicalId() const
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
LocalPoint localPosition() const
void fillTrk(edm::Event &, const edm::EventSetup &)
unsigned int tecWheel(const DetId &id) const
T const * product() const
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit > > &simHitsPerWire, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
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)
virtual ~GlobalRecHitsProducer()
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)
virtual LocalPoint localPosition() const
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
DTWireId wireId() const
Return the wireId.