Skip to content

Commit

Permalink
Update/remove comments for tau reco at MiniAOD
Browse files Browse the repository at this point in the history
  • Loading branch information
steggema committed Mar 12, 2018
1 parent b77fdca commit 413e8fb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion RecoTauTag/RecoTau/interface/PFRecoTauClusterVariables.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TauIdMVAAuxiliaries {
EcalEnInSignalPFCands += pfcand->ecalEnergy();
HcalEnInSignalPFCands += pfcand->hcalEnergy();
}
// JAN - FIXME: not calculated for PackedCandidate
// TauReco@MiniAOD: recalculate for PackedCandidate if added to MiniAOD event content
}
float total = EcalEnInSignalPFCands + HcalEnInSignalPFCands;
if(total == 0.){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,15 @@ PFRecoTauChargedHadronFromPFCandidatePlugin::return_type PFRecoTauChargedHadronF
else algo = PFRecoTauChargedHadron::kPFNeutralHadron;
std::auto_ptr<PFRecoTauChargedHadron> chargedHadron(new PFRecoTauChargedHadron(**cand, algo));

// JAN - work on this. This must be adapted carefully to MiniAOD packed candidates
const reco::PFCandidate* pfCand = dynamic_cast<const reco::PFCandidate*>(&**cand);
if (pfCand) {
if ( pfCand->trackRef().isNonnull() ) chargedHadron->track_ = edm::refToPtr(pfCand->trackRef());
else if ( pfCand->muonRef().isNonnull() && pfCand->muonRef()->innerTrack().isNonnull() ) chargedHadron->track_ = edm::refToPtr(pfCand->muonRef()->innerTrack());
else if ( pfCand->muonRef().isNonnull() && pfCand->muonRef()->globalTrack().isNonnull() ) chargedHadron->track_ = edm::refToPtr(pfCand->muonRef()->globalTrack());
else if ( pfCand->muonRef().isNonnull() && pfCand->muonRef()->outerTrack().isNonnull() ) chargedHadron->track_ = edm::refToPtr(pfCand->muonRef()->outerTrack());
else if ( pfCand->gsfTrackRef().isNonnull() ) chargedHadron->track_ = edm::refToPtr(pfCand->gsfTrackRef());


}
} // TauReco@MiniAOD: Tracks only available dynamically, so no possiblity to save ref here; checked by code downstream

chargedHadron->positionAtECALEntrance_ = atECALEntrance(&**cand, bField_);
chargedHadron->chargedPFCandidate_ = (*cand);
chargedHadron->addDaughter(*cand);
Expand Down Expand Up @@ -238,7 +236,7 @@ PFRecoTauChargedHadronFromPFCandidatePlugin::return_type PFRecoTauChargedHadronF
maxUnmatchedBlockElements = maxUnmatchedBlockElementsPhoton_;
minMergeEt = minMergeGammaEt_;
}
// JAN - FIXME - block matching possible in miniAOD? probably not?? but is it important after all?
// TauReco@MiniAOD: No access to PF blocks at MiniAOD level, but the code below seems to have very minor impact
const reco::PFCandidate* pfCHCand = dynamic_cast<const reco::PFCandidate*>(&*chargedHadron->chargedPFCandidate_);
const reco::PFCandidate* pfJetConstituent = dynamic_cast<const reco::PFCandidate*>(&**jetConstituent);
if (pfCHCand && pfJetConstituent) {
Expand Down
3 changes: 1 addition & 2 deletions RecoTauTag/RecoTau/plugins/PFRecoTauEnergyAlgorithmPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ void PFRecoTauEnergyAlgorithmPlugin::operator()(reco::PFTau& tau) const
<< " HCAL = " << (pfCand)->hcalEnergy() << ","
<< " HO = " << (pfCand)->hoEnergy() << std::endl;
}
// JAN - FIXME - this info is not readily available in miniAOD
// This means this sub-algo is currently broken
// TauReco@MiniAOD: This info is not yet available in miniAOD.
if ( edm::isFinite(pfCand->ecalEnergy()) ) allNeutralsSumEn += pfCand->ecalEnergy();
if ( edm::isFinite(pfCand->hcalEnergy()) ) allNeutralsSumEn += pfCand->hcalEnergy();
if ( edm::isFinite(pfCand->hoEnergy()) ) allNeutralsSumEn += pfCand->hoEnergy();
Expand Down
1 change: 0 additions & 1 deletion RecoTauTag/RecoTau/plugins/RecoTauProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ void RecoTauProducer::produce(edm::Event& evt, const edm::EventSetup& es)
builder != builders_.end(); ++builder) {
// Get a ptr_vector of taus from the builder
reco::tau::RecoTauBuilderPlugin::output_type taus((*builder)(jetRef, chargedHadrons, piZeros, uniqueRegionalCands));
// JAN - convert reco::Jet ref to PFJet ref (only in direct interaction with PFTau)

// Make sure all taus have their jetref set correctly
std::for_each(taus.begin(), taus.end(), boost::bind(&reco::PFTau::setjetRef, _1, reco::JetBaseRef(jetRef)));
Expand Down
5 changes: 2 additions & 3 deletions RecoTauTag/RecoTau/src/RecoTauVertexAssociator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ namespace {

inline const reco::TrackBaseRef getTrackRef(const Candidate& cand)
{
// TauReco@MiniAOD: This version does not work on top of MiniAOD, however,
// it is only used for non-default track-vertex associations
const PFCandidate* pfCandPtr = dynamic_cast<const PFCandidate*>(&cand);
if (pfCandPtr != nullptr) {
if ( pfCandPtr->trackRef().isNonnull() ) return reco::TrackBaseRef(pfCandPtr->trackRef());
else if ( pfCandPtr->gsfTrackRef().isNonnull() ) return reco::TrackBaseRef(pfCandPtr->gsfTrackRef());
else return reco::TrackBaseRef();
}

// FIXME - JAN - should put an error message somewhere that we use an algo that
// is not supported for PackedCandidates

return reco::TrackBaseRef();
}
}
Expand Down

0 comments on commit 413e8fb

Please sign in to comment.