19 std::string MsgLoggerCat =
"GlobalRecHitsProducer_GlobalRecHitsProducer";
29 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
31 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
55 produces<PGlobalRecHit>(
label);
60 <<
"\n===============================\n"
61 <<
"Initialized as EDProducer with parameter values:\n"
62 <<
" Name = " <<
fName <<
"\n"
63 <<
" Verbosity = " << verbosity <<
"\n"
64 <<
" Frequency = " << frequency <<
"\n"
65 <<
" Label = " << label <<
"\n"
66 <<
" GetProv = " << getAllProvenances <<
"\n"
67 <<
" PrintProv = " << printProvenanceInfo <<
"\n"
68 <<
" ECalEBSrc = " << ECalEBSrc_.label()
69 <<
":" << ECalEBSrc_.instance() <<
"\n"
70 <<
" ECalUncalEBSrc = " << ECalUncalEBSrc_.
label()
71 <<
":" << ECalUncalEBSrc_.
instance() <<
"\n"
72 <<
" ECalEESrc = " << ECalEESrc_.
label()
73 <<
":" << ECalUncalEESrc_.
instance() <<
"\n"
74 <<
" ECalUncalEESrc = " << ECalUncalEESrc_.
label()
75 <<
":" << ECalEESrc_.
instance() <<
"\n"
76 <<
" ECalESSrc = " << ECalESSrc_.
label()
77 <<
":" << ECalESSrc_.
instance() <<
"\n"
78 <<
" HCalSrc = " << HCalSrc_.
label()
79 <<
":" << HCalSrc_.
instance() <<
"\n"
80 <<
" SiStripSrc = " << SiStripSrc_.
label()
81 <<
":" << SiStripSrc_.
instance() <<
"\n"
82 <<
" SiPixelSrc = " << SiPxlSrc_.
label()
83 <<
":" << SiPxlSrc_.
instance() <<
"\n"
84 <<
" MuDTSrc = " << MuDTSrc_.
label()
85 <<
":" << MuDTSrc_.
instance() <<
"\n"
86 <<
" MuDTSimSrc = " << MuDTSimSrc_.
label()
87 <<
":" << MuDTSimSrc_.
instance() <<
"\n"
88 <<
" MuCSCSrc = " << MuCSCSrc_.
label()
89 <<
":" << MuCSCSrc_.
instance() <<
"\n"
90 <<
" MuRPCSrc = " << MuRPCSrc_.
label()
91 <<
":" << MuRPCSrc_.
instance() <<
"\n"
92 <<
" MuRPCSimSrc = " << MuRPCSimSrc_.
label()
93 <<
":" << MuRPCSimSrc_.
instance() <<
"\n"
94 <<
"===============================\n";
104 std::string MsgLoggerCat =
"GlobalRecHitsProducer_beginJob";
113 std::string MsgLoggerCat =
"GlobalRecHitsProducer_endJob";
116 <<
"Terminating having processed " <<
count <<
" events.";
123 std::string MsgLoggerCat =
"GlobalRecHitsProducer_produce";
129 int nrun = iEvent.
id().
run();
134 <<
"Processing run " << nrun <<
", event " << nevt
135 <<
" (" <<
count <<
" events total)";
139 <<
"Processing run " << nrun <<
", event " << nevt
140 <<
" (" <<
count <<
" events total)";
150 std::vector<const edm::Provenance*> AllProv;
155 <<
"Number of Provenances = " << AllProv.size();
158 TString eventout(
"\nProvenance info:\n");
160 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
161 eventout +=
"\n ******************************";
162 eventout +=
"\n Module : ";
164 eventout += AllProv[
i]->moduleLabel();
165 eventout +=
"\n ProductID : ";
167 eventout += AllProv[
i]->productID().id();
168 eventout +=
"\n ClassName : ";
170 eventout += AllProv[
i]->className();
171 eventout +=
"\n InstanceName : ";
173 eventout += AllProv[
i]->productInstanceName();
174 eventout +=
"\n BranchName : ";
176 eventout += AllProv[
i]->branchName();
178 eventout +=
"\n ******************************\n";
197 <<
"Done gathering data from event.";
204 <<
"Saving event contents:";
225 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillECal";
229 eventout =
"\nGathering info:";
246 if (!EcalUncalibRecHitEB.
isValid()) {
248 <<
"Unable to find EcalUncalRecHitEB in event!";
256 <<
"Unable to find EcalRecHitEB in event!";
262 iEvent.
getByLabel(
"mix",barrelHitsName,crossingFrame);
263 if (!crossingFrame.
isValid()) {
265 <<
"Unable to find cal barrel crossingFrame in event!";
271 std::auto_ptr<MixCollection<PCaloHit> >
277 = barrelHits->begin();
278 hitItr != barrelHits->end();
283 uint32_t crystid = ebid.
rawId();
284 ebSimMap[crystid] += hitItr->energy();
294 EBUncalibRecHit->
begin();
295 uncalibRecHit != EBUncalibRecHit->
end();
302 if (myRecHit != EBRecHit->
end()) {
304 EBRE.push_back(myRecHit->energy());
310 eventout +=
"\n Number of EBRecHits collected:............ ";
311 eventout += nEBRecHits;
319 if (!EcalUncalibRecHitEE.
isValid()) {
321 <<
"Unable to find EcalUncalRecHitEE in event!";
329 <<
"Unable to find EcalRecHitEE in event!";
335 iEvent.
getByLabel(
"mix",endcapHitsName,crossingFrame);
336 if (!crossingFrame.
isValid()) {
338 <<
"Unable to find cal endcap crossingFrame in event!";
344 std::auto_ptr<MixCollection<PCaloHit> >
350 = endcapHits->begin();
351 hitItr != endcapHits->end();
356 uint32_t crystid = eeid.
rawId();
357 eeSimMap[crystid] += hitItr->energy();
367 EEUncalibRecHit->
begin();
368 uncalibRecHit != EEUncalibRecHit->
end();
375 if (myRecHit != EERecHit->
end()) {
377 EERE.push_back(myRecHit->energy());
383 eventout +=
"\n Number of EERecHits collected:............ ";
384 eventout += nEERecHits;
394 <<
"Unable to find EcalRecHitES in event!";
400 iEvent.
getByLabel(
"mix",preshowerHitsName,crossingFrame);
401 if (!crossingFrame.
isValid()) {
403 <<
"Unable to find cal preshower crossingFrame in event!";
409 std::auto_ptr<MixCollection<PCaloHit> >
415 = preshowerHits->begin();
416 hitItr != preshowerHits->end();
421 uint32_t crystid = esid.
rawId();
422 esSimMap[crystid] += hitItr->energy();
430 recHit != ESRecHit->
end();
436 ESRE.push_back(recHit->energy());
441 eventout +=
"\n Number of ESRecHits collected:............ ";
442 eventout += nESRecHits;
453 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeECal";
456 TString eventout(
"\n nEBRecHits = ");
457 eventout +=
EBRE.size();
458 for (
unsigned int i = 0;
i <
EBRE.size(); ++
i) {
459 eventout +=
"\n (RE, SHE) = (";
465 eventout +=
"\n nEERecHits = ";
466 eventout +=
EERE.size();
467 for (
unsigned int i = 0;
i <
EERE.size(); ++
i) {
468 eventout +=
"\n (RE, SHE) = (";
474 eventout +=
"\n nESRecHits = ";
475 eventout +=
ESRE.size();
476 for (
unsigned int i = 0;
i <
ESRE.size(); ++
i) {
477 eventout +=
"\n (RE, SHE) = (";
496 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillHCal";
500 eventout =
"\nGathering info:";
507 <<
"Unable to find CaloGeometry in event!";
518 <<
"Unable to find hcalHits in event!";
527 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
528 simhits != simhitResult->end();
532 uint32_t cellid = detId.
rawId();
535 fHBEnergySimHits[cellid] += simhits->energy();
538 fHEEnergySimHits[cellid] += simhits->energy();
541 fHOEnergySimHits[cellid] += simhits->energy();
544 fHFEnergySimHits[cellid] += simhits->energy();
549 Double_t maxHBEnergy = 0.;
550 Double_t maxHEEnergy = 0.;
551 Double_t maxHFEnergy = 0.;
553 Double_t maxHBPhi = -1000.;
554 Double_t maxHEPhi = -1000.;
555 Double_t maxHOPhi = -1000.;
556 Double_t maxHFPhi = -1000.;
558 Double_t maxHBEta = -1000.;
559 Double_t maxHEEta = -1000.;
560 Double_t maxHOEta = -1000.;
561 Double_t maxHFEta = -1000.;
563 Double_t
PI = 3.141592653589;
568 std::vector<edm::Handle<HBHERecHitCollection> > hbhe;
570 if (!hbhe[0].isValid()) {
572 <<
"Unable to find any HBHERecHitCollections in event!";
575 std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
579 for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
583 jhbhe != (*ihbhe)->end(); ++jhbhe) {
590 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
593 if ( (jhbhe->energy()) > maxHBEnergy ) {
594 maxHBEnergy = jhbhe->energy();
605 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
608 if ( (jhbhe->energy()) > maxHEEnergy ) {
609 maxHEEnergy = jhbhe->energy();
617 jhbhe != (*ihbhe)->end(); ++jhbhe) {
626 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
630 float deltaphi = maxHBPhi - fPhi;
631 if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
632 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
633 float deltaeta = fEta - maxHBEta;
634 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
636 HBCalREC.push_back(jhbhe->energy());
638 HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
646 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
650 float deltaphi = maxHEPhi - fPhi;
651 if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
652 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
653 float deltaeta = fEta - maxHEEta;
654 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
656 HECalREC.push_back(jhbhe->energy());
658 HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
665 eventout +=
"\n Number of HBRecHits collected:............ ";
670 eventout +=
"\n Number of HERecHits collected:............ ";
677 std::vector<edm::Handle<HFRecHitCollection> > hf;
679 if (!hf[0].isValid()) {
681 <<
"Unable to find any HFRecHitCollections in event!";
684 std::vector<edm::Handle<HFRecHitCollection> >::iterator
ihf;
687 for (ihf = hf.begin(); ihf != hf.end(); ++
ihf) {
691 jhf != (*ihf)->end(); ++jhf) {
698 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
701 if ( (jhf->energy()) > maxHFEnergy ) {
702 maxHFEnergy = jhf->energy();
710 jhf != (*ihf)->end(); ++jhf) {
719 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
723 float deltaphi = maxHBPhi - fPhi;
724 if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
725 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
726 float deltaeta = fEta - maxHFEta;
727 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
731 HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
737 eventout +=
"\n Number of HFDigis collected:.............. ";
744 std::vector<edm::Handle<HORecHitCollection> > ho;
746 if (!ho[0].isValid()) {
748 <<
"Unable to find any HORecHitCollections in event!";
751 std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
754 for (iho = ho.begin(); iho != ho.end(); ++iho) {
757 jho != (*iho)->end(); ++jho) {
766 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
770 float deltaphi = maxHOPhi - fPhi;
771 if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
772 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
773 float deltaeta = fEta - maxHOEta;
774 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
778 HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
784 eventout +=
"\n Number of HODigis collected:.............. ";
796 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeHCal";
799 TString eventout(
"\n nHBRecHits = ");
801 for (
unsigned int i = 0;
i <
HBCalREC.size(); ++
i) {
802 eventout +=
"\n (REC, R, SHE) = (";
810 eventout +=
"\n nHERecHits = ";
812 for (
unsigned int i = 0;
i <
HECalREC.size(); ++
i) {
813 eventout +=
"\n (REC, R, SHE) = (";
821 eventout +=
"\n nHFRecHits = ";
823 for (
unsigned int i = 0;
i <
HFCalREC.size(); ++
i) {
824 eventout +=
"\n (REC, R, SHE) = (";
832 eventout +=
"\n nHORecHits = ";
834 for (
unsigned int i = 0;
i <
HOCalREC.size(); ++
i) {
835 eventout +=
"\n (REC, R, SHE) = (";
864 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillTrk";
868 eventout =
"\nGathering info:";
873 if (!rechitsmatched.
isValid()) {
875 <<
"Unable to find stripmatchedrechits in event!";
885 <<
"Unable to find TrackerDigiGeometry in event!";
890 int nStripBrl = 0, nStripFwd = 0;
893 for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin();
894 it != pDD->dets().end(); ++it) {
896 uint32_t myid = ((*it)->geographicalId()).rawId();
902 if (rechitmatchedMatch != rechitsmatched->end()) {
908 for ( itermatched = rechitmatchedRangeIteratorBegin;
909 itermatched != rechitmatchedRangeIteratorEnd;
912 SiStripMatchedRecHit2D
const rechit = *itermatched;
915 float mindist = 999999.;
916 float distx = 999999.;
917 float disty = 999999.;
918 float dist = 999999.;
919 std::pair<LocalPoint,LocalVector> closestPair;
922 float rechitmatchedx = position.
x();
923 float rechitmatchedy = position.
y();
933 std::pair<LocalPoint,LocalVector> hitPair;
935 for(std::vector<PSimHit>::const_iterator
m =
matched.begin();
939 distx = fabs(rechitmatchedx - hitPair.first.x());
940 disty = fabs(rechitmatchedy - hitPair.first.y());
941 dist =
sqrt(distx*distx+disty*disty);
945 closestPair = hitPair;
956 TIBL1RX.push_back(rechitmatchedx);
957 TIBL1RY.push_back(rechitmatchedy);
958 TIBL1SX.push_back(closestPair.first.x());
959 TIBL1SY.push_back(closestPair.first.y());
962 TIBL2RX.push_back(rechitmatchedx);
963 TIBL2RY.push_back(rechitmatchedy);
964 TIBL2SX.push_back(closestPair.first.x());
965 TIBL2SY.push_back(closestPair.first.y());
968 TIBL3RX.push_back(rechitmatchedx);
969 TIBL3RY.push_back(rechitmatchedy);
970 TIBL3SX.push_back(closestPair.first.x());
971 TIBL3SY.push_back(closestPair.first.y());
974 TIBL4RX.push_back(rechitmatchedx);
975 TIBL4RY.push_back(rechitmatchedy);
976 TIBL4SX.push_back(closestPair.first.x());
977 TIBL4SY.push_back(closestPair.first.y());
988 TOBL1RX.push_back(rechitmatchedx);
989 TOBL1RY.push_back(rechitmatchedy);
990 TOBL1SX.push_back(closestPair.first.x());
991 TOBL1SY.push_back(closestPair.first.y());
994 TOBL2RX.push_back(rechitmatchedx);
995 TOBL2RY.push_back(rechitmatchedy);
996 TOBL2SX.push_back(closestPair.first.x());
997 TOBL2SY.push_back(closestPair.first.y());
1000 TOBL3RX.push_back(rechitmatchedx);
1001 TOBL3RY.push_back(rechitmatchedy);
1002 TOBL3SX.push_back(closestPair.first.x());
1003 TOBL3SY.push_back(closestPair.first.y());
1006 TOBL4RX.push_back(rechitmatchedx);
1007 TOBL4RY.push_back(rechitmatchedy);
1008 TOBL4SX.push_back(closestPair.first.x());
1009 TOBL4SY.push_back(closestPair.first.y());
1020 TIDW1RX.push_back(rechitmatchedx);
1021 TIDW1RY.push_back(rechitmatchedy);
1022 TIDW1SX.push_back(closestPair.first.x());
1023 TIDW1SY.push_back(closestPair.first.y());
1026 TIDW2RX.push_back(rechitmatchedx);
1027 TIDW2RY.push_back(rechitmatchedy);
1028 TIDW2SX.push_back(closestPair.first.x());
1029 TIDW2SY.push_back(closestPair.first.y());
1032 TIDW3RX.push_back(rechitmatchedx);
1033 TIDW3RY.push_back(rechitmatchedy);
1034 TIDW3SX.push_back(closestPair.first.x());
1035 TIDW3SY.push_back(closestPair.first.y());
1046 TECW1RX.push_back(rechitmatchedx);
1047 TECW1RY.push_back(rechitmatchedy);
1048 TECW1SX.push_back(closestPair.first.x());
1049 TECW1SY.push_back(closestPair.first.y());
1052 TECW2RX.push_back(rechitmatchedx);
1053 TECW2RY.push_back(rechitmatchedy);
1054 TECW2SX.push_back(closestPair.first.x());
1055 TECW2SY.push_back(closestPair.first.y());
1058 TECW3RX.push_back(rechitmatchedx);
1059 TECW3RY.push_back(rechitmatchedy);
1060 TECW3SX.push_back(closestPair.first.x());
1061 TECW3SY.push_back(closestPair.first.y());
1064 TECW4RX.push_back(rechitmatchedx);
1065 TECW4RY.push_back(rechitmatchedy);
1066 TECW4SX.push_back(closestPair.first.x());
1067 TECW4SY.push_back(closestPair.first.y());
1070 TECW5RX.push_back(rechitmatchedx);
1071 TECW5RY.push_back(rechitmatchedy);
1072 TECW5SX.push_back(closestPair.first.x());
1073 TECW5SY.push_back(closestPair.first.y());
1076 TECW6RX.push_back(rechitmatchedx);
1077 TECW6RY.push_back(rechitmatchedy);
1078 TECW6SX.push_back(closestPair.first.x());
1079 TECW6SY.push_back(closestPair.first.y());
1082 TECW7RX.push_back(rechitmatchedx);
1083 TECW7RY.push_back(rechitmatchedy);
1084 TECW7SX.push_back(closestPair.first.x());
1085 TECW7SY.push_back(closestPair.first.y());
1088 TECW8RX.push_back(rechitmatchedx);
1089 TECW8RY.push_back(rechitmatchedy);
1090 TECW8SX.push_back(closestPair.first.x());
1091 TECW8SY.push_back(closestPair.first.y());
1101 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1102 eventout += nStripBrl;
1106 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1107 eventout += nStripFwd;
1116 <<
"Unable to find SiPixelRecHitCollection in event!";
1125 <<
"Unable to find TrackerDigiGeometry in event!";
1130 int nPxlBrl = 0, nPxlFwd = 0;
1132 for (TrackerGeometry::DetContainer::const_iterator it = geom->dets().begin();
1133 it != geom->dets().end(); ++it) {
1135 uint32_t myid = ((*it)->geographicalId()).rawId();
1136 DetId detId = ((*it)->geographicalId());
1145 if (pixeldet == recHitColl->end())
continue;
1153 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1158 if ( !matched.empty() ) {
1160 float closest = 9999.9;
1163 float rechit_x = lp.
x();
1164 float rechit_y = lp.
y();
1170 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
1171 m != matched.end(); ++
m) {
1173 float sim_x1 = (*m).entryPoint().x();
1174 float sim_x2 = (*m).exitPoint().x();
1175 float sim_xpos = 0.5*(sim_x1+sim_x2);
1177 float sim_y1 = (*m).entryPoint().y();
1178 float sim_y2 = (*m).exitPoint().y();
1179 float sim_ypos = 0.5*(sim_y1+sim_y2);
1181 float x_res = fabs(sim_xpos - rechit_x);
1182 float y_res = fabs(sim_ypos - rechit_y);
1184 float dist =
sqrt(x_res*x_res + y_res*y_res);
1186 if ( dist < closest ) {
1199 BRL1RX.push_back(rechit_x);
1200 BRL1RY.push_back(rechit_y);
1205 BRL2RX.push_back(rechit_x);
1206 BRL2RY.push_back(rechit_y);
1211 BRL3RX.push_back(rechit_x);
1212 BRL3RY.push_back(rechit_y);
1223 if (tTopo->
pxfDisk(myid) == 1) {
1224 if (tTopo->
pxfSide(myid) == 1) {
1230 if (tTopo->
pxfSide(myid) == 2) {
1237 if (tTopo->
pxfDisk(myid) == 2) {
1238 if (tTopo->
pxfSide(myid) == 1) {
1244 if (tTopo->
pxfSide(myid) == 2) {
1258 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1259 eventout += nPxlBrl;
1263 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1264 eventout += nPxlFwd;
1275 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeTrk";
1280 TString eventout(
"\n nTIBL1 = ");
1282 for (
unsigned int i = 0;
i <
TIBL1RX.size(); ++
i) {
1283 eventout +=
"\n (RX, RY, SX, SY) = (";
1293 eventout +=
"\n nTIBL2 = ";
1295 for (
unsigned int i = 0;
i <
TIBL2RX.size(); ++
i) {
1296 eventout +=
"\n (RX, RY, SX, SY) = (";
1306 eventout +=
"\n nTIBL3 = ";
1308 for (
unsigned int i = 0;
i <
TIBL3RX.size(); ++
i) {
1309 eventout +=
"\n (RX, RY, SX, SY) = (";
1319 eventout +=
"\n nTIBL4 = ";
1321 for (
unsigned int i = 0;
i <
TIBL4RX.size(); ++
i) {
1322 eventout +=
"\n (RX, RY, SX, SY) = (";
1332 eventout +=
"\n nTOBL1 = ";
1334 for (
unsigned int i = 0;
i <
TOBL1RX.size(); ++
i) {
1335 eventout +=
"\n (RX, RY, SX, SY) = (";
1345 eventout +=
"\n nTOBL2 = ";
1347 for (
unsigned int i = 0;
i <
TOBL2RX.size(); ++
i) {
1348 eventout +=
"\n (RX, RY, SX, SY) = (";
1358 eventout +=
"\n nTOBL3 = ";
1360 for (
unsigned int i = 0;
i <
TOBL3RX.size(); ++
i) {
1361 eventout +=
"\n (RX, RY, SX, SY) = (";
1371 eventout +=
"\n nTOBL4 = ";
1373 for (
unsigned int i = 0;
i <
TOBL4RX.size(); ++
i) {
1374 eventout +=
"\n (RX, RY, SX, SY) = (";
1384 eventout +=
"\n nTIDW1 = ";
1386 for (
unsigned int i = 0;
i <
TIDW1RX.size(); ++
i) {
1387 eventout +=
"\n (RX, RY, SX, SY) = (";
1397 eventout +=
"\n nTIDW2 = ";
1399 for (
unsigned int i = 0;
i <
TIDW2RX.size(); ++
i) {
1400 eventout +=
"\n (RX, RY, SX, SY) = (";
1410 eventout +=
"\n nTIDW3 = ";
1412 for (
unsigned int i = 0;
i <
TIDW3RX.size(); ++
i) {
1413 eventout +=
"\n (RX, RY, SX, SY) = (";
1423 eventout +=
"\n nTECW1 = ";
1425 for (
unsigned int i = 0;
i <
TECW1RX.size(); ++
i) {
1426 eventout +=
"\n (RX, RY, SX, SY) = (";
1436 eventout +=
"\n nTECW2 = ";
1438 for (
unsigned int i = 0;
i <
TECW2RX.size(); ++
i) {
1439 eventout +=
"\n (RX, RY, SX, SY) = (";
1449 eventout +=
"\n nTECW3 = ";
1451 for (
unsigned int i = 0;
i <
TECW3RX.size(); ++
i) {
1452 eventout +=
"\n (RX, RY, SX, SY) = (";
1462 eventout +=
"\n nTECW4 = ";
1464 for (
unsigned int i = 0;
i <
TECW4RX.size(); ++
i) {
1465 eventout +=
"\n (RX, RY, SX, SY) = (";
1475 eventout +=
"\n nTECW5 = ";
1477 for (
unsigned int i = 0;
i <
TECW5RX.size(); ++
i) {
1478 eventout +=
"\n (RX, RY, SX, SY) = (";
1488 eventout +=
"\n nTECW6 = ";
1490 for (
unsigned int i = 0;
i <
TECW6RX.size(); ++
i) {
1491 eventout +=
"\n (RX, RY, SX, SY) = (";
1501 eventout +=
"\n nTECW7 = ";
1503 for (
unsigned int i = 0;
i <
TECW7RX.size(); ++
i) {
1504 eventout +=
"\n (RX, RY, SX, SY) = (";
1514 eventout +=
"\n nTECW8 = ";
1516 for (
unsigned int i = 0;
i <
TECW8RX.size(); ++
i) {
1517 eventout +=
"\n (RX, RY, SX, SY) = (";
1529 eventout +=
"\n nBRL1 = ";
1530 eventout +=
BRL1RX.size();
1531 for (
unsigned int i = 0;
i <
BRL1RX.size(); ++
i) {
1532 eventout +=
"\n (RX, RY, SX, SY) = (";
1542 eventout +=
"\n nBRL2 = ";
1543 eventout +=
BRL2RX.size();
1544 for (
unsigned int i = 0;
i <
BRL2RX.size(); ++
i) {
1545 eventout +=
"\n (RX, RY, SX, SY) = (";
1555 eventout +=
"\n nBRL3 = ";
1556 eventout +=
BRL3RX.size();
1557 for (
unsigned int i = 0;
i <
BRL3RX.size(); ++
i) {
1558 eventout +=
"\n (RX, RY, SX, SY) = (";
1568 eventout +=
"\n nFWD1p = ";
1570 for (
unsigned int i = 0;
i <
FWD1pRX.size(); ++
i) {
1571 eventout +=
"\n (RX, RY, SX, SY) = (";
1581 eventout +=
"\n nFWD1n = ";
1583 for (
unsigned int i = 0;
i <
FWD1nRX.size(); ++
i) {
1584 eventout +=
"\n (RX, RY, SX, SY) = (";
1594 eventout +=
"\n nFWD2p = ";
1596 for (
unsigned int i = 0;
i <
FWD2pRX.size(); ++
i) {
1597 eventout +=
"\n (RX, RY, SX, SY) = (";
1607 eventout +=
"\n nFWD2p = ";
1609 for (
unsigned int i = 0;
i <
FWD2nRX.size(); ++
i) {
1610 eventout +=
"\n (RX, RY, SX, SY) = (";
1660 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillMuon";
1664 eventout =
"\nGathering info:";
1671 <<
"Unable to find DTMuonGeometryRecord in event!";
1679 <<
"Unable to find dtsimHits in event!";
1683 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1690 <<
"Unable to find dtRecHits in event!";
1694 std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1698 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1701 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1720 <<
"Unable to find muo CSC crossingFrame in event!";
1727 hitItr !=
simHits.end(); ++hitItr)
1729 theMap[hitItr->detUnitId()].push_back(*hitItr);
1737 <<
"Unable to find CSCMuonGeometryRecord in event!";
1747 <<
"Unable to find CSC RecHits in event!";
1754 recHitItr != cscRecHits->end(); ++recHitItr) {
1756 int detId = (*recHitItr).cscDetId().rawId();
1759 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1761 if (mapItr !=
theMap.end()) {
1762 simHits = mapItr->second;
1765 if (simHits.size() == 1) {
1778 eventout +=
"\n Number of CSCRecHits collected:........... ";
1783 std::map<double, int> mapsim, maprec;
1784 std::map<int, double> nmapsim, nmaprec;
1790 <<
"Unable to find RPCMuonGeometryRecord in event!";
1798 <<
"Unable to find RPCSimHit in event!";
1806 <<
"Unable to find RPCRecHit in event!";
1813 for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1815 const RPCRoll *roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(Rid));
1819 eventout +=
"\n Number of RPCRecHits collected:........... ";
1828 LocalPoint rhitlocal = (*recIt).localPosition();
1829 double rhitlocalx = rhitlocal.
x();
1830 maprec[rhitlocalx] = nrec;
1834 for (std::map<double,int>::iterator iter = maprec.begin();
1835 iter != maprec.end(); ++iter) {
1837 nmaprec[
i] = (*iter).first;
1840 edm::PSimHitContainer::const_iterator simIt;
1842 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1843 int ptype = (*simIt).particleType();
1845 if (ptype == 13 || ptype == -13) {
1847 LocalPoint shitlocal = (*simIt).localPosition();
1848 double shitlocalx = shitlocal.
x();
1849 mapsim[shitlocalx] = nsim;
1854 for (std::map<double,int>::iterator iter = mapsim.begin();
1855 iter != mapsim.end(); ++iter) {
1857 nmapsim[
i] = (*iter).first;
1861 for (
int r = 0;
r < nsim;
r++) {
1863 RPCRHX.push_back(nmaprec[
r+1]);
1864 RPCSHX.push_back(nmapsim[
r+1]);
1869 eventout +=
"\n Number of RPCRecHits collected:........... ";
1881 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeMuon";
1886 TString eventout(
"\n nDT = ");
1887 eventout +=
DTRHD.size();
1888 for (
unsigned int i = 0;
i <
DTRHD.size(); ++
i) {
1889 eventout +=
"\n (RHD, SHD) = (";
1897 eventout +=
"\n nCSC = ";
1899 for (
unsigned int i = 0;
i <
CSCRHPHI.size(); ++
i) {
1900 eventout +=
"\n (rhphi, rhperp, shphi) = (";
1910 eventout +=
"\n nRPC = ";
1911 eventout +=
RPCRHX.size();
1912 for (
unsigned int i = 0;
i <
RPCRHX.size(); ++
i) {
1913 eventout +=
"\n (rhx, shx) = (";
1934 std::string MsgLoggerCat =
"GlobalRecHitsProducer_clear";
1938 <<
"Clearing event holders";
2091 std::pair<LocalPoint,LocalVector>
2099 LocalPoint localHit = plane.toLocal(globalpos);
2106 float scale = -localHit.
z() / dir.
z();
2118 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
2122 std::map<DTWireId, std::vector<DTRecHit1DPair> >
2125 std::map<DTWireId, std::vector<DTRecHit1DPair> >
ret;
2128 rechit != dt1DRecHitPairs->end(); rechit++) {
2129 ret[(*rechit).wireId()].push_back(*rechit);
2142 float xEntry = entryP.
x()-xwire;
2143 float xExit = exitP.
x()-xwire;
2146 return fabs(xEntry - (entryP.
z()*(xExit-xEntry))/(exitP.
z()-entryP.
z()));
2150 template <
typename type>
2154 const std::vector<type>& recHits,
2155 const float simHitDist) {
2157 const type* theBestRecHit = 0;
2159 for(
typename std::vector<type>::const_iterator recHit = recHits.begin();
2160 recHit != recHits.end();
2163 if(fabs(distTmp-simHitDist) < res) {
2164 res = fabs(distTmp-simHitDist);
2165 theBestRecHit = &(*recHit);
2169 return theBestRecHit;
2189 template <
typename type>
2197 std::map<DTWireId, std::vector<PSimHit> > simHitsPerWire = _simHitsPerWire;
2198 std::map<DTWireId, std::vector<type> > recHitsPerWire = _recHitsPerWire;
2201 for(
std::map<
DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
2202 simHitsPerWire.begin();
2203 wireAndSHits != simHitsPerWire.end();
2205 DTWireId wireId = (*wireAndSHits).first;
2206 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
2220 if(simHitWireDist>2.1) {
2226 if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
2231 std::vector<type> recHits = recHitsPerWire[wireId];
2234 const type* theBestRecHit =
2241 DTRHD.push_back(recHitWireDist);
2242 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
T getUntrackedParameter(std::string const &, T const &) const
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
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
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)
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 &)
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)
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< T >::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)
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_
static int position[TOTALCHAMBERS][3]
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
C::const_iterator const_iterator
constant access iterator type
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
Local3DPoint localPosition() const
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
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_
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void storeTrk(PGlobalRecHit &)
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 &)
void putDTRecHits(const std::vector< float > &rhd, const std::vector< float > &shd)
T const * product() const
static const int sdHcalFwd
T const * product() const
static const int sdHcalBrl
void storeHCal(PGlobalRecHit &)
void putTOBL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
unsigned int pxfSide(const DetId &id) const
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
void fillTrk(edm::Event &, const edm::EventSetup &)
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
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.
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
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
DTWireId wireId() const
Return the wireId.