37 file =
new TFile(
"out.root",
"recreate");
38 hchi2seedAll =
new TH1F(
"hchi2seedAll",
"hchi2seedAll",2000,0,200);
39 hchi2seedProb =
new TH1F(
"hchi2seedProb",
"hchi2seedProb",2000,0,200);
49 for (
int i=0;
i!=17;
i++){
53 std::stringstream
title;
54 for (
int i=0;
i!=6;
i++)
55 for (
int j=0;
j!=9;
j++){
56 if (
i==0 &&
j>2)
break;
57 if (
i==1 &&
j>1)
break;
58 if (
i==2 &&
j>3)
break;
59 if (
i==3 &&
j>2)
break;
60 if (
i==4 &&
j>5)
break;
61 if (
i==5 &&
j>8)
break;
68 title <<
"pullX_" << i+1 <<
"-" <<
j+1 <<
"_sh-rh";
69 hPullX_shrh[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
71 title <<
"pullY_" << i+1 <<
"-" << j+1 <<
"_sh-rh";
72 hPullY_shrh[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
74 title <<
"pullX_" << i+1 <<
"-" << j+1 <<
"_sh-st";
75 hPullX_shst[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
77 title <<
"pullY_" << i+1 <<
"-" << j+1 <<
"_sh-st";
78 hPullY_shst[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
80 title <<
"pullX_" << i+1 <<
"-" << j+1 <<
"_st-rh";
81 hPullX_strh[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
83 title <<
"pullY_" << i+1 <<
"-" << j+1 <<
"_st-rh";
84 hPullY_strh[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
86 title <<
"PullGP_X_" << i+1 <<
"-" << j+1 <<
"_sh-st";
87 hPullGP_X_shst[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
89 title <<
"PullGP_Y_" << i+1 <<
"-" << j+1 <<
"_sh-st";
90 hPullGP_Y_shst[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
92 title <<
"PullGP_Z_" << i+1 <<
"-" << j+1 <<
"_sh-st";
93 hPullGP_Z_shst[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
94 if ( ((i==2||i==4)&&(j==0||j==1)) || (i==3||i==5) ){
96 title <<
"pullM_" << i+1 <<
"-" << j+1 <<
"_sh-rh";
97 hPullM_shrh[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
99 title <<
"pullS_" << i+1 <<
"-" << j+1 <<
"_sh-rh";
100 hPullS_shrh[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
102 title <<
"pullM_" << i+1 <<
"-" << j+1 <<
"_sh-st";
103 hPullM_shst[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
105 title <<
"pullS_" << i+1 <<
"-" << j+1 <<
"_sh-st";
106 hPullS_shst[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
108 title <<
"pullM_" << i+1 <<
"-" << j+1 <<
"_st-rh";
109 hPullM_strh[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
111 title <<
"pullS_" << i+1 <<
"-" << j+1 <<
"_st-rh";
112 hPullS_strh[title.str()] =
new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
116 hPullGPXvsGPX_shst =
new TH2F(
"PullGPXvsGPX_shst",
"PullGPXvsGPX_shst",1000,-50,50,100,-50,50);
117 hPullGPXvsGPY_shst =
new TH2F(
"PullGPXvsGPY_shst",
"PullGPXvsGPY_shst",1000,-50,50,100,-50,50);
118 hPullGPXvsGPZ_shst =
new TH2F(
"PullGPXvsGPZ_shst",
"PullGPXvsGPZ_shst",1000,-50,50,200,-100,100);
119 hPullGPXvsGPr_shst =
new TH2F(
"PullGPXvsGPr_shst",
"PullGPXvsGPr_shst",1000,-50,50,300,-150,150);
120 hPullGPXvsGPeta_shst =
new TH2F(
"PullGPXvsGPeta_shst",
"PullGPXvsGPeta_shst",1000,-50,50,50,-2.5,2.5);
121 hPullGPXvsGPphi_shst =
new TH2F(
"PullGPXvsGPphi_shst",
"PullGPXvsGPphi_shst",1000,-50,50,63,0,6.3);
154 for (
std::map<
unsigned int, std::vector<PSimHit> >::iterator it=theHitsMap.begin();
155 it!=theHitsMap.end();it++){
156 for (std::vector<PSimHit>::iterator isim = it->second.begin();
157 isim != it->second.end(); ++isim){
158 idHitsMap[isim->trackId()].push_back(&*isim);
162 for (
std::map<
unsigned int,std::vector<PSimHit*> >::iterator it=
idHitsMap.begin();
165 for (std::vector<PSimHit*>::iterator isim = it->second.begin();
166 isim != it->second.end(); ++isim){
178 <<
" r=" << pos.
perp() <<
" phi=" << pos.
phi()
179 <<
" trackId=" << hit.
trackId()
181 <<
" pabs=" << hit.
pabs()
182 <<
" processType=" << hit. processType();
187 const std::vector<TrajectoryMeasurement>& meas,
193 LogTrace(
"CkfDebugger") <<
"\nnow in analyseCompatibleMeasurements" ;
194 LogTrace(
"CkfDebugger") <<
"number of input hits:" << meas.size() ;
195 for(std::vector<TrajectoryMeasurement>::const_iterator tmpIt=meas.begin();tmpIt!=meas.end();tmpIt++){
196 if (tmpIt->recHit()->isValid())
LogTrace(
"CkfDebugger") <<
"valid hit at position:" << tmpIt->recHit()->globalPosition() ;
203 unsigned int trajId = 0;
205 LogTrace(
"CkfDebugger") <<
"trajectory not correct" ;
208 LogTrace(
"CkfDebugger") <<
"correct trajectory" ;
212 LogTrace(
"CkfDebugger") <<
"Seed has delta" ;
220 std::vector<const PSimHit*> correctHits =
nextCorrectHits(traj, trajId);
221 if ( correctHits.size() == 0)
return true;
223 for (std::vector<const PSimHit*>::iterator corHit=correctHits.begin();corHit!=correctHits.end();corHit++){
224 for (std::vector<TM>::const_iterator
i=meas.begin();
i!=meas.end();
i++) {
226 LogTrace(
"CkfDebugger") <<
"Correct hit found at position " <<
i-meas.begin() ;
234 const PSimHit* correctHit = *(correctHits.begin());
237 edm::LogVerbatim(
"CkfDebugger") << std::endl <<
"CkfDebugger: problem found: correct hit not found by findCompatibleMeasurements" ;
239 edm::LogVerbatim(
"CkfDebugger") <<
"The size of the meas vector is " << meas.size() ;
242 for (std::vector<TM>::const_iterator
i=meas.begin();
i!=meas.end();
i++) {
243 edm::LogVerbatim(
"CkfDebugger") <<
"Is the hit valid? " <<
i->recHit()->isValid() ;
244 if (
i->recHit()->isValid()) {
246 <<
" layer " << ((
i->recHit()->det()->geographicalId().rawId() >>16) & 0xF)
247 <<
" subdet " <<
i->recHit()->det()->geographicalId().subdetId()
248 <<
" Chi2 " <<
i->estimate() ;
250 else if (
i->recHit()->det() == 0) {
251 edm::LogVerbatim(
"CkfDebugger") <<
"Invalid RecHit returned with zero Det pointer" ;
253 else if (
i->recHit()->det() ==
det(correctHit)) {
257 edm::LogVerbatim(
"CkfDebugger") <<
"Invalid hit returned in Det at gpos " <<
i->recHit()->det()->position()
258 <<
" correct Det is at " <<
det(correctHit)->
position() ;
263 std::pair<CTTRHp, double> correctRecHit =
265 if (correctRecHit.first==0 ) {
267 if ( fabs(correctRecHit.second-0)<0.01 ) {
dump[1]++;}
268 if ( fabs(correctRecHit.second+1)<0.01 ) {
dump[8]++;}
269 if ( fabs(correctRecHit.second+2)<0.01 ) {
dump[9]++;}
270 if ( fabs(correctRecHit.second+3)<0.01 ) {
dump[10]++;}
271 if ( fabs(correctRecHit.second+4)<0.01 ) {
dump[11]++;}
272 if ( fabs(correctRecHit.second+5)<0.01 ) {
dump[12]++;}
273 if ( fabs(correctRecHit.second+6)<0.01 ) {
dump[13]++;}
274 if ( fabs(correctRecHit.second+7)<0.01 ) {
dump[14]++;}
275 if ( fabs(correctRecHit.second+8)<0.01 ) {
dump[15]++;}
281 if (correctRecHit.second>30) {
282 edm::LogVerbatim(
"CkfDebugger") <<
"Outling RecHit at pos=" << correctRecHit.first->globalPosition()
283 <<
" from SimHit at pos="<<
position(correctHit)
288 dump5[pair<int,int>((correctRecHit.first->det()->geographicalId().subdetId()-1),(
layer(correctRecHit.first->det()))-1)]++;
293 dump3[pair<int,int>((correctRecHit.first->det()->geographicalId().subdetId()-1),(
layer(correctRecHit.first->det()))-1)]++;
304 edm::LogVerbatim(
"CkfDebugger") <<
"no deltas in the seed. What is wrong?" ;
310 int subdetId = correctRecHit.first->det()->geographicalId().subdetId();
311 int layerId =
layer(correctRecHit.first->det());
314 LogTrace(
"CkfDebugger") <<
"position(correctHit)=" <<
position(correctHit) ;
315 LogTrace(
"CkfDebugger") <<
"correctRecHit.first->globalPosition()=" << correctRecHit.first->globalPosition() ;
320 LogTrace(
"CkfDebugger") <<
"correctRecHit.first->localPosition()=" << correctRecHit.first->localPosition() ;
321 LogTrace(
"CkfDebugger") <<
"correctRecHit.first->localPositionError()=" << correctRecHit.first->localPositionError() ;
326 double pullx_shrh = (correctHit->
localPosition().
x()-correctRecHit.first->localPosition().x())/
327 sqrt(correctRecHit.first->localPositionError().xx());
328 double pully_shrh = 0;
329 if (correctRecHit.first->localPositionError().yy()!=0)
330 pully_shrh = (correctHit->
localPosition().
y()-correctRecHit.first->localPosition().y())/
331 sqrt(correctRecHit.first->localPositionError().yy());
337 LogTrace(
"CkfDebugger") <<
"pullx(sh-rh)=" << pullx_shrh ;
338 LogTrace(
"CkfDebugger") <<
"pully(sh-rh)=" << pully_shrh ;
339 LogTrace(
"CkfDebugger") <<
"pullx(sh-st)=" << pullx_shst ;
340 LogTrace(
"CkfDebugger") <<
"pully(sh-st)=" << pully_shst ;
342 LogTrace(
"CkfDebugger") <<
"pullx(st-rh)=" << (detState.
localPosition().
x()-correctRecHit.first->localPosition().x())/
345 std::pair<double,double> pulls =
computePulls(correctRecHit.first, detState);
346 if (subdetId>0 &&subdetId<7 && layerId>0 && layerId<10) {
349 title <<
"pullX_" << subdetId <<
"-" << layerId <<
"_sh-rh";
352 title <<
"pullY_" << subdetId <<
"-" << layerId <<
"_sh-rh";
355 title <<
"pullX_" << subdetId <<
"-" << layerId <<
"_sh-st";
358 title <<
"pullY_" << subdetId <<
"-" << layerId <<
"_sh-st";
361 title <<
"pullX_" << subdetId <<
"-" << layerId <<
"_st-rh";
364 title <<
"pullY_" << subdetId <<
"-" << layerId <<
"_st-rh";
370 double pullGPx = (shGPos.
x()-stGPos.
x())/
sqrt(stGPosErr.
cxx());
372 title <<
"PullGP_X_" << subdetId <<
"-" << layerId <<
"_sh-st";
375 title <<
"PullGP_Y_" << subdetId <<
"-" << layerId <<
"_sh-st";
378 title <<
"PullGP_Z_" << subdetId <<
"-" << layerId <<
"_sh-st";
381 if (subdetId==3&&layerId==1){
389 if (dynamic_cast<const SiStripMatchedRecHit2D*>(correctRecHit.first->hit())) {
390 LogTrace(
"CkfDebugger") <<
"MONO HIT";
391 CTTRHp tMonoHit =
theTTRHBuilder->
build(dynamic_cast<const SiStripMatchedRecHit2D*>(correctRecHit.first->hit())->monoHit());
394 double pullM_shrh = (sMonoHit.
localPosition().
x()-tMonoHit->localPosition().x())/
395 sqrt(tMonoHit->localPositionError().xx());
398 std::pair<double,double> pullsMono =
computePulls(tMonoHit, monoState);
400 title <<
"pullM_" << subdetId <<
"-" << layerId <<
"_sh-rh";
403 title <<
"pullM_" << subdetId <<
"-" << layerId <<
"_sh-st";
406 title <<
"pullM_" << subdetId <<
"-" << layerId <<
"_st-rh";
409 LogTrace(
"CkfDebugger") <<
"STEREO HIT";
410 CTTRHp tStereoHit =
theTTRHBuilder->
build(dynamic_cast<const SiStripMatchedRecHit2D*>(correctRecHit.first->hit())->stereoHit());
413 double pullS_shrh = (sStereoHit.
localPosition().
x()-tStereoHit->localPosition().x())/
414 sqrt(tStereoHit->localPositionError().xx());
417 std::pair<double,double> pullsStereo =
computePulls(tStereoHit, stereoState);
419 title <<
"pullS_" << subdetId <<
"-" << layerId <<
"_sh-rh";
422 title <<
"pullS_" << subdetId <<
"-" << layerId <<
"_sh-st";
425 title <<
"pullS_" << subdetId <<
"-" << layerId <<
"_st-rh";
429 edm::LogVerbatim(
"CkfDebugger") <<
"unexpected result: wrong det or layer id "
430 << subdetId <<
" " << layerId <<
" "
431 << correctRecHit.first->det()->geographicalId().rawId();
437 edm::LogVerbatim(
"CkfDebugger") <<
"unexpected result " << correctRecHit.second ;
443 dump2[pair<int,int>((correctRecHit.first->det()->geographicalId().subdetId()-1),(
layer(correctRecHit.first->det()))-1)]++;
446 dump4[pair<int,int>((correctRecHit.first->det()->geographicalId().subdetId()-1),(
layer(correctRecHit.first->det()))-1)]++;
448 if (correctRecHit.second>30) {
458 LogTrace(
"CkfDebugger") <<
"now in correctTrajectory" ;
462 if (currentTrackId.size() == 0)
return false;
464 for (Trajectory::RecHitContainer::const_iterator rh=hits.begin(); rh!=hits.end(); ++rh) {
467 if (!(*rh)->hit()->isValid()) {
473 bool nogoodhit =
true;
475 for (std::vector<PSimHit>::iterator shit=assSimHits.begin();shit!=assSimHits.end();shit++){
478 if (nogoodhit)
return false;
483 for (std::vector<SimHitIdpr>::iterator
i=currentTrackId.begin();
i!=currentTrackId.end();
i++){
484 for (std::vector<SimHitIdpr>::iterator
j=nextTrackId.begin();
j!=nextTrackId.end();
j++){
485 if (
i->first ==
j->first) test =
false;
490 if (test) {
return false;}
500 LogTrace(
"CkfDebugger") <<
"now in assocTrackId" ;
502 if (!rechit->hit()->isValid()) {
518 std::vector<const PSimHit*>
result;
520 LogTrace(
"CkfDebugger") <<
"now in nextCorrectHits" ;
525 for (TransientTrackingRecHit::RecHitContainer::const_iterator ch=comp.begin();
526 ch!=comp.end(); ++ch) {
527 if ((*ch)->globalPosition().mag() > maxR) lastRecHit = *ch;
528 maxR = (*ch)->globalPosition().mag();
531 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: lastRecHit is at gpos " << lastRecHit->globalPosition()
532 <<
" layer " <<
layer((lastRecHit->det()))
533 <<
" subdet " << lastRecHit->det()->geographicalId().subdetId() ;
537 for (std::vector<PSimHit>::const_iterator shit=pSimHitVec.begin();shit!=pSimHitVec.end();shit++){
539 LogTrace(
"CkfDebugger") <<
"from hitAssociator SimHits are at GP=" << detUnit->
toGlobal( shit->localPosition())
540 <<
" traId=" << shit->trackId() <<
" particleType " << shit->particleType()
541 <<
" pabs=" << shit->pabs() <<
" detUnitId=" << shit->detUnitId() <<
" layer " <<
layer((
det(&*shit)))
547 if (!pSimHitVec.empty()) {
549 for (std::vector<PSimHit>::const_iterator ch=pSimHitVec.begin(); ch!=pSimHitVec.end(); ++ch) {
550 if ( ( ch->trackId()== trajId) && (ch->timeOfFlight() > maxTOF) && (
goodSimHit(*ch) )) {
557 if (lastPSH == 0)
return result;
561 std::vector<PSimHit*> trackHits =
idHitsMap[trajId];
562 if (fabs((
double)(trackHits.back()->detUnitId()-lastPSH->
detUnitId()))<1 )
return result;
563 std::vector<PSimHit*>::iterator currentIt = trackHits.end();
564 for (std::vector<PSimHit*>::iterator it=trackHits.begin();
565 it!=trackHits.end();it++){
573 result.push_back(*it);
578 bool samelayer =
true;
579 if (currentIt!=(trackHits.end()-1) && currentIt!=trackHits.end()) {
580 for (std::vector<PSimHit*>::iterator nextIt = currentIt; (samelayer && nextIt!=trackHits.end()) ;nextIt++){
584 result.push_back(*nextIt);
586 else samelayer =
false;
596 if (sh.
pabs() > 0.9)
return true;
603 LogTrace(
"CkfDebugger") <<
"now in associated" ;
605 if (!rechit->isValid())
return false;
609 for (std::vector<PSimHit>::const_iterator shit=pSimHitVec.begin();shit!=pSimHitVec.end();shit++){
615 if ( ( fabs((*shit).timeOfFlight()-pSimHit.
timeOfFlight())<1e-9 ) &&
616 ( fabs((*shit).pabs()-pSimHit.
pabs())<1e-9 ) )
return true;
623 LogTrace(
"CkfDebugger") <<
"now in correctMeas" ;
625 if (recHit->isValid())
LogTrace(
"CkfDebugger") <<
"hit at position:" << recHit->globalPosition() ;
632 for (TransientTrackingRecHit::RecHitContainer::const_iterator ch=comp.begin();
633 ch!=comp.end(); ++ch) {
636 for (TransientTrackingRecHit::RecHitContainer::const_iterator ch2=comp.begin();
637 ch2!=comp.end(); ++ch2) {
638 if (ch2 == ch)
continue;
643 for (std::vector<SimHitIdpr>::iterator
j=ids.begin();
j!=ids.end();
j++){
645 if (correctHit->
trackId()==
j->first) {
669 LogTrace(
"CkfDebugger") <<
"now in analyseRecHitExistance" ;
671 std::pair<CTTRHp, double>
result;
679 if (!firstDetState.
isValid()) {
680 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: propagation failed from state " << startingState <<
" to first det surface "
683 return std::pair<CTTRHp, double>((
CTTRHp)(0),-1);
687 for ( MeasurementDet::RecHitContainer::const_iterator rh = recHits.begin(); rh != recHits.end(); rh++) {
690 result = std::pair<CTTRHp, double>(*rh,
theChi2->
estimate( firstDetState, **rh).second);
691 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: A RecHit associated to the correct Simhit exists at lpos "
692 << (**rh).localPosition()
693 <<
" gpos " << (**rh).globalPosition()
694 <<
" layer " <<
layer((**rh).det())
695 <<
" subdet " << (**rh).det()->geographicalId().subdetId()
700 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: there is no RecHit associated to the correct SimHit." ;
701 edm::LogVerbatim(
"CkfDebugger") <<
" There are " << recHits.size() <<
" RecHits in the simHit DetUnit" ;
705 for (MeasurementDet::RecHitContainer::const_iterator rh = recHits.begin(); rh != recHits.end(); rh++)
706 edm::LogVerbatim(
"CkfDebugger") <<
"RH#" << y++ <<
" GP=" << (**rh).globalPosition() <<
" subdet=" << (**rh).det()->geographicalId().subdetId()
707 <<
" layer=" <<
layer((**rh).det()) ;
708 for ( MeasurementDet::RecHitContainer::const_iterator rh = recHits.begin(); rh != recHits.end(); rh++) {
709 edm::LogVerbatim(
"CkfDebugger") <<
"Non-associated RecHit at pos " << (**rh).localPosition() ;
716 if (!subdet.
glued()) {
717 edm::LogVerbatim(
"CkfDebugger") <<
"The DetUnit is not part of a GluedDet" ;
719 if (result.second>30){
720 LogTrace(
"CkfDebugger") <<
"rh->parameters()=" << result.first->parameters() ;
721 LogTrace(
"CkfDebugger") <<
"rh->parametersError()=" << result.first->parametersError() ;
731 LogTrace(
"CkfDebugger") <<
"R(-1)=" <<
R ;
732 LogTrace(
"CkfDebugger") <<
"chi2=" <<
R.similarity(r) ;
738 return std::pair<CTTRHp, double>((
CTTRHp)(0),-8);
746 edm::LogVerbatim(
"CkfDebugger") <<
"Partner DetUnit does not have a SimHit from the same track" ;
757 return std::pair<CTTRHp, double>(projHit,chi2);
762 <<
" lpos " << sh2->localPosition() ;
766 if (partnerDet == 0) {
769 return std::pair<CTTRHp, double>((
CTTRHp)(0),-3);
775 if (!secondDetState.
isValid()) {
776 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: propagation failed from state " << startingState <<
" to second det surface "
779 return std::pair<CTTRHp, double>((
CTTRHp)(0),-1);
782 for ( MeasurementDet::RecHitContainer::const_iterator rh = recHits2.begin(); rh != recHits2.end(); rh++) {
785 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: A RecHit associated to the correct Simhit exists at lpos "
786 << (**rh).localPosition()
787 <<
" gpos " << (**rh).globalPosition()
793 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: there is no RecHit associated to the correct SimHit." ;
794 LogTrace(
"CkfDebugger") <<
" There are " << recHits.size() <<
" RecHits in the simHit DetUnit" ;
795 for ( MeasurementDet::RecHitContainer::const_iterator rh = recHits.begin(); rh != recHits.end(); rh++) {
796 LogTrace(
"CkfDebugger") <<
"Non-associated RecHit at pos " << (**rh).localPosition() ;
803 if (found && found2) {
807 if ( gluedDet == 0) {
808 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger ERROR: glued MeasurementDet not found!" ;
810 return std::pair<CTTRHp, double>((
CTTRHp)(0),-4);
814 if (!gluedDetState.
isValid()) {
815 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: propagation failed from state " << startingState <<
" to det surface "
818 return std::pair<CTTRHp, double>((
CTTRHp)(0),-1);
821 gluedHits = gluedDet->
recHits( gluedDetState);
822 edm::LogVerbatim(
"CkfDebugger") <<
"CkfDebugger: the GluedDet returned " << gluedHits.size() <<
" hits" ;
823 if (gluedHits.size()==0){
824 edm::LogVerbatim(
"CkfDebugger") <<
"Found and associated mono and stereo recHits but not matched!!!" ;
826 return std::pair<CTTRHp, double>((
CTTRHp)(0),-5);
829 for ( MeasurementDet::RecHitContainer::const_iterator rh = gluedHits.begin(); rh != gluedHits.end(); rh++) {
832 edm::LogVerbatim(
"CkfDebugger") <<
"Matched hit at lpos " << (**rh).localPosition()
833 <<
" gpos " << (**rh).globalPosition()
834 <<
" has Chi2 " << chi2
836 result = std::pair<CTTRHp, double>(&**rh,chi2);
839 LogTrace(
"CkfDebugger") <<
"rh->parameters()=" << (*rh)->parameters() ;
840 LogTrace(
"CkfDebugger") <<
"rh->parametersError()=" << (*rh)->parametersError() ;
850 LogTrace(
"CkfDebugger") <<
"R(-1)=" <<
R ;
851 LogTrace(
"CkfDebugger") <<
"chi2=" <<
R.similarity(r) ;
856 if (found3)
return result;
858 edm::LogVerbatim(
"CkfDebugger") <<
"Found and associated mono and stereo recHits. Matched found but not associated!!!" ;
860 return std::pair<CTTRHp, double>((
CTTRHp)(0),-6);
863 else if ( (found && !found2) || (!found && found2) ) {
866 return std::pair<CTTRHp, double>((
CTTRHp)(0),-7);
871 return std::pair<CTTRHp, double>((
CTTRHp)(0),-2);
874 return std::pair<CTTRHp, double>((
CTTRHp)(0),0);
880 if ( (*shi)->detUnitId() == detId.
rawId() &&
891 unsigned int correctDetId = correctRecHit->det()->geographicalId().rawId();
892 int correctLayId =
layer(correctRecHit->det());
893 LogTrace(
"CkfDebugger") <<
"correct layer id=" << correctLayId ;
904 bool navLayerAfter =
false;
906 for (std::vector<const DetLayer*>::iterator il = nl.begin(); il != nl.end(); il++) {
907 if ( dynamic_cast<const BarrelDetLayer*>(*il) ){
912 int layId =
layer(((*(*il)->basicComponents().begin())));
913 LogTrace(
"CkfDebugger") <<
" subdet=" << (*(*il)->basicComponents().begin())->geographicalId().subdetId() <<
"layer id=" << layId ;
914 if (layId==correctLayId) {
920 navLayerAfter =
true;
924 edm::LogVerbatim(
"CkfDebugger") <<
"correct layer taken into account. layer id: " << correctLayId ;
925 }
else if (navLayerAfter){
926 edm::LogVerbatim(
"CkfDebugger")<<
"SimHit layer after the layers returned by Navigation.";
928 edm::LogVerbatim(
"CkfDebugger")<<
"check: " << (correctRecHit->det()->geographicalId().subdetId()) <<
" " << (
layer(correctRecHit->det()));
929 dump6[pair<int,int>((correctRecHit->det()->geographicalId().subdetId()-1),(
layer(correctRecHit->det()))-1)]++;
933 edm::LogVerbatim(
"CkfDebugger") <<
"correct layer NOT taken into account. correct layer id: " << correctLayId ;
950 for (std::vector<DetWithState>::iterator
det=compatDets.begin();
det!=compatDets.end();
det++){
956 if (detId==
gluedId(correctRecHit->det()->geographicalId()).rawId()) {
963 edm::LogVerbatim(
"CkfDebugger") <<
"correct det taken into account. correctDetId is: " << correctDetId
964 <<
". please check chi2." ;
968 edm::LogVerbatim(
"CkfDebugger") <<
"correct det NOT taken into account. correctDetId: " << correctDetId ;
980 if ( pSimHitVec1.size()==0 || pSimHitVec2.size()==0 ||
hasDelta(&(*pSimHitVec1.begin())) ||
hasDelta(&(*pSimHitVec2.begin())) ) {
992 if (pSimHitVec2.size()!=0) {
993 const PSimHit& simHit = *pSimHitVec2.begin();
1035 LogTrace(
"CkfDebugger") <<
"chi2=" << chi2 ;
1045 for (
int it=0; it!=((int)(
dump.size())); it++)
1073 for (
int i=0;
i!=6;
i++)
1074 for (
int j=0;
j!=9;
j++){
1075 if (
i==0 &&
j>2)
break;
1076 if (
i==1 &&
j>1)
break;
1077 if (
i==2 &&
j>3)
break;
1078 if (
i==3 &&
j>2)
break;
1079 if (
i==4 &&
j>5)
break;
1080 if (
i==5 &&
j>8)
break;
1084 for (
int i=0;
i!=6;
i++)
1085 for (
int j=0;
j!=9;
j++){
1086 if (
i==0 &&
j>2)
break;
1087 if (
i==1 &&
j>1)
break;
1088 if (
i==2 &&
j>3)
break;
1089 if (
i==3 &&
j>2)
break;
1090 if (
i==4 &&
j>5)
break;
1091 if (
i==5 &&
j>8)
break;
1094 edm::LogVerbatim(
"CkfDebugger") <<
"\nlayer with hit having chi2>30 for delta rays:" ;
1095 for (
int i=0;
i!=6;
i++)
1096 for (
int j=0;
j!=9;
j++){
1097 if (
i==0 &&
j>2)
break;
1098 if (
i==1 &&
j>1)
break;
1099 if (
i==2 &&
j>3)
break;
1100 if (
i==3 &&
j>2)
break;
1101 if (
i==4 &&
j>5)
break;
1102 if (
i==5 &&
j>8)
break;
1106 for (
int i=0;
i!=6;
i++)
1107 for (
int j=0;
j!=9;
j++){
1108 if (
i==0 &&
j>2)
break;
1109 if (
i==1 &&
j>1)
break;
1110 if (
i==2 &&
j>3)
break;
1111 if (
i==3 &&
j>2)
break;
1112 if (
i==4 &&
j>5)
break;
1113 if (
i==5 &&
j>8)
break;
1116 edm::LogVerbatim(
"CkfDebugger") <<
"\nlayer with correct RecHit after missing Sim Hit:" ;
1117 for (
int i=0;
i!=6;
i++)
1118 for (
int j=0;
j!=9;
j++){
1119 if (
i==0 &&
j>2)
break;
1120 if (
i==1 &&
j>1)
break;
1121 if (
i==2 &&
j>3)
break;
1122 if (
i==3 &&
j>2)
break;
1123 if (
i==4 &&
j>5)
break;
1124 if (
i==5 &&
j>8)
break;
1129 std::stringstream
title;
1130 for (
int i=0;
i!=6;
i++)
1131 for (
int j=0;
j!=9;
j++){
1132 if (
i==0 &&
j>2)
break;
1133 if (
i==1 &&
j>1)
break;
1134 if (
i==2 &&
j>3)
break;
1135 if (
i==3 &&
j>2)
break;
1136 if (
i==4 &&
j>5)
break;
1137 if (
i==5 &&
j>8)
break;
1139 title <<
"pullX_" <<
i+1 <<
"-" <<
j+1 <<
"_sh-rh";
1142 title <<
"pullY_" <<
i+1 <<
"-" << j+1 <<
"_sh-rh";
1145 title <<
"pullX_" <<
i+1 <<
"-" << j+1 <<
"_sh-st";
1148 title <<
"pullY_" <<
i+1 <<
"-" << j+1 <<
"_sh-st";
1151 title <<
"pullX_" <<
i+1 <<
"-" << j+1 <<
"_st-rh";
1154 title <<
"pullY_" <<
i+1 <<
"-" << j+1 <<
"_st-rh";
1157 title <<
"PullGP_X_" <<
i+1 <<
"-" << j+1 <<
"_sh-st";
1160 title <<
"PullGP_Y_" <<
i+1 <<
"-" << j+1 <<
"_sh-st";
1163 title <<
"PullGP_Z_" <<
i+1 <<
"-" << j+1 <<
"_sh-st";
1165 if ( ((
i==2||
i==4)&&(j==0||j==1)) || (
i==3||
i==5) ){
1167 title <<
"pullM_" <<
i+1 <<
"-" << j+1 <<
"_sh-rh";
1170 title <<
"pullS_" <<
i+1 <<
"-" << j+1 <<
"_sh-rh";
1173 title <<
"pullM_" <<
i+1 <<
"-" << j+1 <<
"_sh-st";
1176 title <<
"pullS_" <<
i+1 <<
"-" << j+1 <<
"_sh-st";
1179 title <<
"pullM_" <<
i+1 <<
"-" << j+1 <<
"_st-rh";
1182 title <<
"pullS_" <<
i+1 <<
"-" << j+1 <<
"_st-rh";
GlobalPoint globalPosition() const
std::map< std::string, TH1F * > hPullS_shrh
bool hasDelta(const PSimHit *correctHit)
std::pair< CTTRHp, double > analyseRecHitExistance(const PSimHit &sh, const TSOS &startingState)
std::map< std::string, TH1F * > hPullY_shst
bool correctMeas(const TM &tm, const PSimHit *correctHit) const
void printSimHits(const edm::Event &iEvent)
std::map< std::pair< int, int >, int > dump6
virtual float length() const =0
const MeasurementTracker * theMeasurementTracker
const LocalTrajectoryParameters & localParameters() const
std::pair< double, double > computePulls(CTTRHp recHit, TSOS startingState)
TH2F * hPullGPXvsGPeta_shst
void dumpSimHit(const SimHit &hit) const
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
const MagneticField * theMagField
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const =0
LocalPoint localPosition() const
const TransientTrackingRecHitBuilder * theTTRHBuilder
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
std::map< std::string, TH1F * > hPullGP_Z_shst
const GeometricSearchTracker * theGeomSearchTracker
TransientTrackingRecHit::ConstRecHitContainer RecHitContainer
virtual const GeomDet & geomDet() const
virtual std::vector< const DetLayer * > nextLayers(NavigationDirection direction) const
Geom::Phi< T > phi() const
std::map< std::string, TH1F * > hPullY_strh
GlobalPoint globalPosition() const
ConstRecHitPointer recHit() const
std::map< std::string, TH1F * > hPullM_shrh
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const BoundSurface & surface() const
std::map< std::string, TH1F * > hPullX_shst
int partner_det_not_fuond
std::vector< const PSimHit * > nextCorrectHits(const Trajectory &, unsigned int &)
unsigned int partnerDetId() const
std::vector< SimHitIdpr > associateHitId(const TrackingRecHit &thit)
std::map< std::string, TH1F * > hPullM_shst
LocalError positionError() const
std::vector< ConstRecHitPointer > RecHitContainer
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
const MeasurementEstimator * theChi2
unsigned int trackId() const
ConstRecHitContainer recHits(bool splitting=false) const
RecHitPointer project(const TransientTrackingRecHit &hit, const GeomDet &det, const TrajectoryStateOnSurface &ts) const
PropagationDirection const & direction() const
uint32_t rawId() const
get the raw id
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &) const =0
DataContainer const & measurements() const
AlgebraicVector5 vector() const
CkfDebugger(edm::EventSetup const &es)
int analyseRecHitNotFound(const Trajectory &, CTTRHp)
unsigned int glued() const
glued
const Surface::PositionType & position() const
The position (origin of the R.F.)
std::map< std::string, TH1F * > hPullGP_Y_shst
int layer(const GeomDetUnit *det)
float timeOfFlight() const
double testSeed(CTTRHp, CTTRHp, TrajectoryStateOnSurface)
int matched_not_associated
Local3DPoint localPosition() const
bool associated(CTTRHp rechit, const PSimHit &sh) const
const CartesianTrajectoryError & cartesianError() const
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
TrajectoryMeasurement const & lastMeasurement() const
int assocTrackId(CTTRHp rechit) const
TH2F * hPullGPXvsGPr_shst
const DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
TrackerHitAssociator * hitAssociator
TH2F * hPullGPXvsGPY_shst
DetId geographicalId() const
The label of this GeomDet.
TransientTrackingRecHit::ConstRecHitPointer CTTRHp
TrajectoryStateOnSurface updatedState() const
const AlgebraicSymMatrix55 & matrix() const
std::map< std::string, TH1F * > hPullX_shrh
const LocalTrajectoryError & localError() const
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::map< std::string, TH1F * > hPullGP_X_shst
const Surface::PositionType & position() const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
GlobalError position() const
Position error submatrix.
const Propagator * theForwardPropagator
bool correctTrajectory(const Trajectory &, unsigned int &) const
const Bounds & bounds() const
CLHEP::HepVector AlgebraicVector
std::map< std::string, TH1F * > hPullM_strh
TrajectoryMeasurement const & firstMeasurement() const
std::map< std::string, TH1F * > hPullS_shst
ROOT::Math::SVector< double, 5 > AlgebraicVector5
ConstRecHitContainer RecHitContainer
std::map< std::pair< int, int >, int > dump2
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
std::map< std::string, TH1F * > hPullS_strh
unsigned short processType() const
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const TrackerGeometry * theTrackerGeom
const GeomDetUnit * det(const PSimHit *sh) const
bool goodSimHit(const PSimHit &sh) const
std::map< std::string, TH1F * > hPullY_shrh
TH2F * hPullGPXvsGPX_shst
const Surface & surface() const
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
unsigned int trackId() const
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
std::map< std::string, TH1F * > hPullX_strh
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
TH2F * hPullGPXvsGPZ_shst
const PSimHit * pSimHit(unsigned int tkId, DetId detId)
std::map< std::pair< int, int >, int > dump5
Global3DPoint position(const PSimHit *sh) const
std::map< unsigned int, std::vector< PSimHit * > > idHitsMap
virtual float width() const =0
DetId gluedId(const DetId &du)
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
bool analyseCompatibleMeasurements(const Trajectory &, const std::vector< TrajectoryMeasurement > &, const MeasurementTracker *, const Propagator *, const Chi2MeasurementEstimatorBase *, const TransientTrackingRecHitBuilder *)
unsigned int detUnitId() const
std::map< std::pair< int, int >, int > dump4
TH2F * hPullGPXvsGPphi_shst
std::map< std::pair< int, int >, int > dump3