22 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_GlobalRecHitsAnalyzer";
31 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
33 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
63 <<
"\n===============================\n"
64 <<
"Initialized as EDProducer with parameter values:\n"
65 <<
" Name = " <<
fName <<
"\n"
66 <<
" Verbosity = " << verbosity <<
"\n"
67 <<
" Frequency = " << frequency <<
"\n"
68 <<
" GetProv = " << getAllProvenances <<
"\n"
69 <<
" PrintProv = " << printProvenanceInfo <<
"\n"
70 <<
" ECalEBSrc = " << ECalEBSrc_.label()
71 <<
":" << ECalEBSrc_.instance() <<
"\n"
72 <<
" ECalUncalEBSrc = " << ECalUncalEBSrc_.
label()
73 <<
":" << ECalUncalEBSrc_.
instance() <<
"\n"
74 <<
" ECalEESrc = " << ECalEESrc_.
label()
75 <<
":" << ECalUncalEESrc_.
instance() <<
"\n"
76 <<
" ECalUncalEESrc = " << ECalUncalEESrc_.
label()
77 <<
":" << ECalEESrc_.
instance() <<
"\n"
78 <<
" ECalESSrc = " << ECalESSrc_.
label()
79 <<
":" << ECalESSrc_.
instance() <<
"\n"
80 <<
" HCalSrc = " << HCalSrc_.
label()
81 <<
":" << HCalSrc_.
instance() <<
"\n"
82 <<
" SiStripSrc = " << SiStripSrc_.
label()
83 <<
":" << SiStripSrc_.
instance() <<
"\n"
84 <<
" SiPixelSrc = " << SiPxlSrc_.
label()
85 <<
":" << SiPxlSrc_.
instance() <<
"\n"
86 <<
" MuDTSrc = " << MuDTSrc_.
label()
87 <<
":" << MuDTSrc_.
instance() <<
"\n"
88 <<
" MuDTSimSrc = " << MuDTSimSrc_.
label()
89 <<
":" << MuDTSimSrc_.
instance() <<
"\n"
90 <<
" MuCSCSrc = " << MuCSCSrc_.
label()
91 <<
":" << MuCSCSrc_.
instance() <<
"\n"
92 <<
" MuRPCSrc = " << MuRPCSrc_.
label()
93 <<
":" << MuRPCSrc_.
instance() <<
"\n"
94 <<
" MuRPCSimSrc = " << MuRPCSimSrc_.
label()
95 <<
":" << MuRPCSimSrc_.
instance() <<
"\n"
96 <<
"===============================\n";
103 if (verbosity > 0 ) {
117 string SiStripString[19] = {
"TECW1",
"TECW2",
"TECW3",
"TECW4",
"TECW5",
118 "TECW6",
"TECW7",
"TECW8",
"TIBL1",
"TIBL2",
119 "TIBL3",
"TIBL4",
"TIDW1",
"TIDW2",
"TIDW3",
120 "TOBL1",
"TOBL2",
"TOBL3",
"TOBL4"};
121 for(
int i = 0;
i<19; ++
i) {
126 string hcharname, hchartitle;
128 for(
int amend = 0; amend < 19; ++amend) {
129 hcharname =
"hSiStripn_"+SiStripString[amend];
130 hchartitle= SiStripString[amend]+
" rechits";
133 SiStripString[amend],1);
135 hcharname =
"hSiStripResX_"+SiStripString[amend];
136 hchartitle= SiStripString[amend]+
" rechit x resolution";
139 +SiStripString[amend],1);
141 hcharname =
"hSiStripResY_"+SiStripString[amend];
142 hchartitle= SiStripString[amend]+
" rechit y resolution";
145 SiStripString[amend],1);
152 string HCalString[4]={
"HB",
"HE",
"HF",
"HO"};
153 float HCalnUpper[4]={3000.,3000.,3000.,3000.};
154 float HCalnLower[4]={0.,0.,0.,0.};
155 for(
int j =0;
j <4; ++
j) {
161 for(
int amend = 0; amend < 4; ++amend) {
162 hcharname =
"hHcaln_"+HCalString[amend];
163 hchartitle= HCalString[amend]+
" rechits";
168 hcharname =
"hHcalRes_"+HCalString[amend];
169 hchartitle= HCalString[amend]+
" rechit resolution";
177 string ECalString[3] = {
"EB",
"EE",
"ES"};
178 int ECalnBins[3] = {1000,3000,150};
179 float ECalnUpper[3] = {20000., 62000., 3000.};
180 float ECalnLower[3] = {0., 0., 0.};
181 int ECalResBins[3] = {200,200,200};
182 float ECalResUpper[3] = {1., 0.3, .0002};
183 float ECalResLower[3] = {-1., -0.3, -.0002};
184 for(
int i =0;
i<3; ++
i) {
190 for(
int amend = 0; amend < 3; ++amend) {
191 hcharname =
"hEcaln_"+ECalString[amend];
192 hchartitle= ECalString[amend]+
" rechits";
194 ECalnLower[amend], ECalnUpper[amend]);
197 hcharname =
"hEcalRes_"+ECalString[amend];
198 hchartitle= ECalString[amend]+
" rechit resolution";
201 ECalResUpper[amend]);
207 string SiPixelString[7] = {
"BRL1",
"BRL2",
"BRL3",
"FWD1n",
"FWD1p",
209 for(
int j =0;
j<7; ++
j) {
216 for(
int amend = 0; amend < 7; ++amend) {
217 hcharname =
"hSiPixeln_"+SiPixelString[amend];
218 hchartitle= SiPixelString[amend]+
" rechits";
221 SiPixelString[amend],1);
223 hcharname =
"hSiPixelResX_"+SiPixelString[amend];
224 hchartitle= SiPixelString[amend]+
" rechit x resolution";
227 SiPixelString[amend],1);
229 hcharname =
"hSiPixelResY_"+SiPixelString[amend];
230 hchartitle= SiPixelString[amend]+
" rechit y resolution";
234 SiPixelString[amend],1);
245 string n_List[3] = {
"hDtMuonn",
"hCSCn",
"hRPCn"};
246 string hist_string[3] = {
"Dt",
"CSC",
"RPC"};
248 for(
int amend=0; amend<3; ++amend) {
249 hchartitle = hist_string[amend]+
" rechits";
271 hcharname =
"hDtMuonRes";
272 hchartitle =
"DT wire distance resolution";
274 hcharname =
"CSCResRDPhi";
275 hchartitle =
"CSC perp*dphi resolution";
277 hcharname =
"hRPCResX";
278 hchartitle =
"RPC rechits x resolution";
292 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_endJob";
295 <<
"Terminating having processed " <<
count <<
" events.";
302 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_analyze";
308 int nrun = iEvent.
id().
run();
313 <<
"Processing run " << nrun <<
", event " << nevt
314 <<
" (" <<
count <<
" events total)";
318 <<
"Processing run " << nrun <<
", event " << nevt
319 <<
" (" <<
count <<
" events total)";
326 std::vector<const edm::Provenance*> AllProv;
331 <<
"Number of Provenances = " << AllProv.size();
334 TString eventout(
"\nProvenance info:\n");
336 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
337 eventout +=
"\n ******************************";
338 eventout +=
"\n Module : ";
339 eventout += AllProv[
i]->moduleLabel();
340 eventout +=
"\n ProductID : ";
341 eventout += AllProv[
i]->productID().id();
342 eventout +=
"\n ClassName : ";
343 eventout += AllProv[
i]->className();
344 eventout +=
"\n InstanceName : ";
345 eventout += AllProv[
i]->productInstanceName();
346 eventout +=
"\n BranchName : ";
347 eventout += AllProv[
i]->branchName();
349 eventout +=
"\n ******************************\n";
368 <<
"Done gathering data from event.";
376 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillECal";
380 eventout =
"\nGathering info:";
390 bool validUncalibRecHitEB =
true;
391 if (!EcalUncalibRecHitEB.
isValid()) {
393 <<
"Unable to find EcalUncalRecHitEB in event!";
394 validUncalibRecHitEB =
false;
399 bool validRecHitEB =
true;
402 <<
"Unable to find EcalRecHitEB in event!";
403 validRecHitEB =
false;
408 iEvent.
getByLabel(
"mix",barrelHitsName,crossingFrame);
409 bool validXFrame =
true;
410 if (!crossingFrame.
isValid()) {
412 <<
"Unable to find cal barrel crossingFrame in event!";
418 std::auto_ptr<MixCollection<PCaloHit> >
423 = barrelHits->begin();
424 hitItr != barrelHits->end();
429 uint32_t crystid = ebid.
rawId();
430 ebSimMap[crystid] += hitItr->energy();
436 if (validUncalibRecHitEB && validRecHitEB) {
442 EBUncalibRecHit->
begin();
443 uncalibRecHit != EBUncalibRecHit->
end();
450 if (myRecHit != EBRecHit->
end()) {
457 eventout +=
"\n Number of EBRecHits collected:............ ";
458 eventout += nEBRecHits;
468 bool validuncalibRecHitEE =
true;
469 if (!EcalUncalibRecHitEE.
isValid()) {
471 <<
"Unable to find EcalUncalRecHitEE in event!";
472 validuncalibRecHitEE =
false;
477 bool validRecHitEE =
true;
480 <<
"Unable to find EcalRecHitEE in event!";
481 validRecHitEE =
false;
486 iEvent.
getByLabel(
"mix",endcapHitsName,crossingFrame);
488 if (!crossingFrame.
isValid()) {
490 <<
"Unable to find cal endcap crossingFrame in event!";
496 std::auto_ptr<MixCollection<PCaloHit> >
501 = endcapHits->begin();
502 hitItr != endcapHits->end();
507 uint32_t crystid = eeid.
rawId();
508 eeSimMap[crystid] += hitItr->energy();
513 if (validuncalibRecHitEE && validRecHitEE) {
520 EEUncalibRecHit->
begin();
521 uncalibRecHit != EEUncalibRecHit->
end();
528 if (myRecHit != EERecHit->
end()) {
535 eventout +=
"\n Number of EERecHits collected:............ ";
536 eventout += nEERecHits;
546 bool validRecHitES =
true;
549 <<
"Unable to find EcalRecHitES in event!";
550 validRecHitES =
false;
555 iEvent.
getByLabel(
"mix",preshowerHitsName,crossingFrame);
557 if (!crossingFrame.
isValid()) {
559 <<
"Unable to find cal preshower crossingFrame in event!";
565 std::auto_ptr<MixCollection<PCaloHit> >
570 = preshowerHits->begin();
571 hitItr != preshowerHits->end();
576 uint32_t crystid = esid.
rawId();
577 esSimMap[crystid] += hitItr->energy();
587 recHit != ESRecHit->
end();
597 eventout +=
"\n Number of ESRecHits collected:............ ";
598 eventout += nESRecHits;
612 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillHCal";
616 eventout =
"\nGathering info:";
623 <<
"Unable to find CaloGeometry in event!";
628 edm::PCaloHitContainer::const_iterator itHit;
635 bool validhcalHits =
true;
638 <<
"Unable to find hcalHits in event!";
639 validhcalHits =
false;
649 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
650 simhits != simhitResult->end();
654 uint32_t cellid = detId.
rawId();
657 fHBEnergySimHits[cellid] += simhits->energy();
660 fHEEnergySimHits[cellid] += simhits->energy();
663 fHOEnergySimHits[cellid] += simhits->energy();
666 fHFEnergySimHits[cellid] += simhits->energy();
672 Double_t maxHBEnergy = 0.;
673 Double_t maxHEEnergy = 0.;
674 Double_t maxHFEnergy = 0.;
676 Double_t maxHBPhi = -1000.;
677 Double_t maxHEPhi = -1000.;
678 Double_t maxHOPhi = -1000.;
679 Double_t maxHFPhi = -1000.;
682 Double_t
PI = 3.141592653589;
687 std::vector<edm::Handle<HBHERecHitCollection> > hbhe;
689 bool validHBHE =
true;
690 if (!hbhe[0].isValid()) {
692 <<
"Unable to find any HBHERecHitCollections in event!";
697 std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
701 for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
705 jhbhe != (*ihbhe)->end(); ++jhbhe) {
712 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
714 if ( (jhbhe->energy()) > maxHBEnergy ) {
715 maxHBEnergy = jhbhe->energy();
724 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
726 if ( (jhbhe->energy()) > maxHEEnergy ) {
727 maxHEEnergy = jhbhe->energy();
734 jhbhe != (*ihbhe)->end(); ++jhbhe) {
743 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
746 float deltaphi = maxHBPhi - fPhi;
747 if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
748 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
751 fHBEnergySimHits[cell.rawId()]);
759 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
762 float deltaphi = maxHEPhi - fPhi;
763 if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
764 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
766 fHEEnergySimHits[cell.rawId()]);
773 eventout +=
"\n Number of HBRecHits collected:............ ";
778 eventout +=
"\n Number of HERecHits collected:............ ";
788 std::vector<edm::Handle<HFRecHitCollection> > hf;
791 if (!hf[0].isValid()) {
793 <<
"Unable to find any HFRecHitCollections in event!";
797 std::vector<edm::Handle<HFRecHitCollection> >::iterator
ihf;
800 for (ihf = hf.begin(); ihf != hf.end(); ++
ihf) {
804 jhf != (*ihf)->end(); ++jhf) {
811 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
813 if ( (jhf->energy()) > maxHFEnergy ) {
814 maxHFEnergy = jhf->energy();
821 jhf != (*ihf)->end(); ++jhf) {
830 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
833 float deltaphi = maxHBPhi - fPhi;
834 if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
835 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
837 mehHcalRes[2]->
Fill(jhf->energy()-fHFEnergySimHits[cell.rawId()]);
843 eventout +=
"\n Number of HFDigis collected:.............. ";
852 std::vector<edm::Handle<HORecHitCollection> > ho;
855 if (!ho[0].isValid()) {
857 <<
"Unable to find any HORecHitCollections in event!";
862 std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
865 for (iho = ho.begin(); iho != ho.end(); ++iho) {
868 jho != (*iho)->end(); ++jho) {
877 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
880 float deltaphi = maxHOPhi - fPhi;
881 if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
882 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
883 mehHcalRes[3]->
Fill(jho->energy()-fHOEnergySimHits[cell.rawId()]);
889 eventout +=
"\n Number of HODigis collected:.............. ";
910 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillTrk";
914 eventout =
"\nGathering info:";
919 bool validstrip =
true;
920 if (!rechitsmatched.
isValid()) {
922 <<
"Unable to find stripmatchedrechits in event!";
932 <<
"Unable to find TrackerDigiGeometry in event!";
938 int nStripBrl = 0, nStripFwd = 0;
941 for (TrackerGeometry::DetContainer::const_iterator it =
943 it != pDD->dets().end(); ++it) {
945 uint32_t myid = ((*it)->geographicalId()).rawId();
951 if (rechitmatchedMatch != rechitsmatched->end()) {
957 for ( itermatched = rechitmatchedRangeIteratorBegin;
958 itermatched != rechitmatchedRangeIteratorEnd;
961 SiStripMatchedRecHit2D
const rechit = *itermatched;
964 float mindist = 999999.;
965 float distx = 999999.;
966 float disty = 999999.;
967 float dist = 999999.;
968 std::pair<LocalPoint,LocalVector> closestPair;
971 float rechitmatchedx = position.
x();
972 float rechitmatchedy = position.
y();
982 std::pair<LocalPoint,LocalVector> hitPair;
984 for(std::vector<PSimHit>::const_iterator
m =
matched.begin();
988 distx = fabs(rechitmatchedx - hitPair.first.x());
989 disty = fabs(rechitmatchedy - hitPair.first.y());
990 dist =
sqrt(distx*distx+disty*disty);
994 closestPair = hitPair;
1114 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1115 eventout += nStripBrl;
1118 for(
int i =8;
i<12; ++
i)
1120 for(
int i =16;
i<19; ++
i)
1124 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1125 eventout += nStripFwd;
1127 for(
int i =0;
i<8; ++
i)
1129 for(
int i =12;
i<16; ++
i)
1137 bool validpixel =
true;
1140 <<
"Unable to find SiPixelRecHitCollection in event!";
1149 <<
"Unable to find TrackerDigiGeometry in event!";
1154 int nPxlBrl = 0, nPxlFwd = 0;
1156 for (TrackerGeometry::DetContainer::const_iterator it =
1157 geom->dets().begin();
1158 it != geom->dets().end(); ++it) {
1160 uint32_t myid = ((*it)->geographicalId()).rawId();
1161 DetId detId = ((*it)->geographicalId());
1167 if (pixeldet == recHitColl->end())
continue;
1177 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1182 if ( !matched.empty() ) {
1184 float closest = 9999.9;
1186 float rechit_x = lp.
x();
1187 float rechit_y = lp.
y();
1193 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
1194 m != matched.end(); ++
m) {
1196 float sim_x1 = (*m).entryPoint().x();
1197 float sim_x2 = (*m).exitPoint().x();
1198 float sim_xpos = 0.5*(sim_x1+sim_x2);
1200 float sim_y1 = (*m).entryPoint().y();
1201 float sim_y2 = (*m).exitPoint().y();
1202 float sim_ypos = 0.5*(sim_y1+sim_y2);
1204 float x_res = fabs(sim_xpos - rechit_x);
1205 float y_res = fabs(sim_ypos - rechit_y);
1207 float dist =
sqrt(x_res*x_res + y_res*y_res);
1209 if ( dist < closest ) {
1241 if (tTopo->
pxfDisk(myid) == 1) {
1242 if (tTopo->
pxfSide(myid) == 1) {
1246 if (tTopo->
pxfSide(myid) == 2) {
1251 if (tTopo->
pxfDisk(myid) == 2) {
1252 if (tTopo->
pxfSide(myid) == 1) {
1256 if (tTopo->
pxfSide(myid) == 2) {
1268 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1269 eventout += nPxlBrl;
1271 for(
int i=0;
i<3; ++
i) {
1276 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1277 eventout += nPxlFwd;
1280 for(
int i=3;
i<7; ++
i) {
1294 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillMuon";
1298 eventout =
"\nGathering info:";
1305 <<
"Unable to find DTMuonGeometryRecord in event!";
1311 bool validdtsim =
true;
1314 <<
"Unable to find dtsimHits in event!";
1320 bool validdtrec =
true;
1323 <<
"Unable to find dtRecHits in event!";
1327 if (validdtsim && validdtrec) {
1329 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1332 std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1335 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1338 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1350 bool validXFrame =
true;
1353 <<
"Unable to find muo CSC crossingFrame in event!";
1354 validXFrame =
false;
1361 hitItr !=
simHits.end(); ++hitItr) {
1362 theMap[hitItr->detUnitId()].push_back(*hitItr);
1371 <<
"Unable to find CSCMuonGeometryRecord in event!";
1379 bool validCSC =
true;
1382 <<
"Unable to find CSC RecHits in event!";
1391 recHitItr != cscRecHits->end(); ++recHitItr) {
1393 int detId = (*recHitItr).cscDetId().rawId();
1396 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1398 if (mapItr !=
theMap.end()) {
1399 simHits = mapItr->second;
1402 if (simHits.size() == 1) {
1415 eventout +=
"\n Number of CSCRecHits collected:........... ";
1422 std::map<double, int> mapsim, maprec;
1423 std::map<int, double> nmapsim, nmaprec;
1429 <<
"Unable to find RPCMuonGeometryRecord in event!";
1435 bool validrpcsim =
true;
1438 <<
"Unable to find RPCSimHit in event!";
1439 validrpcsim =
false;
1444 bool validrpc =
true;
1447 <<
"Unable to find RPCRecHit in event!";
1455 for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1457 const RPCRoll *roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(Rid));
1462 "\n Number of RPCRecHits collected:........... ";
1471 LocalPoint rhitlocal = (*recIt).localPosition();
1472 double rhitlocalx = rhitlocal.
x();
1473 maprec[rhitlocalx] = nrec;
1477 for (std::map<double,int>::iterator iter = maprec.begin();
1478 iter != maprec.end(); ++iter) {
1480 nmaprec[
i] = (*iter).first;
1485 edm::PSimHitContainer::const_iterator simIt;
1486 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1487 int ptype = (*simIt).particleType();
1488 if (ptype == 13 || ptype == -13) {
1490 LocalPoint shitlocal = (*simIt).localPosition();
1491 double shitlocalx = shitlocal.
x();
1492 mapsim[shitlocalx] = nsim;
1497 for (std::map<double,int>::iterator iter = mapsim.begin();
1498 iter != mapsim.end(); ++iter) {
1500 nmapsim[
i] = (*iter).first;
1505 for (
int r = 0;
r < nsim;
r++) {
1512 eventout +=
"\n Number of RPCRecHits collected:........... ";
1525 std::pair<LocalPoint,LocalVector>
1533 LocalPoint localHit = plane.toLocal(globalpos);
1540 float scale = -localHit.
z() / dir.
z();
1552 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
1556 std::map<DTWireId, std::vector<DTRecHit1DPair> >
1559 std::map<DTWireId, std::vector<DTRecHit1DPair> >
ret;
1562 rechit != dt1DRecHitPairs->end(); rechit++) {
1563 ret[(*rechit).wireId()].push_back(*rechit);
1576 float xEntry = entryP.
x()-xwire;
1577 float xExit = exitP.
x()-xwire;
1580 return fabs(xEntry - (entryP.
z()*(xExit-xEntry))/(exitP.
z()-entryP.
z()));
1584 template <
typename type>
1588 const std::vector<type>& recHits,
1589 const float simHitDist) {
1591 const type* theBestRecHit = 0;
1593 for(
typename std::vector<type>::const_iterator recHit = recHits.begin();
1594 recHit != recHits.end();
1597 if(fabs(distTmp-simHitDist) < res) {
1598 res = fabs(distTmp-simHitDist);
1599 theBestRecHit = &(*recHit);
1603 return theBestRecHit;
1623 template <
typename type>
1631 std::map<DTWireId, std::vector<PSimHit> > simHitsPerWire = _simHitsPerWire;
1632 std::map<DTWireId, std::vector<type> > recHitsPerWire = _recHitsPerWire;
1635 for(
std::map<
DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
1636 simHitsPerWire.begin();
1637 wireAndSHits != simHitsPerWire.end();
1639 DTWireId wireId = (*wireAndSHits).first;
1640 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
1654 if(simHitWireDist>2.1) {
1659 if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
1663 std::vector<type> recHits = recHitsPerWire[wireId];
1666 const type* theBestRecHit =
void getManyByType(std::vector< Handle< PROD > > &results) const
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
EventNumber_t event() const
GlobalRecHitsAnalyzer(const edm::ParameterSet &)
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
MonitorElement * mehCSCResRDPhi
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
std::vector< PCaloHit > PCaloHitContainer
unsigned int tibLayer(const DetId &id) const
virtual float stripAngle(float strip) const =0
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
static const int sdHcalOut
std::vector< PSimHit > matched
MonitorElement * mehDtMuonn
MonitorElement * mehHcalRes[4]
unsigned int pxfDisk(const DetId &id) const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Sin< T >::type sin(const T &t)
void fillMuon(const edm::Event &, const edm::EventSetup &)
Geom::Phi< T > phi() const
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.
edm::InputTag ECalUncalEBSrc_
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
unsigned int tidWheel(const DetId &id) const
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
edm::InputTag ECalUncalEESrc_
MonitorElement * mehEcalRes[3]
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
MonitorElement * mehSiStripn[19]
static int position[TOTALCHAMBERS][3]
edm::InputTag SiStripSrc_
virtual float strip(const LocalPoint &) const =0
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
uint32_t rawId() const
get the raw id
std::map< int, edm::PSimHitContainer > theMap
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
C::const_iterator const_iterator
constant access iterator type
const DTTopology & specificTopology() const
Local3DPoint exitPoint() const
Exit point in the local Det frame.
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.
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit > > &simHitsPerWire, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * mehSiPixelResX[7]
Cos< T >::type cos(const T &t)
MonitorElement * mehRPCResX
MonitorElement * mehEcaln[3]
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
void setVerbose(unsigned level)
MonitorElement * mehSiPixelResY[7]
MonitorElement * mehSiStripResY[19]
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
unsigned int pxbLayer(const DetId &id) const
const_iterator end() const
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
int wire() const
Return the wire number.
edm::InputTag MuRPCSimSrc_
T const * product() const
MonitorElement * mehSiPixeln[7]
static const int sdHcalFwd
T const * product() const
std::map< uint32_t, float, std::less< uint32_t > > MapType
static const int sdHcalBrl
void fillTrk(const edm::Event &, const edm::EventSetup &)
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
MonitorElement * mehHcaln[4]
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
void fillECal(const edm::Event &, const edm::EventSetup &)
unsigned int pxfSide(const DetId &id) const
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
virtual ~GlobalRecHitsAnalyzer()
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
void showDirStructure(void) const
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
unsigned int tecWheel(const DetId &id) const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * mehDtMuonRes
MonitorElement * mehSiStripResX[19]
Local3DPoint entryPoint() const
Entry point in the local Det frame.
static const int sdHcalEC
const CSCChamber * chamber() const
void setCurrentFolder(const std::string &fullpath)
const GeomDetUnit * stereoDet() const
const_iterator begin() const
unsigned int tobLayer(const DetId &id) const
virtual LocalPoint localPosition() const
edm::InputTag MuDTSimSrc_
void fillHCal(const edm::Event &, const edm::EventSetup &)
DTWireId wireId() const
Return the wireId.