18 printProvenanceInfo(
false), trackerHitAssociatorConfig_(iPSet, consumesCollector()),
count(0)
20 consumesMany<edm::SortedCollection<HBHERecHit, edm::StrictWeakOrdering<HBHERecHit> > >();
21 consumesMany<edm::SortedCollection<HFRecHit, edm::StrictWeakOrdering<HFRecHit> > >();
22 consumesMany<edm::SortedCollection<HORecHit, edm::StrictWeakOrdering<HORecHit> > >();
23 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_GlobalRecHitsAnalyzer";
32 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
34 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
85 <<
"\n===============================\n"
86 <<
"Initialized as EDProducer with parameter values:\n"
87 <<
" Name = " <<
fName <<
"\n"
88 <<
" Verbosity = " << verbosity <<
"\n"
89 <<
" Frequency = " << frequency <<
"\n"
90 <<
" GetProv = " << getAllProvenances <<
"\n"
91 <<
" PrintProv = " << printProvenanceInfo <<
"\n"
92 <<
" ECalEBSrc = " << ECalEBSrc_.label()
93 <<
":" << ECalEBSrc_.instance() <<
"\n"
94 <<
" ECalUncalEBSrc = " << ECalUncalEBSrc_.
label()
95 <<
":" << ECalUncalEBSrc_.
instance() <<
"\n"
96 <<
" ECalEESrc = " << ECalEESrc_.
label()
97 <<
":" << ECalUncalEESrc_.
instance() <<
"\n"
98 <<
" ECalUncalEESrc = " << ECalUncalEESrc_.
label()
99 <<
":" << ECalEESrc_.
instance() <<
"\n"
100 <<
" ECalESSrc = " << ECalESSrc_.
label()
101 <<
":" << ECalESSrc_.
instance() <<
"\n"
102 <<
" HCalSrc = " << HCalSrc_.
label()
103 <<
":" << HCalSrc_.
instance() <<
"\n"
104 <<
" SiStripSrc = " << SiStripSrc_.
label()
105 <<
":" << SiStripSrc_.
instance() <<
"\n"
106 <<
" SiPixelSrc = " << SiPxlSrc_.
label()
107 <<
":" << SiPxlSrc_.
instance() <<
"\n"
108 <<
" MuDTSrc = " << MuDTSrc_.
label()
109 <<
":" << MuDTSrc_.
instance() <<
"\n"
110 <<
" MuDTSimSrc = " << MuDTSimSrc_.
label()
111 <<
":" << MuDTSimSrc_.
instance() <<
"\n"
112 <<
" MuCSCSrc = " << MuCSCSrc_.
label()
113 <<
":" << MuCSCSrc_.
instance() <<
"\n"
114 <<
" MuRPCSrc = " << MuRPCSrc_.
label()
115 <<
":" << MuRPCSrc_.
instance() <<
"\n"
116 <<
" MuRPCSimSrc = " << MuRPCSimSrc_.
label()
117 <<
":" << MuRPCSimSrc_.
instance() <<
"\n"
118 <<
"===============================\n";
126 string SiStripString[19] = {
"TECW1",
"TECW2",
"TECW3",
"TECW4",
"TECW5",
127 "TECW6",
"TECW7",
"TECW8",
"TIBL1",
"TIBL2",
128 "TIBL3",
"TIBL4",
"TIDW1",
"TIDW2",
"TIDW3",
129 "TOBL1",
"TOBL2",
"TOBL3",
"TOBL4"};
130 for(
int i = 0;
i<19; ++
i) {
135 string hcharname, hchartitle;
137 for(
int amend = 0; amend < 19; ++amend) {
138 hcharname =
"hSiStripn_"+SiStripString[amend];
139 hchartitle= SiStripString[amend]+
" rechits";
142 SiStripString[amend],1);
144 hcharname =
"hSiStripResX_"+SiStripString[amend];
145 hchartitle= SiStripString[amend]+
" rechit x resolution";
148 +SiStripString[amend],1);
150 hcharname =
"hSiStripResY_"+SiStripString[amend];
151 hchartitle= SiStripString[amend]+
" rechit y resolution";
154 SiStripString[amend],1);
161 string HCalString[4]={
"HB",
"HE",
"HF",
"HO"};
162 float HCalnUpper[4]={3000.,3000.,3000.,3000.};
163 float HCalnLower[4]={0.,0.,0.,0.};
164 for(
int j =0;
j <4; ++
j) {
170 for(
int amend = 0; amend < 4; ++amend) {
171 hcharname =
"hHcaln_"+HCalString[amend];
172 hchartitle= HCalString[amend]+
" rechits";
173 mehHcaln[amend] = iBooker.
book1D(hcharname,hchartitle, 1000, HCalnLower[amend],
177 hcharname =
"hHcalRes_"+HCalString[amend];
178 hchartitle= HCalString[amend]+
" rechit resolution";
186 string ECalString[3] = {
"EB",
"EE",
"ES"};
187 int ECalnBins[3] = {1000,3000,150};
188 float ECalnUpper[3] = {20000., 62000., 3000.};
189 float ECalnLower[3] = {0., 0., 0.};
190 int ECalResBins[3] = {200,200,200};
191 float ECalResUpper[3] = {1., 0.3, .0002};
192 float ECalResLower[3] = {-1., -0.3, -.0002};
193 for(
int i =0;
i<3; ++
i) {
199 for(
int amend = 0; amend < 3; ++amend) {
200 hcharname =
"hEcaln_"+ECalString[amend];
201 hchartitle= ECalString[amend]+
" rechits";
202 mehEcaln[amend] = iBooker.
book1D(hcharname,hchartitle, ECalnBins[amend],
203 ECalnLower[amend], ECalnUpper[amend]);
206 hcharname =
"hEcalRes_"+ECalString[amend];
207 hchartitle= ECalString[amend]+
" rechit resolution";
210 ECalResUpper[amend]);
216 string SiPixelString[7] = {
"BRL1",
"BRL2",
"BRL3",
"FWD1n",
"FWD1p",
218 for(
int j =0;
j<7; ++
j) {
225 for(
int amend = 0; amend < 7; ++amend) {
226 hcharname =
"hSiPixeln_"+SiPixelString[amend];
227 hchartitle= SiPixelString[amend]+
" rechits";
230 SiPixelString[amend],1);
232 hcharname =
"hSiPixelResX_"+SiPixelString[amend];
233 hchartitle= SiPixelString[amend]+
" rechit x resolution";
236 SiPixelString[amend],1);
238 hcharname =
"hSiPixelResY_"+SiPixelString[amend];
239 hchartitle= SiPixelString[amend]+
" rechit y resolution";
243 SiPixelString[amend],1);
254 string n_List[3] = {
"hDtMuonn",
"hCSCn",
"hRPCn"};
255 string hist_string[3] = {
"Dt",
"CSC",
"RPC"};
257 for(
int amend=0; amend<3; ++amend) {
258 hchartitle = hist_string[amend]+
" rechits";
265 mehCSCn=iBooker.
book1D(n_List[amend],hchartitle,50, 0., 500.);
270 mehRPCn=iBooker.
book1D(n_List[amend],hchartitle,50, 0., 500.);
280 hcharname =
"hDtMuonRes";
281 hchartitle =
"DT wire distance resolution";
283 hcharname =
"CSCResRDPhi";
284 hchartitle =
"CSC perp*dphi resolution";
286 hcharname =
"hRPCResX";
287 hchartitle =
"RPC rechits x resolution";
295 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_analyze";
306 <<
"Processing run " << nrun <<
", event " << nevt
307 <<
" (" <<
count <<
" events total)";
311 <<
"Processing run " << nrun <<
", event " << nevt
312 <<
" (" <<
count <<
" events total)";
319 std::vector<const edm::Provenance*> AllProv;
324 <<
"Number of Provenances = " << AllProv.size();
327 TString eventout(
"\nProvenance info:\n");
329 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
330 eventout +=
"\n ******************************";
331 eventout +=
"\n Module : ";
332 eventout += AllProv[
i]->moduleLabel();
333 eventout +=
"\n ProductID : ";
334 eventout += AllProv[
i]->productID().id();
335 eventout +=
"\n ClassName : ";
336 eventout += AllProv[
i]->className();
337 eventout +=
"\n InstanceName : ";
338 eventout += AllProv[
i]->productInstanceName();
339 eventout +=
"\n BranchName : ";
340 eventout += AllProv[
i]->branchName();
342 eventout +=
"\n ******************************\n";
361 <<
"Done gathering data from event.";
369 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillECal";
373 eventout =
"\nGathering info:";
383 bool validUncalibRecHitEB =
true;
384 if (!EcalUncalibRecHitEB.
isValid()) {
386 <<
"Unable to find EcalUncalRecHitEB in event!";
387 validUncalibRecHitEB =
false;
392 bool validRecHitEB =
true;
395 <<
"Unable to find EcalRecHitEB in event!";
396 validRecHitEB =
false;
401 bool validXFrame =
true;
402 if (!crossingFrame.
isValid()) {
404 <<
"Unable to find cal barrel crossingFrame in event!";
410 std::auto_ptr<MixCollection<PCaloHit> >
415 = barrelHits->begin();
416 hitItr != barrelHits->end();
421 uint32_t crystid = ebid.
rawId();
422 ebSimMap[crystid] += hitItr->energy();
428 if (validUncalibRecHitEB && validRecHitEB) {
434 EBUncalibRecHit->
begin();
435 uncalibRecHit != EBUncalibRecHit->
end();
442 if (myRecHit != EBRecHit->
end()) {
449 eventout +=
"\n Number of EBRecHits collected:............ ";
450 eventout += nEBRecHits;
460 bool validuncalibRecHitEE =
true;
461 if (!EcalUncalibRecHitEE.
isValid()) {
463 <<
"Unable to find EcalUncalRecHitEE in event!";
464 validuncalibRecHitEE =
false;
469 bool validRecHitEE =
true;
472 <<
"Unable to find EcalRecHitEE in event!";
473 validRecHitEE =
false;
479 if (!crossingFrame.
isValid()) {
481 <<
"Unable to find cal endcap crossingFrame in event!";
487 std::auto_ptr<MixCollection<PCaloHit> >
492 = endcapHits->begin();
493 hitItr != endcapHits->end();
498 uint32_t crystid = eeid.
rawId();
499 eeSimMap[crystid] += hitItr->energy();
504 if (validuncalibRecHitEE && validRecHitEE) {
511 EEUncalibRecHit->
begin();
512 uncalibRecHit != EEUncalibRecHit->
end();
519 if (myRecHit != EERecHit->
end()) {
526 eventout +=
"\n Number of EERecHits collected:............ ";
527 eventout += nEERecHits;
537 bool validRecHitES =
true;
540 <<
"Unable to find EcalRecHitES in event!";
541 validRecHitES =
false;
547 if (!crossingFrame.
isValid()) {
549 <<
"Unable to find cal preshower crossingFrame in event!";
555 std::auto_ptr<MixCollection<PCaloHit> >
560 = preshowerHits->begin();
561 hitItr != preshowerHits->end();
566 uint32_t crystid = esid.
rawId();
567 esSimMap[crystid] += hitItr->energy();
577 recHit != ESRecHit->
end();
587 eventout +=
"\n Number of ESRecHits collected:............ ";
588 eventout += nESRecHits;
602 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillHCal";
606 eventout =
"\nGathering info:";
613 <<
"Unable to find CaloGeometry in event!";
618 edm::PCaloHitContainer::const_iterator itHit;
625 bool validhcalHits =
true;
628 <<
"Unable to find hcalHits in event!";
629 validhcalHits =
false;
632 std::map<HcalDetId,float> fHBEnergySimHits;
633 std::map<HcalDetId,float> fHEEnergySimHits;
634 std::map<HcalDetId,float> fHOEnergySimHits;
635 std::map<HcalDetId,float> fHFEnergySimHits;
639 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
640 simhits != simhitResult->end();
646 fHBEnergySimHits[detId] += simhits->energy();
649 fHEEnergySimHits[detId] += simhits->energy();
652 fHOEnergySimHits[detId] += simhits->energy();
655 fHFEnergySimHits[detId] += simhits->energy();
661 Double_t maxHBEnergy = 0.;
662 Double_t maxHEEnergy = 0.;
663 Double_t maxHFEnergy = 0.;
665 Double_t maxHBPhi = -1000.;
666 Double_t maxHEPhi = -1000.;
667 Double_t maxHOPhi = -1000.;
668 Double_t maxHFPhi = -1000.;
671 Double_t
PI = 3.141592653589;
676 std::vector<edm::Handle<HBHERecHitCollection> > hbhe;
678 bool validHBHE =
true;
679 if (!hbhe[0].isValid()) {
681 <<
"Unable to find any HBHERecHitCollections in event!";
686 std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
690 for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
694 jhbhe != (*ihbhe)->end(); ++jhbhe) {
701 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
703 if ( (jhbhe->energy()) > maxHBEnergy ) {
704 maxHBEnergy = jhbhe->energy();
713 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
715 if ( (jhbhe->energy()) > maxHEEnergy ) {
716 maxHEEnergy = jhbhe->energy();
723 jhbhe != (*ihbhe)->end(); ++jhbhe) {
732 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
735 float deltaphi = maxHBPhi - fPhi;
736 if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
737 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
740 fHBEnergySimHits[cell]);
748 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
751 float deltaphi = maxHEPhi - fPhi;
752 if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
753 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
755 fHEEnergySimHits[cell]);
762 eventout +=
"\n Number of HBRecHits collected:............ ";
767 eventout +=
"\n Number of HERecHits collected:............ ";
777 std::vector<edm::Handle<HFRecHitCollection> > hf;
780 if (!hf[0].isValid()) {
782 <<
"Unable to find any HFRecHitCollections in event!";
786 std::vector<edm::Handle<HFRecHitCollection> >::iterator
ihf;
789 for (ihf = hf.begin(); ihf != hf.end(); ++
ihf) {
793 jhf != (*ihf)->end(); ++jhf) {
800 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
802 if ( (jhf->energy()) > maxHFEnergy ) {
803 maxHFEnergy = jhf->energy();
810 jhf != (*ihf)->end(); ++jhf) {
819 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
822 float deltaphi = maxHBPhi - fPhi;
823 if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
824 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
832 eventout +=
"\n Number of HFDigis collected:.............. ";
841 std::vector<edm::Handle<HORecHitCollection> > ho;
844 if (!ho[0].isValid()) {
846 <<
"Unable to find any HORecHitCollections in event!";
851 std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
854 for (iho = ho.begin(); iho != ho.end(); ++iho) {
857 jho != (*iho)->end(); ++jho) {
866 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
869 float deltaphi = maxHOPhi - fPhi;
870 if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
871 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
878 eventout +=
"\n Number of HODigis collected:.............. ";
899 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillTrk";
903 eventout =
"\nGathering info:";
908 bool validstrip =
true;
909 if (!rechitsmatched.
isValid()) {
911 <<
"Unable to find stripmatchedrechits in event!";
921 <<
"Unable to find TrackerDigiGeometry in event!";
927 int nStripBrl = 0, nStripFwd = 0;
930 for (TrackerGeometry::DetContainer::const_iterator it =
932 it != pDD->dets().end(); ++it) {
934 uint32_t myid = ((*it)->geographicalId()).rawId();
935 DetId detid = ((*it)->geographicalId());
940 if (rechitmatchedMatch != rechitsmatched->end()) {
946 for ( itermatched = rechitmatchedRangeIteratorBegin;
947 itermatched != rechitmatchedRangeIteratorEnd;
953 float mindist = 999999.;
954 float distx = 999999.;
955 float disty = 999999.;
956 float dist = 999999.;
957 std::pair<LocalPoint,LocalVector> closestPair;
960 float rechitmatchedx = position.
x();
961 float rechitmatchedy = position.
y();
971 std::pair<LocalPoint,LocalVector> hitPair;
973 for(std::vector<PSimHit>::const_iterator
m =
matched.begin();
977 distx = fabs(rechitmatchedx - hitPair.first.x());
978 disty = fabs(rechitmatchedy - hitPair.first.y());
979 dist =
sqrt(distx*distx+disty*disty);
983 closestPair = hitPair;
1103 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1104 eventout += nStripBrl;
1107 for(
int i =8;
i<12; ++
i)
1109 for(
int i =16;
i<19; ++
i)
1113 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1114 eventout += nStripFwd;
1116 for(
int i =0;
i<8; ++
i)
1118 for(
int i =12;
i<16; ++
i)
1126 bool validpixel =
true;
1129 <<
"Unable to find SiPixelRecHitCollection in event!";
1138 <<
"Unable to find TrackerDigiGeometry in event!";
1143 int nPxlBrl = 0, nPxlFwd = 0;
1145 for (TrackerGeometry::DetContainer::const_iterator it =
1146 geom->dets().begin();
1147 it != geom->dets().end(); ++it) {
1149 uint32_t myid = ((*it)->geographicalId()).rawId();
1150 DetId detId = ((*it)->geographicalId());
1156 if (pixeldet == recHitColl->end())
continue;
1166 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1171 if ( !matched.empty() ) {
1173 float closest = 9999.9;
1175 float rechit_x = lp.
x();
1176 float rechit_y = lp.
y();
1182 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
1183 m != matched.end(); ++
m) {
1185 float sim_x1 = (*m).entryPoint().x();
1186 float sim_x2 = (*m).exitPoint().x();
1187 float sim_xpos = 0.5*(sim_x1+sim_x2);
1189 float sim_y1 = (*m).entryPoint().y();
1190 float sim_y2 = (*m).exitPoint().y();
1191 float sim_ypos = 0.5*(sim_y1+sim_y2);
1193 float x_res = fabs(sim_xpos - rechit_x);
1194 float y_res = fabs(sim_ypos - rechit_y);
1196 float dist =
sqrt(x_res*x_res + y_res*y_res);
1198 if ( dist < closest ) {
1230 if (tTopo->
pxfDisk(myid) == 1) {
1231 if (tTopo->
pxfSide(myid) == 1) {
1235 if (tTopo->
pxfSide(myid) == 2) {
1240 if (tTopo->
pxfDisk(myid) == 2) {
1241 if (tTopo->
pxfSide(myid) == 1) {
1245 if (tTopo->
pxfSide(myid) == 2) {
1257 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1258 eventout += nPxlBrl;
1260 for(
int i=0;
i<3; ++
i) {
1265 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1266 eventout += nPxlFwd;
1269 for(
int i=3;
i<7; ++
i) {
1283 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillMuon";
1287 eventout =
"\nGathering info:";
1294 <<
"Unable to find DTMuonGeometryRecord in event!";
1300 bool validdtsim =
true;
1303 <<
"Unable to find dtsimHits in event!";
1309 bool validdtrec =
true;
1312 <<
"Unable to find dtRecHits in event!";
1316 if (validdtsim && validdtrec) {
1318 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1321 std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1324 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1327 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1339 bool validXFrame =
true;
1342 <<
"Unable to find muo CSC crossingFrame in event!";
1343 validXFrame =
false;
1350 hitItr !=
simHits.end(); ++hitItr) {
1351 theMap[hitItr->detUnitId()].push_back(*hitItr);
1360 <<
"Unable to find CSCMuonGeometryRecord in event!";
1368 bool validCSC =
true;
1371 <<
"Unable to find CSC RecHits in event!";
1380 recHitItr != cscRecHits->end(); ++recHitItr) {
1382 int detId = (*recHitItr).cscDetId().rawId();
1385 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1387 if (mapItr !=
theMap.end()) {
1388 simHits = mapItr->second;
1391 if (simHits.size() == 1) {
1404 eventout +=
"\n Number of CSCRecHits collected:........... ";
1411 std::map<double, int> mapsim, maprec;
1412 std::map<int, double> nmapsim, nmaprec;
1418 <<
"Unable to find RPCMuonGeometryRecord in event!";
1424 bool validrpcsim =
true;
1427 <<
"Unable to find RPCSimHit in event!";
1428 validrpcsim =
false;
1433 bool validrpc =
true;
1436 <<
"Unable to find RPCRecHit in event!";
1444 for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1446 const RPCRoll *roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(Rid));
1451 "\n Number of RPCRecHits collected:........... ";
1460 LocalPoint rhitlocal = (*recIt).localPosition();
1461 double rhitlocalx = rhitlocal.
x();
1462 maprec[rhitlocalx] = nrec;
1466 for (std::map<double,int>::iterator iter = maprec.begin();
1467 iter != maprec.end(); ++iter) {
1469 nmaprec[
i] = (*iter).first;
1474 edm::PSimHitContainer::const_iterator simIt;
1475 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1476 int ptype = (*simIt).particleType();
1477 if (ptype == 13 || ptype == -13) {
1479 LocalPoint shitlocal = (*simIt).localPosition();
1480 double shitlocalx = shitlocal.
x();
1481 mapsim[shitlocalx] = nsim;
1486 for (std::map<double,int>::iterator iter = mapsim.begin();
1487 iter != mapsim.end(); ++iter) {
1489 nmapsim[
i] = (*iter).first;
1494 for (
int r = 0;
r < nsim;
r++) {
1501 eventout +=
"\n Number of RPCRecHits collected:........... ";
1514 std::pair<LocalPoint,LocalVector>
1522 LocalPoint localHit = plane.toLocal(globalpos);
1529 float scale = -localHit.
z() / dir.
z();
1541 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
1545 std::map<DTWireId, std::vector<DTRecHit1DPair> >
1548 std::map<DTWireId, std::vector<DTRecHit1DPair> >
ret;
1551 rechit != dt1DRecHitPairs->end(); rechit++) {
1552 ret[(*rechit).wireId()].push_back(*rechit);
1565 float xEntry = entryP.
x()-xwire;
1566 float xExit = exitP.
x()-xwire;
1569 return fabs(xEntry - (entryP.
z()*(xExit-xEntry))/(exitP.
z()-entryP.
z()));
1573 template <
typename type>
1577 const std::vector<type>&
recHits,
1578 const float simHitDist) {
1580 const type* theBestRecHit = 0;
1582 for(
typename std::vector<type>::const_iterator recHit = recHits.begin();
1583 recHit != recHits.end();
1586 if(fabs(distTmp-simHitDist) < res) {
1587 res = fabs(distTmp-simHitDist);
1588 theBestRecHit = &(*recHit);
1592 return theBestRecHit;
1612 template <
typename type>
1614 const std::map<
DTWireId, std::vector<PSimHit> >&
1616 const std::map<
DTWireId, std::vector<type> >&
1620 std::map<DTWireId, std::vector<PSimHit> > simHitsPerWire = _simHitsPerWire;
1621 std::map<DTWireId, std::vector<type> > recHitsPerWire = _recHitsPerWire;
1624 for(std::map<
DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
1625 simHitsPerWire.begin();
1626 wireAndSHits != simHitsPerWire.end();
1628 DTWireId wireId = (*wireAndSHits).first;
1629 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
1643 if(simHitWireDist>2.1) {
1648 if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
1652 std::vector<type>
recHits = recHitsPerWire[wireId];
1655 const type* theBestRecHit =
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
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
tuple ret
prodAgent to be discontinued
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
edm::EDGetTokenT< EBRecHitCollection > ECalEBSrc_Token_
static const int sdHcalOut
std::vector< PSimHit > matched
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
MonitorElement * mehDtMuonn
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
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)
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
void fillMuon(const edm::Event &, const edm::EventSetup &)
Geom::Phi< T > phi() const
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.
edm::InputTag ECalUncalEBSrc_
unsigned long long EventNumber_t
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
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.
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
MonitorElement * mehSiStripn[19]
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)
const DTTopology & specificTopology() const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Local3DPoint exitPoint() const
Exit point in the local Det frame.
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
const CSCChamberSpecs * specs() const
static const int sdPxlBrl
Local3DPoint localPosition() const
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 &)
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
MonitorElement * mehSiPixelResX[7]
Cos< T >::type cos(const T &t)
MonitorElement * book1D(Args &&...args)
MonitorElement * mehRPCResX
MonitorElement * mehEcaln[3]
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
MonitorElement * mehSiPixelResY[7]
MonitorElement * mehSiStripResY[19]
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
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_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
void setCurrentFolder(const std::string &fullpath)
T const * product() const
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
T const * product() const
MonitorElement * mehSiPixeln[7]
static const int sdHcalFwd
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
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
iterator find(key_type k)
MonitorElement * mehHcaln[4]
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
static int position[264][3]
void fillECal(const edm::Event &, const edm::EventSetup &)
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
virtual ~GlobalRecHitsAnalyzer()
TrackerHitAssociator::Config trackerHitAssociatorConfig_
DetId geographicalId() const
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
volatile std::atomic< bool > shutdown_flag false
LocalPoint localPosition() 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)
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
MonitorElement * mehDtMuonRes
MonitorElement * mehSiStripResX[19]
Local3DPoint entryPoint() const
Entry point in the local Det frame.
static const int sdHcalEC
const CSCChamber * chamber() const
virtual LocalPoint localPosition() const final
const GeomDetUnit * stereoDet() const
const_iterator begin() const
unsigned int tobLayer(const DetId &id) const
virtual LocalPoint localPosition() const
edm::InputTag MuDTSimSrc_
const TrackerGeomDet * idToDet(DetId) const
void fillHCal(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< EERecHitCollection > ECalEESrc_Token_
DTWireId wireId() const
Return the wireId.
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_