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 ) {
118 string SiStripString[19] = {
"TECW1",
"TECW2",
"TECW3",
"TECW4",
"TECW5",
119 "TECW6",
"TECW7",
"TECW8",
"TIBL1",
"TIBL2",
120 "TIBL3",
"TIBL4",
"TIDW1",
"TIDW2",
"TIDW3",
121 "TOBL1",
"TOBL2",
"TOBL3",
"TOBL4"};
122 for(
int i = 0;
i<19; ++
i) {
127 string hcharname, hchartitle;
129 for(
int amend = 0; amend < 19; ++amend) {
130 hcharname =
"hSiStripn_"+SiStripString[amend];
131 hchartitle= SiStripString[amend]+
" rechits";
132 sprintf(hname, hcharname.c_str());
133 sprintf(htitle, hchartitle.c_str());
136 SiStripString[amend],1);
137 mehSiStripn[amend]->setAxisTitle(
"Count",2);
138 hcharname =
"hSiStripResX_"+SiStripString[amend];
139 hchartitle= SiStripString[amend]+
" rechit x resolution";
140 sprintf(hname, hcharname.c_str());
141 sprintf(htitle, hchartitle.c_str());
144 +SiStripString[amend],1);
145 mehSiStripResX[amend]->setAxisTitle(
"Count",2);
146 hcharname =
"hSiStripResY_"+SiStripString[amend];
147 hchartitle= SiStripString[amend]+
" rechit y resolution";
148 sprintf(hname, hcharname.c_str());
149 sprintf(htitle, hchartitle.c_str());
152 SiStripString[amend],1);
153 mehSiStripResY[amend]->setAxisTitle(
"Count",2);
159 string HCalString[4]={
"HB",
"HE",
"HF",
"HO"};
160 float HCalnUpper[4]={3000.,3000.,3000.,3000.};
161 float HCalnLower[4]={0.,0.,0.,0.};
162 for(
int j =0;
j <4; ++
j) {
168 for(
int amend = 0; amend < 4; ++amend) {
169 hcharname =
"hHcaln_"+HCalString[amend];
170 hchartitle= HCalString[amend]+
" rechits";
171 sprintf(hname, hcharname.c_str());
172 sprintf(htitle, hchartitle.c_str());
176 mehHcaln[amend]->setAxisTitle(
"Count",2);
177 hcharname =
"hHcalRes_"+HCalString[amend];
178 hchartitle= HCalString[amend]+
" rechit resolution";
179 sprintf(hname, hcharname.c_str());
180 sprintf(htitle, hchartitle.c_str());
182 mehHcalRes[amend]->
setAxisTitle(
"RecHit E - SimHit E",1);
183 mehHcalRes[amend]->setAxisTitle(
"Count",2);
188 string ECalString[3] = {
"EB",
"EE",
"ES"};
189 int ECalnBins[3] = {1000,3000,150};
190 float ECalnUpper[3] = {20000., 62000., 3000.};
191 float ECalnLower[3] = {0., 0., 0.};
192 int ECalResBins[3] = {200,200,200};
193 float ECalResUpper[3] = {1., 0.3, .0002};
194 float ECalResLower[3] = {-1., -0.3, -.0002};
195 for(
int i =0;
i<3; ++
i) {
201 for(
int amend = 0; amend < 3; ++amend) {
202 hcharname =
"hEcaln_"+ECalString[amend];
203 hchartitle= ECalString[amend]+
" rechits";
204 sprintf(hname, hcharname.c_str());
205 sprintf(htitle, hchartitle.c_str());
207 ECalnLower[amend], ECalnUpper[amend]);
209 mehEcaln[amend]->setAxisTitle(
"Count",2);
210 hcharname =
"hEcalRes_"+ECalString[amend];
211 hchartitle= ECalString[amend]+
" rechit resolution";
212 sprintf(hname, hcharname.c_str());
213 sprintf(htitle, hchartitle.c_str());
216 ECalResUpper[amend]);
217 mehEcalRes[amend]->
setAxisTitle(
"RecHit E - SimHit E",1);
218 mehEcalRes[amend]->setAxisTitle(
"Count",2);
222 string SiPixelString[7] = {
"BRL1",
"BRL2",
"BRL3",
"FWD1n",
"FWD1p",
224 for(
int j =0;
j<7; ++
j) {
231 for(
int amend = 0; amend < 7; ++amend) {
232 hcharname =
"hSiPixeln_"+SiPixelString[amend];
233 hchartitle= SiPixelString[amend]+
" rechits";
234 sprintf(hname, hcharname.c_str());
235 sprintf(htitle, hchartitle.c_str());
238 SiPixelString[amend],1);
239 mehSiPixeln[amend]->setAxisTitle(
"Count",2);
240 hcharname =
"hSiPixelResX_"+SiPixelString[amend];
241 hchartitle= SiPixelString[amend]+
" rechit x resolution";
242 sprintf(hname, hcharname.c_str());
243 sprintf(htitle, hchartitle.c_str());
246 SiPixelString[amend],1);
247 mehSiPixelResX[amend]->setAxisTitle(
"Count",2);
248 hcharname =
"hSiPixelResY_"+SiPixelString[amend];
249 hchartitle= SiPixelString[amend]+
" rechit y resolution";
251 sprintf(hname, hcharname.c_str());
252 sprintf(htitle, hchartitle.c_str());
255 SiPixelString[amend],1);
256 mehSiPixelResY[amend]->setAxisTitle(
"Count",2);
266 string n_List[3] = {
"hDtMuonn",
"hCSCn",
"hRPCn"};
267 string hist_string[3] = {
"Dt",
"CSC",
"RPC"};
269 for(
int amend=0; amend<3; ++amend) {
270 hchartitle = hist_string[amend]+
" rechits";
271 sprintf(hname, n_List[amend].c_str());
272 sprintf(htitle, hchartitle.c_str());
294 sprintf(hname,
"hDtMuonRes");
295 sprintf(htitle,
"DT wire distance resolution");
297 sprintf(hname,
"CSCResRDPhi");
298 sprintf(htitle,
"CSC perp*dphi resolution");
300 sprintf(hname,
"hRPCResX");
301 sprintf(htitle,
"RPC rechits x resolution");
315 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_endJob";
318 <<
"Terminating having processed " <<
count <<
" events.";
325 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_analyze";
331 int nrun = iEvent.
id().
run();
332 int nevt = iEvent.
id().
event();
336 <<
"Processing run " << nrun <<
", event " << nevt
337 <<
" (" <<
count <<
" events total)";
341 <<
"Processing run " << nrun <<
", event " << nevt
342 <<
" (" <<
count <<
" events total)";
349 std::vector<const edm::Provenance*> AllProv;
354 <<
"Number of Provenances = " << AllProv.size();
357 TString eventout(
"\nProvenance info:\n");
359 for (
unsigned int i = 0;
i < AllProv.size(); ++
i) {
360 eventout +=
"\n ******************************";
361 eventout +=
"\n Module : ";
362 eventout += AllProv[
i]->moduleLabel();
363 eventout +=
"\n ProductID : ";
364 eventout += AllProv[
i]->productID().id();
365 eventout +=
"\n ClassName : ";
366 eventout += AllProv[
i]->className();
367 eventout +=
"\n InstanceName : ";
368 eventout += AllProv[
i]->productInstanceName();
369 eventout +=
"\n BranchName : ";
370 eventout += AllProv[
i]->branchName();
372 eventout +=
"\n ******************************\n";
391 <<
"Done gathering data from event.";
399 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillECal";
403 eventout =
"\nGathering info:";
413 bool validUncalibRecHitEB =
true;
414 if (!EcalUncalibRecHitEB.
isValid()) {
416 <<
"Unable to find EcalUncalRecHitEB in event!";
417 validUncalibRecHitEB =
false;
422 bool validRecHitEB =
true;
425 <<
"Unable to find EcalRecHitEB in event!";
426 validRecHitEB =
false;
430 const std::string barrelHitsName(
hitsProducer+
"EcalHitsEB");
431 iEvent.
getByLabel(
"mix",barrelHitsName,crossingFrame);
432 bool validXFrame =
true;
433 if (!crossingFrame.
isValid()) {
435 <<
"Unable to find cal barrel crossingFrame in event!";
441 std::auto_ptr<MixCollection<PCaloHit> >
446 = barrelHits->begin();
447 hitItr != barrelHits->end();
452 uint32_t crystid = ebid.
rawId();
453 ebSimMap[crystid] += hitItr->energy();
459 if (validUncalibRecHitEB && validRecHitEB) {
465 EBUncalibRecHit->
begin();
466 uncalibRecHit != EBUncalibRecHit->
end();
473 if (myRecHit != EBRecHit->
end()) {
480 eventout +=
"\n Number of EBRecHits collected:............ ";
481 eventout += nEBRecHits;
491 bool validuncalibRecHitEE =
true;
492 if (!EcalUncalibRecHitEE.
isValid()) {
494 <<
"Unable to find EcalUncalRecHitEE in event!";
495 validuncalibRecHitEE =
false;
500 bool validRecHitEE =
true;
503 <<
"Unable to find EcalRecHitEE in event!";
504 validRecHitEE =
false;
508 const std::string endcapHitsName(
hitsProducer+
"EcalHitsEE");
509 iEvent.
getByLabel(
"mix",endcapHitsName,crossingFrame);
511 if (!crossingFrame.
isValid()) {
513 <<
"Unable to find cal endcap crossingFrame in event!";
519 std::auto_ptr<MixCollection<PCaloHit> >
524 = endcapHits->begin();
525 hitItr != endcapHits->end();
530 uint32_t crystid = eeid.
rawId();
531 eeSimMap[crystid] += hitItr->energy();
536 if (validuncalibRecHitEE && validRecHitEE) {
543 EEUncalibRecHit->
begin();
544 uncalibRecHit != EEUncalibRecHit->
end();
551 if (myRecHit != EERecHit->
end()) {
558 eventout +=
"\n Number of EERecHits collected:............ ";
559 eventout += nEERecHits;
569 bool validRecHitES =
true;
572 <<
"Unable to find EcalRecHitES in event!";
573 validRecHitES =
false;
577 const std::string preshowerHitsName(
hitsProducer+
"EcalHitsES");
578 iEvent.
getByLabel(
"mix",preshowerHitsName,crossingFrame);
580 if (!crossingFrame.
isValid()) {
582 <<
"Unable to find cal preshower crossingFrame in event!";
588 std::auto_ptr<MixCollection<PCaloHit> >
593 = preshowerHits->begin();
594 hitItr != preshowerHits->end();
599 uint32_t crystid = esid.
rawId();
600 esSimMap[crystid] += hitItr->energy();
610 recHit != ESRecHit->
end();
620 eventout +=
"\n Number of ESRecHits collected:............ ";
621 eventout += nESRecHits;
635 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillHCal";
639 eventout =
"\nGathering info:";
646 <<
"Unable to find CaloGeometry in event!";
651 edm::PCaloHitContainer::const_iterator itHit;
658 bool validhcalHits =
true;
661 <<
"Unable to find hcalHits in event!";
662 validhcalHits =
false;
672 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
673 simhits != simhitResult->end();
677 uint32_t cellid = detId.
rawId();
680 fHBEnergySimHits[cellid] += simhits->energy();
683 fHEEnergySimHits[cellid] += simhits->energy();
686 fHOEnergySimHits[cellid] += simhits->energy();
689 fHFEnergySimHits[cellid] += simhits->energy();
695 Double_t maxHBEnergy = 0.;
696 Double_t maxHEEnergy = 0.;
697 Double_t maxHOEnergy = 0.;
698 Double_t maxHFEnergy = 0.;
700 Double_t maxHBPhi = -1000.;
701 Double_t maxHEPhi = -1000.;
702 Double_t maxHOPhi = -1000.;
703 Double_t maxHFPhi = -1000.;
705 Double_t maxHBEta = -1000.;
706 Double_t maxHEEta = -1000.;
707 Double_t maxHOEta = -1000.;
709 Double_t
PI = 3.141592653589;
714 std::vector<edm::Handle<HBHERecHitCollection> > hbhe;
716 bool validHBHE =
true;
717 if (!hbhe[0].isValid()) {
719 <<
"Unable to find any HBHERecHitCollections in event!";
724 std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
728 for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
732 jhbhe != (*ihbhe)->end(); ++jhbhe) {
739 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
742 if ( (jhbhe->energy()) > maxHBEnergy ) {
743 maxHBEnergy = jhbhe->energy();
744 maxHOEnergy = maxHBEnergy;
755 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
758 if ( (jhbhe->energy()) > maxHEEnergy ) {
759 maxHEEnergy = jhbhe->energy();
767 jhbhe != (*ihbhe)->end(); ++jhbhe) {
776 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
779 float deltaphi = maxHBPhi - fPhi;
780 if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
781 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
784 fHBEnergySimHits[cell.rawId()]);
792 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
795 float deltaphi = maxHEPhi - fPhi;
796 if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
797 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
799 fHEEnergySimHits[cell.rawId()]);
806 eventout +=
"\n Number of HBRecHits collected:............ ";
811 eventout +=
"\n Number of HERecHits collected:............ ";
821 std::vector<edm::Handle<HFRecHitCollection> > hf;
824 if (!hf[0].isValid()) {
826 <<
"Unable to find any HFRecHitCollections in event!";
830 std::vector<edm::Handle<HFRecHitCollection> >::iterator ihf;
833 for (ihf = hf.begin(); ihf != hf.end(); ++ihf) {
837 jhf != (*ihf)->end(); ++jhf) {
844 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
846 if ( (jhf->energy()) > maxHFEnergy ) {
847 maxHFEnergy = jhf->energy();
854 jhf != (*ihf)->end(); ++jhf) {
863 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
866 float deltaphi = maxHBPhi - fPhi;
867 if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
868 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
870 mehHcalRes[2]->
Fill(jhf->energy()-fHFEnergySimHits[cell.rawId()]);
876 eventout +=
"\n Number of HFDigis collected:.............. ";
885 std::vector<edm::Handle<HORecHitCollection> > ho;
888 if (!ho[0].isValid()) {
890 <<
"Unable to find any HORecHitCollections in event!";
895 std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
898 for (iho = ho.begin(); iho != ho.end(); ++iho) {
901 jho != (*iho)->end(); ++jho) {
910 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
913 float deltaphi = maxHOPhi - fPhi;
914 if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
915 if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
916 mehHcalRes[3]->
Fill(jho->energy()-fHOEnergySimHits[cell.rawId()]);
922 eventout +=
"\n Number of HODigis collected:.............. ";
937 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillTrk";
941 eventout =
"\nGathering info:";
946 bool validstrip =
true;
947 if (!rechitsmatched.
isValid()) {
949 <<
"Unable to find stripmatchedrechits in event!";
959 <<
"Unable to find TrackerDigiGeometry in event!";
965 int nStripBrl = 0, nStripFwd = 0;
968 for (TrackerGeometry::DetContainer::const_iterator it =
970 it != pDD->dets().end(); ++it) {
972 uint32_t myid = ((*it)->geographicalId()).rawId();
978 if (rechitmatchedMatch != rechitsmatched->end()) {
984 for ( itermatched = rechitmatchedRangeIteratorBegin;
985 itermatched != rechitmatchedRangeIteratorEnd;
991 float mindist = 999999.;
992 float distx = 999999.;
993 float disty = 999999.;
994 float dist = 999999.;
995 std::pair<LocalPoint,LocalVector> closestPair;
998 float rechitmatchedx = position.
x();
999 float rechitmatchedy = position.
y();
1009 std::pair<LocalPoint,LocalVector> hitPair;
1011 for(std::vector<PSimHit>::const_iterator
m =
matched.begin();
1015 distx = fabs(rechitmatchedx - hitPair.first.x());
1016 disty = fabs(rechitmatchedy - hitPair.first.y());
1017 dist =
sqrt(distx*distx+disty*disty);
1021 closestPair = hitPair;
1031 if (tibid.
layer() == 1) {
1035 if (tibid.
layer() == 2) {
1039 if (tibid.
layer() == 3) {
1044 if (tibid.
layer() == 4) {
1056 if (tobid.
layer() == 1) {
1060 if (tobid.
layer() == 2) {
1064 if (tobid.
layer() == 3) {
1068 if (tobid.
layer() == 4) {
1080 if (tidid.
wheel() == 1) {
1084 if (tidid.
wheel() == 2) {
1088 if (tidid.
wheel() == 3) {
1100 if (tecid.
wheel() == 1) {
1104 if (tecid.
wheel() == 2) {
1108 if (tecid.
wheel() == 3) {
1112 if (tecid.
wheel() == 4) {
1117 if (tecid.
wheel() == 5) {
1121 if (tecid.
wheel() == 6) {
1125 if (tecid.
wheel() == 7) {
1129 if (tecid.
wheel() == 8) {
1141 eventout +=
"\n Number of BrlStripRecHits collected:...... ";
1142 eventout += nStripBrl;
1145 for(
int i =8;
i<12; ++
i)
1147 for(
int i =16;
i<19; ++
i)
1151 eventout +=
"\n Number of FrwdStripRecHits collected:..... ";
1152 eventout += nStripFwd;
1154 for(
int i =0;
i<8; ++
i)
1156 for(
int i =12;
i<16; ++
i)
1164 bool validpixel =
true;
1167 <<
"Unable to find SiPixelRecHitCollection in event!";
1176 <<
"Unable to find TrackerDigiGeometry in event!";
1181 int nPxlBrl = 0, nPxlFwd = 0;
1183 for (TrackerGeometry::DetContainer::const_iterator it =
1184 geom->dets().begin();
1185 it != geom->dets().end(); ++it) {
1187 uint32_t myid = ((*it)->geographicalId()).rawId();
1188 DetId detId = ((*it)->geographicalId());
1194 if (pixeldet == recHitColl->end())
continue;
1204 for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1209 if ( !matched.empty() ) {
1211 float closest = 9999.9;
1213 float rechit_x = lp.
x();
1214 float rechit_y = lp.
y();
1220 for (std::vector<PSimHit>::const_iterator
m = matched.begin();
1221 m != matched.end(); ++
m) {
1223 float sim_x1 = (*m).entryPoint().x();
1224 float sim_x2 = (*m).exitPoint().x();
1225 float sim_xpos = 0.5*(sim_x1+sim_x2);
1227 float sim_y1 = (*m).entryPoint().y();
1228 float sim_y2 = (*m).exitPoint().y();
1229 float sim_ypos = 0.5*(sim_y1+sim_y2);
1231 float x_res = fabs(sim_xpos - rechit_x);
1232 float y_res = fabs(sim_ypos - rechit_y);
1234 float dist =
sqrt(x_res*x_res + y_res*y_res);
1236 if ( dist < closest ) {
1248 if (bdetid.
layer() == 1) {
1253 if (bdetid.
layer() == 2) {
1257 if (bdetid.
layer() == 3) {
1268 if (fdetid.
disk() == 1) {
1269 if (fdetid.
side() == 1) {
1273 if (fdetid.
side() == 2) {
1278 if (fdetid.
disk() == 2) {
1279 if (fdetid.
side() == 1) {
1283 if (fdetid.
side() == 2) {
1295 eventout +=
"\n Number of BrlPixelRecHits collected:...... ";
1296 eventout += nPxlBrl;
1298 for(
int i=0;
i<3; ++
i) {
1303 eventout +=
"\n Number of FrwdPixelRecHits collected:..... ";
1304 eventout += nPxlFwd;
1307 for(
int i=3;
i<7; ++
i) {
1321 std::string MsgLoggerCat =
"GlobalRecHitsAnalyzer_fillMuon";
1325 eventout =
"\nGathering info:";
1332 <<
"Unable to find DTMuonGeometryRecord in event!";
1338 bool validdtsim =
true;
1341 <<
"Unable to find dtsimHits in event!";
1347 bool validdtrec =
true;
1350 <<
"Unable to find dtRecHits in event!";
1354 if (validdtsim && validdtrec) {
1356 std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1359 std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1362 int nDt =
compute(dtGeom.
product(), simHitsPerWire, recHitsPerWire, 1);
1365 eventout +=
"\n Number of DtMuonRecHits collected:........ ";
1377 bool validXFrame =
true;
1380 <<
"Unable to find muo CSC crossingFrame in event!";
1381 validXFrame =
false;
1388 hitItr !=
simHits.end(); ++hitItr) {
1389 theMap[hitItr->detUnitId()].push_back(*hitItr);
1398 <<
"Unable to find CSCMuonGeometryRecord in event!";
1406 bool validCSC =
true;
1409 <<
"Unable to find CSC RecHits in event!";
1418 recHitItr != cscRecHits->end(); ++recHitItr) {
1420 int detId = (*recHitItr).cscDetId().rawId();
1423 std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1425 if (mapItr !=
theMap.end()) {
1426 simHits = mapItr->second;
1429 if (simHits.size() == 1) {
1442 eventout +=
"\n Number of CSCRecHits collected:........... ";
1449 std::map<double, int> mapsim, maprec;
1450 std::map<int, double> nmapsim, nmaprec;
1456 <<
"Unable to find RPCMuonGeometryRecord in event!";
1462 bool validrpcsim =
true;
1465 <<
"Unable to find RPCSimHit in event!";
1466 validrpcsim =
false;
1471 bool validrpc =
true;
1474 <<
"Unable to find RPCRecHit in event!";
1482 for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1484 const RPCRoll *roll =
dynamic_cast<const RPCRoll*
>(rpcGeom->roll(Rid));
1489 "\n Number of RPCRecHits collected:........... ";
1498 LocalPoint rhitlocal = (*recIt).localPosition();
1499 double rhitlocalx = rhitlocal.
x();
1500 maprec[rhitlocalx] = nrec;
1504 for (std::map<double,int>::iterator iter = maprec.begin();
1505 iter != maprec.end(); ++iter) {
1507 nmaprec[
i] = (*iter).first;
1512 edm::PSimHitContainer::const_iterator simIt;
1513 for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1514 int ptype = (*simIt).particleType();
1515 if (ptype == 13 || ptype == -13) {
1517 LocalPoint shitlocal = (*simIt).localPosition();
1518 double shitlocalx = shitlocal.
x();
1519 mapsim[shitlocalx] = nsim;
1524 for (std::map<double,int>::iterator iter = mapsim.begin();
1525 iter != mapsim.end(); ++iter) {
1527 nmapsim[
i] = (*iter).first;
1532 for (
int r = 0;
r < nsim;
r++) {
1539 eventout +=
"\n Number of RPCRecHits collected:........... ";
1552 std::pair<LocalPoint,LocalVector>
1567 float scale = -localHit.
z() / dir.
z();
1579 return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
1583 std::map<DTWireId, std::vector<DTRecHit1DPair> >
1586 std::map<DTWireId, std::vector<DTRecHit1DPair> >
ret;
1589 rechit != dt1DRecHitPairs->end(); rechit++) {
1590 ret[(*rechit).wireId()].push_back(*rechit);
1603 float xEntry = entryP.
x()-xwire;
1604 float xExit = exitP.
x()-xwire;
1607 return fabs(xEntry - (entryP.
z()*(xExit-xEntry))/(exitP.
z()-entryP.
z()));
1611 template <
typename type>
1615 const std::vector<type>& recHits,
1616 const float simHitDist) {
1618 const type* theBestRecHit = 0;
1620 for(
typename std::vector<type>::const_iterator recHit = recHits.begin();
1621 recHit != recHits.end();
1624 if(fabs(distTmp-simHitDist) < res) {
1625 res = fabs(distTmp-simHitDist);
1626 theBestRecHit = &(*recHit);
1630 return theBestRecHit;
1650 template <
typename type>
1660 for(
std::map<
DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
1661 simHitsPerWire.begin();
1662 wireAndSHits != simHitsPerWire.end();
1664 DTWireId wireId = (*wireAndSHits).first;
1665 std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
1679 if(simHitWireDist>2.1) {
1684 if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
1688 std::vector<type> recHits = recHitsPerWire[wireId];
1691 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)
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]
virtual LocalPoint localPosition() const
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]
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()
DetId geographicalId() const
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
void showDirStructure(void) const
LocalPoint localPosition() const
const GlobalPoint & getPosition() 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
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
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.