38 : trackerHitAssociatorConfig_(
std::
move(iC)), totSeeds(0) {
39 file =
new TFile(
"out.root",
"recreate");
40 hchi2seedAll =
new TH1F(
"hchi2seedAll",
"hchi2seedAll", 2000, 0, 200);
41 hchi2seedProb =
new TH1F(
"hchi2seedProb",
"hchi2seedProb", 2000, 0, 200);
60 for (
int i = 0;
i != 17;
i++) {
64 std::stringstream
title;
65 for (
int i = 0;
i != 6;
i++)
66 for (
int j = 0;
j != 9;
j++) {
79 dump2[pair<int, int>(
i,
j)] = 0;
80 dump3[pair<int, int>(
i,
j)] = 0;
81 dump4[pair<int, int>(
i,
j)] = 0;
82 dump5[pair<int, int>(
i,
j)] = 0;
83 dump6[pair<int, int>(
i,
j)] = 0;
85 title <<
"pullX_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-rh";
88 title <<
"pullY_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-rh";
91 title <<
"pullX_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
94 title <<
"pullY_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
97 title <<
"pullX_" <<
i + 1 <<
"-" <<
j + 1 <<
"_st-rh";
100 title <<
"pullY_" <<
i + 1 <<
"-" <<
j + 1 <<
"_st-rh";
103 title <<
"PullGP_X_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
106 title <<
"PullGP_Y_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
109 title <<
"PullGP_Z_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
111 if (((
i == 2 ||
i == 4) && (
j == 0 ||
j == 1)) || (
i == 3 ||
i == 5)) {
113 title <<
"pullM_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-rh";
116 title <<
"pullS_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-rh";
119 title <<
"pullM_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
122 title <<
"pullS_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
125 title <<
"pullM_" <<
i + 1 <<
"-" <<
j + 1 <<
"_st-rh";
128 title <<
"pullS_" <<
i + 1 <<
"-" <<
j + 1 <<
"_st-rh";
133 hPullGPXvsGPX_shst =
new TH2F(
"PullGPXvsGPX_shst",
"PullGPXvsGPX_shst", 1000, -50, 50, 100, -50, 50);
134 hPullGPXvsGPY_shst =
new TH2F(
"PullGPXvsGPY_shst",
"PullGPXvsGPY_shst", 1000, -50, 50, 100, -50, 50);
135 hPullGPXvsGPZ_shst =
new TH2F(
"PullGPXvsGPZ_shst",
"PullGPXvsGPZ_shst", 1000, -50, 50, 200, -100, 100);
136 hPullGPXvsGPr_shst =
new TH2F(
"PullGPXvsGPr_shst",
"PullGPXvsGPr_shst", 1000, -50, 50, 300, -150, 150);
137 hPullGPXvsGPeta_shst =
new TH2F(
"PullGPXvsGPeta_shst",
"PullGPXvsGPeta_shst", 1000, -50, 50, 50, -2.5, 2.5);
138 hPullGPXvsGPphi_shst =
new TH2F(
"PullGPXvsGPphi_shst",
"PullGPXvsGPphi_shst", 1000, -50, 50, 63, 0, 6.3);
171 for (
std::map<
unsigned int, std::vector<PSimHit> >::iterator it = theHitsMap.begin(); it != theHitsMap.end(); it++) {
172 for (std::vector<PSimHit>::iterator isim = it->second.begin(); isim != it->second.end(); ++isim) {
173 idHitsMap[isim->trackId()].push_back(&*isim);
178 sort(it->second.begin(), it->second.end(), [](
auto*
a,
auto*
b) {
return a->timeOfFlight() <
b->timeOfFlight(); });
179 for (std::vector<PSimHit*>::iterator isim = it->second.begin(); isim != it->second.end(); ++isim) {
189 <<
" trackId=" <<
hit.trackId() <<
" particleType=" <<
hit.particleType()
190 <<
" pabs=" <<
hit.pabs() <<
" processType=" <<
hit.processType();
194 const std::vector<TrajectoryMeasurement>& meas,
199 LogTrace(
"CkfDebugger") <<
"\nnow in analyseCompatibleMeasurements";
200 LogTrace(
"CkfDebugger") <<
"number of input hits:" << meas.size();
201 for (std::vector<TrajectoryMeasurement>::const_iterator tmpIt = meas.begin(); tmpIt != meas.end(); tmpIt++) {
202 if (tmpIt->recHit()->isValid())
203 LogTrace(
"CkfDebugger") <<
"valid hit at position:" << tmpIt->recHit()->globalPosition();
210 unsigned int trajId = 0;
212 LogTrace(
"CkfDebugger") <<
"trajectory not correct";
215 LogTrace(
"CkfDebugger") <<
"correct trajectory";
221 LogTrace(
"CkfDebugger") <<
"Seed has delta";
229 std::vector<const PSimHit*> correctHits =
nextCorrectHits(traj, trajId);
230 if (correctHits.empty())
233 for (std::vector<const PSimHit*>::iterator corHit = correctHits.begin(); corHit != correctHits.end(); corHit++) {
234 for (std::vector<TM>::const_iterator
i = meas.begin();
i != meas.end();
i++) {
236 LogTrace(
"CkfDebugger") <<
"Correct hit found at position " <<
i - meas.begin();
244 const PSimHit* correctHit = *(correctHits.begin());
248 <<
"CkfDebugger: problem found: correct hit not found by findCompatibleMeasurements";
251 edm::LogVerbatim(
"CkfDebugger") <<
"The size of the meas vector is " << meas.size();
255 for (std::vector<TM>::const_iterator
i = meas.begin();
i != meas.end();
i++) {
256 edm::LogVerbatim(
"CkfDebugger") <<
"Is the hit valid? " <<
i->recHit()->isValid();
257 if (
i->recHit()->isValid()) {
258 edm::LogVerbatim(
"CkfDebugger") <<
"RecHit at " <<
i->recHit()->globalPosition() <<
" layer "
259 << ((
i->recHit()->det()->geographicalId().rawId() >> 16) & 0xF) <<
" subdet "
260 <<
i->recHit()->det()->geographicalId().subdetId() <<
" Chi2 " <<
i->estimate();
261 }
else if (
i->recHit()->det() ==
nullptr) {
262 edm::LogVerbatim(
"CkfDebugger") <<
"Invalid RecHit returned with zero Det pointer";
263 }
else if (
i->recHit()->det() ==
det(correctHit)) {
266 edm::LogVerbatim(
"CkfDebugger") <<
"Invalid hit returned in Det at gpos " <<
i->recHit()->det()->position()
267 <<
" correct Det is at " <<
det(correctHit)->
position();
273 if (correctRecHit.first ==
nullptr) {
275 if (fabs(correctRecHit.second - 0) < 0.01) {
278 if (fabs(correctRecHit.second + 1) < 0.01) {
281 if (fabs(correctRecHit.second + 2) < 0.01) {
284 if (fabs(correctRecHit.second + 3) < 0.01) {
287 if (fabs(correctRecHit.second + 4) < 0.01) {
290 if (fabs(correctRecHit.second + 5) < 0.01) {
293 if (fabs(correctRecHit.second + 6) < 0.01) {
296 if (fabs(correctRecHit.second + 7) < 0.01) {
299 if (fabs(correctRecHit.second + 8) < 0.01) {
306 if (correctRecHit.second > 30) {
307 edm::LogVerbatim(
"CkfDebugger") <<
"Outling RecHit at pos=" << correctRecHit.first->globalPosition()
308 <<
" from SimHit at pos=" <<
position(correctHit)
314 dump5[pair<int, int>((correctRecHit.first->det()->geographicalId().subdetId() - 1),
315 (
layer(correctRecHit.first->det())) - 1)]++;
320 dump3[pair<int, int>((correctRecHit.first->det()->geographicalId().subdetId() - 1),
321 (
layer(correctRecHit.first->det())) - 1)]++;
334 correctRecHit.first->det()->
surface());
339 int subdetId = correctRecHit.first->det()->geographicalId().subdetId();
340 int layerId =
layer(correctRecHit.first->det());
343 LogTrace(
"CkfDebugger") <<
"correctRecHit.first->globalPosition()="
344 << correctRecHit.first->globalPosition();
349 LogTrace(
"CkfDebugger") <<
"correctRecHit.first->localPosition()="
350 << correctRecHit.first->localPosition();
351 LogTrace(
"CkfDebugger") <<
"correctRecHit.first->localPositionError()="
352 << correctRecHit.first->localPositionError();
354 LogTrace(
"CkfDebugger") <<
"detState.localError().positionError()="
357 LogTrace(
"CkfDebugger") <<
"simDetState.localError().positionError()="
359 double pullx_shrh = (correctHit->
localPosition().
x() - correctRecHit.first->localPosition().x()) /
360 sqrt(correctRecHit.first->localPositionError().xx());
361 double pully_shrh = 0;
362 if (correctRecHit.first->localPositionError().yy() != 0)
363 pully_shrh = (correctHit->
localPosition().
y() - correctRecHit.first->localPosition().y()) /
364 sqrt(correctRecHit.first->localPositionError().yy());
370 LogTrace(
"CkfDebugger") <<
"pullx(sh-rh)=" << pullx_shrh;
371 LogTrace(
"CkfDebugger") <<
"pully(sh-rh)=" << pully_shrh;
372 LogTrace(
"CkfDebugger") <<
"pullx(sh-st)=" << pullx_shst;
373 LogTrace(
"CkfDebugger") <<
"pully(sh-st)=" << pully_shst;
375 LogTrace(
"CkfDebugger") <<
"pullx(st-rh)="
376 << (detState.
localPosition().
x() - correctRecHit.first->localPosition().x()) /
377 sqrt(correctRecHit.first->localPositionError().xx() +
380 std::pair<double, double> pulls =
computePulls(correctRecHit.first, detState);
381 if (subdetId > 0 && subdetId < 7 && layerId > 0 && layerId < 10) {
384 title <<
"pullX_" << subdetId <<
"-" << layerId <<
"_sh-rh";
387 title <<
"pullY_" << subdetId <<
"-" << layerId <<
"_sh-rh";
390 title <<
"pullX_" << subdetId <<
"-" << layerId <<
"_sh-st";
393 title <<
"pullY_" << subdetId <<
"-" << layerId <<
"_sh-st";
396 title <<
"pullX_" << subdetId <<
"-" << layerId <<
"_st-rh";
399 title <<
"pullY_" << subdetId <<
"-" << layerId <<
"_st-rh";
405 double pullGPx = (shGPos.
x() - stGPos.
x()) /
sqrt(stGPosErr.
cxx());
407 title <<
"PullGP_X_" << subdetId <<
"-" << layerId <<
"_sh-st";
410 title <<
"PullGP_Y_" << subdetId <<
"-" << layerId <<
"_sh-st";
413 title <<
"PullGP_Z_" << subdetId <<
"-" << layerId <<
"_sh-st";
416 if (subdetId == 3 && layerId == 1) {
424 if (dynamic_cast<const SiStripMatchedRecHit2D*>(correctRecHit.first->hit())) {
425 LogTrace(
"CkfDebugger") <<
"MONO HIT";
426 auto m = dynamic_cast<const SiStripMatchedRecHit2D*>(correctRecHit.first->hit())->monoHit();
431 double pullM_shrh = (sMonoHit.
localPosition().
x() - tMonoHit->localPosition().x()) /
432 sqrt(tMonoHit->localPositionError().xx());
435 std::pair<double, double> pullsMono =
computePulls(tMonoHit, monoState);
437 title <<
"pullM_" << subdetId <<
"-" << layerId <<
"_sh-rh";
440 title <<
"pullM_" << subdetId <<
"-" << layerId <<
"_sh-st";
443 title <<
"pullM_" << subdetId <<
"-" << layerId <<
"_st-rh";
446 LogTrace(
"CkfDebugger") <<
"STEREO HIT";
447 auto s = dynamic_cast<const SiStripMatchedRecHit2D*>(correctRecHit.first->hit())->stereoHit();
452 double pullS_shrh = (sStereoHit.
localPosition().
x() - tStereoHit->localPosition().x()) /
453 sqrt(tStereoHit->localPositionError().xx());
456 std::pair<double, double> pullsStereo =
computePulls(tStereoHit, stereoState);
458 title <<
"pullS_" << subdetId <<
"-" << layerId <<
"_sh-rh";
461 title <<
"pullS_" << subdetId <<
"-" << layerId <<
"_sh-st";
464 title <<
"pullS_" << subdetId <<
"-" << layerId <<
"_st-rh";
469 <<
"unexpected result: wrong det or layer id " << subdetId <<
" " << layerId <<
" "
470 << correctRecHit.first->det()->geographicalId().rawId();
475 edm::LogVerbatim(
"CkfDebugger") <<
"unexpected result " << correctRecHit.second;
482 dump2[pair<int, int>((correctRecHit.first->det()->geographicalId().subdetId() - 1),
483 (
layer(correctRecHit.first->det())) - 1)]++;
486 dump4[pair<int, int>((correctRecHit.first->det()->geographicalId().subdetId() - 1),
487 (
layer(correctRecHit.first->det())) - 1)]++;
489 if (correctRecHit.second > 30) {
498 LogTrace(
"CkfDebugger") <<
"now in correctTrajectory";
502 if (currentTrackId.empty())
505 for (Trajectory::RecHitContainer::const_iterator rh =
hits.begin(); rh !=
hits.end(); ++rh) {
507 if (!(*rh)->hit()->isValid()) {
513 bool nogoodhit =
true;
515 for (std::vector<PSimHit>::iterator shit = assSimHits.begin(); shit != assSimHits.end(); shit++) {
525 for (std::vector<SimHitIdpr>::iterator
i = currentTrackId.begin();
i != currentTrackId.end();
i++) {
526 for (std::vector<SimHitIdpr>::iterator
j = nextTrackId.begin();
j != nextTrackId.end();
j++) {
527 if (
i->first ==
j->first)
544 LogTrace(
"CkfDebugger") <<
"now in assocTrackId";
546 if (!rechit->hit()->isValid()) {
559 std::vector<const PSimHit*>
result;
561 LogTrace(
"CkfDebugger") <<
"now in nextCorrectHits";
566 for (TransientTrackingRecHit::RecHitContainer::const_iterator ch =
comp.begin(); ch !=
comp.end(); ++ch) {
567 if ((*ch)->globalPosition().mag() > maxR)
569 maxR = (*ch)->globalPosition().mag();
572 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: lastRecHit is at gpos " << lastRecHit->globalPosition() <<
" layer "
573 <<
layer((lastRecHit->det())) <<
" subdet "
574 << lastRecHit->det()->geographicalId().subdetId();
578 for (std::vector<PSimHit>::const_iterator shit = pSimHitVec.begin(); shit != pSimHitVec.end(); shit++) {
580 LogTrace(
"CkfDebugger") <<
"from hitAssociator SimHits are at GP=" << detUnit->
toGlobal(shit->localPosition())
581 <<
" traId=" << shit->trackId() <<
" particleType " << shit->particleType()
582 <<
" pabs=" << shit->pabs() <<
" detUnitId=" << shit->detUnitId() <<
" layer "
587 const PSimHit* lastPSH =
nullptr;
588 if (!pSimHitVec.empty()) {
590 for (std::vector<PSimHit>::const_iterator ch = pSimHitVec.begin(); ch != pSimHitVec.end(); ++ch) {
591 if ((ch->trackId() == trajId) && (ch->timeOfFlight() > maxTOF) && (
goodSimHit(*ch))) {
598 if (lastPSH ==
nullptr)
603 std::vector<PSimHit*> trackHits =
idHitsMap[trajId];
604 if (fabs((
double)(trackHits.back()->detUnitId() - lastPSH->
detUnitId())) < 1)
606 std::vector<PSimHit*>::iterator currentIt = trackHits.end();
607 for (std::vector<PSimHit*>::iterator it = trackHits.begin(); it != trackHits.end(); it++) {
620 bool samelayer =
true;
621 if (currentIt != (trackHits.end() - 1) && currentIt != trackHits.end()) {
622 for (std::vector<PSimHit*>::iterator nextIt = currentIt; (samelayer && nextIt != trackHits.end()); nextIt++) {
626 result.push_back(*nextIt);
644 LogTrace(
"CkfDebugger") <<
"now in associated";
646 if (!rechit->isValid())
651 for (std::vector<PSimHit>::const_iterator shit = pSimHitVec.begin(); shit != pSimHitVec.end(); shit++) {
665 LogTrace(
"CkfDebugger") <<
"now in correctMeas";
668 LogTrace(
"CkfDebugger") <<
"hit at position:" <<
recHit->globalPosition();
674 for (TransientTrackingRecHit::RecHitContainer::const_iterator ch =
comp.begin(); ch !=
comp.end(); ++ch) {
677 for (TransientTrackingRecHit::RecHitContainer::const_iterator ch2 =
comp.begin(); ch2 !=
comp.end(); ++ch2) {
684 for (std::vector<SimHitIdpr>::iterator
j = ids.begin();
j != ids.end();
j++) {
686 if (correctHit->
trackId() ==
j->first) {
692 LogTrace(
"CkfDebugger") <<
"returning false 1";
711 LogTrace(
"CkfDebugger") <<
"now in analyseRecHitExistance";
714 std::pair<CTTRHp, double>
result;
722 if (!firstDetState.
isValid()) {
723 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: propagation failed from state " << startingState <<
" to first det surface "
726 return std::pair<CTTRHp, double>((
CTTRHp)(0),-1);
730 for ( MeasurementDet::RecHitContainer::const_iterator rh =
recHits.begin(); rh !=
recHits.end(); rh++) {
734 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: A RecHit associated to the correct Simhit exists at lpos "
735 << (**rh).localPosition()
736 <<
" gpos " << (**rh).globalPosition()
737 <<
" layer " <<
layer((**rh).det())
738 <<
" subdet " << (**rh).det()->geographicalId().subdetId()
743 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: there is no RecHit associated to the correct SimHit." ;
748 for (MeasurementDet::RecHitContainer::const_iterator rh =
recHits.begin(); rh !=
recHits.end(); rh++)
749 edm::LogVerbatim(
"CkfDebugger") <<
"RH#" <<
y++ <<
" GP=" << (**rh).globalPosition() <<
" subdet=" << (**rh).det()->geographicalId().subdetId()
750 <<
" layer=" <<
layer((**rh).det()) ;
751 for ( MeasurementDet::RecHitContainer::const_iterator rh =
recHits.begin(); rh !=
recHits.end(); rh++) {
752 edm::LogVerbatim(
"CkfDebugger") <<
"Non-associated RecHit at pos " << (**rh).localPosition() ;
759 if (!subdet.
glued()) {
760 edm::LogVerbatim(
"CkfDebugger") <<
"The DetUnit is not part of a GluedDet" ;
763 LogTrace(
"CkfDebugger") <<
"rh->parameters()=" <<
result.first->parameters() ;
764 LogTrace(
"CkfDebugger") <<
"rh->parametersError()=" <<
result.first->parametersError() ;
767 LogTrace(
"CkfDebugger") <<
"me.measuredParameters(**rh)=" <<
me.measuredParameters(*
result.first) ;
768 LogTrace(
"CkfDebugger") <<
"me.measuredError(**rh)=" <<
me.measuredError(*
result.first) ;
774 LogTrace(
"CkfDebugger") <<
"R(-1)=" <<
R ;
775 LogTrace(
"CkfDebugger") <<
"chi2=" <<
R.similarity(
r) ;
781 return std::pair<CTTRHp, double>((
CTTRHp)(0),-8);
789 edm::LogVerbatim(
"CkfDebugger") <<
"Partner DetUnit does not have a SimHit from the same track" ;
792 TrackingRecHitProjector<ProjectedRecHit2D>
proj;
800 return std::pair<CTTRHp, double>(projHit,
chi2);
805 <<
" lpos " << sh2->localPosition() ;
809 if (partnerDet == 0) {
812 return std::pair<CTTRHp, double>((
CTTRHp)(0),-3);
818 if (!secondDetState.
isValid()) {
819 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: propagation failed from state " << startingState <<
" to second det surface "
822 return std::pair<CTTRHp, double>((
CTTRHp)(0),-1);
825 for ( MeasurementDet::RecHitContainer::const_iterator rh = recHits2.begin(); rh != recHits2.end(); rh++) {
828 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: A RecHit associated to the correct Simhit exists at lpos "
829 << (**rh).localPosition()
830 <<
" gpos " << (**rh).globalPosition()
836 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: there is no RecHit associated to the correct SimHit." ;
837 LogTrace(
"CkfDebugger") <<
" There are " <<
recHits.size() <<
" RecHits in the simHit DetUnit" ;
838 for ( MeasurementDet::RecHitContainer::const_iterator rh =
recHits.begin(); rh !=
recHits.end(); rh++) {
839 LogTrace(
"CkfDebugger") <<
"Non-associated RecHit at pos " << (**rh).localPosition() ;
846 if (
found && found2) {
850 if ( gluedDet == 0) {
851 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger ERROR: glued MeasurementDet not found!" ;
853 return std::pair<CTTRHp, double>((
CTTRHp)(0),-4);
857 if (!gluedDetState.
isValid()) {
858 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: propagation failed from state " << startingState <<
" to det surface "
861 return std::pair<CTTRHp, double>((
CTTRHp)(0),-1);
864 gluedHits = gluedDet->
recHits( gluedDetState);
865 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: the GluedDet returned " << gluedHits.size() <<
" hits" ;
866 if (gluedHits.size()==0){
867 edm::LogVerbatim(
"CkfDebugger") <<
"Found and associated mono and stereo recHits but not matched!!!" ;
869 return std::pair<CTTRHp, double>((
CTTRHp)(0),-5);
872 for ( MeasurementDet::RecHitContainer::const_iterator rh = gluedHits.begin(); rh != gluedHits.end(); rh++) {
875 edm::LogVerbatim(
"CkfDebugger") <<
"Matched hit at lpos " << (**rh).localPosition()
876 <<
" gpos " << (**rh).globalPosition()
877 <<
" has Chi2 " <<
chi2
879 result = std::pair<CTTRHp, double>(&**rh,
chi2);
882 LogTrace(
"CkfDebugger") <<
"rh->parameters()=" << (*rh)->parameters() ;
883 LogTrace(
"CkfDebugger") <<
"rh->parametersError()=" << (*rh)->parametersError() ;
886 LogTrace(
"CkfDebugger") <<
"me.measuredParameters(**rh)=" <<
me.measuredParameters(**rh) ;
887 LogTrace(
"CkfDebugger") <<
"me.measuredError(**rh)=" <<
me.measuredError(**rh) ;
893 LogTrace(
"CkfDebugger") <<
"R(-1)=" <<
R ;
894 LogTrace(
"CkfDebugger") <<
"chi2=" <<
R.similarity(
r) ;
899 if (found3)
return result;
901 edm::LogVerbatim(
"CkfDebugger") <<
"Found and associated mono and stereo recHits. Matched found but not associated!!!" ;
903 return std::pair<CTTRHp, double>((
CTTRHp)(0),-6);
906 else if ( (
found && !found2) || (!
found && found2) ) {
909 return std::pair<CTTRHp, double>((
CTTRHp)(0),-7);
914 return std::pair<CTTRHp, double>((
CTTRHp)(0),-2);
918 return std::pair<CTTRHp, double>((
CTTRHp)(
nullptr), 0);
922 for (std::vector<PSimHit*>::iterator shi =
idHitsMap[tkId].begin(); shi !=
idHitsMap[tkId].end(); ++shi) {
923 if ((*shi)->detUnitId() == detId.
rawId() &&
933 unsigned int correctDetId = correctRecHit->det()->geographicalId().rawId();
934 int correctLayId =
layer(correctRecHit->det());
935 LogTrace(
"CkfDebugger") <<
"correct layer id=" << correctLayId;
938 std::vector<const DetLayer*> nl =
948 bool navLayerAfter =
false;
950 for (std::vector<const DetLayer*>::iterator il = nl.begin(); il != nl.end(); il++) {
951 if (dynamic_cast<const BarrelDetLayer*>(*il)) {
952 const BarrelDetLayer* pbl = dynamic_cast<const BarrelDetLayer*>(*il);
953 LogTrace(
"CkfDebugger") <<
"pbl->specificSurface().bounds().length()="
955 LogTrace(
"CkfDebugger") <<
"pbl->specificSurface().bounds().width()=" << pbl->
specificSurface().bounds().width();
957 int layId =
layer(((*(*il)->basicComponents().begin())));
958 LogTrace(
"CkfDebugger") <<
" subdet=" << (*(*il)->basicComponents().begin())->geographicalId().subdetId()
959 <<
"layer id=" << layId;
960 if (layId == correctLayId) {
966 navLayerAfter =
true;
970 edm::LogVerbatim(
"CkfDebugger") <<
"correct layer taken into account. layer id: " << correctLayId;
971 }
else if (navLayerAfter) {
972 edm::LogVerbatim(
"CkfDebugger") <<
"SimHit layer after the layers returned by Navigation.";
974 edm::LogVerbatim(
"CkfDebugger") <<
"check: " << (correctRecHit->det()->geographicalId().subdetId()) <<
" "
975 << (
layer(correctRecHit->det()));
976 dump6[pair<int, int>((correctRecHit->det()->geographicalId().subdetId() - 1), (
layer(correctRecHit->det())) - 1)]++;
980 edm::LogVerbatim(
"CkfDebugger") <<
"correct layer NOT taken into account. correct layer id: " << correctLayId;
997 for (std::vector<DetWithState>::iterator
det = compatDets.begin();
det != compatDets.end();
det++) {
1003 if (detId ==
gluedId(correctRecHit->det()->geographicalId()).rawId()) {
1010 edm::LogVerbatim(
"CkfDebugger") <<
"correct det taken into account. correctDetId is: " << correctDetId
1011 <<
". please check chi2.";
1014 edm::LogVerbatim(
"CkfDebugger") <<
"correct det NOT taken into account. correctDetId: " << correctDetId;
1026 if (pSimHitVec1.empty() || pSimHitVec2.empty() ||
hasDelta(&(*pSimHitVec1.begin())) ||
1027 hasDelta(&(*pSimHitVec2.begin()))) {
1039 if (!pSimHitVec2.empty()) {
1042 double shlp1 = -1 /
simHit.momentumAtEntry().mag();
1043 double shlp2 =
simHit.momentumAtEntry().x() /
simHit.momentumAtEntry().z();
1044 double shlp3 =
simHit.momentumAtEntry().y() /
simHit.momentumAtEntry().z();
1045 double shlp4 =
simHit.localPosition().x();
1046 double shlp5 =
simHit.localPosition().y();
1081 double chi2 = ROOT::Math::Similarity(
v -
state.localParameters().vector(),
R);
1090 for (
int it = 0; it != ((
int)(
dump.size())); it++)
1118 for (
int i = 0;
i != 6;
i++)
1119 for (
int j = 0;
j != 9;
j++) {
1120 if (
i == 0 &&
j > 2)
1122 if (
i == 1 &&
j > 1)
1124 if (
i == 2 &&
j > 3)
1126 if (
i == 3 &&
j > 2)
1128 if (
i == 4 &&
j > 5)
1130 if (
i == 5 &&
j > 8)
1135 for (
int i = 0;
i != 6;
i++)
1136 for (
int j = 0;
j != 9;
j++) {
1137 if (
i == 0 &&
j > 2)
1139 if (
i == 1 &&
j > 1)
1141 if (
i == 2 &&
j > 3)
1143 if (
i == 3 &&
j > 2)
1145 if (
i == 4 &&
j > 5)
1147 if (
i == 5 &&
j > 8)
1151 edm::LogVerbatim(
"CkfDebugger") <<
"\nlayer with hit having chi2>30 for delta rays:";
1152 for (
int i = 0;
i != 6;
i++)
1153 for (
int j = 0;
j != 9;
j++) {
1154 if (
i == 0 &&
j > 2)
1156 if (
i == 1 &&
j > 1)
1158 if (
i == 2 &&
j > 3)
1160 if (
i == 3 &&
j > 2)
1162 if (
i == 4 &&
j > 5)
1164 if (
i == 5 &&
j > 8)
1169 for (
int i = 0;
i != 6;
i++)
1170 for (
int j = 0;
j != 9;
j++) {
1171 if (
i == 0 &&
j > 2)
1173 if (
i == 1 &&
j > 1)
1175 if (
i == 2 &&
j > 3)
1177 if (
i == 3 &&
j > 2)
1179 if (
i == 4 &&
j > 5)
1181 if (
i == 5 &&
j > 8)
1185 edm::LogVerbatim(
"CkfDebugger") <<
"\nlayer with correct RecHit after missing Sim Hit:";
1186 for (
int i = 0;
i != 6;
i++)
1187 for (
int j = 0;
j != 9;
j++) {
1188 if (
i == 0 &&
j > 2)
1190 if (
i == 1 &&
j > 1)
1192 if (
i == 2 &&
j > 3)
1194 if (
i == 3 &&
j > 2)
1196 if (
i == 4 &&
j > 5)
1198 if (
i == 5 &&
j > 8)
1204 std::stringstream
title;
1205 for (
int i = 0;
i != 6;
i++)
1206 for (
int j = 0;
j != 9;
j++) {
1207 if (
i == 0 &&
j > 2)
1209 if (
i == 1 &&
j > 1)
1211 if (
i == 2 &&
j > 3)
1213 if (
i == 3 &&
j > 2)
1215 if (
i == 4 &&
j > 5)
1217 if (
i == 5 &&
j > 8)
1220 title <<
"pullX_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-rh";
1223 title <<
"pullY_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-rh";
1226 title <<
"pullX_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
1229 title <<
"pullY_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
1232 title <<
"pullX_" <<
i + 1 <<
"-" <<
j + 1 <<
"_st-rh";
1235 title <<
"pullY_" <<
i + 1 <<
"-" <<
j + 1 <<
"_st-rh";
1238 title <<
"PullGP_X_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
1241 title <<
"PullGP_Y_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
1244 title <<
"PullGP_Z_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
1246 if (((
i == 2 ||
i == 4) && (
j == 0 ||
j == 1)) || (
i == 3 ||
i == 5)) {
1248 title <<
"pullM_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-rh";
1251 title <<
"pullS_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-rh";
1254 title <<
"pullM_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
1257 title <<
"pullS_" <<
i + 1 <<
"-" <<
j + 1 <<
"_sh-st";
1260 title <<
"pullM_" <<
i + 1 <<
"-" <<
j + 1 <<
"_st-rh";
1263 title <<
"pullS_" <<
i + 1 <<
"-" <<
j + 1 <<
"_st-rh";