Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINIAOD: Whitelist IVF cands in packing + BugFix on SharedTracks helpers #10088

Merged
merged 2 commits into from Jul 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 15 additions & 1 deletion PhysicsTools/PatAlgos/plugins/PATPackedCandidateProducer.cc
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
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
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this changes RECO, please submit a separate PR or at least make this bugfix evident in the PR subject.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot right now, it is one character fix...making another PR is quite an overhead

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please at least update the subject of the PR to mention this bugfix (it's going to affect the cand-based taggers, right?)

)
count++;
}
Expand Down