15 printProvenanceInfo(
false), trackerHitAssociatorConfig_(iPSet, consumesCollector()),
count(0)
17 std::string MsgLoggerCat =
"GlobalRecHitsProducer_GlobalRecHitsProducer";
27 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
29 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
74 produces<PGlobalRecHit>(
label);
79 <<
"\n===============================\n"
80 <<
"Initialized as EDProducer with parameter values:\n"
81 <<
" Name = " <<
fName <<
"\n"
82 <<
" Verbosity = " << verbosity <<
"\n"
83 <<
" Frequency = " << frequency <<
"\n"
84 <<
" Label = " << label <<
"\n"
85 <<
" GetProv = " << getAllProvenances <<
"\n"
86 <<
" PrintProv = " << printProvenanceInfo <<
"\n"
87 <<
" ECalEBSrc = " << ECalEBSrc_.label()
88 <<
":" << ECalEBSrc_.instance() <<
"\n"
89 <<
" ECalUncalEBSrc = " << ECalUncalEBSrc_.
label()
90 <<
":" << ECalUncalEBSrc_.
instance() <<
"\n"
91 <<
" ECalEESrc = " << ECalEESrc_.
label()
92 <<
":" << ECalUncalEESrc_.
instance() <<
"\n"
93 <<
" ECalUncalEESrc = " << ECalUncalEESrc_.
label()
94 <<
":" << ECalEESrc_.
instance() <<
"\n"
95 <<
" ECalESSrc = " << ECalESSrc_.
label()
96 <<
":" << ECalESSrc_.
instance() <<
"\n"
97 <<
" HCalSrc = " << HCalSrc_.
label()
98 <<
":" << HCalSrc_.
instance() <<
"\n"
99 <<
" SiStripSrc = " << SiStripSrc_.
label()
100 <<
":" << SiStripSrc_.
instance() <<
"\n"
101 <<
" SiPixelSrc = " << SiPxlSrc_.
label()
102 <<
":" << SiPxlSrc_.
instance() <<
"\n"
103 <<
" MuDTSrc = " << MuDTSrc_.
label()
104 <<
":" << MuDTSrc_.
instance() <<
"\n"
105 <<
" MuDTSimSrc = " << MuDTSimSrc_.
label()
106 <<
":" << MuDTSimSrc_.
instance() <<
"\n"
107 <<
" MuCSCSrc = " << MuCSCSrc_.
label()
108 <<
":" << MuCSCSrc_.
instance() <<
"\n"
109 <<
" MuRPCSrc = " << MuRPCSrc_.
label()
110 <<
":" << MuRPCSrc_.
instance() <<
"\n"
111 <<
" MuRPCSimSrc = " << MuRPCSimSrc_.
label()
112 <<
":" << MuRPCSimSrc_.
instance() <<
"\n"
113 <<
"===============================\n";
123 std::string MsgLoggerCat =
"GlobalRecHitsProducer_beginJob";
132 std::string MsgLoggerCat =
"GlobalRecHitsProducer_endJob";
135 <<
"Terminating having processed " <<
count <<
" events.";
142 std::string MsgLoggerCat =
"GlobalRecHitsProducer_produce";
153 <<
"Processing run " << nrun <<
", event " << nevt
154 <<
" (" <<
count <<
" events total)";
158 <<
"Processing run " << nrun <<
", event " << nevt
159 <<
" (" <<
count <<
" events total)";
169 std::vector<const edm::Provenance*> AllProv;
174 <<
"Number of Provenances = " << AllProv.size();
177 TString eventout(
"\nProvenance info:\n");
179 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
180 eventout +=
"\n ******************************";
181 eventout +=
"\n Module : ";
183 eventout += AllProv[
i]->moduleLabel();
184 eventout +=
"\n ProductID : ";
186 eventout += AllProv[
i]->productID().id();
187 eventout +=
"\n ClassName : ";
189 eventout += AllProv[
i]->className();
190 eventout +=
"\n InstanceName : ";
192 eventout += AllProv[
i]->productInstanceName();
193 eventout +=
"\n BranchName : ";
195 eventout += AllProv[
i]->branchName();
197 eventout +=
"\n ******************************\n";
216 <<
"Done gathering data from event.";
223 <<
"Saving event contents:";
244 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillECal";
248 eventout =
"\nGathering info:";
265 if (!EcalUncalibRecHitEB.
isValid()) {
267 <<
"Unable to find EcalUncalRecHitEB in event!";
275 <<
"Unable to find EcalRecHitEB in event!";
281 if (!crossingFrame.
isValid()) {
283 <<
"Unable to find cal barrel crossingFrame in event!";
289 std::auto_ptr<MixCollection<PCaloHit> >
295 = barrelHits->begin();
296 hitItr != barrelHits->end();
301 uint32_t crystid = ebid.
rawId();
302 ebSimMap[crystid] += hitItr->energy();
312 EBUncalibRecHit->
begin();
313 uncalibRecHit != EBUncalibRecHit->
end();
320 if (myRecHit != EBRecHit->
end()) {
322 EBRE.push_back(myRecHit->energy());
328 eventout +=
"\n Number of EBRecHits collected:............ ";
329 eventout += nEBRecHits;
337 if (!EcalUncalibRecHitEE.
isValid()) {
339 <<
"Unable to find EcalUncalRecHitEE in event!";
347 <<
"Unable to find EcalRecHitEE in event!";
353 if (!crossingFrame.
isValid()) {
355 <<
"Unable to find cal endcap crossingFrame in event!";
361 std::auto_ptr<MixCollection<PCaloHit> >
367 = endcapHits->begin();
368 hitItr != endcapHits->end();
373 uint32_t crystid = eeid.
rawId();
374 eeSimMap[crystid] += hitItr->energy();
384 EEUncalibRecHit->
begin();
385 uncalibRecHit != EEUncalibRecHit->
end();
392 if (myRecHit != EERecHit->
end()) {
394 EERE.push_back(myRecHit->energy());
400 eventout +=
"\n Number of EERecHits collected:............ ";
401 eventout += nEERecHits;
411 <<
"Unable to find EcalRecHitES in event!";
417 if (!crossingFrame.
isValid()) {
419 <<
"Unable to find cal preshower crossingFrame in event!";
425 std::auto_ptr<MixCollection<PCaloHit> >
431 = preshowerHits->begin();
432 hitItr != preshowerHits->end();
437 uint32_t crystid = esid.
rawId();
438 esSimMap[crystid] += hitItr->energy();
446 recHit != ESRecHit->
end();
452 ESRE.push_back(recHit->energy());
457 eventout +=
"\n Number of ESRecHits collected:............ ";
458 eventout += nESRecHits;
469 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeECal";
472 TString eventout(
"\n nEBRecHits = ");
473 eventout +=
EBRE.size();
474 for (
unsigned int i = 0;
i <
EBRE.size(); ++
i) {
475 eventout +=
"\n (RE, SHE) = (";
481 eventout +=
"\n nEERecHits = ";
482 eventout +=
EERE.size();
483 for (
unsigned int i = 0;
i <
EERE.size(); ++
i) {
484 eventout +=
"\n (RE, SHE) = (";
490 eventout +=
"\n nESRecHits = ";
491 eventout +=
ESRE.size();
492 for (
unsigned int i = 0;
i <
ESRE.size(); ++
i) {
493 eventout +=
"\n (RE, SHE) = (";
512 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillHCal";
516 eventout =
"\nGathering info:";
523 <<
"Unable to find CaloGeometry in event!";
534 <<
"Unable to find hcalHits in event!";
543 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
544 simhits != simhitResult->end();
548 uint32_t cellid = detId.
rawId();
551 fHBEnergySimHits[cellid] += simhits->energy();
554 fHEEnergySimHits[cellid] += simhits->energy();
557 fHOEnergySimHits[cellid] += simhits->energy();
560 fHFEnergySimHits[cellid] += simhits->energy();
565 Double_t maxHBEnergy = 0.;
566 Double_t maxHEEnergy = 0.;
567 Double_t maxHFEnergy = 0.;
569 Double_t maxHBPhi = -1000.;
570 Double_t maxHEPhi = -1000.;
571 Double_t maxHOPhi = -1000.;
572 Double_t maxHFPhi = -1000.;
574 Double_t maxHBEta = -1000.;
575 Double_t maxHEEta = -1000.;
576 Double_t maxHOEta = -1000.;
577 Double_t maxHFEta = -1000.;
579 Double_t
PI = 3.141592653589;
584 std::vector<edm::Handle<HBHERecHitCollection> > hbhe;
586 if (!hbhe[0].isValid()) {
588 <<
"Unable to find any HBHERecHitCollections in event!";
591 std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
595 for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
599 jhbhe != (*ihbhe)->end(); ++jhbhe) {
606 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
609 if ( (jhbhe->energy()) > maxHBEnergy ) {
610 maxHBEnergy = jhbhe->energy();
621 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
624 if ( (jhbhe->energy()) > maxHEEnergy ) {
625 maxHEEnergy = jhbhe->energy();
633 jhbhe != (*ihbhe)->end(); ++jhbhe) {
642 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
646 float deltaphi = maxHBPhi - fPhi;
647 if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
648 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
649 float deltaeta = fEta - maxHBEta;
650 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
652 HBCalREC.push_back(jhbhe->energy());
654 HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
662 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
666 float deltaphi = maxHEPhi - fPhi;
667 if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
668 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
669 float deltaeta = fEta - maxHEEta;
670 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
672 HECalREC.push_back(jhbhe->energy());
674 HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
681 eventout +=
"\n Number of HBRecHits collected:............ ";
686 eventout +=
"\n Number of HERecHits collected:............ ";
693 std::vector<edm::Handle<HFRecHitCollection> > hf;
695 if (!hf[0].isValid()) {
697 <<
"Unable to find any HFRecHitCollections in event!";
700 std::vector<edm::Handle<HFRecHitCollection> >::iterator
ihf;
703 for (ihf = hf.begin(); ihf != hf.end(); ++
ihf) {
707 jhf != (*ihf)->end(); ++jhf) {
714 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
717 if ( (jhf->energy()) > maxHFEnergy ) {
718 maxHFEnergy = jhf->energy();
726 jhf != (*ihf)->end(); ++jhf) {
735 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
739 float deltaphi = maxHBPhi - fPhi;
740 if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
741 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
742 float deltaeta = fEta - maxHFEta;
743 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
747 HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
753 eventout +=
"\n Number of HFDigis collected:.............. ";
760 std::vector<edm::Handle<HORecHitCollection> > ho;
762 if (!ho[0].isValid()) {
764 <<
"Unable to find any HORecHitCollections in event!";
767 std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
770 for (iho = ho.begin(); iho != ho.end(); ++iho) {
773 jho != (*iho)->end(); ++jho) {
782 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
786 float deltaphi = maxHOPhi - fPhi;
787 if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
788 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
789 float deltaeta = fEta - maxHOEta;
790 Double_t
r =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
794 HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
800 eventout +=
"\n Number of HODigis collected:.............. ";
812 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeHCal";
815 TString eventout(
"\n nHBRecHits = ");
817 for (
unsigned int i = 0;
i <
HBCalREC.size(); ++
i) {
818 eventout +=
"\n (REC, R, SHE) = (";
826 eventout +=
"\n nHERecHits = ";
828 for (
unsigned int i = 0;
i <
HECalREC.size(); ++
i) {
829 eventout +=
"\n (REC, R, SHE) = (";
837 eventout +=
"\n nHFRecHits = ";
839 for (
unsigned int i = 0;
i <
HFCalREC.size(); ++
i) {
840 eventout +=
"\n (REC, R, SHE) = (";
848 eventout +=
"\n nHORecHits = ";
850 for (
unsigned int i = 0;
i <
HOCalREC.size(); ++
i) {
851 eventout +=
"\n (REC, R, SHE) = (";
880 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillTrk";
884 eventout =
"\nGathering info:";
889 if (!rechitsmatched.
isValid()) {
891 <<
"Unable to find stripmatchedrechits in event!";
901 <<
"Unable to find TrackerDigiGeometry in event!";
906 int nStripBrl = 0, nStripFwd = 0;
909 for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin();
910 it != pDD->dets().end(); ++it) {
912 uint32_t myid = ((*it)->geographicalId()).rawId();
913 DetId detid = ((*it)->geographicalId());
918 if (rechitmatchedMatch != rechitsmatched->end()) {
924 for ( itermatched = rechitmatchedRangeIteratorBegin;
925 itermatched != rechitmatchedRangeIteratorEnd;
931 float mindist = 999999.;
932 float distx = 999999.;
933 float disty = 999999.;
934 float dist = 999999.;
935 std::pair<LocalPoint,LocalVector> closestPair;
938 float rechitmatchedx = position.
x();
939 float rechitmatchedy = position.
y();
949 std::pair<LocalPoint,LocalVector> hitPair;
951 for(std::vector<PSimHit>::const_iterator
m =
matched.begin();
955 distx = fabs(rechitmatchedx - hitPair.first.x());
956 disty = fabs(rechitmatchedy - hitPair.first.y());
957 dist =
sqrt(distx*distx+disty*disty);
961 closestPair = hitPair;
972 TIBL1RX.push_back(rechitmatchedx);
973 TIBL1RY.push_back(rechitmatchedy);
974 TIBL1SX.push_back(closestPair.first.x());
975 TIBL1SY.push_back(closestPair.first.y());
978 TIBL2RX.push_back(rechitmatchedx);
979 TIBL2RY.push_back(rechitmatchedy);
980 TIBL2SX.push_back(closestPair.first.x());
981 TIBL2SY.push_back(closestPair.first.y());
984 TIBL3RX.push_back(rechitmatchedx);
985 TIBL3RY.push_back(rechitmatchedy);
986 TIBL3SX.push_back(closestPair.first.x());
987 TIBL3SY.push_back(closestPair.first.y());
990 TIBL4RX.push_back(rechitmatchedx);
991 TIBL4RY.push_back(rechitmatchedy);
992 TIBL4SX.push_back(closestPair.first.x());
993 TIBL4SY.push_back(closestPair.first.y());
1004 TOBL1RX.push_back(rechitmatchedx);
1005 TOBL1RY.push_back(rechitmatchedy);
1006 TOBL1SX.push_back(closestPair.first.x());
1007 TOBL1SY.push_back(closestPair.first.y());
1010 TOBL2RX.push_back(rechitmatchedx);
1011 TOBL2RY.push_back(rechitmatchedy);
1012 TOBL2SX.push_back(closestPair.first.x());
1013 TOBL2SY.push_back(closestPair.first.y());
1016 TOBL3RX.push_back(rechitmatchedx);
1017 TOBL3RY.push_back(rechitmatchedy);
1018 TOBL3SX.push_back(closestPair.first.x());
1019 TOBL3SY.push_back(closestPair.first.y());
1022 TOBL4RX.push_back(rechitmatchedx);
1023 TOBL4RY.push_back(rechitmatchedy);
1024 TOBL4SX.push_back(closestPair.first.x());
1025 TOBL4SY.push_back(closestPair.first.y());
1036 TIDW1RX.push_back(rechitmatchedx);
1037 TIDW1RY.push_back(rechitmatchedy);
1038 TIDW1SX.push_back(closestPair.first.x());
1039 TIDW1SY.push_back(closestPair.first.y());
1042 TIDW2RX.push_back(rechitmatchedx);
1043 TIDW2RY.push_back(rechitmatchedy);
1044 TIDW2SX.push_back(closestPair.first.x());
1045 TIDW2SY.push_back(closestPair.first.y());
1048 TIDW3RX.push_back(rechitmatchedx);
1049 TIDW3RY.push_back(rechitmatchedy);
1050 TIDW3SX.push_back(closestPair.first.x());
1051 TIDW3SY.push_back(closestPair.first.y());
1062 TECW1RX.push_back(rechitmatchedx);
1063 TECW1RY.push_back(rechitmatchedy);
1064 TECW1SX.push_back(closestPair.first.x());
1065 TECW1SY.push_back(closestPair.first.y());
1068 TECW2RX.push_back(rechitmatchedx);
1069 TECW2RY.push_back(rechitmatchedy);
1070 TECW2SX.push_back(closestPair.first.x());
1071 TECW2SY.push_back(closestPair.first.y());
1074 TECW3RX.push_back(rechitmatchedx);
1075 TECW3RY.push_back(rechitmatchedy);
1076 TECW3SX.push_back(closestPair.first.x());
1077 TECW3SY.push_back(closestPair.first.y());
1080 TECW4RX.push_back(rechitmatchedx);
1081 TECW4RY.push_back(rechitmatchedy);
1082 TECW4SX.push_back(closestPair.first.x());
1083 TECW4SY.push_back(closestPair.first.y());
1086 TECW5RX.push_back(rechitmatchedx);
1087 TECW5RY.push_back(rechitmatchedy);
1088 TECW5SX.push_back(closestPair.first.x());
1089 TECW5SY.push_back(closestPair.first.y());
1092 TECW6RX.push_back(rechitmatchedx);
1093 TECW6RY.push_back(rechitmatchedy);
1094 TECW6SX.push_back(closestPair.first.x());
1095 TECW6SY.push_back(closestPair.first.y());
1098 TECW7RX.push_back(rechitmatchedx);
1099 TECW7RY.push_back(rechitmatchedy);
1100 TECW7SX.push_back(closestPair.first.x());
1101 TECW7SY.push_back(closestPair.first.y());
1104 TECW8RX.push_back(rechitmatchedx);
1105 TECW8RY.push_back(rechitmatchedy);
1106 TECW8SX.push_back(closestPair.first.x());
1107 TECW8SY.push_back(closestPair.first.y());
1117 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1118 eventout += nStripBrl;
1122 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1123 eventout += nStripFwd;
1132 <<
"Unable to find SiPixelRecHitCollection in event!";
1141 <<
"Unable to find TrackerDigiGeometry in event!";
1146 int nPxlBrl = 0, nPxlFwd = 0;
1148 for (TrackerGeometry::DetContainer::const_iterator it = geom->dets().begin();
1149 it != geom->dets().end(); ++it) {
1151 uint32_t myid = ((*it)->geographicalId()).rawId();
1152 DetId detId = ((*it)->geographicalId());
1161 if (pixeldet == recHitColl->end())
continue;
1169 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1174 if ( !matched.empty() ) {
1176 float closest = 9999.9;
1179 float rechit_x = lp.
x();
1180 float rechit_y = lp.
y();
1186 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
1187 m != matched.end(); ++
m) {
1189 float sim_x1 = (*m).entryPoint().x();
1190 float sim_x2 = (*m).exitPoint().x();
1191 float sim_xpos = 0.5*(sim_x1+sim_x2);
1193 float sim_y1 = (*m).entryPoint().y();
1194 float sim_y2 = (*m).exitPoint().y();
1195 float sim_ypos = 0.5*(sim_y1+sim_y2);
1197 float x_res = fabs(sim_xpos - rechit_x);
1198 float y_res = fabs(sim_ypos - rechit_y);
1200 float dist =
sqrt(x_res*x_res + y_res*y_res);
1202 if ( dist < closest ) {
1215 BRL1RX.push_back(rechit_x);
1216 BRL1RY.push_back(rechit_y);
1221 BRL2RX.push_back(rechit_x);
1222 BRL2RY.push_back(rechit_y);
1227 BRL3RX.push_back(rechit_x);
1228 BRL3RY.push_back(rechit_y);
1239 if (tTopo->
pxfDisk(myid) == 1) {
1240 if (tTopo->
pxfSide(myid) == 1) {
1246 if (tTopo->
pxfSide(myid) == 2) {
1253 if (tTopo->
pxfDisk(myid) == 2) {
1254 if (tTopo->
pxfSide(myid) == 1) {
1260 if (tTopo->
pxfSide(myid) == 2) {
1274 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1275 eventout += nPxlBrl;
1279 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1280 eventout += nPxlFwd;
1291 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeTrk";
1296 TString eventout(
"\n nTIBL1 = ");
1298 for (
unsigned int i = 0;
i <
TIBL1RX.size(); ++
i) {
1299 eventout +=
"\n (RX, RY, SX, SY) = (";
1309 eventout +=
"\n nTIBL2 = ";
1311 for (
unsigned int i = 0;
i <
TIBL2RX.size(); ++
i) {
1312 eventout +=
"\n (RX, RY, SX, SY) = (";
1322 eventout +=
"\n nTIBL3 = ";
1324 for (
unsigned int i = 0;
i <
TIBL3RX.size(); ++
i) {
1325 eventout +=
"\n (RX, RY, SX, SY) = (";
1335 eventout +=
"\n nTIBL4 = ";
1337 for (
unsigned int i = 0;
i <
TIBL4RX.size(); ++
i) {
1338 eventout +=
"\n (RX, RY, SX, SY) = (";
1348 eventout +=
"\n nTOBL1 = ";
1350 for (
unsigned int i = 0;
i <
TOBL1RX.size(); ++
i) {
1351 eventout +=
"\n (RX, RY, SX, SY) = (";
1361 eventout +=
"\n nTOBL2 = ";
1363 for (
unsigned int i = 0;
i <
TOBL2RX.size(); ++
i) {
1364 eventout +=
"\n (RX, RY, SX, SY) = (";
1374 eventout +=
"\n nTOBL3 = ";
1376 for (
unsigned int i = 0;
i <
TOBL3RX.size(); ++
i) {
1377 eventout +=
"\n (RX, RY, SX, SY) = (";
1387 eventout +=
"\n nTOBL4 = ";
1389 for (
unsigned int i = 0;
i <
TOBL4RX.size(); ++
i) {
1390 eventout +=
"\n (RX, RY, SX, SY) = (";
1400 eventout +=
"\n nTIDW1 = ";
1402 for (
unsigned int i = 0;
i <
TIDW1RX.size(); ++
i) {
1403 eventout +=
"\n (RX, RY, SX, SY) = (";
1413 eventout +=
"\n nTIDW2 = ";
1415 for (
unsigned int i = 0;
i <
TIDW2RX.size(); ++
i) {
1416 eventout +=
"\n (RX, RY, SX, SY) = (";
1426 eventout +=
"\n nTIDW3 = ";
1428 for (
unsigned int i = 0;
i <
TIDW3RX.size(); ++
i) {
1429 eventout +=
"\n (RX, RY, SX, SY) = (";
1439 eventout +=
"\n nTECW1 = ";
1441 for (
unsigned int i = 0;
i <
TECW1RX.size(); ++
i) {
1442 eventout +=
"\n (RX, RY, SX, SY) = (";
1452 eventout +=
"\n nTECW2 = ";
1454 for (
unsigned int i = 0;
i <
TECW2RX.size(); ++
i) {
1455 eventout +=
"\n (RX, RY, SX, SY) = (";
1465 eventout +=
"\n nTECW3 = ";
1467 for (
unsigned int i = 0;
i <
TECW3RX.size(); ++
i) {
1468 eventout +=
"\n (RX, RY, SX, SY) = (";
1478 eventout +=
"\n nTECW4 = ";
1480 for (
unsigned int i = 0;
i <
TECW4RX.size(); ++
i) {
1481 eventout +=
"\n (RX, RY, SX, SY) = (";
1491 eventout +=
"\n nTECW5 = ";
1493 for (
unsigned int i = 0;
i <
TECW5RX.size(); ++
i) {
1494 eventout +=
"\n (RX, RY, SX, SY) = (";
1504 eventout +=
"\n nTECW6 = ";
1506 for (
unsigned int i = 0;
i <
TECW6RX.size(); ++
i) {
1507 eventout +=
"\n (RX, RY, SX, SY) = (";
1517 eventout +=
"\n nTECW7 = ";
1519 for (
unsigned int i = 0;
i <
TECW7RX.size(); ++
i) {
1520 eventout +=
"\n (RX, RY, SX, SY) = (";
1530 eventout +=
"\n nTECW8 = ";
1532 for (
unsigned int i = 0;
i <
TECW8RX.size(); ++
i) {
1533 eventout +=
"\n (RX, RY, SX, SY) = (";
1545 eventout +=
"\n nBRL1 = ";
1546 eventout +=
BRL1RX.size();
1547 for (
unsigned int i = 0;
i <
BRL1RX.size(); ++
i) {
1548 eventout +=
"\n (RX, RY, SX, SY) = (";
1558 eventout +=
"\n nBRL2 = ";
1559 eventout +=
BRL2RX.size();
1560 for (
unsigned int i = 0;
i <
BRL2RX.size(); ++
i) {
1561 eventout +=
"\n (RX, RY, SX, SY) = (";
1571 eventout +=
"\n nBRL3 = ";
1572 eventout +=
BRL3RX.size();
1573 for (
unsigned int i = 0;
i <
BRL3RX.size(); ++
i) {
1574 eventout +=
"\n (RX, RY, SX, SY) = (";
1584 eventout +=
"\n nFWD1p = ";
1586 for (
unsigned int i = 0;
i <
FWD1pRX.size(); ++
i) {
1587 eventout +=
"\n (RX, RY, SX, SY) = (";
1597 eventout +=
"\n nFWD1n = ";
1599 for (
unsigned int i = 0;
i <
FWD1nRX.size(); ++
i) {
1600 eventout +=
"\n (RX, RY, SX, SY) = (";
1610 eventout +=
"\n nFWD2p = ";
1612 for (
unsigned int i = 0;
i <
FWD2pRX.size(); ++
i) {
1613 eventout +=
"\n (RX, RY, SX, SY) = (";
1623 eventout +=
"\n nFWD2p = ";
1625 for (
unsigned int i = 0;
i <
FWD2nRX.size(); ++
i) {
1626 eventout +=
"\n (RX, RY, SX, SY) = (";
1676 std::string MsgLoggerCat =
"GlobalRecHitsProducer_fillMuon";
1680 eventout =
"\nGathering info:";
1687 <<
"Unable to find DTMuonGeometryRecord in event!";
1695 <<
"Unable to find dtsimHits in event!";
1699 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1706 <<
"Unable to find dtRecHits in event!";
1710 std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1714 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1717 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1736 <<
"Unable to find muo CSC crossingFrame in event!";
1743 hitItr !=
simHits.end(); ++hitItr)
1745 theMap[hitItr->detUnitId()].push_back(*hitItr);
1753 <<
"Unable to find CSCMuonGeometryRecord in event!";
1763 <<
"Unable to find CSC RecHits in event!";
1770 recHitItr != cscRecHits->end(); ++recHitItr) {
1772 int detId = (*recHitItr).cscDetId().rawId();
1775 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1777 if (mapItr !=
theMap.end()) {
1778 simHits = mapItr->second;
1781 if (simHits.size() == 1) {
1794 eventout +=
"\n Number of CSCRecHits collected:........... ";
1799 std::map<double, int> mapsim, maprec;
1800 std::map<int, double> nmapsim, nmaprec;
1806 <<
"Unable to find RPCMuonGeometryRecord in event!";
1814 <<
"Unable to find RPCSimHit in event!";
1822 <<
"Unable to find RPCRecHit in event!";
1829 for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1831 const RPCRoll *roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(Rid));
1835 eventout +=
"\n Number of RPCRecHits collected:........... ";
1844 LocalPoint rhitlocal = (*recIt).localPosition();
1845 double rhitlocalx = rhitlocal.
x();
1846 maprec[rhitlocalx] = nrec;
1850 for (std::map<double,int>::iterator iter = maprec.begin();
1851 iter != maprec.end(); ++iter) {
1853 nmaprec[
i] = (*iter).first;
1856 edm::PSimHitContainer::const_iterator simIt;
1858 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1859 int ptype = (*simIt).particleType();
1861 if (ptype == 13 || ptype == -13) {
1863 LocalPoint shitlocal = (*simIt).localPosition();
1864 double shitlocalx = shitlocal.
x();
1865 mapsim[shitlocalx] = nsim;
1870 for (std::map<double,int>::iterator iter = mapsim.begin();
1871 iter != mapsim.end(); ++iter) {
1873 nmapsim[
i] = (*iter).first;
1877 for (
int r = 0;
r < nsim;
r++) {
1879 RPCRHX.push_back(nmaprec[
r+1]);
1880 RPCSHX.push_back(nmapsim[
r+1]);
1885 eventout +=
"\n Number of RPCRecHits collected:........... ";
1897 std::string MsgLoggerCat =
"GlobalRecHitsProducer_storeMuon";
1902 TString eventout(
"\n nDT = ");
1903 eventout +=
DTRHD.size();
1904 for (
unsigned int i = 0;
i <
DTRHD.size(); ++
i) {
1905 eventout +=
"\n (RHD, SHD) = (";
1913 eventout +=
"\n nCSC = ";
1915 for (
unsigned int i = 0;
i <
CSCRHPHI.size(); ++
i) {
1916 eventout +=
"\n (rhphi, rhperp, shphi) = (";
1926 eventout +=
"\n nRPC = ";
1927 eventout +=
RPCRHX.size();
1928 for (
unsigned int i = 0;
i <
RPCRHX.size(); ++
i) {
1929 eventout +=
"\n (rhx, shx) = (";
1950 std::string MsgLoggerCat =
"GlobalRecHitsProducer_clear";
1954 <<
"Clearing event holders";
2107 std::pair<LocalPoint,LocalVector>
2115 LocalPoint localHit = plane.toLocal(globalpos);
2122 float scale = -localHit.
z() / dir.
z();
2134 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
2138 std::map<DTWireId, std::vector<DTRecHit1DPair> >
2141 std::map<DTWireId, std::vector<DTRecHit1DPair> >
ret;
2144 rechit != dt1DRecHitPairs->end(); rechit++) {
2145 ret[(*rechit).wireId()].push_back(*rechit);
2158 float xEntry = entryP.
x()-xwire;
2159 float xExit = exitP.
x()-xwire;
2162 return fabs(xEntry - (entryP.
z()*(xExit-xEntry))/(exitP.
z()-entryP.
z()));
2166 template <
typename type>
2170 const std::vector<type>&
recHits,
2171 const float simHitDist) {
2173 const type* theBestRecHit = 0;
2175 for(
typename std::vector<type>::const_iterator recHit = recHits.begin();
2176 recHit != recHits.end();
2179 if(fabs(distTmp-simHitDist) < res) {
2180 res = fabs(distTmp-simHitDist);
2181 theBestRecHit = &(*recHit);
2185 return theBestRecHit;
2205 template <
typename type>
2207 const std::map<
DTWireId, std::vector<PSimHit> >&
2209 const std::map<
DTWireId, std::vector<type> >&
2213 std::map<DTWireId, std::vector<PSimHit> > simHitsPerWire = _simHitsPerWire;
2214 std::map<DTWireId, std::vector<type> > recHitsPerWire = _recHitsPerWire;
2217 for(std::map<
DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
2218 simHitsPerWire.begin();
2219 wireAndSHits != simHitsPerWire.end();
2221 DTWireId wireId = (*wireAndSHits).first;
2222 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
2236 if(simHitWireDist>2.1) {
2242 if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
2247 std::vector<type>
recHits = recHitsPerWire[wireId];
2250 const type* theBestRecHit =
2257 DTRHD.push_back(recHitWireDist);
2258 DTSHD.push_back(simHitWireDist);
void putTIBL1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
GlobalRecHitsProducer(const edm::ParameterSet &)
void getManyByType(std::vector< Handle< PROD > > &results) const
edm::InputTag ECalUncalEESrc_
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
EventNumber_t event() const
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
void getAllProvenance(std::vector< Provenance const * > &provenances) const
tuple ret
prodAgent to be discontinued
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
TrackerHitAssociator::Config trackerHitAssociatorConfig_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
unsigned int tibLayer(const DetId &id) const
void putHECalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
virtual float stripAngle(float strip) const =0
void putFWD1nRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTOBL4RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
static const int sdHcalOut
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
void putHBCalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< PSimHit > matched
void putTECW6RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
unsigned int pxfDisk(const DetId &id) const
void putBRL1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTECW8RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void fillHCal(edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void putEECalRecHits(const std::vector< float > &re, const std::vector< float > &she)
void putTECW5RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
edm::EDGetTokenT< EERecHitCollection > ECalEESrc_Token_
Sin< T >::type sin(const T &t)
void putTECW7RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
Geom::Phi< T > phi() const
void putCSCRecHits(const std::vector< float > &rhphi, const std::vector< float > &rhperp, const std::vector< float > &shphi)
void putTECW2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
std::vector< EcalUncalibratedRecHit >::const_iterator const_iterator
static const PSimHit * findMuSimHit(const edm::PSimHitContainer &hits)
Select the SimHit from a muon in a vector of SimHits.
void putTIDW1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
unsigned long long EventNumber_t
void putRPCRecHits(const std::vector< float > &rhx, const std::vector< float > &shx)
void putTECW1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
unsigned int tidWheel(const DetId &id) const
void storeMuon(PGlobalRecHit &)
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
edm::InputTag MuRPCSimSrc_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
void storeECal(PGlobalRecHit &)
std::map< int, edm::PSimHitContainer > theMap
void putBRL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
virtual float strip(const LocalPoint &) const =0
virtual void produce(edm::Event &, const edm::EventSetup &)
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
uint32_t rawId() const
get the raw id
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
const DTTopology & specificTopology() const
Local3DPoint exitPoint() const
Exit point in the local Det frame.
void putTOBL1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTIDW2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
edm::InputTag SiStripSrc_
void putFWD2nRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
const CSCChamberSpecs * specs() const
static const int sdPxlBrl
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
Local3DPoint localPosition() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void putHOCalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
void putTECW3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTOBL3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTIBL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
Cos< T >::type cos(const T &t)
edm::InputTag ECalUncalEBSrc_
std::map< uint32_t, float, std::less< uint32_t > > MapType
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
void putEBCalRecHits(const std::vector< float > &re, const std::vector< float > &she)
void putBRL3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::InputTag MuDTSimSrc_
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
void storeTrk(PGlobalRecHit &)
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
unsigned int pxbLayer(const DetId &id) const
const_iterator end() const
void putTIBL4RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
int wire() const
Return the wire number.
void putESCalRecHits(const std::vector< float > &re, const std::vector< float > &she)
void putFWD1pRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void fillMuon(edm::Event &, const edm::EventSetup &)
T const * product() const
void putDTRecHits(const std::vector< float > &rhd, const std::vector< float > &shd)
T const * product() const
static const int sdHcalFwd
static const int sdHcalBrl
void storeHCal(PGlobalRecHit &)
void putTOBL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
static int position[264][3]
unsigned int pxfSide(const DetId &id) const
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
virtual const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
DetId geographicalId() const
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
volatile std::atomic< bool > shutdown_flag false
LocalPoint localPosition() const
void fillTrk(edm::Event &, const edm::EventSetup &)
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
unsigned int tecWheel(const DetId &id) const
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit > > &simHitsPerWire, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
Local3DPoint entryPoint() const
Entry point in the local Det frame.
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
void putTECW4RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
static const int sdHcalEC
const CSCChamber * chamber() const
edm::EDGetTokenT< EBRecHitCollection > ECalEBSrc_Token_
void fillECal(edm::Event &, const edm::EventSetup &)
void putFWD2pRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
virtual LocalPoint localPosition() const final
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
const TrackerGeomDet * idToDet(DetId) const
DTWireId wireId() const
Return the wireId.