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

Topic pandora track cleaning #8023

Merged
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
11 changes: 7 additions & 4 deletions RecoBTag/SoftLepton/plugins/SoftPFMuonTagInfoProducer.cc
Expand Up @@ -148,10 +148,13 @@ bool SoftPFMuonTagInfoProducer::isTightMuon(const reco::Muon* muon) {

bool SoftPFMuonTagInfoProducer::isMuonClean(edm::Event& iEvent,const reco::PFCandidate* PFcandidate){
const reco::Muon* muon=PFcandidate->muonRef().get();
if(muonId>=0 && !isLooseMuon(muon)) return false;
if(muonId>=1 && !isSoftMuon (muon)) return false;
if(muonId>=2 && !isTightMuon(muon)) return false;
return true;
if( muon != nullptr && PFcandidate->muonRef().isNonnull() ) {
if(muonId>=0 && !isLooseMuon(muon)) return false;
if(muonId>=1 && !isSoftMuon (muon)) return false;
if(muonId>=2 && !isTightMuon(muon)) return false;
return true;
}
return false;
}


Expand Up @@ -103,7 +103,9 @@ namespace cms_content {
//
PandoraCMSPFCandProducer::PandoraCMSPFCandProducer(const edm::ParameterSet& iConfig) :
debugPrint(iConfig.getParameter<bool>("debugPrint")), debugHisto(iConfig.getParameter<bool>("debugHisto")), useRecoTrackAsssociation(iConfig.getParameter<bool>("useRecoTrackAsssociation")),
m_calibEE(ForwardSubdetector::HGCEE,"EE",debugPrint), m_calibHEF(ForwardSubdetector::HGCHEF,"HEF",debugPrint), m_calibHEB(ForwardSubdetector::HGCHEB,"HEB",debugPrint), calibInitialized(false)
m_calibEE(ForwardSubdetector::HGCEE,"EE",debugPrint), m_calibHEF(ForwardSubdetector::HGCHEF,"HEF",debugPrint), m_calibHEB(ForwardSubdetector::HGCHEB,"HEB",debugPrint), calibInitialized(false),
_deltaPtOverPtForPfo(iConfig.getParameter<double>("MaxDeltaPtOverPtForPfo")),
_deltaPtOverPtForClusterlessPfo(iConfig.getParameter<double>("MaxDeltaPtOverPtForClusterlessPfo"))
{
produces<reco::PFClusterCollection>();
produces<reco::PFBlockCollection>();
Expand Down Expand Up @@ -832,14 +834,19 @@ void PandoraCMSPFCandProducer::prepareTrack(edm::Event& iEvent){ // function to
canFormPfo = true;
canFormClusterlessPfo = true;
}
const float deltaPtRel = track->ptError()/track->pt();
canFormClusterlessPfo *= (deltaPtRel < _deltaPtOverPtForClusterlessPfo); //tighter requirements for tracks with no cluster

trackParameters.m_canFormPfo = canFormPfo;
trackParameters.m_canFormClusterlessPfo = canFormClusterlessPfo;

//The parent address
trackParameters.m_pParentAddress = (void *) pftrack;
recTrackMap.emplace((void*)pftrack,i); //associate parent address with collection index

PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Track::Create(*m_pPandora, trackParameters));
if( deltaPtRel < _deltaPtOverPtForPfo ) {
PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Track::Create(*m_pPandora, trackParameters));
}
}

}
Expand Down
Expand Up @@ -393,4 +393,7 @@ class PandoraCMSPFCandProducer : public edm::EDProducer {
short _debugLevel;
double speedoflight;

double _deltaPtOverPtForPfo;
double _deltaPtOverPtForClusterlessPfo;

};
4 changes: 3 additions & 1 deletion RecoParticleFlow/PandoraTranslator/python/runPandora_cfi.py
Expand Up @@ -22,5 +22,7 @@
overburdenDepthFile = cms.FileInPath('RecoParticleFlow/PFClusterProducer/data/HGCMaterialOverburden.root'),
useOverburdenCorrection = cms.bool(False), #disabled until the overburden values make sense
pf_electron_output_col=cms.string('electrons'),
outputFile = cms.string('pandoraoutput.root')
outputFile = cms.string('pandoraoutput.root'),
MaxDeltaPtOverPtForPfo = cms.double(1.00),
MaxDeltaPtOverPtForClusterlessPfo = cms.double(0.50),
)