17 std::string MsgLoggerCat =
"GlobalRecHitsProducer_GlobalRecHitsProducer";
27 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
29 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::Provenance*> 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::auto_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::auto_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::auto_ptr<MixCollection<PCaloHit> >
432 = preshowerHits->begin();
433 hitItr != preshowerHits->end();
438 uint32_t crystid = esid.
rawId();
439 esSimMap[crystid] += hitItr->energy();
447 recHit != ESRecHit->
end();
453 ESRE.push_back(recHit->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;
596 for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
600 jhbhe != (*ihbhe)->end(); ++jhbhe) {
607 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
610 if ( (jhbhe->energy()) > maxHBEnergy ) {
611 maxHBEnergy = jhbhe->energy();
622 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
625 if ( (jhbhe->energy()) > maxHEEnergy ) {
626 maxHEEnergy = jhbhe->energy();
634 jhbhe != (*ihbhe)->end(); ++jhbhe) {
643 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
647 float deltaphi = maxHBPhi - fPhi;
648 if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
649 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
650 float deltaeta = fEta - maxHBEta;
651 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
653 HBCalREC.push_back(jhbhe->energy());
655 HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
663 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
667 float deltaphi = maxHEPhi - fPhi;
668 if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
669 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
670 float deltaeta = fEta - maxHEEta;
671 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
673 HECalREC.push_back(jhbhe->energy());
675 HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
682 eventout +=
"\n Number of HBRecHits collected:............ ";
687 eventout +=
"\n Number of HERecHits collected:............ ";
694 std::vector<edm::Handle<HFRecHitCollection> > hf;
696 if (!hf[0].isValid()) {
698 <<
"Unable to find any HFRecHitCollections in event!";
701 std::vector<edm::Handle<HFRecHitCollection> >::iterator
ihf;
704 for (ihf = hf.begin(); ihf != hf.end(); ++
ihf) {
708 jhf != (*ihf)->end(); ++jhf) {
715 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
718 if ( (jhf->energy()) > maxHFEnergy ) {
719 maxHFEnergy = jhf->energy();
727 jhf != (*ihf)->end(); ++jhf) {
736 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
740 float deltaphi = maxHBPhi - fPhi;
741 if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
742 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
743 float deltaeta = fEta - maxHFEta;
744 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
748 HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
754 eventout +=
"\n Number of HFDigis collected:.............. ";
761 std::vector<edm::Handle<HORecHitCollection> > ho;
763 if (!ho[0].isValid()) {
765 <<
"Unable to find any HORecHitCollections in event!";
768 std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
771 for (iho = ho.begin(); iho != ho.end(); ++iho) {
774 jho != (*iho)->end(); ++jho) {
783 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
787 float deltaphi = maxHOPhi - fPhi;
788 if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
789 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
790 float deltaeta = fEta - maxHOEta;
791 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
795 HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
801 eventout +=
"\n Number of HODigis collected:.............. ";
813 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeHCal";
816 TString eventout(
"\n nHBRecHits = ");
818 for (
unsigned int i = 0;
i <
HBCalREC.size(); ++
i) {
819 eventout +=
"\n (REC, R, SHE) = (";
827 eventout +=
"\n nHERecHits = ";
829 for (
unsigned int i = 0;
i <
HECalREC.size(); ++
i) {
830 eventout +=
"\n (REC, R, SHE) = (";
838 eventout +=
"\n nHFRecHits = ";
840 for (
unsigned int i = 0;
i <
HFCalREC.size(); ++
i) {
841 eventout +=
"\n (REC, R, SHE) = (";
849 eventout +=
"\n nHORecHits = ";
851 for (
unsigned int i = 0;
i <
HOCalREC.size(); ++
i) {
852 eventout +=
"\n (REC, R, SHE) = (";
881 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillTrk";
885 eventout =
"\nGathering info:";
890 if (!rechitsmatched.
isValid()) {
892 <<
"Unable to find stripmatchedrechits in event!";
902 <<
"Unable to find TrackerDigiGeometry in event!";
907 int nStripBrl = 0, nStripFwd = 0;
910 for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin();
911 it != pDD->dets().end(); ++it) {
913 uint32_t myid = ((*it)->geographicalId()).rawId();
919 if (rechitmatchedMatch != rechitsmatched->end()) {
925 for ( itermatched = rechitmatchedRangeIteratorBegin;
926 itermatched != rechitmatchedRangeIteratorEnd;
932 float mindist = 999999.;
933 float distx = 999999.;
934 float disty = 999999.;
935 float dist = 999999.;
936 std::pair<LocalPoint,LocalVector> closestPair;
939 float rechitmatchedx = position.
x();
940 float rechitmatchedy = position.
y();
950 std::pair<LocalPoint,LocalVector> hitPair;
952 for(std::vector<PSimHit>::const_iterator
m =
matched.begin();
956 distx = fabs(rechitmatchedx - hitPair.first.x());
957 disty = fabs(rechitmatchedy - hitPair.first.y());
958 dist =
sqrt(distx*distx+disty*disty);
962 closestPair = hitPair;
973 TIBL1RX.push_back(rechitmatchedx);
974 TIBL1RY.push_back(rechitmatchedy);
975 TIBL1SX.push_back(closestPair.first.x());
976 TIBL1SY.push_back(closestPair.first.y());
979 TIBL2RX.push_back(rechitmatchedx);
980 TIBL2RY.push_back(rechitmatchedy);
981 TIBL2SX.push_back(closestPair.first.x());
982 TIBL2SY.push_back(closestPair.first.y());
985 TIBL3RX.push_back(rechitmatchedx);
986 TIBL3RY.push_back(rechitmatchedy);
987 TIBL3SX.push_back(closestPair.first.x());
988 TIBL3SY.push_back(closestPair.first.y());
991 TIBL4RX.push_back(rechitmatchedx);
992 TIBL4RY.push_back(rechitmatchedy);
993 TIBL4SX.push_back(closestPair.first.x());
994 TIBL4SY.push_back(closestPair.first.y());
1005 TOBL1RX.push_back(rechitmatchedx);
1006 TOBL1RY.push_back(rechitmatchedy);
1007 TOBL1SX.push_back(closestPair.first.x());
1008 TOBL1SY.push_back(closestPair.first.y());
1011 TOBL2RX.push_back(rechitmatchedx);
1012 TOBL2RY.push_back(rechitmatchedy);
1013 TOBL2SX.push_back(closestPair.first.x());
1014 TOBL2SY.push_back(closestPair.first.y());
1017 TOBL3RX.push_back(rechitmatchedx);
1018 TOBL3RY.push_back(rechitmatchedy);
1019 TOBL3SX.push_back(closestPair.first.x());
1020 TOBL3SY.push_back(closestPair.first.y());
1023 TOBL4RX.push_back(rechitmatchedx);
1024 TOBL4RY.push_back(rechitmatchedy);
1025 TOBL4SX.push_back(closestPair.first.x());
1026 TOBL4SY.push_back(closestPair.first.y());
1037 TIDW1RX.push_back(rechitmatchedx);
1038 TIDW1RY.push_back(rechitmatchedy);
1039 TIDW1SX.push_back(closestPair.first.x());
1040 TIDW1SY.push_back(closestPair.first.y());
1043 TIDW2RX.push_back(rechitmatchedx);
1044 TIDW2RY.push_back(rechitmatchedy);
1045 TIDW2SX.push_back(closestPair.first.x());
1046 TIDW2SY.push_back(closestPair.first.y());
1049 TIDW3RX.push_back(rechitmatchedx);
1050 TIDW3RY.push_back(rechitmatchedy);
1051 TIDW3SX.push_back(closestPair.first.x());
1052 TIDW3SY.push_back(closestPair.first.y());
1063 TECW1RX.push_back(rechitmatchedx);
1064 TECW1RY.push_back(rechitmatchedy);
1065 TECW1SX.push_back(closestPair.first.x());
1066 TECW1SY.push_back(closestPair.first.y());
1069 TECW2RX.push_back(rechitmatchedx);
1070 TECW2RY.push_back(rechitmatchedy);
1071 TECW2SX.push_back(closestPair.first.x());
1072 TECW2SY.push_back(closestPair.first.y());
1075 TECW3RX.push_back(rechitmatchedx);
1076 TECW3RY.push_back(rechitmatchedy);
1077 TECW3SX.push_back(closestPair.first.x());
1078 TECW3SY.push_back(closestPair.first.y());
1081 TECW4RX.push_back(rechitmatchedx);
1082 TECW4RY.push_back(rechitmatchedy);
1083 TECW4SX.push_back(closestPair.first.x());
1084 TECW4SY.push_back(closestPair.first.y());
1087 TECW5RX.push_back(rechitmatchedx);
1088 TECW5RY.push_back(rechitmatchedy);
1089 TECW5SX.push_back(closestPair.first.x());
1090 TECW5SY.push_back(closestPair.first.y());
1093 TECW6RX.push_back(rechitmatchedx);
1094 TECW6RY.push_back(rechitmatchedy);
1095 TECW6SX.push_back(closestPair.first.x());
1096 TECW6SY.push_back(closestPair.first.y());
1099 TECW7RX.push_back(rechitmatchedx);
1100 TECW7RY.push_back(rechitmatchedy);
1101 TECW7SX.push_back(closestPair.first.x());
1102 TECW7SY.push_back(closestPair.first.y());
1105 TECW8RX.push_back(rechitmatchedx);
1106 TECW8RY.push_back(rechitmatchedy);
1107 TECW8SX.push_back(closestPair.first.x());
1108 TECW8SY.push_back(closestPair.first.y());
1118 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1119 eventout += nStripBrl;
1123 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1124 eventout += nStripFwd;
1133 <<
"Unable to find SiPixelRecHitCollection in event!";
1142 <<
"Unable to find TrackerDigiGeometry in event!";
1147 int nPxlBrl = 0, nPxlFwd = 0;
1149 for (TrackerGeometry::DetContainer::const_iterator it = geom->dets().begin();
1150 it != geom->dets().end(); ++it) {
1152 uint32_t myid = ((*it)->geographicalId()).rawId();
1153 DetId detId = ((*it)->geographicalId());
1162 if (pixeldet == recHitColl->end())
continue;
1170 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1175 if ( !matched.empty() ) {
1177 float closest = 9999.9;
1180 float rechit_x = lp.
x();
1181 float rechit_y = lp.
y();
1187 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
1188 m != matched.end(); ++
m) {
1190 float sim_x1 = (*m).entryPoint().x();
1191 float sim_x2 = (*m).exitPoint().x();
1192 float sim_xpos = 0.5*(sim_x1+sim_x2);
1194 float sim_y1 = (*m).entryPoint().y();
1195 float sim_y2 = (*m).exitPoint().y();
1196 float sim_ypos = 0.5*(sim_y1+sim_y2);
1198 float x_res = fabs(sim_xpos - rechit_x);
1199 float y_res = fabs(sim_ypos - rechit_y);
1201 float dist =
sqrt(x_res*x_res + y_res*y_res);
1203 if ( dist < closest ) {
1216 BRL1RX.push_back(rechit_x);
1217 BRL1RY.push_back(rechit_y);
1222 BRL2RX.push_back(rechit_x);
1223 BRL2RY.push_back(rechit_y);
1228 BRL3RX.push_back(rechit_x);
1229 BRL3RY.push_back(rechit_y);
1240 if (tTopo->
pxfDisk(myid) == 1) {
1241 if (tTopo->
pxfSide(myid) == 1) {
1247 if (tTopo->
pxfSide(myid) == 2) {
1254 if (tTopo->
pxfDisk(myid) == 2) {
1255 if (tTopo->
pxfSide(myid) == 1) {
1261 if (tTopo->
pxfSide(myid) == 2) {
1275 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1276 eventout += nPxlBrl;
1280 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1281 eventout += nPxlFwd;
1292 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeTrk";
1297 TString eventout(
"\n nTIBL1 = ");
1299 for (
unsigned int i = 0;
i <
TIBL1RX.size(); ++
i) {
1300 eventout +=
"\n (RX, RY, SX, SY) = (";
1310 eventout +=
"\n nTIBL2 = ";
1312 for (
unsigned int i = 0;
i <
TIBL2RX.size(); ++
i) {
1313 eventout +=
"\n (RX, RY, SX, SY) = (";
1323 eventout +=
"\n nTIBL3 = ";
1325 for (
unsigned int i = 0;
i <
TIBL3RX.size(); ++
i) {
1326 eventout +=
"\n (RX, RY, SX, SY) = (";
1336 eventout +=
"\n nTIBL4 = ";
1338 for (
unsigned int i = 0;
i <
TIBL4RX.size(); ++
i) {
1339 eventout +=
"\n (RX, RY, SX, SY) = (";
1349 eventout +=
"\n nTOBL1 = ";
1351 for (
unsigned int i = 0;
i <
TOBL1RX.size(); ++
i) {
1352 eventout +=
"\n (RX, RY, SX, SY) = (";
1362 eventout +=
"\n nTOBL2 = ";
1364 for (
unsigned int i = 0;
i <
TOBL2RX.size(); ++
i) {
1365 eventout +=
"\n (RX, RY, SX, SY) = (";
1375 eventout +=
"\n nTOBL3 = ";
1377 for (
unsigned int i = 0;
i <
TOBL3RX.size(); ++
i) {
1378 eventout +=
"\n (RX, RY, SX, SY) = (";
1388 eventout +=
"\n nTOBL4 = ";
1390 for (
unsigned int i = 0;
i <
TOBL4RX.size(); ++
i) {
1391 eventout +=
"\n (RX, RY, SX, SY) = (";
1401 eventout +=
"\n nTIDW1 = ";
1403 for (
unsigned int i = 0;
i <
TIDW1RX.size(); ++
i) {
1404 eventout +=
"\n (RX, RY, SX, SY) = (";
1414 eventout +=
"\n nTIDW2 = ";
1416 for (
unsigned int i = 0;
i <
TIDW2RX.size(); ++
i) {
1417 eventout +=
"\n (RX, RY, SX, SY) = (";
1427 eventout +=
"\n nTIDW3 = ";
1429 for (
unsigned int i = 0;
i <
TIDW3RX.size(); ++
i) {
1430 eventout +=
"\n (RX, RY, SX, SY) = (";
1440 eventout +=
"\n nTECW1 = ";
1442 for (
unsigned int i = 0;
i <
TECW1RX.size(); ++
i) {
1443 eventout +=
"\n (RX, RY, SX, SY) = (";
1453 eventout +=
"\n nTECW2 = ";
1455 for (
unsigned int i = 0;
i <
TECW2RX.size(); ++
i) {
1456 eventout +=
"\n (RX, RY, SX, SY) = (";
1466 eventout +=
"\n nTECW3 = ";
1468 for (
unsigned int i = 0;
i <
TECW3RX.size(); ++
i) {
1469 eventout +=
"\n (RX, RY, SX, SY) = (";
1479 eventout +=
"\n nTECW4 = ";
1481 for (
unsigned int i = 0;
i <
TECW4RX.size(); ++
i) {
1482 eventout +=
"\n (RX, RY, SX, SY) = (";
1492 eventout +=
"\n nTECW5 = ";
1494 for (
unsigned int i = 0;
i <
TECW5RX.size(); ++
i) {
1495 eventout +=
"\n (RX, RY, SX, SY) = (";
1505 eventout +=
"\n nTECW6 = ";
1507 for (
unsigned int i = 0;
i <
TECW6RX.size(); ++
i) {
1508 eventout +=
"\n (RX, RY, SX, SY) = (";
1518 eventout +=
"\n nTECW7 = ";
1520 for (
unsigned int i = 0;
i <
TECW7RX.size(); ++
i) {
1521 eventout +=
"\n (RX, RY, SX, SY) = (";
1531 eventout +=
"\n nTECW8 = ";
1533 for (
unsigned int i = 0;
i <
TECW8RX.size(); ++
i) {
1534 eventout +=
"\n (RX, RY, SX, SY) = (";
1546 eventout +=
"\n nBRL1 = ";
1547 eventout +=
BRL1RX.size();
1548 for (
unsigned int i = 0;
i <
BRL1RX.size(); ++
i) {
1549 eventout +=
"\n (RX, RY, SX, SY) = (";
1559 eventout +=
"\n nBRL2 = ";
1560 eventout +=
BRL2RX.size();
1561 for (
unsigned int i = 0;
i <
BRL2RX.size(); ++
i) {
1562 eventout +=
"\n (RX, RY, SX, SY) = (";
1572 eventout +=
"\n nBRL3 = ";
1573 eventout +=
BRL3RX.size();
1574 for (
unsigned int i = 0;
i <
BRL3RX.size(); ++
i) {
1575 eventout +=
"\n (RX, RY, SX, SY) = (";
1585 eventout +=
"\n nFWD1p = ";
1587 for (
unsigned int i = 0;
i <
FWD1pRX.size(); ++
i) {
1588 eventout +=
"\n (RX, RY, SX, SY) = (";
1598 eventout +=
"\n nFWD1n = ";
1600 for (
unsigned int i = 0;
i <
FWD1nRX.size(); ++
i) {
1601 eventout +=
"\n (RX, RY, SX, SY) = (";
1611 eventout +=
"\n nFWD2p = ";
1613 for (
unsigned int i = 0;
i <
FWD2pRX.size(); ++
i) {
1614 eventout +=
"\n (RX, RY, SX, SY) = (";
1624 eventout +=
"\n nFWD2p = ";
1626 for (
unsigned int i = 0;
i <
FWD2nRX.size(); ++
i) {
1627 eventout +=
"\n (RX, RY, SX, SY) = (";
1677 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillMuon";
1681 eventout =
"\nGathering info:";
1688 <<
"Unable to find DTMuonGeometryRecord in event!";
1696 <<
"Unable to find dtsimHits in event!";
1700 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1707 <<
"Unable to find dtRecHits in event!";
1711 std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1715 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1718 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1737 <<
"Unable to find muo CSC crossingFrame in event!";
1744 hitItr !=
simHits.end(); ++hitItr)
1746 theMap[hitItr->detUnitId()].push_back(*hitItr);
1754 <<
"Unable to find CSCMuonGeometryRecord in event!";
1764 <<
"Unable to find CSC RecHits in event!";
1771 recHitItr != cscRecHits->end(); ++recHitItr) {
1773 int detId = (*recHitItr).cscDetId().rawId();
1776 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1778 if (mapItr !=
theMap.end()) {
1779 simHits = mapItr->second;
1782 if (simHits.size() == 1) {
1795 eventout +=
"\n Number of CSCRecHits collected:........... ";
1800 std::map<double, int> mapsim, maprec;
1801 std::map<int, double> nmapsim, nmaprec;
1807 <<
"Unable to find RPCMuonGeometryRecord in event!";
1815 <<
"Unable to find RPCSimHit in event!";
1823 <<
"Unable to find RPCRecHit in event!";
1830 for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1832 const RPCRoll *roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(Rid));
1836 eventout +=
"\n Number of RPCRecHits collected:........... ";
1845 LocalPoint rhitlocal = (*recIt).localPosition();
1846 double rhitlocalx = rhitlocal.
x();
1847 maprec[rhitlocalx] = nrec;
1851 for (std::map<double,int>::iterator
iter = maprec.begin();
1854 nmaprec[
i] = (*iter).first;
1857 edm::PSimHitContainer::const_iterator simIt;
1859 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1860 int ptype = (*simIt).particleType();
1862 if (ptype == 13 || ptype == -13) {
1864 LocalPoint shitlocal = (*simIt).localPosition();
1865 double shitlocalx = shitlocal.
x();
1866 mapsim[shitlocalx] = nsim;
1871 for (std::map<double,int>::iterator
iter = mapsim.begin();
1874 nmapsim[
i] = (*iter).first;
1878 for (
int r = 0;
r < nsim;
r++) {
1880 RPCRHX.push_back(nmaprec[
r+1]);
1881 RPCSHX.push_back(nmapsim[
r+1]);
1886 eventout +=
"\n Number of RPCRecHits collected:........... ";
1898 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeMuon";
1903 TString eventout(
"\n nDT = ");
1904 eventout +=
DTRHD.size();
1905 for (
unsigned int i = 0;
i <
DTRHD.size(); ++
i) {
1906 eventout +=
"\n (RHD, SHD) = (";
1914 eventout +=
"\n nCSC = ";
1916 for (
unsigned int i = 0;
i <
CSCRHPHI.size(); ++
i) {
1917 eventout +=
"\n (rhphi, rhperp, shphi) = (";
1927 eventout +=
"\n nRPC = ";
1928 eventout +=
RPCRHX.size();
1929 for (
unsigned int i = 0;
i <
RPCRHX.size(); ++
i) {
1930 eventout +=
"\n (rhx, shx) = (";
1951 std::string MsgLoggerCat =
"GlobalRecHitsProducer_clear";
1955 <<
"Clearing event holders";
2108 std::pair<LocalPoint,LocalVector>
2116 LocalPoint localHit = plane.toLocal(globalpos);
2123 float scale = -localHit.
z() / dir.
z();
2135 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
2139 std::map<DTWireId, std::vector<DTRecHit1DPair> >
2142 std::map<DTWireId, std::vector<DTRecHit1DPair> >
ret;
2145 rechit != dt1DRecHitPairs->end(); rechit++) {
2146 ret[(*rechit).wireId()].push_back(*rechit);
2159 float xEntry = entryP.
x()-xwire;
2160 float xExit = exitP.
x()-xwire;
2163 return fabs(xEntry - (entryP.
z()*(xExit-xEntry))/(exitP.
z()-entryP.
z()));
2167 template <
typename type>
2171 const std::vector<type>&
recHits,
2172 const float simHitDist) {
2174 const type* theBestRecHit = 0;
2176 for(
typename std::vector<type>::const_iterator recHit = recHits.begin();
2177 recHit != recHits.end();
2180 if(fabs(distTmp-simHitDist) < res) {
2181 res = fabs(distTmp-simHitDist);
2182 theBestRecHit = &(*recHit);
2186 return theBestRecHit;
2206 template <
typename type>
2214 std::map<DTWireId, std::vector<PSimHit> > simHitsPerWire = _simHitsPerWire;
2215 std::map<DTWireId, std::vector<type> > recHitsPerWire = _recHitsPerWire;
2218 for(
std::map<
DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
2219 simHitsPerWire.begin();
2220 wireAndSHits != simHitsPerWire.end();
2222 DTWireId wireId = (*wireAndSHits).first;
2223 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
2237 if(simHitWireDist>2.1) {
2243 if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
2248 std::vector<type>
recHits = recHitsPerWire[wireId];
2251 const type* theBestRecHit =
2258 DTRHD.push_back(recHitWireDist);
2259 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
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.
void getAllProvenance(std::vector< Provenance const * > &provenances) const
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
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)
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_
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 &)
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
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
void putBRL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
virtual float strip(const LocalPoint &) const =0
virtual void produce(edm::Event &, const edm::EventSetup &)
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
uint32_t rawId() const
get the raw id
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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)
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_
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 &)
T const * product() const
void putDTRecHits(const std::vector< float > &rhd, const std::vector< float > &shd)
T const * product() const
static const int sdHcalFwd
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)
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
static int position[264][3]
unsigned int pxfSide(const DetId &id) const
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
virtual const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
DetId geographicalId() const
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
volatile std::atomic< bool > shutdown_flag false
LocalPoint localPosition() const
void fillTrk(edm::Event &, const edm::EventSetup &)
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
virtual LocalPoint localPosition() const
unsigned int tecWheel(const DetId &id) 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_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
virtual const TrackerGeomDet * idToDet(DetId) const
DTWireId wireId() const
Return the wireId.