Skip to content

Commit

Permalink
Merge pull request #12930 from bachtis/PFFIX_TrackHCALLink
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed Jan 14, 2016
2 parents 45a401b + d11c60e commit 5dce4cf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
29 changes: 22 additions & 7 deletions RecoParticleFlow/PFProducer/plugins/linkers/TrackAndHCALLinker.cc
Expand Up @@ -4,6 +4,7 @@
#include "DataFormats/ParticleFlowReco/interface/PFBlockElementTrack.h"
#include "RecoParticleFlow/PFClusterTools/interface/LinkByRecHit.h"
#include "DataFormats/Math/interface/deltaPhi.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

class TrackAndHCALLinker : public BlockElementLinkerBase {
public:
Expand Down Expand Up @@ -64,19 +65,33 @@ double TrackAndHCALLinker::testLink
break;

// If the link exist, we fill dist and linktest.



if (mlit != multilinks.end()){


//special case ! A looper can exit the barrel inwards and hit the endcap
//In this case calculate the distance based on the first crossing since
//the looper will probably never make it to the endcap
if (tkAtHCALEx.position().R()<tkAtHCALEnt.position().R()) {
throw cms::Exception("WorkingIn4DSpace")
<< "Qu'est ce que c'est que ce gag ? "
<< tkAtHCALEx.position().R() << " is smaller than "
<< tkAtHCALEnt.position().R() << " !" << std::endl;
}
dist = LinkByRecHit::computeDist(hcalreppos.Eta(),
dist = LinkByRecHit::computeDist(hcalreppos.Eta(),
hcalreppos.Phi(),
tracketa,
trackphi);

edm::LogWarning("TrackHCALLinker ") <<"Special case of linking with track hitting HCAL and looping back in the tracker ";
}
else {
dist = LinkByRecHit::computeDist(hcalreppos.Eta(),
hcalreppos.Phi(),
tracketa + 0.1 * dHEta,
trackphi + 0.1 * dHPhi);
}

}
} else {// Old algorithm

} else {// Old algorithm
if ( tkAtHCALEnt.isValid() )
dist = LinkByRecHit::testTrackAndClusterByRecHit( *trackref,
*clusterref,
Expand Down
2 changes: 0 additions & 2 deletions RecoParticleFlow/PFTracking/src/PFTrackTransformer.cc
Expand Up @@ -177,8 +177,6 @@ PFTrackTransformer::addPoints( reco::PFRecTrack& pftrack,
pftrack.addPoint(dummyMaxSh);
}



//HCAL entrance
theOutParticle.propagateToHcalEntrance(false);
if(theOutParticle.getSuccess()!=0)
Expand Down

0 comments on commit 5dce4cf

Please sign in to comment.