20 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_GlobalRecHitsAnalyzer";
29 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
31 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
61 <<
"\n===============================\n"
62 <<
"Initialized as EDProducer with parameter values:\n"
63 <<
" Name = " <<
fName <<
"\n"
64 <<
" Verbosity = " << verbosity <<
"\n"
65 <<
" Frequency = " << frequency <<
"\n"
66 <<
" GetProv = " << getAllProvenances <<
"\n"
67 <<
" PrintProv = " << printProvenanceInfo <<
"\n"
68 <<
" ECalEBSrc = " << ECalEBSrc_.label()
69 <<
":" << ECalEBSrc_.instance() <<
"\n"
70 <<
" ECalUncalEBSrc = " << ECalUncalEBSrc_.
label()
71 <<
":" << ECalUncalEBSrc_.
instance() <<
"\n"
72 <<
" ECalEESrc = " << ECalEESrc_.
label()
73 <<
":" << ECalUncalEESrc_.
instance() <<
"\n"
74 <<
" ECalUncalEESrc = " << ECalUncalEESrc_.
label()
75 <<
":" << ECalEESrc_.
instance() <<
"\n"
76 <<
" ECalESSrc = " << ECalESSrc_.
label()
77 <<
":" << ECalESSrc_.
instance() <<
"\n"
78 <<
" HCalSrc = " << HCalSrc_.
label()
79 <<
":" << HCalSrc_.
instance() <<
"\n"
80 <<
" SiStripSrc = " << SiStripSrc_.
label()
81 <<
":" << SiStripSrc_.
instance() <<
"\n"
82 <<
" SiPixelSrc = " << SiPxlSrc_.
label()
83 <<
":" << SiPxlSrc_.
instance() <<
"\n"
84 <<
" MuDTSrc = " << MuDTSrc_.
label()
85 <<
":" << MuDTSrc_.
instance() <<
"\n"
86 <<
" MuDTSimSrc = " << MuDTSimSrc_.
label()
87 <<
":" << MuDTSimSrc_.
instance() <<
"\n"
88 <<
" MuCSCSrc = " << MuCSCSrc_.
label()
89 <<
":" << MuCSCSrc_.
instance() <<
"\n"
90 <<
" MuRPCSrc = " << MuRPCSrc_.
label()
91 <<
":" << MuRPCSrc_.
instance() <<
"\n"
92 <<
" MuRPCSimSrc = " << MuRPCSimSrc_.
label()
93 <<
":" << MuRPCSimSrc_.
instance() <<
"\n"
94 <<
"===============================\n";
101 if (verbosity > 0 ) {
115 string SiStripString[19] = {
"TECW1",
"TECW2",
"TECW3",
"TECW4",
"TECW5",
116 "TECW6",
"TECW7",
"TECW8",
"TIBL1",
"TIBL2",
117 "TIBL3",
"TIBL4",
"TIDW1",
"TIDW2",
"TIDW3",
118 "TOBL1",
"TOBL2",
"TOBL3",
"TOBL4"};
119 for(
int i = 0;
i<19; ++
i) {
124 string hcharname, hchartitle;
126 for(
int amend = 0; amend < 19; ++amend) {
127 hcharname =
"hSiStripn_"+SiStripString[amend];
128 hchartitle= SiStripString[amend]+
" rechits";
131 SiStripString[amend],1);
133 hcharname =
"hSiStripResX_"+SiStripString[amend];
134 hchartitle= SiStripString[amend]+
" rechit x resolution";
137 +SiStripString[amend],1);
139 hcharname =
"hSiStripResY_"+SiStripString[amend];
140 hchartitle= SiStripString[amend]+
" rechit y resolution";
143 SiStripString[amend],1);
150 string HCalString[4]={
"HB",
"HE",
"HF",
"HO"};
151 float HCalnUpper[4]={3000.,3000.,3000.,3000.};
152 float HCalnLower[4]={0.,0.,0.,0.};
153 for(
int j =0;
j <4; ++
j) {
159 for(
int amend = 0; amend < 4; ++amend) {
160 hcharname =
"hHcaln_"+HCalString[amend];
161 hchartitle= HCalString[amend]+
" rechits";
166 hcharname =
"hHcalRes_"+HCalString[amend];
167 hchartitle= HCalString[amend]+
" rechit resolution";
175 string ECalString[3] = {
"EB",
"EE",
"ES"};
176 int ECalnBins[3] = {1000,3000,150};
177 float ECalnUpper[3] = {20000., 62000., 3000.};
178 float ECalnLower[3] = {0., 0., 0.};
179 int ECalResBins[3] = {200,200,200};
180 float ECalResUpper[3] = {1., 0.3, .0002};
181 float ECalResLower[3] = {-1., -0.3, -.0002};
182 for(
int i =0;
i<3; ++
i) {
188 for(
int amend = 0; amend < 3; ++amend) {
189 hcharname =
"hEcaln_"+ECalString[amend];
190 hchartitle= ECalString[amend]+
" rechits";
192 ECalnLower[amend], ECalnUpper[amend]);
195 hcharname =
"hEcalRes_"+ECalString[amend];
196 hchartitle= ECalString[amend]+
" rechit resolution";
199 ECalResUpper[amend]);
205 string SiPixelString[7] = {
"BRL1",
"BRL2",
"BRL3",
"FWD1n",
"FWD1p",
207 for(
int j =0;
j<7; ++
j) {
214 for(
int amend = 0; amend < 7; ++amend) {
215 hcharname =
"hSiPixeln_"+SiPixelString[amend];
216 hchartitle= SiPixelString[amend]+
" rechits";
219 SiPixelString[amend],1);
221 hcharname =
"hSiPixelResX_"+SiPixelString[amend];
222 hchartitle= SiPixelString[amend]+
" rechit x resolution";
225 SiPixelString[amend],1);
227 hcharname =
"hSiPixelResY_"+SiPixelString[amend];
228 hchartitle= SiPixelString[amend]+
" rechit y resolution";
232 SiPixelString[amend],1);
243 string n_List[3] = {
"hDtMuonn",
"hCSCn",
"hRPCn"};
244 string hist_string[3] = {
"Dt",
"CSC",
"RPC"};
246 for(
int amend=0; amend<3; ++amend) {
247 hchartitle = hist_string[amend]+
" rechits";
269 hcharname =
"hDtMuonRes";
270 hchartitle =
"DT wire distance resolution";
272 hcharname =
"CSCResRDPhi";
273 hchartitle =
"CSC perp*dphi resolution";
275 hcharname =
"hRPCResX";
276 hchartitle =
"RPC rechits x resolution";
290 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_endJob";
293 <<
"Terminating having processed " <<
count <<
" events.";
300 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_analyze";
306 int nrun = iEvent.
id().
run();
311 <<
"Processing run " << nrun <<
", event " << nevt
312 <<
" (" <<
count <<
" events total)";
316 <<
"Processing run " << nrun <<
", event " << nevt
317 <<
" (" <<
count <<
" events total)";
324 std::vector<const edm::Provenance*> AllProv;
329 <<
"Number of Provenances = " << AllProv.size();
332 TString eventout(
"\nProvenance info:\n");
334 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
335 eventout +=
"\n ******************************";
336 eventout +=
"\n Module : ";
337 eventout += AllProv[
i]->moduleLabel();
338 eventout +=
"\n ProductID : ";
339 eventout += AllProv[
i]->productID().id();
340 eventout +=
"\n ClassName : ";
341 eventout += AllProv[
i]->className();
342 eventout +=
"\n InstanceName : ";
343 eventout += AllProv[
i]->productInstanceName();
344 eventout +=
"\n BranchName : ";
345 eventout += AllProv[
i]->branchName();
347 eventout +=
"\n ******************************\n";
366 <<
"Done gathering data from event.";
374 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillECal";
378 eventout =
"\nGathering info:";
388 bool validUncalibRecHitEB =
true;
389 if (!EcalUncalibRecHitEB.
isValid()) {
391 <<
"Unable to find EcalUncalRecHitEB in event!";
392 validUncalibRecHitEB =
false;
397 bool validRecHitEB =
true;
400 <<
"Unable to find EcalRecHitEB in event!";
401 validRecHitEB =
false;
405 const std::string barrelHitsName(
hitsProducer+
"EcalHitsEB");
406 iEvent.
getByLabel(
"mix",barrelHitsName,crossingFrame);
407 bool validXFrame =
true;
408 if (!crossingFrame.
isValid()) {
410 <<
"Unable to find cal barrel crossingFrame in event!";
416 std::auto_ptr<MixCollection<PCaloHit> >
421 = barrelHits->begin();
422 hitItr != barrelHits->end();
427 uint32_t crystid = ebid.
rawId();
428 ebSimMap[crystid] += hitItr->energy();
434 if (validUncalibRecHitEB && validRecHitEB) {
440 EBUncalibRecHit->
begin();
441 uncalibRecHit != EBUncalibRecHit->
end();
448 if (myRecHit != EBRecHit->
end()) {
455 eventout +=
"\n Number of EBRecHits collected:............ ";
456 eventout += nEBRecHits;
466 bool validuncalibRecHitEE =
true;
467 if (!EcalUncalibRecHitEE.
isValid()) {
469 <<
"Unable to find EcalUncalRecHitEE in event!";
470 validuncalibRecHitEE =
false;
475 bool validRecHitEE =
true;
478 <<
"Unable to find EcalRecHitEE in event!";
479 validRecHitEE =
false;
483 const std::string endcapHitsName(
hitsProducer+
"EcalHitsEE");
484 iEvent.
getByLabel(
"mix",endcapHitsName,crossingFrame);
486 if (!crossingFrame.
isValid()) {
488 <<
"Unable to find cal endcap crossingFrame in event!";
494 std::auto_ptr<MixCollection<PCaloHit> >
499 = endcapHits->begin();
500 hitItr != endcapHits->end();
505 uint32_t crystid = eeid.
rawId();
506 eeSimMap[crystid] += hitItr->energy();
511 if (validuncalibRecHitEE && validRecHitEE) {
518 EEUncalibRecHit->
begin();
519 uncalibRecHit != EEUncalibRecHit->
end();
526 if (myRecHit != EERecHit->
end()) {
533 eventout +=
"\n Number of EERecHits collected:............ ";
534 eventout += nEERecHits;
544 bool validRecHitES =
true;
547 <<
"Unable to find EcalRecHitES in event!";
548 validRecHitES =
false;
552 const std::string preshowerHitsName(
hitsProducer+
"EcalHitsES");
553 iEvent.
getByLabel(
"mix",preshowerHitsName,crossingFrame);
555 if (!crossingFrame.
isValid()) {
557 <<
"Unable to find cal preshower crossingFrame in event!";
563 std::auto_ptr<MixCollection<PCaloHit> >
568 = preshowerHits->begin();
569 hitItr != preshowerHits->end();
574 uint32_t crystid = esid.
rawId();
575 esSimMap[crystid] += hitItr->energy();
585 recHit != ESRecHit->
end();
595 eventout +=
"\n Number of ESRecHits collected:............ ";
596 eventout += nESRecHits;
610 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillHCal";
614 eventout =
"\nGathering info:";
621 <<
"Unable to find CaloGeometry in event!";
626 edm::PCaloHitContainer::const_iterator itHit;
633 bool validhcalHits =
true;
636 <<
"Unable to find hcalHits in event!";
637 validhcalHits =
false;
647 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
648 simhits != simhitResult->end();
652 uint32_t cellid = detId.
rawId();
655 fHBEnergySimHits[cellid] += simhits->energy();
658 fHEEnergySimHits[cellid] += simhits->energy();
661 fHOEnergySimHits[cellid] += simhits->energy();
664 fHFEnergySimHits[cellid] += simhits->energy();
670 Double_t maxHBEnergy = 0.;
671 Double_t maxHEEnergy = 0.;
672 Double_t maxHFEnergy = 0.;
674 Double_t maxHBPhi = -1000.;
675 Double_t maxHEPhi = -1000.;
676 Double_t maxHOPhi = -1000.;
677 Double_t maxHFPhi = -1000.;
680 Double_t
PI = 3.141592653589;
685 std::vector<edm::Handle<HBHERecHitCollection> > hbhe;
687 bool validHBHE =
true;
688 if (!hbhe[0].isValid()) {
690 <<
"Unable to find any HBHERecHitCollections in event!";
695 std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
699 for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
703 jhbhe != (*ihbhe)->end(); ++jhbhe) {
710 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
712 if ( (jhbhe->energy()) > maxHBEnergy ) {
713 maxHBEnergy = jhbhe->energy();
722 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
724 if ( (jhbhe->energy()) > maxHEEnergy ) {
725 maxHEEnergy = jhbhe->energy();
732 jhbhe != (*ihbhe)->end(); ++jhbhe) {
741 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
744 float deltaphi = maxHBPhi - fPhi;
745 if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
746 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
749 fHBEnergySimHits[cell.rawId()]);
757 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
760 float deltaphi = maxHEPhi - fPhi;
761 if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
762 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
764 fHEEnergySimHits[cell.rawId()]);
771 eventout +=
"\n Number of HBRecHits collected:............ ";
776 eventout +=
"\n Number of HERecHits collected:............ ";
786 std::vector<edm::Handle<HFRecHitCollection> > hf;
789 if (!hf[0].isValid()) {
791 <<
"Unable to find any HFRecHitCollections in event!";
795 std::vector<edm::Handle<HFRecHitCollection> >::iterator
ihf;
798 for (ihf = hf.begin(); ihf != hf.end(); ++
ihf) {
802 jhf != (*ihf)->end(); ++jhf) {
809 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
811 if ( (jhf->energy()) > maxHFEnergy ) {
812 maxHFEnergy = jhf->energy();
819 jhf != (*ihf)->end(); ++jhf) {
828 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
831 float deltaphi = maxHBPhi - fPhi;
832 if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
833 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
835 mehHcalRes[2]->
Fill(jhf->energy()-fHFEnergySimHits[cell.rawId()]);
841 eventout +=
"\n Number of HFDigis collected:.............. ";
850 std::vector<edm::Handle<HORecHitCollection> > ho;
853 if (!ho[0].isValid()) {
855 <<
"Unable to find any HORecHitCollections in event!";
860 std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
863 for (iho = ho.begin(); iho != ho.end(); ++iho) {
866 jho != (*iho)->end(); ++jho) {
875 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
878 float deltaphi = maxHOPhi - fPhi;
879 if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
880 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
881 mehHcalRes[3]->
Fill(jho->energy()-fHOEnergySimHits[cell.rawId()]);
887 eventout +=
"\n Number of HODigis collected:.............. ";
902 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillTrk";
906 eventout =
"\nGathering info:";
911 bool validstrip =
true;
912 if (!rechitsmatched.
isValid()) {
914 <<
"Unable to find stripmatchedrechits in event!";
924 <<
"Unable to find TrackerDigiGeometry in event!";
930 int nStripBrl = 0, nStripFwd = 0;
933 for (TrackerGeometry::DetContainer::const_iterator it =
935 it != pDD->dets().end(); ++it) {
937 uint32_t myid = ((*it)->geographicalId()).rawId();
943 if (rechitmatchedMatch != rechitsmatched->end()) {
949 for ( itermatched = rechitmatchedRangeIteratorBegin;
950 itermatched != rechitmatchedRangeIteratorEnd;
953 SiStripMatchedRecHit2D
const rechit = *itermatched;
956 float mindist = 999999.;
957 float distx = 999999.;
958 float disty = 999999.;
959 float dist = 999999.;
960 std::pair<LocalPoint,LocalVector> closestPair;
963 float rechitmatchedx = position.
x();
964 float rechitmatchedy = position.
y();
974 std::pair<LocalPoint,LocalVector> hitPair;
976 for(std::vector<PSimHit>::const_iterator
m =
matched.begin();
980 distx = fabs(rechitmatchedx - hitPair.first.x());
981 disty = fabs(rechitmatchedy - hitPair.first.y());
982 dist =
sqrt(distx*distx+disty*disty);
986 closestPair = hitPair;
996 if (tibid.
layer() == 1) {
1000 if (tibid.
layer() == 2) {
1004 if (tibid.
layer() == 3) {
1009 if (tibid.
layer() == 4) {
1021 if (tobid.
layer() == 1) {
1025 if (tobid.
layer() == 2) {
1029 if (tobid.
layer() == 3) {
1033 if (tobid.
layer() == 4) {
1045 if (tidid.
wheel() == 1) {
1049 if (tidid.
wheel() == 2) {
1053 if (tidid.
wheel() == 3) {
1065 if (tecid.
wheel() == 1) {
1069 if (tecid.
wheel() == 2) {
1073 if (tecid.
wheel() == 3) {
1077 if (tecid.
wheel() == 4) {
1082 if (tecid.
wheel() == 5) {
1086 if (tecid.
wheel() == 6) {
1090 if (tecid.
wheel() == 7) {
1094 if (tecid.
wheel() == 8) {
1106 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1107 eventout += nStripBrl;
1110 for(
int i =8;
i<12; ++
i)
1112 for(
int i =16;
i<19; ++
i)
1116 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1117 eventout += nStripFwd;
1119 for(
int i =0;
i<8; ++
i)
1121 for(
int i =12;
i<16; ++
i)
1129 bool validpixel =
true;
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 =
1149 geom->dets().begin();
1150 it != geom->dets().end(); ++it) {
1152 uint32_t myid = ((*it)->geographicalId()).rawId();
1153 DetId detId = ((*it)->geographicalId());
1159 if (pixeldet == recHitColl->end())
continue;
1169 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1174 if ( !matched.empty() ) {
1176 float closest = 9999.9;
1178 float rechit_x = lp.
x();
1179 float rechit_y = lp.
y();
1185 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
1186 m != matched.end(); ++
m) {
1188 float sim_x1 = (*m).entryPoint().x();
1189 float sim_x2 = (*m).exitPoint().x();
1190 float sim_xpos = 0.5*(sim_x1+sim_x2);
1192 float sim_y1 = (*m).entryPoint().y();
1193 float sim_y2 = (*m).exitPoint().y();
1194 float sim_ypos = 0.5*(sim_y1+sim_y2);
1196 float x_res = fabs(sim_xpos - rechit_x);
1197 float y_res = fabs(sim_ypos - rechit_y);
1199 float dist =
sqrt(x_res*x_res + y_res*y_res);
1201 if ( dist < closest ) {
1213 if (bdetid.
layer() == 1) {
1218 if (bdetid.
layer() == 2) {
1222 if (bdetid.
layer() == 3) {
1233 if (fdetid.
disk() == 1) {
1234 if (fdetid.
side() == 1) {
1238 if (fdetid.
side() == 2) {
1243 if (fdetid.
disk() == 2) {
1244 if (fdetid.
side() == 1) {
1248 if (fdetid.
side() == 2) {
1260 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1261 eventout += nPxlBrl;
1263 for(
int i=0;
i<3; ++
i) {
1268 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1269 eventout += nPxlFwd;
1272 for(
int i=3;
i<7; ++
i) {
1286 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillMuon";
1290 eventout =
"\nGathering info:";
1297 <<
"Unable to find DTMuonGeometryRecord in event!";
1303 bool validdtsim =
true;
1306 <<
"Unable to find dtsimHits in event!";
1312 bool validdtrec =
true;
1315 <<
"Unable to find dtRecHits in event!";
1319 if (validdtsim && validdtrec) {
1321 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1324 std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1327 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1330 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1342 bool validXFrame =
true;
1345 <<
"Unable to find muo CSC crossingFrame in event!";
1346 validXFrame =
false;
1353 hitItr !=
simHits.end(); ++hitItr) {
1354 theMap[hitItr->detUnitId()].push_back(*hitItr);
1363 <<
"Unable to find CSCMuonGeometryRecord in event!";
1371 bool validCSC =
true;
1374 <<
"Unable to find CSC RecHits in event!";
1383 recHitItr != cscRecHits->end(); ++recHitItr) {
1385 int detId = (*recHitItr).cscDetId().rawId();
1388 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1390 if (mapItr !=
theMap.end()) {
1391 simHits = mapItr->second;
1394 if (simHits.size() == 1) {
1407 eventout +=
"\n Number of CSCRecHits collected:........... ";
1414 std::map<double, int> mapsim, maprec;
1415 std::map<int, double> nmapsim, nmaprec;
1421 <<
"Unable to find RPCMuonGeometryRecord in event!";
1427 bool validrpcsim =
true;
1430 <<
"Unable to find RPCSimHit in event!";
1431 validrpcsim =
false;
1436 bool validrpc =
true;
1439 <<
"Unable to find RPCRecHit in event!";
1447 for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1449 const RPCRoll *roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(Rid));
1454 "\n Number of RPCRecHits collected:........... ";
1463 LocalPoint rhitlocal = (*recIt).localPosition();
1464 double rhitlocalx = rhitlocal.
x();
1465 maprec[rhitlocalx] = nrec;
1469 for (std::map<double,int>::iterator iter = maprec.begin();
1470 iter != maprec.end(); ++iter) {
1472 nmaprec[
i] = (*iter).first;
1477 edm::PSimHitContainer::const_iterator simIt;
1478 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1479 int ptype = (*simIt).particleType();
1480 if (ptype == 13 || ptype == -13) {
1482 LocalPoint shitlocal = (*simIt).localPosition();
1483 double shitlocalx = shitlocal.
x();
1484 mapsim[shitlocalx] = nsim;
1489 for (std::map<double,int>::iterator iter = mapsim.begin();
1490 iter != mapsim.end(); ++iter) {
1492 nmapsim[
i] = (*iter).first;
1497 for (
int r = 0;
r < nsim;
r++) {
1504 eventout +=
"\n Number of RPCRecHits collected:........... ";
1517 std::pair<LocalPoint,LocalVector>
1532 float scale = -localHit.
z() / dir.
z();
1544 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
1548 std::map<DTWireId, std::vector<DTRecHit1DPair> >
1551 std::map<DTWireId, std::vector<DTRecHit1DPair> >
ret;
1554 rechit != dt1DRecHitPairs->end(); rechit++) {
1555 ret[(*rechit).wireId()].push_back(*rechit);
1568 float xEntry = entryP.
x()-xwire;
1569 float xExit = exitP.
x()-xwire;
1572 return fabs(xEntry - (entryP.
z()*(xExit-xEntry))/(exitP.
z()-entryP.
z()));
1576 template <
typename type>
1580 const std::vector<type>& recHits,
1581 const float simHitDist) {
1583 const type* theBestRecHit = 0;
1585 for(
typename std::vector<type>::const_iterator recHit = recHits.begin();
1586 recHit != recHits.end();
1589 if(fabs(distTmp-simHitDist) < res) {
1590 res = fabs(distTmp-simHitDist);
1591 theBestRecHit = &(*recHit);
1595 return theBestRecHit;
1615 template <
typename type>
1625 for(
std::map<
DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
1626 simHitsPerWire.begin();
1627 wireAndSHits != simHitsPerWire.end();
1629 DTWireId wireId = (*wireAndSHits).first;
1630 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
1644 if(simHitWireDist>2.1) {
1649 if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
1653 std::vector<type> recHits = recHitsPerWire[wireId];
1656 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 layer() const
layer id
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]
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)
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
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.
MonitorElement * mehSiStripn[19]
static int position[TOTALCHAMBERS][3]
unsigned int layer() const
layer id
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, std::map< DTWireId, std::vector< PSimHit > > simHitsPerWire, std::map< DTWireId, std::vector< type > > recHitsPerWire, int step)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
LocalPoint toLocal(const GlobalPoint &gp) const
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
unsigned int disk() const
disk id
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
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.
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
unsigned int wheel() const
wheel id
static const int sdHcalBrl
void fillTrk(const edm::Event &, const edm::EventSetup &)
unsigned int layer() const
layer id
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
MonitorElement * mehHcaln[4]
const BoundPlane & surface() const
The nominal surface of the GeomDet.
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
unsigned int side() const
positive or negative id
void fillECal(const edm::Event &, const edm::EventSetup &)
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
LocalPoint localPosition() 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
virtual LocalPoint localPosition() const
edm::InputTag MuDTSimSrc_
unsigned int wheel() const
wheel id
void fillHCal(const edm::Event &, const edm::EventSetup &)
DTWireId wireId() const
Return the wireId.