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();
128 int nevt = iEvent.
id().
event();
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 maxHOEnergy = 0.;
550 Double_t maxHFEnergy = 0.;
552 Double_t maxHBPhi = -1000.;
553 Double_t maxHEPhi = -1000.;
554 Double_t maxHOPhi = -1000.;
555 Double_t maxHFPhi = -1000.;
557 Double_t maxHBEta = -1000.;
558 Double_t maxHEEta = -1000.;
559 Double_t maxHOEta = -1000.;
560 Double_t maxHFEta = -1000.;
562 Double_t
PI = 3.141592653589;
567 std::vector<edm::Handle<HBHERecHitCollection> > hbhe;
569 if (!hbhe[0].isValid()) {
571 <<
"Unable to find any HBHERecHitCollections in event!";
574 std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
578 for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
582 jhbhe != (*ihbhe)->end(); ++jhbhe) {
589 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
592 if ( (jhbhe->energy()) > maxHBEnergy ) {
593 maxHBEnergy = jhbhe->energy();
594 maxHOEnergy = maxHBEnergy;
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) = (";
858 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillTrk";
862 eventout =
"\nGathering info:";
867 if (!rechitsmatched.
isValid()) {
869 <<
"Unable to find stripmatchedrechits in event!";
879 <<
"Unable to find TrackerDigiGeometry in event!";
884 int nStripBrl = 0, nStripFwd = 0;
887 for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin();
888 it != pDD->dets().end(); ++it) {
890 uint32_t myid = ((*it)->geographicalId()).rawId();
896 if (rechitmatchedMatch != rechitsmatched->end()) {
902 for ( itermatched = rechitmatchedRangeIteratorBegin;
903 itermatched != rechitmatchedRangeIteratorEnd;
909 float mindist = 999999.;
910 float distx = 999999.;
911 float disty = 999999.;
912 float dist = 999999.;
913 std::pair<LocalPoint,LocalVector> closestPair;
916 float rechitmatchedx = position.
x();
917 float rechitmatchedy = position.
y();
927 std::pair<LocalPoint,LocalVector> hitPair;
929 for(std::vector<PSimHit>::const_iterator
m =
matched.begin();
933 distx = fabs(rechitmatchedx - hitPair.first.x());
934 disty = fabs(rechitmatchedy - hitPair.first.y());
935 dist =
sqrt(distx*distx+disty*disty);
939 closestPair = hitPair;
949 if (tibid.
layer() == 1) {
950 TIBL1RX.push_back(rechitmatchedx);
951 TIBL1RY.push_back(rechitmatchedy);
952 TIBL1SX.push_back(closestPair.first.x());
953 TIBL1SY.push_back(closestPair.first.y());
955 if (tibid.
layer() == 2) {
956 TIBL2RX.push_back(rechitmatchedx);
957 TIBL2RY.push_back(rechitmatchedy);
958 TIBL2SX.push_back(closestPair.first.x());
959 TIBL2SY.push_back(closestPair.first.y());
961 if (tibid.
layer() == 3) {
962 TIBL3RX.push_back(rechitmatchedx);
963 TIBL3RY.push_back(rechitmatchedy);
964 TIBL3SX.push_back(closestPair.first.x());
965 TIBL3SY.push_back(closestPair.first.y());
967 if (tibid.
layer() == 4) {
968 TIBL4RX.push_back(rechitmatchedx);
969 TIBL4RY.push_back(rechitmatchedy);
970 TIBL4SX.push_back(closestPair.first.x());
971 TIBL4SY.push_back(closestPair.first.y());
981 if (tobid.
layer() == 1) {
982 TOBL1RX.push_back(rechitmatchedx);
983 TOBL1RY.push_back(rechitmatchedy);
984 TOBL1SX.push_back(closestPair.first.x());
985 TOBL1SY.push_back(closestPair.first.y());
987 if (tobid.
layer() == 2) {
988 TOBL2RX.push_back(rechitmatchedx);
989 TOBL2RY.push_back(rechitmatchedy);
990 TOBL2SX.push_back(closestPair.first.x());
991 TOBL2SY.push_back(closestPair.first.y());
993 if (tobid.
layer() == 3) {
994 TOBL3RX.push_back(rechitmatchedx);
995 TOBL3RY.push_back(rechitmatchedy);
996 TOBL3SX.push_back(closestPair.first.x());
997 TOBL3SY.push_back(closestPair.first.y());
999 if (tobid.
layer() == 4) {
1000 TOBL4RX.push_back(rechitmatchedx);
1001 TOBL4RY.push_back(rechitmatchedy);
1002 TOBL4SX.push_back(closestPair.first.x());
1003 TOBL4SY.push_back(closestPair.first.y());
1013 if (tidid.
wheel() == 1) {
1014 TIDW1RX.push_back(rechitmatchedx);
1015 TIDW1RY.push_back(rechitmatchedy);
1016 TIDW1SX.push_back(closestPair.first.x());
1017 TIDW1SY.push_back(closestPair.first.y());
1019 if (tidid.
wheel() == 2) {
1020 TIDW2RX.push_back(rechitmatchedx);
1021 TIDW2RY.push_back(rechitmatchedy);
1022 TIDW2SX.push_back(closestPair.first.x());
1023 TIDW2SY.push_back(closestPair.first.y());
1025 if (tidid.
wheel() == 3) {
1026 TIDW3RX.push_back(rechitmatchedx);
1027 TIDW3RY.push_back(rechitmatchedy);
1028 TIDW3SX.push_back(closestPair.first.x());
1029 TIDW3SY.push_back(closestPair.first.y());
1039 if (tecid.
wheel() == 1) {
1040 TECW1RX.push_back(rechitmatchedx);
1041 TECW1RY.push_back(rechitmatchedy);
1042 TECW1SX.push_back(closestPair.first.x());
1043 TECW1SY.push_back(closestPair.first.y());
1045 if (tecid.
wheel() == 2) {
1046 TECW2RX.push_back(rechitmatchedx);
1047 TECW2RY.push_back(rechitmatchedy);
1048 TECW2SX.push_back(closestPair.first.x());
1049 TECW2SY.push_back(closestPair.first.y());
1051 if (tecid.
wheel() == 3) {
1052 TECW3RX.push_back(rechitmatchedx);
1053 TECW3RY.push_back(rechitmatchedy);
1054 TECW3SX.push_back(closestPair.first.x());
1055 TECW3SY.push_back(closestPair.first.y());
1057 if (tecid.
wheel() == 4) {
1058 TECW4RX.push_back(rechitmatchedx);
1059 TECW4RY.push_back(rechitmatchedy);
1060 TECW4SX.push_back(closestPair.first.x());
1061 TECW4SY.push_back(closestPair.first.y());
1063 if (tecid.
wheel() == 5) {
1064 TECW5RX.push_back(rechitmatchedx);
1065 TECW5RY.push_back(rechitmatchedy);
1066 TECW5SX.push_back(closestPair.first.x());
1067 TECW5SY.push_back(closestPair.first.y());
1069 if (tecid.
wheel() == 6) {
1070 TECW6RX.push_back(rechitmatchedx);
1071 TECW6RY.push_back(rechitmatchedy);
1072 TECW6SX.push_back(closestPair.first.x());
1073 TECW6SY.push_back(closestPair.first.y());
1075 if (tecid.
wheel() == 7) {
1076 TECW7RX.push_back(rechitmatchedx);
1077 TECW7RY.push_back(rechitmatchedy);
1078 TECW7SX.push_back(closestPair.first.x());
1079 TECW7SY.push_back(closestPair.first.y());
1081 if (tecid.
wheel() == 8) {
1082 TECW8RX.push_back(rechitmatchedx);
1083 TECW8RY.push_back(rechitmatchedy);
1084 TECW8SX.push_back(closestPair.first.x());
1085 TECW8SY.push_back(closestPair.first.y());
1095 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1096 eventout += nStripBrl;
1100 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1101 eventout += nStripFwd;
1110 <<
"Unable to find SiPixelRecHitCollection in event!";
1119 <<
"Unable to find TrackerDigiGeometry in event!";
1124 int nPxlBrl = 0, nPxlFwd = 0;
1126 for (TrackerGeometry::DetContainer::const_iterator it = geom->dets().begin();
1127 it != geom->dets().end(); ++it) {
1129 uint32_t myid = ((*it)->geographicalId()).rawId();
1130 DetId detId = ((*it)->geographicalId());
1139 if (pixeldet == recHitColl->end())
continue;
1147 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1152 if ( !matched.empty() ) {
1154 float closest = 9999.9;
1157 float rechit_x = lp.
x();
1158 float rechit_y = lp.
y();
1164 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
1165 m != matched.end(); ++
m) {
1167 float sim_x1 = (*m).entryPoint().x();
1168 float sim_x2 = (*m).exitPoint().x();
1169 float sim_xpos = 0.5*(sim_x1+sim_x2);
1171 float sim_y1 = (*m).entryPoint().y();
1172 float sim_y2 = (*m).exitPoint().y();
1173 float sim_ypos = 0.5*(sim_y1+sim_y2);
1175 float x_res = fabs(sim_xpos - rechit_x);
1176 float y_res = fabs(sim_ypos - rechit_y);
1178 float dist =
sqrt(x_res*x_res + y_res*y_res);
1180 if ( dist < closest ) {
1192 if (bdetid.
layer() == 1) {
1193 BRL1RX.push_back(rechit_x);
1194 BRL1RY.push_back(rechit_y);
1198 if (bdetid.
layer() == 2) {
1199 BRL2RX.push_back(rechit_x);
1200 BRL2RY.push_back(rechit_y);
1204 if (bdetid.
layer() == 3) {
1205 BRL3RX.push_back(rechit_x);
1206 BRL3RY.push_back(rechit_y);
1217 if (fdetid.
disk() == 1) {
1218 if (fdetid.
side() == 1) {
1224 if (fdetid.
side() == 2) {
1231 if (fdetid.
disk() == 2) {
1232 if (fdetid.
side() == 1) {
1238 if (fdetid.
side() == 2) {
1252 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1253 eventout += nPxlBrl;
1257 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1258 eventout += nPxlFwd;
1269 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeTrk";
1274 TString eventout(
"\n nTIBL1 = ");
1276 for (
unsigned int i = 0;
i <
TIBL1RX.size(); ++
i) {
1277 eventout +=
"\n (RX, RY, SX, SY) = (";
1287 eventout +=
"\n nTIBL2 = ";
1289 for (
unsigned int i = 0;
i <
TIBL2RX.size(); ++
i) {
1290 eventout +=
"\n (RX, RY, SX, SY) = (";
1300 eventout +=
"\n nTIBL3 = ";
1302 for (
unsigned int i = 0;
i <
TIBL3RX.size(); ++
i) {
1303 eventout +=
"\n (RX, RY, SX, SY) = (";
1313 eventout +=
"\n nTIBL4 = ";
1315 for (
unsigned int i = 0;
i <
TIBL4RX.size(); ++
i) {
1316 eventout +=
"\n (RX, RY, SX, SY) = (";
1326 eventout +=
"\n nTOBL1 = ";
1328 for (
unsigned int i = 0;
i <
TOBL1RX.size(); ++
i) {
1329 eventout +=
"\n (RX, RY, SX, SY) = (";
1339 eventout +=
"\n nTOBL2 = ";
1341 for (
unsigned int i = 0;
i <
TOBL2RX.size(); ++
i) {
1342 eventout +=
"\n (RX, RY, SX, SY) = (";
1352 eventout +=
"\n nTOBL3 = ";
1354 for (
unsigned int i = 0;
i <
TOBL3RX.size(); ++
i) {
1355 eventout +=
"\n (RX, RY, SX, SY) = (";
1365 eventout +=
"\n nTOBL4 = ";
1367 for (
unsigned int i = 0;
i <
TOBL4RX.size(); ++
i) {
1368 eventout +=
"\n (RX, RY, SX, SY) = (";
1378 eventout +=
"\n nTIDW1 = ";
1380 for (
unsigned int i = 0;
i <
TIDW1RX.size(); ++
i) {
1381 eventout +=
"\n (RX, RY, SX, SY) = (";
1391 eventout +=
"\n nTIDW2 = ";
1393 for (
unsigned int i = 0;
i <
TIDW2RX.size(); ++
i) {
1394 eventout +=
"\n (RX, RY, SX, SY) = (";
1404 eventout +=
"\n nTIDW3 = ";
1406 for (
unsigned int i = 0;
i <
TIDW3RX.size(); ++
i) {
1407 eventout +=
"\n (RX, RY, SX, SY) = (";
1417 eventout +=
"\n nTECW1 = ";
1419 for (
unsigned int i = 0;
i <
TECW1RX.size(); ++
i) {
1420 eventout +=
"\n (RX, RY, SX, SY) = (";
1430 eventout +=
"\n nTECW2 = ";
1432 for (
unsigned int i = 0;
i <
TECW2RX.size(); ++
i) {
1433 eventout +=
"\n (RX, RY, SX, SY) = (";
1443 eventout +=
"\n nTECW3 = ";
1445 for (
unsigned int i = 0;
i <
TECW3RX.size(); ++
i) {
1446 eventout +=
"\n (RX, RY, SX, SY) = (";
1456 eventout +=
"\n nTECW4 = ";
1458 for (
unsigned int i = 0;
i <
TECW4RX.size(); ++
i) {
1459 eventout +=
"\n (RX, RY, SX, SY) = (";
1469 eventout +=
"\n nTECW5 = ";
1471 for (
unsigned int i = 0;
i <
TECW5RX.size(); ++
i) {
1472 eventout +=
"\n (RX, RY, SX, SY) = (";
1482 eventout +=
"\n nTECW6 = ";
1484 for (
unsigned int i = 0;
i <
TECW6RX.size(); ++
i) {
1485 eventout +=
"\n (RX, RY, SX, SY) = (";
1495 eventout +=
"\n nTECW7 = ";
1497 for (
unsigned int i = 0;
i <
TECW7RX.size(); ++
i) {
1498 eventout +=
"\n (RX, RY, SX, SY) = (";
1508 eventout +=
"\n nTECW8 = ";
1510 for (
unsigned int i = 0;
i <
TECW8RX.size(); ++
i) {
1511 eventout +=
"\n (RX, RY, SX, SY) = (";
1523 eventout +=
"\n nBRL1 = ";
1524 eventout +=
BRL1RX.size();
1525 for (
unsigned int i = 0;
i <
BRL1RX.size(); ++
i) {
1526 eventout +=
"\n (RX, RY, SX, SY) = (";
1536 eventout +=
"\n nBRL2 = ";
1537 eventout +=
BRL2RX.size();
1538 for (
unsigned int i = 0;
i <
BRL2RX.size(); ++
i) {
1539 eventout +=
"\n (RX, RY, SX, SY) = (";
1549 eventout +=
"\n nBRL3 = ";
1550 eventout +=
BRL3RX.size();
1551 for (
unsigned int i = 0;
i <
BRL3RX.size(); ++
i) {
1552 eventout +=
"\n (RX, RY, SX, SY) = (";
1562 eventout +=
"\n nFWD1p = ";
1564 for (
unsigned int i = 0;
i <
FWD1pRX.size(); ++
i) {
1565 eventout +=
"\n (RX, RY, SX, SY) = (";
1575 eventout +=
"\n nFWD1n = ";
1577 for (
unsigned int i = 0;
i <
FWD1nRX.size(); ++
i) {
1578 eventout +=
"\n (RX, RY, SX, SY) = (";
1588 eventout +=
"\n nFWD2p = ";
1590 for (
unsigned int i = 0;
i <
FWD2pRX.size(); ++
i) {
1591 eventout +=
"\n (RX, RY, SX, SY) = (";
1601 eventout +=
"\n nFWD2p = ";
1603 for (
unsigned int i = 0;
i <
FWD2nRX.size(); ++
i) {
1604 eventout +=
"\n (RX, RY, SX, SY) = (";
1654 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillMuon";
1658 eventout =
"\nGathering info:";
1665 <<
"Unable to find DTMuonGeometryRecord in event!";
1673 <<
"Unable to find dtsimHits in event!";
1677 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1684 <<
"Unable to find dtRecHits in event!";
1688 std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1692 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1695 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1714 <<
"Unable to find muo CSC crossingFrame in event!";
1721 hitItr !=
simHits.end(); ++hitItr)
1723 theMap[hitItr->detUnitId()].push_back(*hitItr);
1731 <<
"Unable to find CSCMuonGeometryRecord in event!";
1741 <<
"Unable to find CSC RecHits in event!";
1748 recHitItr != cscRecHits->end(); ++recHitItr) {
1750 int detId = (*recHitItr).cscDetId().rawId();
1753 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1755 if (mapItr !=
theMap.end()) {
1756 simHits = mapItr->second;
1759 if (simHits.size() == 1) {
1772 eventout +=
"\n Number of CSCRecHits collected:........... ";
1777 std::map<double, int> mapsim, maprec;
1778 std::map<int, double> nmapsim, nmaprec;
1784 <<
"Unable to find RPCMuonGeometryRecord in event!";
1792 <<
"Unable to find RPCSimHit in event!";
1800 <<
"Unable to find RPCRecHit in event!";
1807 for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1809 const RPCRoll *roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(Rid));
1813 eventout +=
"\n Number of RPCRecHits collected:........... ";
1822 LocalPoint rhitlocal = (*recIt).localPosition();
1823 double rhitlocalx = rhitlocal.
x();
1824 maprec[rhitlocalx] = nrec;
1828 for (std::map<double,int>::iterator iter = maprec.begin();
1829 iter != maprec.end(); ++iter) {
1831 nmaprec[
i] = (*iter).first;
1834 edm::PSimHitContainer::const_iterator simIt;
1836 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1837 int ptype = (*simIt).particleType();
1839 if (ptype == 13 || ptype == -13) {
1841 LocalPoint shitlocal = (*simIt).localPosition();
1842 double shitlocalx = shitlocal.
x();
1843 mapsim[shitlocalx] = nsim;
1848 for (std::map<double,int>::iterator iter = mapsim.begin();
1849 iter != mapsim.end(); ++iter) {
1851 nmapsim[
i] = (*iter).first;
1855 for (
int r = 0;
r < nsim;
r++) {
1857 RPCRHX.push_back(nmaprec[
r+1]);
1858 RPCSHX.push_back(nmapsim[
r+1]);
1863 eventout +=
"\n Number of RPCRecHits collected:........... ";
1875 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeMuon";
1880 TString eventout(
"\n nDT = ");
1881 eventout +=
DTRHD.size();
1882 for (
unsigned int i = 0;
i <
DTRHD.size(); ++
i) {
1883 eventout +=
"\n (RHD, SHD) = (";
1891 eventout +=
"\n nCSC = ";
1893 for (
unsigned int i = 0;
i <
CSCRHPHI.size(); ++
i) {
1894 eventout +=
"\n (rhphi, rhperp, shphi) = (";
1904 eventout +=
"\n nRPC = ";
1905 eventout +=
RPCRHX.size();
1906 for (
unsigned int i = 0;
i <
RPCRHX.size(); ++
i) {
1907 eventout +=
"\n (rhx, shx) = (";
1928 std::string MsgLoggerCat =
"GlobalRecHitsProducer_clear";
1932 <<
"Clearing event holders";
2085 std::pair<LocalPoint,LocalVector>
2100 float scale = -localHit.
z() / dir.
z();
2112 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
2116 std::map<DTWireId, std::vector<DTRecHit1DPair> >
2119 std::map<DTWireId, std::vector<DTRecHit1DPair> >
ret;
2122 rechit != dt1DRecHitPairs->end(); rechit++) {
2123 ret[(*rechit).wireId()].push_back(*rechit);
2136 float xEntry = entryP.
x()-xwire;
2137 float xExit = exitP.
x()-xwire;
2140 return fabs(xEntry - (entryP.
z()*(xExit-xEntry))/(exitP.
z()-entryP.
z()));
2144 template <
typename type>
2148 const std::vector<type>& recHits,
2149 const float simHitDist) {
2151 const type* theBestRecHit = 0;
2153 for(
typename std::vector<type>::const_iterator recHit = recHits.begin();
2154 recHit != recHits.end();
2157 if(fabs(distTmp-simHitDist) < res) {
2158 res = fabs(distTmp-simHitDist);
2159 theBestRecHit = &(*recHit);
2163 return theBestRecHit;
2183 template <
typename type>
2193 for(
std::map<
DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
2194 simHitsPerWire.begin();
2195 wireAndSHits != simHitsPerWire.end();
2197 DTWireId wireId = (*wireAndSHits).first;
2198 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
2212 if(simHitWireDist>2.1) {
2218 if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
2223 std::vector<type> recHits = recHitsPerWire[wireId];
2226 const type* theBestRecHit =
2233 DTRHD.push_back(recHitWireDist);
2234 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 &)
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 &)
virtual LocalPoint localPosition() const
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)
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)
DetId geographicalId() const
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 &)
const GlobalPoint & getPosition() const
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
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
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.