17 std::string MsgLoggerCat =
"GlobalRecHitsProducer_GlobalRecHitsProducer";
27 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
29 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
53 produces<PGlobalRecHit>(
label);
58 <<
"\n===============================\n"
59 <<
"Initialized as EDProducer with parameter values:\n"
60 <<
" Name = " <<
fName <<
"\n"
61 <<
" Verbosity = " << verbosity <<
"\n"
62 <<
" Frequency = " << frequency <<
"\n"
63 <<
" Label = " << label <<
"\n"
64 <<
" GetProv = " << getAllProvenances <<
"\n"
65 <<
" PrintProv = " << printProvenanceInfo <<
"\n"
66 <<
" ECalEBSrc = " << ECalEBSrc_.label()
67 <<
":" << ECalEBSrc_.instance() <<
"\n"
68 <<
" ECalUncalEBSrc = " << ECalUncalEBSrc_.
label()
69 <<
":" << ECalUncalEBSrc_.
instance() <<
"\n"
70 <<
" ECalEESrc = " << ECalEESrc_.
label()
71 <<
":" << ECalUncalEESrc_.
instance() <<
"\n"
72 <<
" ECalUncalEESrc = " << ECalUncalEESrc_.
label()
73 <<
":" << ECalEESrc_.
instance() <<
"\n"
74 <<
" ECalESSrc = " << ECalESSrc_.
label()
75 <<
":" << ECalESSrc_.
instance() <<
"\n"
76 <<
" HCalSrc = " << HCalSrc_.
label()
77 <<
":" << HCalSrc_.
instance() <<
"\n"
78 <<
" SiStripSrc = " << SiStripSrc_.
label()
79 <<
":" << SiStripSrc_.
instance() <<
"\n"
80 <<
" SiPixelSrc = " << SiPxlSrc_.
label()
81 <<
":" << SiPxlSrc_.
instance() <<
"\n"
82 <<
" MuDTSrc = " << MuDTSrc_.
label()
83 <<
":" << MuDTSrc_.
instance() <<
"\n"
84 <<
" MuDTSimSrc = " << MuDTSimSrc_.
label()
85 <<
":" << MuDTSimSrc_.
instance() <<
"\n"
86 <<
" MuCSCSrc = " << MuCSCSrc_.
label()
87 <<
":" << MuCSCSrc_.
instance() <<
"\n"
88 <<
" MuRPCSrc = " << MuRPCSrc_.
label()
89 <<
":" << MuRPCSrc_.
instance() <<
"\n"
90 <<
" MuRPCSimSrc = " << MuRPCSimSrc_.
label()
91 <<
":" << MuRPCSimSrc_.
instance() <<
"\n"
92 <<
"===============================\n";
102 std::string MsgLoggerCat =
"GlobalRecHitsProducer_beginJob";
111 std::string MsgLoggerCat =
"GlobalRecHitsProducer_endJob";
114 <<
"Terminating having processed " <<
count <<
" events.";
121 std::string MsgLoggerCat =
"GlobalRecHitsProducer_produce";
127 int nrun = iEvent.
id().
run();
132 <<
"Processing run " << nrun <<
", event " << nevt
133 <<
" (" <<
count <<
" events total)";
137 <<
"Processing run " << nrun <<
", event " << nevt
138 <<
" (" <<
count <<
" events total)";
148 std::vector<const edm::Provenance*> AllProv;
153 <<
"Number of Provenances = " << AllProv.size();
156 TString eventout(
"\nProvenance info:\n");
158 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
159 eventout +=
"\n ******************************";
160 eventout +=
"\n Module : ";
162 eventout += AllProv[
i]->moduleLabel();
163 eventout +=
"\n ProductID : ";
165 eventout += AllProv[
i]->productID().id();
166 eventout +=
"\n ClassName : ";
168 eventout += AllProv[
i]->className();
169 eventout +=
"\n InstanceName : ";
171 eventout += AllProv[
i]->productInstanceName();
172 eventout +=
"\n BranchName : ";
174 eventout += AllProv[
i]->branchName();
176 eventout +=
"\n ******************************\n";
195 <<
"Done gathering data from event.";
202 <<
"Saving event contents:";
223 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillECal";
227 eventout =
"\nGathering info:";
244 if (!EcalUncalibRecHitEB.
isValid()) {
246 <<
"Unable to find EcalUncalRecHitEB in event!";
254 <<
"Unable to find EcalRecHitEB in event!";
259 const std::string barrelHitsName(
"EcalHitsEB");
260 iEvent.
getByLabel(
"mix",barrelHitsName,crossingFrame);
261 if (!crossingFrame.
isValid()) {
263 <<
"Unable to find cal barrel crossingFrame in event!";
269 std::auto_ptr<MixCollection<PCaloHit> >
275 = barrelHits->begin();
276 hitItr != barrelHits->end();
281 uint32_t crystid = ebid.
rawId();
282 ebSimMap[crystid] += hitItr->energy();
292 EBUncalibRecHit->
begin();
293 uncalibRecHit != EBUncalibRecHit->
end();
300 if (myRecHit != EBRecHit->
end()) {
302 EBRE.push_back(myRecHit->energy());
308 eventout +=
"\n Number of EBRecHits collected:............ ";
309 eventout += nEBRecHits;
317 if (!EcalUncalibRecHitEE.
isValid()) {
319 <<
"Unable to find EcalUncalRecHitEE in event!";
327 <<
"Unable to find EcalRecHitEE in event!";
332 const std::string endcapHitsName(
"EcalHitsEE");
333 iEvent.
getByLabel(
"mix",endcapHitsName,crossingFrame);
334 if (!crossingFrame.
isValid()) {
336 <<
"Unable to find cal endcap crossingFrame in event!";
342 std::auto_ptr<MixCollection<PCaloHit> >
348 = endcapHits->begin();
349 hitItr != endcapHits->end();
354 uint32_t crystid = eeid.
rawId();
355 eeSimMap[crystid] += hitItr->energy();
365 EEUncalibRecHit->
begin();
366 uncalibRecHit != EEUncalibRecHit->
end();
373 if (myRecHit != EERecHit->
end()) {
375 EERE.push_back(myRecHit->energy());
381 eventout +=
"\n Number of EERecHits collected:............ ";
382 eventout += nEERecHits;
392 <<
"Unable to find EcalRecHitES in event!";
397 const std::string preshowerHitsName(
"EcalHitsES");
398 iEvent.
getByLabel(
"mix",preshowerHitsName,crossingFrame);
399 if (!crossingFrame.
isValid()) {
401 <<
"Unable to find cal preshower crossingFrame in event!";
407 std::auto_ptr<MixCollection<PCaloHit> >
413 = preshowerHits->begin();
414 hitItr != preshowerHits->end();
419 uint32_t crystid = esid.
rawId();
420 esSimMap[crystid] += hitItr->energy();
428 recHit != ESRecHit->
end();
434 ESRE.push_back(recHit->energy());
439 eventout +=
"\n Number of ESRecHits collected:............ ";
440 eventout += nESRecHits;
451 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeECal";
454 TString eventout(
"\n nEBRecHits = ");
455 eventout +=
EBRE.size();
456 for (
unsigned int i = 0;
i <
EBRE.size(); ++
i) {
457 eventout +=
"\n (RE, SHE) = (";
463 eventout +=
"\n nEERecHits = ";
464 eventout +=
EERE.size();
465 for (
unsigned int i = 0;
i <
EERE.size(); ++
i) {
466 eventout +=
"\n (RE, SHE) = (";
472 eventout +=
"\n nESRecHits = ";
473 eventout +=
ESRE.size();
474 for (
unsigned int i = 0;
i <
ESRE.size(); ++
i) {
475 eventout +=
"\n (RE, SHE) = (";
494 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillHCal";
498 eventout =
"\nGathering info:";
505 <<
"Unable to find CaloGeometry in event!";
516 <<
"Unable to find hcalHits in event!";
525 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
526 simhits != simhitResult->end();
530 uint32_t cellid = detId.
rawId();
533 fHBEnergySimHits[cellid] += simhits->energy();
536 fHEEnergySimHits[cellid] += simhits->energy();
539 fHOEnergySimHits[cellid] += simhits->energy();
542 fHFEnergySimHits[cellid] += simhits->energy();
547 Double_t maxHBEnergy = 0.;
548 Double_t maxHEEnergy = 0.;
549 Double_t maxHFEnergy = 0.;
551 Double_t maxHBPhi = -1000.;
552 Double_t maxHEPhi = -1000.;
553 Double_t maxHOPhi = -1000.;
554 Double_t maxHFPhi = -1000.;
556 Double_t maxHBEta = -1000.;
557 Double_t maxHEEta = -1000.;
558 Double_t maxHOEta = -1000.;
559 Double_t maxHFEta = -1000.;
561 Double_t
PI = 3.141592653589;
566 std::vector<edm::Handle<HBHERecHitCollection> > hbhe;
568 if (!hbhe[0].isValid()) {
570 <<
"Unable to find any HBHERecHitCollections in event!";
573 std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
577 for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
581 jhbhe != (*ihbhe)->end(); ++jhbhe) {
588 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
591 if ( (jhbhe->energy()) > maxHBEnergy ) {
592 maxHBEnergy = jhbhe->energy();
603 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
606 if ( (jhbhe->energy()) > maxHEEnergy ) {
607 maxHEEnergy = jhbhe->energy();
615 jhbhe != (*ihbhe)->end(); ++jhbhe) {
624 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
628 float deltaphi = maxHBPhi - fPhi;
629 if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
630 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
631 float deltaeta = fEta - maxHBEta;
632 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
634 HBCalREC.push_back(jhbhe->energy());
636 HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
644 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
648 float deltaphi = maxHEPhi - fPhi;
649 if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
650 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
651 float deltaeta = fEta - maxHEEta;
652 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
654 HECalREC.push_back(jhbhe->energy());
656 HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
663 eventout +=
"\n Number of HBRecHits collected:............ ";
668 eventout +=
"\n Number of HERecHits collected:............ ";
675 std::vector<edm::Handle<HFRecHitCollection> > hf;
677 if (!hf[0].isValid()) {
679 <<
"Unable to find any HFRecHitCollections in event!";
682 std::vector<edm::Handle<HFRecHitCollection> >::iterator
ihf;
685 for (ihf = hf.begin(); ihf != hf.end(); ++
ihf) {
689 jhf != (*ihf)->end(); ++jhf) {
696 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
699 if ( (jhf->energy()) > maxHFEnergy ) {
700 maxHFEnergy = jhf->energy();
708 jhf != (*ihf)->end(); ++jhf) {
717 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
721 float deltaphi = maxHBPhi - fPhi;
722 if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
723 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
724 float deltaeta = fEta - maxHFEta;
725 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
729 HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
735 eventout +=
"\n Number of HFDigis collected:.............. ";
742 std::vector<edm::Handle<HORecHitCollection> > ho;
744 if (!ho[0].isValid()) {
746 <<
"Unable to find any HORecHitCollections in event!";
749 std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
752 for (iho = ho.begin(); iho != ho.end(); ++iho) {
755 jho != (*iho)->end(); ++jho) {
764 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
768 float deltaphi = maxHOPhi - fPhi;
769 if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
770 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
771 float deltaeta = fEta - maxHOEta;
772 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
776 HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
782 eventout +=
"\n Number of HODigis collected:.............. ";
794 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeHCal";
797 TString eventout(
"\n nHBRecHits = ");
799 for (
unsigned int i = 0;
i <
HBCalREC.size(); ++
i) {
800 eventout +=
"\n (REC, R, SHE) = (";
808 eventout +=
"\n nHERecHits = ";
810 for (
unsigned int i = 0;
i <
HECalREC.size(); ++
i) {
811 eventout +=
"\n (REC, R, SHE) = (";
819 eventout +=
"\n nHFRecHits = ";
821 for (
unsigned int i = 0;
i <
HFCalREC.size(); ++
i) {
822 eventout +=
"\n (REC, R, SHE) = (";
830 eventout +=
"\n nHORecHits = ";
832 for (
unsigned int i = 0;
i <
HOCalREC.size(); ++
i) {
833 eventout +=
"\n (REC, R, SHE) = (";
856 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillTrk";
860 eventout =
"\nGathering info:";
865 if (!rechitsmatched.
isValid()) {
867 <<
"Unable to find stripmatchedrechits in event!";
877 <<
"Unable to find TrackerDigiGeometry in event!";
882 int nStripBrl = 0, nStripFwd = 0;
885 for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin();
886 it != pDD->dets().end(); ++it) {
888 uint32_t myid = ((*it)->geographicalId()).rawId();
894 if (rechitmatchedMatch != rechitsmatched->end()) {
900 for ( itermatched = rechitmatchedRangeIteratorBegin;
901 itermatched != rechitmatchedRangeIteratorEnd;
904 SiStripMatchedRecHit2D
const rechit = *itermatched;
907 float mindist = 999999.;
908 float distx = 999999.;
909 float disty = 999999.;
910 float dist = 999999.;
911 std::pair<LocalPoint,LocalVector> closestPair;
914 float rechitmatchedx = position.
x();
915 float rechitmatchedy = position.
y();
925 std::pair<LocalPoint,LocalVector> hitPair;
927 for(std::vector<PSimHit>::const_iterator
m =
matched.begin();
931 distx = fabs(rechitmatchedx - hitPair.first.x());
932 disty = fabs(rechitmatchedy - hitPair.first.y());
933 dist =
sqrt(distx*distx+disty*disty);
937 closestPair = hitPair;
947 if (tibid.
layer() == 1) {
948 TIBL1RX.push_back(rechitmatchedx);
949 TIBL1RY.push_back(rechitmatchedy);
950 TIBL1SX.push_back(closestPair.first.x());
951 TIBL1SY.push_back(closestPair.first.y());
953 if (tibid.
layer() == 2) {
954 TIBL2RX.push_back(rechitmatchedx);
955 TIBL2RY.push_back(rechitmatchedy);
956 TIBL2SX.push_back(closestPair.first.x());
957 TIBL2SY.push_back(closestPair.first.y());
959 if (tibid.
layer() == 3) {
960 TIBL3RX.push_back(rechitmatchedx);
961 TIBL3RY.push_back(rechitmatchedy);
962 TIBL3SX.push_back(closestPair.first.x());
963 TIBL3SY.push_back(closestPair.first.y());
965 if (tibid.
layer() == 4) {
966 TIBL4RX.push_back(rechitmatchedx);
967 TIBL4RY.push_back(rechitmatchedy);
968 TIBL4SX.push_back(closestPair.first.x());
969 TIBL4SY.push_back(closestPair.first.y());
979 if (tobid.
layer() == 1) {
980 TOBL1RX.push_back(rechitmatchedx);
981 TOBL1RY.push_back(rechitmatchedy);
982 TOBL1SX.push_back(closestPair.first.x());
983 TOBL1SY.push_back(closestPair.first.y());
985 if (tobid.
layer() == 2) {
986 TOBL2RX.push_back(rechitmatchedx);
987 TOBL2RY.push_back(rechitmatchedy);
988 TOBL2SX.push_back(closestPair.first.x());
989 TOBL2SY.push_back(closestPair.first.y());
991 if (tobid.
layer() == 3) {
992 TOBL3RX.push_back(rechitmatchedx);
993 TOBL3RY.push_back(rechitmatchedy);
994 TOBL3SX.push_back(closestPair.first.x());
995 TOBL3SY.push_back(closestPair.first.y());
997 if (tobid.
layer() == 4) {
998 TOBL4RX.push_back(rechitmatchedx);
999 TOBL4RY.push_back(rechitmatchedy);
1000 TOBL4SX.push_back(closestPair.first.x());
1001 TOBL4SY.push_back(closestPair.first.y());
1011 if (tidid.
wheel() == 1) {
1012 TIDW1RX.push_back(rechitmatchedx);
1013 TIDW1RY.push_back(rechitmatchedy);
1014 TIDW1SX.push_back(closestPair.first.x());
1015 TIDW1SY.push_back(closestPair.first.y());
1017 if (tidid.
wheel() == 2) {
1018 TIDW2RX.push_back(rechitmatchedx);
1019 TIDW2RY.push_back(rechitmatchedy);
1020 TIDW2SX.push_back(closestPair.first.x());
1021 TIDW2SY.push_back(closestPair.first.y());
1023 if (tidid.
wheel() == 3) {
1024 TIDW3RX.push_back(rechitmatchedx);
1025 TIDW3RY.push_back(rechitmatchedy);
1026 TIDW3SX.push_back(closestPair.first.x());
1027 TIDW3SY.push_back(closestPair.first.y());
1037 if (tecid.
wheel() == 1) {
1038 TECW1RX.push_back(rechitmatchedx);
1039 TECW1RY.push_back(rechitmatchedy);
1040 TECW1SX.push_back(closestPair.first.x());
1041 TECW1SY.push_back(closestPair.first.y());
1043 if (tecid.
wheel() == 2) {
1044 TECW2RX.push_back(rechitmatchedx);
1045 TECW2RY.push_back(rechitmatchedy);
1046 TECW2SX.push_back(closestPair.first.x());
1047 TECW2SY.push_back(closestPair.first.y());
1049 if (tecid.
wheel() == 3) {
1050 TECW3RX.push_back(rechitmatchedx);
1051 TECW3RY.push_back(rechitmatchedy);
1052 TECW3SX.push_back(closestPair.first.x());
1053 TECW3SY.push_back(closestPair.first.y());
1055 if (tecid.
wheel() == 4) {
1056 TECW4RX.push_back(rechitmatchedx);
1057 TECW4RY.push_back(rechitmatchedy);
1058 TECW4SX.push_back(closestPair.first.x());
1059 TECW4SY.push_back(closestPair.first.y());
1061 if (tecid.
wheel() == 5) {
1062 TECW5RX.push_back(rechitmatchedx);
1063 TECW5RY.push_back(rechitmatchedy);
1064 TECW5SX.push_back(closestPair.first.x());
1065 TECW5SY.push_back(closestPair.first.y());
1067 if (tecid.
wheel() == 6) {
1068 TECW6RX.push_back(rechitmatchedx);
1069 TECW6RY.push_back(rechitmatchedy);
1070 TECW6SX.push_back(closestPair.first.x());
1071 TECW6SY.push_back(closestPair.first.y());
1073 if (tecid.
wheel() == 7) {
1074 TECW7RX.push_back(rechitmatchedx);
1075 TECW7RY.push_back(rechitmatchedy);
1076 TECW7SX.push_back(closestPair.first.x());
1077 TECW7SY.push_back(closestPair.first.y());
1079 if (tecid.
wheel() == 8) {
1080 TECW8RX.push_back(rechitmatchedx);
1081 TECW8RY.push_back(rechitmatchedy);
1082 TECW8SX.push_back(closestPair.first.x());
1083 TECW8SY.push_back(closestPair.first.y());
1093 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1094 eventout += nStripBrl;
1098 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1099 eventout += nStripFwd;
1108 <<
"Unable to find SiPixelRecHitCollection in event!";
1117 <<
"Unable to find TrackerDigiGeometry in event!";
1122 int nPxlBrl = 0, nPxlFwd = 0;
1124 for (TrackerGeometry::DetContainer::const_iterator it = geom->dets().begin();
1125 it != geom->dets().end(); ++it) {
1127 uint32_t myid = ((*it)->geographicalId()).rawId();
1128 DetId detId = ((*it)->geographicalId());
1137 if (pixeldet == recHitColl->end())
continue;
1145 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1150 if ( !matched.empty() ) {
1152 float closest = 9999.9;
1155 float rechit_x = lp.
x();
1156 float rechit_y = lp.
y();
1162 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
1163 m != matched.end(); ++
m) {
1165 float sim_x1 = (*m).entryPoint().x();
1166 float sim_x2 = (*m).exitPoint().x();
1167 float sim_xpos = 0.5*(sim_x1+sim_x2);
1169 float sim_y1 = (*m).entryPoint().y();
1170 float sim_y2 = (*m).exitPoint().y();
1171 float sim_ypos = 0.5*(sim_y1+sim_y2);
1173 float x_res = fabs(sim_xpos - rechit_x);
1174 float y_res = fabs(sim_ypos - rechit_y);
1176 float dist =
sqrt(x_res*x_res + y_res*y_res);
1178 if ( dist < closest ) {
1190 if (bdetid.
layer() == 1) {
1191 BRL1RX.push_back(rechit_x);
1192 BRL1RY.push_back(rechit_y);
1196 if (bdetid.
layer() == 2) {
1197 BRL2RX.push_back(rechit_x);
1198 BRL2RY.push_back(rechit_y);
1202 if (bdetid.
layer() == 3) {
1203 BRL3RX.push_back(rechit_x);
1204 BRL3RY.push_back(rechit_y);
1215 if (fdetid.
disk() == 1) {
1216 if (fdetid.
side() == 1) {
1222 if (fdetid.
side() == 2) {
1229 if (fdetid.
disk() == 2) {
1230 if (fdetid.
side() == 1) {
1236 if (fdetid.
side() == 2) {
1250 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1251 eventout += nPxlBrl;
1255 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1256 eventout += nPxlFwd;
1267 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeTrk";
1272 TString eventout(
"\n nTIBL1 = ");
1274 for (
unsigned int i = 0;
i <
TIBL1RX.size(); ++
i) {
1275 eventout +=
"\n (RX, RY, SX, SY) = (";
1285 eventout +=
"\n nTIBL2 = ";
1287 for (
unsigned int i = 0;
i <
TIBL2RX.size(); ++
i) {
1288 eventout +=
"\n (RX, RY, SX, SY) = (";
1298 eventout +=
"\n nTIBL3 = ";
1300 for (
unsigned int i = 0;
i <
TIBL3RX.size(); ++
i) {
1301 eventout +=
"\n (RX, RY, SX, SY) = (";
1311 eventout +=
"\n nTIBL4 = ";
1313 for (
unsigned int i = 0;
i <
TIBL4RX.size(); ++
i) {
1314 eventout +=
"\n (RX, RY, SX, SY) = (";
1324 eventout +=
"\n nTOBL1 = ";
1326 for (
unsigned int i = 0;
i <
TOBL1RX.size(); ++
i) {
1327 eventout +=
"\n (RX, RY, SX, SY) = (";
1337 eventout +=
"\n nTOBL2 = ";
1339 for (
unsigned int i = 0;
i <
TOBL2RX.size(); ++
i) {
1340 eventout +=
"\n (RX, RY, SX, SY) = (";
1350 eventout +=
"\n nTOBL3 = ";
1352 for (
unsigned int i = 0;
i <
TOBL3RX.size(); ++
i) {
1353 eventout +=
"\n (RX, RY, SX, SY) = (";
1363 eventout +=
"\n nTOBL4 = ";
1365 for (
unsigned int i = 0;
i <
TOBL4RX.size(); ++
i) {
1366 eventout +=
"\n (RX, RY, SX, SY) = (";
1376 eventout +=
"\n nTIDW1 = ";
1378 for (
unsigned int i = 0;
i <
TIDW1RX.size(); ++
i) {
1379 eventout +=
"\n (RX, RY, SX, SY) = (";
1389 eventout +=
"\n nTIDW2 = ";
1391 for (
unsigned int i = 0;
i <
TIDW2RX.size(); ++
i) {
1392 eventout +=
"\n (RX, RY, SX, SY) = (";
1402 eventout +=
"\n nTIDW3 = ";
1404 for (
unsigned int i = 0;
i <
TIDW3RX.size(); ++
i) {
1405 eventout +=
"\n (RX, RY, SX, SY) = (";
1415 eventout +=
"\n nTECW1 = ";
1417 for (
unsigned int i = 0;
i <
TECW1RX.size(); ++
i) {
1418 eventout +=
"\n (RX, RY, SX, SY) = (";
1428 eventout +=
"\n nTECW2 = ";
1430 for (
unsigned int i = 0;
i <
TECW2RX.size(); ++
i) {
1431 eventout +=
"\n (RX, RY, SX, SY) = (";
1441 eventout +=
"\n nTECW3 = ";
1443 for (
unsigned int i = 0;
i <
TECW3RX.size(); ++
i) {
1444 eventout +=
"\n (RX, RY, SX, SY) = (";
1454 eventout +=
"\n nTECW4 = ";
1456 for (
unsigned int i = 0;
i <
TECW4RX.size(); ++
i) {
1457 eventout +=
"\n (RX, RY, SX, SY) = (";
1467 eventout +=
"\n nTECW5 = ";
1469 for (
unsigned int i = 0;
i <
TECW5RX.size(); ++
i) {
1470 eventout +=
"\n (RX, RY, SX, SY) = (";
1480 eventout +=
"\n nTECW6 = ";
1482 for (
unsigned int i = 0;
i <
TECW6RX.size(); ++
i) {
1483 eventout +=
"\n (RX, RY, SX, SY) = (";
1493 eventout +=
"\n nTECW7 = ";
1495 for (
unsigned int i = 0;
i <
TECW7RX.size(); ++
i) {
1496 eventout +=
"\n (RX, RY, SX, SY) = (";
1506 eventout +=
"\n nTECW8 = ";
1508 for (
unsigned int i = 0;
i <
TECW8RX.size(); ++
i) {
1509 eventout +=
"\n (RX, RY, SX, SY) = (";
1521 eventout +=
"\n nBRL1 = ";
1522 eventout +=
BRL1RX.size();
1523 for (
unsigned int i = 0;
i <
BRL1RX.size(); ++
i) {
1524 eventout +=
"\n (RX, RY, SX, SY) = (";
1534 eventout +=
"\n nBRL2 = ";
1535 eventout +=
BRL2RX.size();
1536 for (
unsigned int i = 0;
i <
BRL2RX.size(); ++
i) {
1537 eventout +=
"\n (RX, RY, SX, SY) = (";
1547 eventout +=
"\n nBRL3 = ";
1548 eventout +=
BRL3RX.size();
1549 for (
unsigned int i = 0;
i <
BRL3RX.size(); ++
i) {
1550 eventout +=
"\n (RX, RY, SX, SY) = (";
1560 eventout +=
"\n nFWD1p = ";
1562 for (
unsigned int i = 0;
i <
FWD1pRX.size(); ++
i) {
1563 eventout +=
"\n (RX, RY, SX, SY) = (";
1573 eventout +=
"\n nFWD1n = ";
1575 for (
unsigned int i = 0;
i <
FWD1nRX.size(); ++
i) {
1576 eventout +=
"\n (RX, RY, SX, SY) = (";
1586 eventout +=
"\n nFWD2p = ";
1588 for (
unsigned int i = 0;
i <
FWD2pRX.size(); ++
i) {
1589 eventout +=
"\n (RX, RY, SX, SY) = (";
1599 eventout +=
"\n nFWD2p = ";
1601 for (
unsigned int i = 0;
i <
FWD2nRX.size(); ++
i) {
1602 eventout +=
"\n (RX, RY, SX, SY) = (";
1652 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillMuon";
1656 eventout =
"\nGathering info:";
1663 <<
"Unable to find DTMuonGeometryRecord in event!";
1671 <<
"Unable to find dtsimHits in event!";
1675 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1682 <<
"Unable to find dtRecHits in event!";
1686 std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1690 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1693 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1712 <<
"Unable to find muo CSC crossingFrame in event!";
1719 hitItr !=
simHits.end(); ++hitItr)
1721 theMap[hitItr->detUnitId()].push_back(*hitItr);
1729 <<
"Unable to find CSCMuonGeometryRecord in event!";
1739 <<
"Unable to find CSC RecHits in event!";
1746 recHitItr != cscRecHits->end(); ++recHitItr) {
1748 int detId = (*recHitItr).cscDetId().rawId();
1751 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1753 if (mapItr !=
theMap.end()) {
1754 simHits = mapItr->second;
1757 if (simHits.size() == 1) {
1770 eventout +=
"\n Number of CSCRecHits collected:........... ";
1775 std::map<double, int> mapsim, maprec;
1776 std::map<int, double> nmapsim, nmaprec;
1782 <<
"Unable to find RPCMuonGeometryRecord in event!";
1790 <<
"Unable to find RPCSimHit in event!";
1798 <<
"Unable to find RPCRecHit in event!";
1805 for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1807 const RPCRoll *roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(Rid));
1811 eventout +=
"\n Number of RPCRecHits collected:........... ";
1820 LocalPoint rhitlocal = (*recIt).localPosition();
1821 double rhitlocalx = rhitlocal.
x();
1822 maprec[rhitlocalx] = nrec;
1826 for (std::map<double,int>::iterator iter = maprec.begin();
1827 iter != maprec.end(); ++iter) {
1829 nmaprec[
i] = (*iter).first;
1832 edm::PSimHitContainer::const_iterator simIt;
1834 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1835 int ptype = (*simIt).particleType();
1837 if (ptype == 13 || ptype == -13) {
1839 LocalPoint shitlocal = (*simIt).localPosition();
1840 double shitlocalx = shitlocal.
x();
1841 mapsim[shitlocalx] = nsim;
1846 for (std::map<double,int>::iterator iter = mapsim.begin();
1847 iter != mapsim.end(); ++iter) {
1849 nmapsim[
i] = (*iter).first;
1853 for (
int r = 0;
r < nsim;
r++) {
1855 RPCRHX.push_back(nmaprec[
r+1]);
1856 RPCSHX.push_back(nmapsim[
r+1]);
1861 eventout +=
"\n Number of RPCRecHits collected:........... ";
1873 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeMuon";
1878 TString eventout(
"\n nDT = ");
1879 eventout +=
DTRHD.size();
1880 for (
unsigned int i = 0;
i <
DTRHD.size(); ++
i) {
1881 eventout +=
"\n (RHD, SHD) = (";
1889 eventout +=
"\n nCSC = ";
1891 for (
unsigned int i = 0;
i <
CSCRHPHI.size(); ++
i) {
1892 eventout +=
"\n (rhphi, rhperp, shphi) = (";
1902 eventout +=
"\n nRPC = ";
1903 eventout +=
RPCRHX.size();
1904 for (
unsigned int i = 0;
i <
RPCRHX.size(); ++
i) {
1905 eventout +=
"\n (rhx, shx) = (";
1926 std::string MsgLoggerCat =
"GlobalRecHitsProducer_clear";
1930 <<
"Clearing event holders";
2083 std::pair<LocalPoint,LocalVector>
2098 float scale = -localHit.
z() / dir.
z();
2110 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
2114 std::map<DTWireId, std::vector<DTRecHit1DPair> >
2117 std::map<DTWireId, std::vector<DTRecHit1DPair> >
ret;
2120 rechit != dt1DRecHitPairs->end(); rechit++) {
2121 ret[(*rechit).wireId()].push_back(*rechit);
2134 float xEntry = entryP.
x()-xwire;
2135 float xExit = exitP.
x()-xwire;
2138 return fabs(xEntry - (entryP.
z()*(xExit-xEntry))/(exitP.
z()-entryP.
z()));
2142 template <
typename type>
2146 const std::vector<type>& recHits,
2147 const float simHitDist) {
2149 const type* theBestRecHit = 0;
2151 for(
typename std::vector<type>::const_iterator recHit = recHits.begin();
2152 recHit != recHits.end();
2155 if(fabs(distTmp-simHitDist) < res) {
2156 res = fabs(distTmp-simHitDist);
2157 theBestRecHit = &(*recHit);
2161 return theBestRecHit;
2181 template <
typename type>
2191 for(
std::map<
DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
2192 simHitsPerWire.begin();
2193 wireAndSHits != simHitsPerWire.end();
2195 DTWireId wireId = (*wireAndSHits).first;
2196 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
2210 if(simHitWireDist>2.1) {
2216 if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
2221 std::vector<type> recHits = recHitsPerWire[wireId];
2224 const type* theBestRecHit =
2231 DTRHD.push_back(recHitWireDist);
2232 DTSHD.push_back(simHitWireDist);
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
void putFWD2nRecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
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
void putTIDW2RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
void putBRL3RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
std::vector< PCaloHit > PCaloHitContainer
void putBRL1RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
void putDTRecHits(std::vector< float > rhd, std::vector< float > shd)
unsigned int layer() const
layer id
virtual float stripAngle(float strip) const =0
static const int sdHcalOut
void putTECW3RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
void putFWD2pRecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
std::vector< PSimHit > matched
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 putTOBL2RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
Sin< T >::type sin(const T &t)
void putTECW1RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
Geom::Phi< T > phi() const
void putTOBL4RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, 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 putEBCalRecHits(std::vector< float > re, std::vector< float > she)
void storeMuon(PGlobalRecHit &)
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
edm::InputTag MuRPCSimSrc_
void putRPCRecHits(std::vector< float > rhx, std::vector< float > shx)
static int position[TOTALCHAMBERS][3]
void storeECal(PGlobalRecHit &)
unsigned int layer() const
layer id
std::map< int, edm::PSimHitContainer > theMap
void putTECW6RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
virtual float strip(const LocalPoint &) const =0
void putTIBL1RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
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
void putTOBL3RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
C::const_iterator const_iterator
constant access iterator type
const DTTopology & specificTopology() const
int compute(const DTGeometry *dtGeom, std::map< DTWireId, std::vector< PSimHit > > simHitsPerWire, std::map< DTWireId, std::vector< type > > recHitsPerWire, int step)
Local3DPoint exitPoint() const
Exit point in the local Det frame.
void putHECalRecHits(std::vector< float > rec, std::vector< float > r, std::vector< float > she)
edm::InputTag SiStripSrc_
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.
void putTECW5RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
void putTIBL3RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void putTIDW1RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
LocalPoint toLocal(const GlobalPoint &gp) const
Cos< T >::type cos(const T &t)
edm::InputTag ECalUncalEBSrc_
std::map< uint32_t, float, std::less< uint32_t > > MapType
void putBRL2RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
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 putESCalRecHits(std::vector< float > re, std::vector< float > she)
unsigned int disk() const
disk id
void putTIDW3RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
void storeTrk(PGlobalRecHit &)
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
const_iterator end() const
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
int wire() const
Return the wire number.
void putEECalRecHits(std::vector< float > re, std::vector< float > she)
void fillMuon(edm::Event &, const edm::EventSetup &)
void putCSCRecHits(std::vector< float > rhphi, std::vector< float > rhperp, std::vector< float > shphi)
void putHFCalRecHits(std::vector< float > rec, std::vector< float > r, std::vector< float > she)
T const * product() const
static const int sdHcalFwd
void putTECW2RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
void putTIBL4RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
void putTECW7RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
void putTECW4RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
T const * product() const
unsigned int wheel() const
wheel id
static const int sdHcalBrl
unsigned int layer() const
layer id
void storeHCal(PGlobalRecHit &)
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
const BoundPlane & surface() const
The nominal surface of the GeomDet.
void putTOBL1RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
void putFWD1nRecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
unsigned int side() const
positive or negative id
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
void putTIBL2RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
LocalPoint localPosition() const
void putHOCalRecHits(std::vector< float > rec, std::vector< float > r, std::vector< float > she)
void putHBCalRecHits(std::vector< float > rec, std::vector< float > r, std::vector< float > she)
void fillTrk(edm::Event &, const edm::EventSetup &)
void putTECW8RecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
Local3DPoint entryPoint() const
Entry point in the local Det frame.
static const int sdHcalEC
const CSCChamber * chamber() const
void fillECal(edm::Event &, const edm::EventSetup &)
void putFWD1pRecHits(std::vector< float > rx, std::vector< float > ry, std::vector< float > sx, std::vector< float > sy)
virtual ~GlobalRecHitsProducer()
const GeomDetUnit * stereoDet() const
const_iterator begin() const
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
virtual LocalPoint localPosition() const
unsigned int wheel() const
wheel id
DTWireId wireId() const
Return the wireId.