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

Tau reconstruction based on miniAOD event content #22594

Merged
merged 129 commits into from
Apr 6, 2019
Merged
Show file tree
Hide file tree
Changes from 126 commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
6936e12
Tau reco: Moving from PFJet to Jet, and from PFCandidate to Candidate
steggema Aug 3, 2017
46aa930
Tau reco: Moving from PFJet to Jet, and from PFCandidate to Candidate…
steggema Aug 4, 2017
da78114
Tau reco: Moving from PFJet to Jet, and from PFCandidate to Candidate…
steggema Aug 7, 2017
cc1f640
Tau reco: Moving from PFJet to Jet, and from PFCandidate to Candidate…
steggema Aug 10, 2017
c1c0e8c
Tau reco: Moving from PFJet to Jet, and from PFCandidate to Candidate…
steggema Aug 10, 2017
934eb5f
PFTau: Use Candidates instead of PFCandidates, and reference to base …
steggema Jan 31, 2018
0bf3efa
Adapt pat::Tau and related classes/producers to change from PFCandida…
steggema Jan 31, 2018
fa7b9f0
Adapt first set of tau algorithms to changes in PFTau data format
steggema Jan 31, 2018
eb8795a
Add chargedHadronFromLostTrack builder and adapt related dataformats/…
mbluj Nov 20, 2017
9f728b2
Use Candidate instead of PFCandidate in PFTauTagInfo, following chang…
steggema Feb 1, 2018
c013bea
Various adaptions in tau plugins for change in PFTau data format
steggema Feb 1, 2018
47c179e
Adapt rest of plugins and other code in RecoTauTag/RecoTau to changes…
steggema Feb 9, 2018
68e208e
Adapt all tau tag tools to changes in PFTau class
steggema Feb 9, 2018
1264f2c
correct parameter name
mbluj Nov 15, 2017
fa59a88
Add Michal's configuration files and simple anti-muon discriminator
steggema Feb 9, 2018
250ff2d
Add tau jet region producer based on PAT Jets
steggema Feb 9, 2018
b9f79af
More adaptions due to changes in PFTau class
steggema Feb 9, 2018
5c5c338
More adaptions due to changes in PFTau class
steggema Feb 9, 2018
785e783
Adaptions for changes in PFTau data format
steggema Feb 12, 2018
8e10bcf
Fix Ptr conversion, and remove unused method from common tau utilities
steggema Feb 13, 2018
5f1bf05
Directly construct taus with packed candidate collections filled, if …
steggema Feb 13, 2018
ae50708
Make two-prong track pT cleaner plugin work properly for taus from Mi…
steggema Feb 15, 2018
ca859e0
Add ioread rules for changes in PFTau
steggema Feb 19, 2018
2065b6e
Add ioread rules for a few changes in data formats
steggema Feb 21, 2018
99a3384
Cleanup following tau code review
steggema Feb 27, 2018
5294f0e
Add specific tau PV producer for taus produced from MiniAOD input (ba…
steggema Feb 28, 2018
c9aab96
Add specific tau PV producer for taus produced from MiniAOD input (ba…
steggema Mar 1, 2018
9abe1a1
Add specific tau PV producer for taus produced from MiniAOD input (ba…
steggema Mar 1, 2018
f15e59d
Fill additional information also for taus built from MiniAOD input
steggema Mar 1, 2018
3f51e17
Merge pull request #72 from steggema/TauRecoMiniAODSinglePFTauClass_10X
roger-wolf Mar 5, 2018
08863b0
Merge branch 'from-CMSSW_10_1_X_2018-03-02-2300' into CMSSW_10_1_X_ta…
roger-wolf Mar 5, 2018
c6437da
added whitespace in template definition
roger-wolf Mar 6, 2018
907147b
new test file
roger-wolf Mar 6, 2018
1379757
adding cfg as initial test file for tau reco based on miniAOD
roger-wolf Mar 7, 2018
b77fdca
Fix muon-tau overlap removal
steggema Mar 12, 2018
413e8fb
Update/remove comments for tau reco at MiniAOD
steggema Mar 12, 2018
95d5cef
Remove commented code, and update comments related to tau reco at Min…
steggema Mar 12, 2018
4bdc092
Merge pull request #74 from steggema/TauRecoMiniAODSinglePFTauClass_10X
roger-wolf Mar 13, 2018
78e824d
commiting to be able to swithc branches
roger-wolf Mar 13, 2018
8001aa7
Merge branch 'from-CMSSW_10_1_X_2018-03-12-2300' into CMSSW_10_1_X_ta…
roger-wolf Mar 13, 2018
8bba3d3
moved class definitions from TauReco to JetReco on request by duplica…
roger-wolf Mar 13, 2018
d0c7a05
code corrections by clang
roger-wolf Mar 13, 2018
22f3af2
Merge commit 'refs/pull/22594/head' of https://github.com/cms-sw/cmss…
steggema Apr 3, 2018
494f855
Rename Candidate accessors in PFTau, add back PFCandidate accessors, …
steggema Apr 5, 2018
51bdf51
Address various code review comments
steggema Apr 6, 2018
5a25a5b
Address various code review comments
steggema Apr 10, 2018
1b1fff7
Remove leftover exception
steggema Apr 10, 2018
1814e22
Only convert to edm::Ptr if candidate is present
steggema Apr 10, 2018
6098eba
Merged CMSSW_10_1_X_TauRecoMiniAODReview from repository steggema wit…
mbluj Apr 10, 2018
ea83bd4
Address style comments: range loops, lower case for variables, duplic…
mbluj Apr 11, 2018
7902388
PV produceres, PF and Mini, prepared to unification
mbluj Apr 13, 2018
83313a1
Unify PVProducers on top of common Base
mbluj Apr 13, 2018
126c000
check both tracks and gsf-tracks in case of electrons
mbluj Apr 13, 2018
962fe35
Rationalize includes and implementation of other Jan's comments
mbluj Apr 16, 2018
be005e9
Merge pull request #1 from mbluj/CMSSW_10_1_X_TauRecoMiniAODReviewMB
steggema Apr 17, 2018
a827bdf
Merge pull request #75 from steggema/CMSSW_10_1_X_TauRecoMiniAODReview
steggema Apr 17, 2018
32f2eea
Merge branch 'from-CMSSW_10_2_X_2018-04-17-2300' into CMSSW_10_1_X_ta…
roger-wolf Apr 18, 2018
5c0ad96
Unify charged-hadron-from-track plugins, and minor review modifications
steggema Apr 18, 2018
d175721
Only allow lost tracks that have a pseudoTrack(), since otherwise the…
steggema Apr 18, 2018
334ffa0
Simplify setting up tau reco@MiniAOD sequence
steggema Apr 18, 2018
f77ae6c
adding runtest for tau reconstruction based on miniAOD input
roger-wolf Apr 18, 2018
c1f1fce
Allow also charged hadrons to be reconstructed from PackedCandidates …
steggema Apr 18, 2018
a73d590
After allowing lost tracks candidates without additional track inform…
steggema Apr 18, 2018
75804b8
Merge branch 'CMSSW_10_1_X_tau-pog_recoOnMiniAOD' into CMSSW_10_1_X_T…
steggema Apr 18, 2018
80b90b2
Merge pull request #76 from steggema/CMSSW_10_1_X_TauRecoMiniAODReview
roger-wolf Apr 18, 2018
01d1881
input file had been overwritten unexpectedly during merge
roger-wolf Apr 20, 2018
71ec9f0
Address a number of code review comments
steggema Apr 30, 2018
c7d6c56
Cache also single-PFCandidate returns, and address other review comments
steggema May 2, 2018
61ed8c5
Merge remote-tracking branch 'my-cmssw/CMSSW_10_1_X_TauRecoMiniAODRev…
steggema May 2, 2018
e47442d
Merge branch 'CMSSW_10_1_X_tau-pog_recoOnMiniAOD' into CMSSW_10_1_X_T…
steggema May 2, 2018
7289b39
Update configuration for tau reconstruction at MiniAOD, and revert to…
steggema May 3, 2018
565657a
Merge remote-tracking branch 'my-cmssw/CMSSW_10_1_X_TauRecoMiniAODRev…
steggema May 3, 2018
4285c06
Merge pull request #77 from steggema/CMSSW_10_1_X_TauRecoMiniAODReview
steggema May 3, 2018
af45120
Avoid casts to PFCandidate
steggema May 3, 2018
cd2db40
Remove PF from local variable name
steggema May 3, 2018
3715377
Merge pull request #78 from steggema/CMSSW_10_1_X_TauRecoMiniAODReview
steggema May 3, 2018
5623774
Add I/O directives for new transient data members, and update to more…
steggema May 11, 2018
2117526
Merge pull request #79 from steggema/CMSSW_10_1_X_TauRecoMiniAODReview
steggema May 11, 2018
3693f3c
Merge branch 'CMSSW_10_3_X' into CMSSW_10_1_X_tau-pog_recoOnMiniAOD
mbluj Sep 7, 2018
9998cdc
Merged CMSSW_10_3_X_recoOnMiniAOD from repository mbluj with cms-merg…
mbluj Sep 7, 2018
0647e3e
update to adjust with changes for tauRecoAtMini
mbluj Sep 7, 2018
dc3f2fc
adjust to changes for tauRecoAtMini
mbluj Sep 7, 2018
28881c0
Merge branch 'CMSSW_10_3_X_recoOnMiniAOD_2' of https://github.com/mbl…
mbluj Sep 7, 2018
767d2c4
small fix
mbluj Sep 7, 2018
ef7525d
update test configuration
mbluj Sep 7, 2018
0859991
Merge pull request #86 from mbluj/CMSSW_10_3_X_recoOnMiniAOD_2
mbluj Sep 7, 2018
9990723
Merged CMSSW_10_3_X from repository cms-sw with cms-merge-topic
mbluj Oct 2, 2018
d2654d6
correct indentation
mbluj Oct 2, 2018
1f32af3
Merge pull request #90 from mbluj/CMSSW_10_3_X_recoOnMiniAOD_3
mbluj Oct 2, 2018
ac3ae41
use modern pointer
mbluj Sep 21, 2018
bbb94f8
Constraints on input values against unphysical outliers
mbluj Sep 21, 2018
5f18399
usePhiAtEcalEntranceExtrapolation becomes an internal parameter of th…
mbluj Sep 21, 2018
40d2d37
looser protection boundaries
mbluj Sep 28, 2018
43c7f88
fix name of input param
mbluj Sep 28, 2018
234e4a9
Range-based loops -- fix cherry-pick conflicts
mbluj Oct 4, 2018
75cd1cf
Range-based loops -- fix cherry-pick conflicts
mbluj Oct 4, 2018
c169cdf
synch with remote
mbluj Oct 16, 2018
f3d2173
fixes: PFCands -> Cands
mbluj Oct 16, 2018
48d50d0
Merge pull request #93 from mbluj/CMSSW_10_3_X_recoOnMiniAOD_3
mbluj Oct 16, 2018
fe9b636
Merged CMSSW_10_1_X_tau-pog_recoOnMiniAOD from repository cms-tau-pog…
mbluj Oct 17, 2018
43e2c1b
Merged CMSSW_10_4_X from repository cms-sw with cms-merge-topic
mbluj Oct 17, 2018
12b994c
post merge fixes
mbluj Oct 17, 2018
92b023d
Merge pull request #94 from mbluj/CMSSW_10_4_X_recoOnMiniAOD
mbluj Oct 17, 2018
f8c7d83
Remove unnecessary catch(...) expressions
mbluj Oct 18, 2018
a4ca868
Merge pull request #95 from mbluj/CMSSW_10_4_X_recoOnMiniAOD
mbluj Oct 18, 2018
2cd2c40
Remove incorrectly used std::move
mbluj Oct 18, 2018
2c2ee20
Merge pull request #97 from mbluj/CMSSW_10_4_X_recoOnMiniAOD
mbluj Oct 18, 2018
2cf812e
Reset properly transient PFTau data via ioread rules
mbluj Nov 5, 2018
70aa61e
Merge pull request #104 from mbluj/CMSSW_10_4_X_recoOnMiniAOD
mbluj Nov 5, 2018
a4e7896
Loop using tempory var for the size
mbluj Nov 13, 2018
01c61c9
Merge branch 'CMSSW_10_5_X' into CMSSW_10_1_X_tau-pog_recoOnMiniAOD
mbluj Feb 4, 2019
3db017f
Merge pull request #116 from mbluj/CMSSW_10_5_X_recoOnMiniAOD
mbluj Feb 4, 2019
8b8bd0a
updated inputs for tests
mbluj Feb 5, 2019
26c6f8f
Merge pull request #117 from mbluj/CMSSW_10_5_X_recoOnMiniAOD
mbluj Feb 5, 2019
98e35ce
Merge branch 'CMSSW_10_5_X' into CMSSW_10_5_X_recoOnMiniAOD
mbluj Feb 11, 2019
a52e3b6
Merge pull request #118 from mbluj/CMSSW_10_5_X_recoOnMiniAOD
mbluj Feb 11, 2019
d67e5db
Merge tag 'CMSSW_10_5_0_pre2' into CMSSW_10_5_X_recoOnMiniAOD
mbluj Feb 26, 2019
4468872
Merge pull request #119 from mbluj/CMSSW_10_5_X_recoOnMiniAOD
mbluj Feb 26, 2019
b9bcea9
Merge commit 'refs/pull/22594/head' of https://github.com/cms-sw/cmss…
steggema Mar 22, 2019
af55ca3
Update PFTau I/O rules to circumvent issue when restoring edm::Ptr<re…
steggema Mar 26, 2019
f0ded3c
Merge remote-tracking branch 'official-cmssw/CMSSW_10_6_X' into CMSSW…
steggema Mar 26, 2019
a5228c2
Merge pull request #120 from steggema/CMSSW_10_6_0_pre2_TauRecoMiniAO…
steggema Mar 26, 2019
d140276
Adapt tau primary vertex finding to changes in fillDescriptions, and …
steggema Mar 26, 2019
0ce14b4
Merge branch 'CMSSW_10_6_0_pre2_TauRecoMiniAOD_ResolveConflicts' of h…
steggema Mar 27, 2019
692e548
Re-add quality cuts to pi0 plugin to allow it to be easily overwritte…
steggema Mar 27, 2019
420ade7
Merge pull request #121 from steggema/CMSSW_10_6_0_pre2_TauRecoMiniAO…
steggema Mar 27, 2019
604dcb1
Use bare and not the tau-reco charged hadron to determine distance fo…
steggema Apr 3, 2019
36006f1
Rectify coding style and adhere to naming convention
steggema Apr 3, 2019
005c7ef
Merge pull request #122 from steggema/CMSSW_10_6_0_pre2_TauRecoMiniAO…
steggema Apr 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions DataFormats/JetReco/src/classes_def_3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,10 @@
<class name="edm::reftobase::RefHolder<reco::PFClusterJetRef>" />
<class name="edm::reftobase::Holder<reco::Jet, reco::JPTJetRef>" />
<class name="edm::reftobase::RefHolder<reco::JPTJetRef>" />

<class name="edm::AssociationMap<edm::OneToOne<edm::View<reco::Jet>,edm::View<reco::Jet>,unsigned int> >">
<field name="transientMap_" transient="true" />
</class>
<class name="edm::Wrapper<edm::AssociationMap<edm::OneToOne<edm::View<reco::Jet>,edm::View<reco::Jet>,unsigned int> > >"/>
<class name="edm::helpers::KeyVal<edm::RefToBaseProd<reco::Jet>,edm::RefToBaseProd<reco::Jet> >"/>
</lcgdict>
5 changes: 4 additions & 1 deletion DataFormats/PatCandidates/interface/Tau.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "DataFormats/PatCandidates/interface/Lepton.h"
#include "DataFormats/JetReco/interface/GenJetCollection.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"

#include "DataFormats/PatCandidates/interface/TauPFSpecific.h"
#include "DataFormats/PatCandidates/interface/TauCaloSpecific.h"
Expand Down Expand Up @@ -160,7 +161,7 @@ namespace pat {
const pat::tau::TauPFEssential & pfEssential() const;
/// Method copied from reco::PFTau.
/// Throws an exception if this pat::Tau was not made from a reco::PFTau
const reco::PFJetRef & pfJetRef() const { return pfSpecific().pfJetRef_; }
const reco::JetBaseRef & pfJetRef() const { return pfSpecific().pfJetRef_; }
/// Method copied from reco::PFTau.
/// Throws an exception if this pat::Tau was not made from a reco::PFTau
reco::PFRecoTauChargedHadronRef leadTauChargedHadronCandidate() const;
Expand Down Expand Up @@ -452,6 +453,8 @@ namespace pat {


private:
/// helper to avoid code duplication in constructors
void initFromBaseTau(const reco::BaseTau& aTau);
// ---- for content embedding ----
bool embeddedIsolationTracks_;
std::vector<reco::Track> isolationTracks_;
Expand Down
6 changes: 3 additions & 3 deletions DataFormats/PatCandidates/interface/TauPFSpecific.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/**
\class pat::tau::PFSpecific TauPFSpecific.h "DataFormats/PatCandidates/interface/TauPFSpecific.h"
\brief Structure to hold information specific to a PFTau inside a pat::Tau
\brief Structure to hold information specific to a PFTau made from PFCandidates inside a pat::Tau

\author Giovanni Petrucciani
*/
Expand All @@ -24,8 +24,8 @@ struct TauPFSpecific {
// constructor from PFTau
TauPFSpecific(const reco::PFTau& tau);
// datamembers
reco::PFJetRef pfJetRef_;
reco::PFCandidatePtr leadPFChargedHadrCand_;
reco::JetBaseRef pfJetRef_;
reco::CandidatePtr leadPFChargedHadrCand_;
float leadPFChargedHadrCandsignedSipt_;
reco::PFCandidatePtr leadPFNeutralCand_;
reco::PFCandidatePtr leadPFCand_;
Expand Down
134 changes: 87 additions & 47 deletions DataFormats/PatCandidates/src/Tau.cc

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion DataFormats/PatCandidates/src/classes_def_objects.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@
<ioread sourceClass="pat::Tau" targetClass="pat::Tau" version="[1-]" source="" target="isolationPFGammaCandsTransientPtrs_">
<![CDATA[isolationPFGammaCandsTransientPtrs_.reset();]]>
</ioread>
<class name="pat::tau::TauPFSpecific" ClassVersion="15">
<class name="pat::tau::TauPFSpecific" ClassVersion="16">
<version ClassVersion="16" checksum="443572625"/>
<version ClassVersion="15" checksum="3425877587"/>
<version ClassVersion="14" checksum="1401440164"/>
<version ClassVersion="13" checksum="3129436753"/>
Expand All @@ -173,6 +174,7 @@
<version ClassVersion="10" checksum="2617942038"/>
</class>
<class name="std::vector<pat::tau::TauPFSpecific>" />

<class name="pat::tau::TauCaloSpecific" ClassVersion="11">
<version ClassVersion="11" checksum="943826557"/>
<version ClassVersion="10" checksum="2692173055"/>
Expand Down Expand Up @@ -617,6 +619,16 @@
<class name="edm::Wrapper< std::vector<edm::Ptr<pat::Jet> > >" />
<class name="edm::Wrapper< std::vector< std::vector<edm::Ptr<pat::Jet> > > >" />

<!-- Association for Jet, and AssociationMap Jet-PackedCandidate -->
<class name="edm::Association<std::vector<pat::Jet> >"/>
<class name="edm::Wrapper<edm::Association<std::vector<pat::Jet> > >"/>
<class name="edm::RefProd<vector<pat::Jet> >"/>
<class name="edm::AssociationMap<edm::OneToMany<std::vector<pat::Jet>,std::vector<pat::PackedCandidate>,unsigned int> >">
<field name="transientMap_" transient="true" />
</class>
<class name="edm::Wrapper<edm::AssociationMap<edm::OneToMany<std::vector<pat::Jet>,std::vector<pat::PackedCandidate>,unsigned int> > >"/>
<class name="edm::helpers::KeyVal<edm::RefProd<vector<pat::Jet> >,edm::RefProd<vector<pat::PackedCandidate> > >"/>

<class name="pat::PATTauDiscriminatorBase">
<field name="transientVector_" transient="true"/>
</class>
Expand Down
1 change: 1 addition & 0 deletions DataFormats/PatCandidates/src/classes_objects.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "DataFormats/Common/interface/ValueMap.h"
#include "DataFormats/Common/interface/Association.h"
#include "DataFormats/Common/interface/AssociationMap.h"
#include "DataFormats/Common/interface/Wrapper.h"
#include "DataFormats/Common/interface/PtrVector.h"
#include "DataFormats/Common/interface/FwdPtr.h"
Expand Down
6 changes: 3 additions & 3 deletions DataFormats/TauReco/interface/JetPiZeroAssociation.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

#include "DataFormats/Common/interface/AssociationVector.h"
#include "DataFormats/TauReco/interface/RecoTauPiZero.h"
#include "DataFormats/JetReco/interface/PFJetCollection.h"
#include "DataFormats/JetReco/interface/JetCollection.h"

namespace reco {
// This base class improves the readability of the ROOT class name by hiding
// the template crap
typedef edm::AssociationVector<PFJetRefProd, std::vector<std::vector<RecoTauPiZero> > >
typedef edm::AssociationVector<JetRefBaseProd, std::vector<std::vector<RecoTauPiZero> > >
JetPiZeroAssociationBase;

class JetPiZeroAssociation : public JetPiZeroAssociationBase {
Expand All @@ -17,7 +17,7 @@ namespace reco {
JetPiZeroAssociationBase()
{ }

JetPiZeroAssociation(const reco::PFJetRefProd & ref) :
JetPiZeroAssociation(const JetRefBaseProd & ref) :
JetPiZeroAssociationBase(ref)
{ }

Expand Down
6 changes: 3 additions & 3 deletions DataFormats/TauReco/interface/PFJetChargedHadronAssociation.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

#include "DataFormats/Common/interface/AssociationVector.h"
#include "DataFormats/TauReco/interface/PFRecoTauChargedHadron.h"
#include "DataFormats/JetReco/interface/PFJetCollection.h"
#include "DataFormats/JetReco/interface/JetCollection.h"

namespace reco
{
// This base class improves the readability of the ROOT class name by hiding
// the template crap
typedef edm::AssociationVector<PFJetRefProd, std::vector<std::vector<PFRecoTauChargedHadron> > > PFJetChargedHadronAssociationBase;
typedef edm::AssociationVector<JetRefBaseProd, std::vector<std::vector<PFRecoTauChargedHadron> > > PFJetChargedHadronAssociationBase;

class PFJetChargedHadronAssociation : public PFJetChargedHadronAssociationBase
{
Expand All @@ -18,7 +18,7 @@ namespace reco
: PFJetChargedHadronAssociationBase()
{}

PFJetChargedHadronAssociation(const reco::PFJetRefProd& ref)
PFJetChargedHadronAssociation(const reco::JetRefBaseProd& ref)
: PFJetChargedHadronAssociationBase(ref)
{}

Expand Down
20 changes: 13 additions & 7 deletions DataFormats/TauReco/interface/PFRecoTauChargedHadron.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
#define DataFormats_TauReco_PFRecoTauChargedHadron_h

#include "DataFormats/Candidate/interface/CompositePtrCandidate.h"
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
#include "DataFormats/Candidate/interface/CandidateFwd.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/Common/interface/Ptr.h"
#include "DataFormats/Math/interface/Point3D.h"

namespace reco { namespace tau {
template<class TrackClass>
class PFRecoTauChargedHadronFromGenericTrackPlugin;
class PFRecoTauChargedHadronFromPFCandidatePlugin;
class PFRecoTauChargedHadronFromTrackPlugin;
class RecoTauConstructor;
class PFRecoTauEnergyAlgorithmPlugin;
}}
Expand Down Expand Up @@ -47,13 +48,16 @@ class PFRecoTauChargedHadron : public CompositePtrCandidate
~PFRecoTauChargedHadron() override;

/// reference to "charged" PFCandidate (either charged PFCandidate or PFNeutralHadron)
const PFCandidatePtr& getChargedPFCandidate() const;
const CandidatePtr& getChargedPFCandidate() const;

/// reference to reco::Track
const TrackPtr& getTrack() const;

/// reference to "lostTrack Candidate" when chadron built with tracks stored as pat::PackedCandidates
const CandidatePtr& getLostTrackCandidate() const;

/// references to additional neutral PFCandidates
const std::vector<PFCandidatePtr>& getNeutralPFCandidates() const;
const std::vector<CandidatePtr>& getNeutralPFCandidates() const;

/// position at ECAL entrance
const math::XYZPointF& positionAtECALEntrance() const;
Expand All @@ -68,16 +72,18 @@ class PFRecoTauChargedHadron : public CompositePtrCandidate

private:
friend class tau::PFRecoTauChargedHadronFromPFCandidatePlugin;
friend class tau::PFRecoTauChargedHadronFromTrackPlugin;
template<class TrackClass>
friend class tau::PFRecoTauChargedHadronFromGenericTrackPlugin;
friend class tau::RecoTauConstructor;
friend class tau::PFRecoTauEnergyAlgorithmPlugin;
friend class ::PFRecoTauChargedHadronProducer;

PFRecoTauChargedHadronAlgorithm algo_;

PFCandidatePtr chargedPFCandidate_;
CandidatePtr chargedPFCandidate_;
CandidatePtr lostTrackCandidate_;
TrackPtr track_;
std::vector<PFCandidatePtr> neutralPFCandidates_;
std::vector<CandidatePtr> neutralPFCandidates_;

math::XYZPointF positionAtECALEntrance_;
};
Expand Down
108 changes: 68 additions & 40 deletions DataFormats/TauReco/interface/PFTau.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include "DataFormats/TauReco/interface/BaseTau.h"
#include "DataFormats/TauReco/interface/PFTauFwd.h"
#include "DataFormats/TauReco/interface/PFTauTagInfo.h"
#include "DataFormats/JetReco/interface/PFJetCollection.h"
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
#include "DataFormats/JetReco/interface/JetCollection.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/Candidate/interface/CandidateFwd.h"
#include "DataFormats/TauReco/interface/RecoTauPiZero.h"
#include "DataFormats/TauReco/interface/RecoTauPiZeroFwd.h"
#include "DataFormats/TauReco/interface/PFRecoTauChargedHadron.h"
Expand Down Expand Up @@ -58,59 +58,72 @@ class PFTau : public BaseTau {
~PFTau() override {};
PFTau* clone() const override;

const PFJetRef& jetRef() const;
void setjetRef(const PFJetRef&);
const JetBaseRef& jetRef() const;
void setjetRef(const JetBaseRef&);

// functions to access the PFTauTagInfoRef used by HLT
const PFTauTagInfoRef& pfTauTagInfoRef() const;
void setpfTauTagInfoRef(const PFTauTagInfoRef);

PFRecoTauChargedHadronRef leadTauChargedHadronCandidate() const;
const PFCandidatePtr& leadPFChargedHadrCand() const;
const PFCandidatePtr& leadPFNeutralCand() const;
const CandidatePtr& leadChargedHadrCand() const;
const CandidatePtr& leadNeutralCand() const;
//Can be either the charged or the neutral one
const PFCandidatePtr& leadPFCand() const;
const CandidatePtr& leadCand() const;

void setleadPFChargedHadrCand(const PFCandidatePtr&);
void setleadPFNeutralCand(const PFCandidatePtr&);
void setleadPFCand(const PFCandidatePtr&);
void setleadChargedHadrCand(const CandidatePtr&);
void setleadNeutralCand(const CandidatePtr&);
void setleadCand(const CandidatePtr&);

/// Signed transverse impact parameter significance of the Track
/// associated to the leading charged PFCandidate
float leadPFChargedHadrCandsignedSipt() const;
void setleadPFChargedHadrCandsignedSipt(const float&);

/// PFCandidates in signal region
const std::vector<reco::PFCandidatePtr>& signalPFCands() const;
void setsignalPFCands(const std::vector<reco::PFCandidatePtr>&);
/// Candidates in signal region
const std::vector<reco::CandidatePtr>& signalCands() const;
void setsignalCands(const std::vector<reco::CandidatePtr>&);

/// Charged hadrons in signal region
const std::vector<reco::PFCandidatePtr>& signalPFChargedHadrCands() const;
void setsignalPFChargedHadrCands(const std::vector<reco::PFCandidatePtr>&);
const std::vector<reco::CandidatePtr>& signalChargedHadrCands() const;
void setsignalChargedHadrCands(const std::vector<reco::CandidatePtr>&);

/// Neutral hadrons in signal region
const std::vector<reco::PFCandidatePtr>& signalPFNeutrHadrCands() const;
void setsignalPFNeutrHadrCands(const std::vector<reco::PFCandidatePtr>&);
const std::vector<reco::CandidatePtr>& signalNeutrHadrCands() const;
void setsignalNeutrHadrCands(const std::vector<reco::CandidatePtr>&);

/// Gamma candidates in signal region
const std::vector<reco::PFCandidatePtr>& signalPFGammaCands() const;
void setsignalPFGammaCands(const std::vector<reco::PFCandidatePtr>&);
const std::vector<reco::CandidatePtr>& signalGammaCands() const;
void setsignalGammaCands(const std::vector<reco::CandidatePtr>&);

/// PFCandidates in isolation region
const std::vector<reco::PFCandidatePtr>& isolationPFCands() const;
void setisolationPFCands(const std::vector<reco::PFCandidatePtr>&);
/// Candidates in isolation region
const std::vector<reco::CandidatePtr>& isolationCands() const;
void setisolationCands(const std::vector<reco::CandidatePtr>&);

/// Charged candidates in isolation region
const std::vector<reco::PFCandidatePtr>& isolationPFChargedHadrCands() const;
void setisolationPFChargedHadrCands(const std::vector<reco::PFCandidatePtr>&);
const std::vector<reco::CandidatePtr>& isolationChargedHadrCands() const;
void setisolationChargedHadrCands(const std::vector<reco::CandidatePtr>&);

//// Neutral hadrons in isolation region
const std::vector<reco::PFCandidatePtr>& isolationPFNeutrHadrCands() const;
void setisolationPFNeutrHadrCands(const std::vector<reco::PFCandidatePtr>&);
const std::vector<reco::CandidatePtr>& isolationNeutrHadrCands() const;
void setisolationNeutrHadrCands(const std::vector<reco::CandidatePtr>&);

/// Gamma candidates in isolation region
const std::vector<reco::CandidatePtr>& isolationGammaCands() const;
void setisolationGammaCands(const std::vector<reco::CandidatePtr>&);

/// Getters for different PFCandidates for PFTaus made from PFCandidates
const PFCandidatePtr leadPFChargedHadrCand() const;
const PFCandidatePtr leadPFNeutralCand() const;
const PFCandidatePtr leadPFCand() const;
const std::vector<reco::PFCandidatePtr>& signalPFCands() const;
const std::vector<reco::PFCandidatePtr>& signalPFChargedHadrCands() const;
const std::vector<reco::PFCandidatePtr>& signalPFNeutrHadrCands() const;
const std::vector<reco::PFCandidatePtr>& signalPFGammaCands() const;
const std::vector<reco::PFCandidatePtr>& isolationPFCands() const;
const std::vector<reco::PFCandidatePtr>& isolationPFChargedHadrCands() const;
const std::vector<reco::PFCandidatePtr>& isolationPFNeutrHadrCands() const;
const std::vector<reco::PFCandidatePtr>& isolationPFGammaCands() const;
void setisolationPFGammaCands(const std::vector<reco::PFCandidatePtr>&);

/// Sum of charged hadron candidate PT in isolation cone; returns NaN
/// if isolation region is undefined.
Expand Down Expand Up @@ -244,24 +257,39 @@ class PFTau : public BaseTau {

float signalConeSize_;

reco::PFJetRef jetRef_;
reco::JetBaseRef jetRef_;
PFTauTagInfoRef PFTauTagInfoRef_;
reco::PFCandidatePtr leadPFChargedHadrCand_;
reco::PFCandidatePtr leadPFNeutralCand_;
reco::PFCandidatePtr leadPFCand_;
reco::CandidatePtr leadChargedHadrCand_;
reco::CandidatePtr leadNeutralCand_;
reco::CandidatePtr leadCand_;
reco::TrackRef electronPreIDTrack_;

// Signal candidates
std::vector<reco::PFCandidatePtr> selectedSignalPFCands_;
std::vector<reco::PFCandidatePtr> selectedSignalPFChargedHadrCands_;
std::vector<reco::PFCandidatePtr> selectedSignalPFNeutrHadrCands_;
std::vector<reco::PFCandidatePtr> selectedSignalPFGammaCands_;
std::vector<reco::CandidatePtr> selectedSignalCands_;
std::vector<reco::CandidatePtr> selectedSignalChargedHadrCands_;
std::vector<reco::CandidatePtr> selectedSignalNeutrHadrCands_;
std::vector<reco::CandidatePtr> selectedSignalGammaCands_;

// Isolation candidates
std::vector<reco::PFCandidatePtr> selectedIsolationPFCands_;
std::vector<reco::PFCandidatePtr> selectedIsolationPFChargedHadrCands_;
std::vector<reco::PFCandidatePtr> selectedIsolationPFNeutrHadrCands_;
std::vector<reco::PFCandidatePtr> selectedIsolationPFGammaCands_;
std::vector<reco::CandidatePtr> selectedIsolationCands_;
std::vector<reco::CandidatePtr> selectedIsolationChargedHadrCands_;
std::vector<reco::CandidatePtr> selectedIsolationNeutrHadrCands_;
std::vector<reco::CandidatePtr> selectedIsolationGammaCands_;

// Transient caches for PFCandidate-based accessors
edm::AtomicPtrCache<reco::PFCandidatePtr> leadPFChargedHadrCand_;
edm::AtomicPtrCache<reco::PFCandidatePtr> leadPFNeutralCand_;
edm::AtomicPtrCache<reco::PFCandidatePtr> leadPFCand_;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why bother making these three be member data? Why not just do the conversion when the function requesting them is called?


edm::AtomicPtrCache<std::vector<reco::PFCandidatePtr> > selectedTransientSignalPFCands_;
edm::AtomicPtrCache<std::vector<reco::PFCandidatePtr> > selectedTransientSignalPFChargedHadrCands_;
edm::AtomicPtrCache<std::vector<reco::PFCandidatePtr> > selectedTransientSignalPFNeutrHadrCands_;
edm::AtomicPtrCache<std::vector<reco::PFCandidatePtr> > selectedTransientSignalPFGammaCands_;

edm::AtomicPtrCache<std::vector<reco::PFCandidatePtr> > selectedTransientIsolationPFCands_;
edm::AtomicPtrCache<std::vector<reco::PFCandidatePtr> > selectedTransientIsolationPFChargedHadrCands_;
edm::AtomicPtrCache<std::vector<reco::PFCandidatePtr> > selectedTransientIsolationPFNeutrHadrCands_;
edm::AtomicPtrCache<std::vector<reco::PFCandidatePtr> > selectedTransientIsolationPFGammaCands_;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have evidence that caching these results is actually beneficial? You could just return a copy of the vector from the function if it is called.


RecoTauPiZeroRefVector signalPiZeroCandidatesRefs_;
RecoTauPiZeroRefVector isolationPiZeroCandidatesRefs_;
Expand Down
Loading