Skip to content

Commit

Permalink
Merge pull request cms-sw#10097 from arizzi/whitelistIVFinPackedCands75X
Browse files Browse the repository at this point in the history
MINIAOD: Whitelist IVF cands in packing (76X version)
  • Loading branch information
davidlange6 committed Jul 13, 2015
2 parents 4fbd23e + ca1a1fa commit 5099d48
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
16 changes: 15 additions & 1 deletion PhysicsTools/PatAlgos/plugins/PATPackedCandidateProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ namespace pat {
edm::EDGetTokenT< edm::ValueMap<float> > PuppiWeight_;
edm::EDGetTokenT<edm::ValueMap<reco::CandidatePtr> > PuppiCandsMap_;
edm::EDGetTokenT<std::vector< reco::PFCandidate > > PuppiCands_;
edm::EDGetTokenT<edm::View<reco::CompositePtrCandidate> > SVWhiteList_;

double minPtForTrackProperties_;
// for debugging
Expand All @@ -94,6 +95,7 @@ pat::PATPackedCandidateProducer::PATPackedCandidateProducer(const edm::Parameter
PuppiWeight_(consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("PuppiSrc"))),
PuppiCandsMap_(consumes<edm::ValueMap<reco::CandidatePtr> >(iConfig.getParameter<edm::InputTag>("PuppiSrc"))),
PuppiCands_(consumes<std::vector< reco::PFCandidate > >(iConfig.getParameter<edm::InputTag>("PuppiSrc"))),
SVWhiteList_(consumes<edm::View< reco::CompositePtrCandidate > >(iConfig.getParameter<edm::InputTag>("secondaryVerticesForWhiteList"))),
minPtForTrackProperties_(iConfig.getParameter<double>("minPtForTrackProperties"))
{
produces< std::vector<pat::PackedCandidate> > ();
Expand Down Expand Up @@ -129,7 +131,19 @@ void pat::PATPackedCandidateProducer::produce(edm::Event& iEvent, const edm::Eve
const edm::Association<reco::VertexCollection> & associatedPV=*(assoHandle.product());
const edm::ValueMap<int> & associationQuality=*(assoQualityHandle.product());

edm::Handle<edm::View<reco::CompositePtrCandidate > > svWhiteListHandle;
iEvent.getByToken(SVWhiteList_,svWhiteListHandle);
const edm::View<reco::CompositePtrCandidate > & svWhiteList=*(svWhiteListHandle.product());
std::set<unsigned int> whiteList;
for(unsigned int i=0; i<svWhiteList.size();i++)
{
for(unsigned int j=0; j< svWhiteList[i].numberOfSourceCandidatePtrs(); j++) {
const edm::Ptr<reco::Candidate> & c = svWhiteList[i].sourceCandidatePtr(j);
if(c.id() == cands.id()) whiteList.insert(c.key());
}
}


edm::Handle<reco::VertexCollection> PVs;
iEvent.getByToken( PVs_, PVs );
reco::VertexRef PV(PVs.id());
Expand Down Expand Up @@ -189,7 +203,7 @@ void pat::PATPackedCandidateProducer::produce(edm::Event& iEvent, const edm::Eve
}
// properties of the best track
outPtrP->back().setLostInnerHits( lostHits );
if(outPtrP->back().pt() > minPtForTrackProperties_) {
if(outPtrP->back().pt() > minPtForTrackProperties_ || whiteList.find(ic)!=whiteList.end()) {
outPtrP->back().setTrackProperties(*ctrack);
//outPtrP->back().setTrackProperties(*ctrack,tsos.curvilinearError());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
originalTracks = cms.InputTag("generalTracks"),
vertexAssociator = cms.InputTag("primaryVertexAssociation","original"),
PuppiSrc = cms.InputTag("puppi"),
secondaryVerticesForWhiteList = cms.InputTag("inclusiveCandidateSecondaryVertices"),
minPtForTrackProperties = cms.double(0.95)
)
2 changes: 1 addition & 1 deletion RecoVertex/VertexTools/src/SharedTracks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace vertexTools {
iter != svTracks.end(); iter++)
{
if( std::abs((*iter)->bestTrack()->dz()-pv.z())/(*iter)->bestTrack()->dzError() < maxsigma &&
std::abs((*iter)->bestTrack()->dxy(pv.position())/(*iter)->bestTrack()->dxyError() < maxsigma )
std::abs((*iter)->bestTrack()->dxy(pv.position())/(*iter)->bestTrack()->dxyError()) < maxsigma
)
count++;
}
Expand Down

0 comments on commit 5099d48

Please sign in to comment.