Skip to content

Commit

Permalink
Merge pull request #28328 from slava77/CMSSW_11_0_0_pre10/EIfromAOD
Browse files Browse the repository at this point in the history
fixes to allow running EI from AOD
  • Loading branch information
cmsbuild authored Nov 2, 2019
2 parents 3616e28 + 31458df commit 5e0283d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ namespace reco {
public:
reco::PFCandidate operator()(edm::FwdPtr<reco::PFCandidate> const& input) const {
reco::PFCandidate output(*input);
/* really, what's the point in this ? The one below should be enough
//and the one loop here is a torture of converting Ptr<PFCandidate> to Ptr<Candidate> and back
for ( unsigned int isource = 0; isource < input->numberOfSourceCandidatePtrs(); ++isource ) {
edm::Ptr<reco::PFCandidate> ptr (input->sourceCandidatePtr(isource) );
output.setSourceCandidatePtr( ptr );
}
*/
output.setSourceCandidatePtr(input.backPtr());

if (input.backPtr().isAvailable())
output.setSourceCandidatePtr(input.backPtr());
else //we are in a job where the original collection is gone
output.setSourceCandidatePtr(input.ptr());
return output;
}
};
Expand Down
1 change: 1 addition & 0 deletions CommonTools/ParticleFlow/python/EITopPAG_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# b-tagging
from RecoBTag.ImpactParameter.pfImpactParameterTagInfos_cfi import pfImpactParameterTagInfos
from RecoBTag.SecondaryVertex.pfInclusiveSecondaryVertexFinderTagInfos_cfi import pfInclusiveSecondaryVertexFinderTagInfos
from RecoBTag.SecondaryVertex.candidateCombinedSecondaryVertexV2Computer_cfi import candidateCombinedSecondaryVertexV2Computer
from RecoBTag.SecondaryVertex.pfCombinedInclusiveSecondaryVertexV2BJetTags_cfi import pfCombinedInclusiveSecondaryVertexV2BJetTags


Expand Down
14 changes: 9 additions & 5 deletions CommonTools/ParticleFlow/python/pfTaus_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@

# Clone tau producer
pfTausProducer = hpsPFTauProducer.clone()
pfTausCombiner = combinatoricRecoTaus.clone()
pfTausCombiner.jetSrc= cms.InputTag("ak4PFJets")
pfTausCombiner.piZeroSrc= "pfJetsLegacyHPSPiZeros"
pfTausCombiner.chargedHadronSrc='pfTauPFJetsRecoTauChargedHadrons'
pfTausCombiner.modifiers[3].pfTauTagInfoSrc=cms.InputTag("pfTauTagInfoProducer")
pfTausCombiner = combinatoricRecoTaus.clone(
jetSrc = "ak4PFJets",
piZeroSrc = "pfJetsLegacyHPSPiZeros",
chargedHadronSrc = "pfTauPFJetsRecoTauChargedHadrons"
)
for mod in pfTausCombiner.modifiers:
if mod.name == "TTIworkaround": mod.pfTauTagInfoSrc = "pfTauTagInfoProducer"

pfTausSelectionDiscriminator = hpsSelectionDiscriminator.clone()
pfTausSelectionDiscriminator.PFTauProducer = cms.InputTag("pfTausCombiner")
pfTausProducerSansRefs = hpsPFTauProducerSansRefs.clone()
Expand Down Expand Up @@ -125,6 +128,7 @@

pfTausPreSequence = cms.Sequence(
pfJetTracksAssociatorAtVertex +
recoTauAK4PFJets08Region +
pfTauPileUpVertices +
pfTauTagInfoProducer
)
Expand Down

0 comments on commit 5e0283d

Please sign in to comment.