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

Dynamic strip reco v3 #10605

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6f399b3
- dynamic strip reconstruction for Yuta
May 19, 2015
7a53594
fixed typo in discriminator name
May 19, 2015
95f3fb0
bug-fix in storing of (raw) footprint correction
May 19, 2015
a90295c
- store neutral pileup weighted isolation pT sum
May 19, 2015
b729963
added pileup weighted neutral isolation
May 19, 2015
b75f447
fixed typo in discriminator name
May 19, 2015
be2fd1b
updated parameters for dynamic strip reconstruction
May 24, 2015
dc1625e
New cleaner module that works also if tau is made up of combination of
anehrkor May 29, 2015
7462cdc
Merge pull request #9 from anehrkor/fixThreeProngCharge
May 29, 2015
10bfa9d
sutract 2 GeV from k offset values (except for 3prong0pi0), as recomm…
Jun 1, 2015
55e8a57
Merge branch 'DynamicStripReco_v2' of github.com:cms-tau-pog/cmssw in…
Jun 1, 2015
01212fc
added functionality to make tau footprint correction dependent on tauPt
Jun 3, 2015
760321e
tightened cut on pTouter from 0.20*tauPt to 0.10*tauPt
Jun 9, 2015
58113d5
apply cut on ptOuter also in case of HPS combined islation 3-hit disc…
Jun 9, 2015
cc6bf3c
- updated deltaBeta correction factor to 0.2
Jun 10, 2015
a451d55
updates to tau vertex producers from Arun
Jul 8, 2015
e1c054f
- dynamic strip reconstruction for Yuta
May 19, 2015
c26646c
fixed typo in discriminator name
May 19, 2015
9e81b22
bug-fix in storing of (raw) footprint correction
May 19, 2015
b71d423
- store neutral pileup weighted isolation pT sum
May 19, 2015
00052a2
added pileup weighted neutral isolation
May 19, 2015
a8ebbe6
fixed typo in discriminator name
May 19, 2015
0fbd342
updated parameters for dynamic strip reconstruction
May 24, 2015
40fae23
New cleaner module that works also if tau is made up of combination of
anehrkor May 29, 2015
5ac4715
sutract 2 GeV from k offset values (except for 3prong0pi0), as recomm…
Jun 1, 2015
48e4e2f
added functionality to make tau footprint correction dependent on tauPt
Jun 3, 2015
96af3ab
tightened cut on pTouter from 0.20*tauPt to 0.10*tauPt
Jun 9, 2015
7b3568d
apply cut on ptOuter also in case of HPS combined islation 3-hit disc…
Jun 9, 2015
ff1b211
- updated deltaBeta correction factor to 0.2
Jun 10, 2015
abaac8e
updates to tau vertex producers from Arun
Jul 8, 2015
d3058a0
Added missing discriminators to updateHPSPFTaus_cff.py - their absenc…
andrewj314 Jul 16, 2015
1765f58
Added import statements whose absence was causing the unit tests to fail
andrewj314 Jul 19, 2015
16846ea
updated patTau selection to use new discriminators
Jul 22, 2015
5fd9900
Merge branch 'DynamicStripReco_v2' of github.com:cms-tau-pog/cmssw in…
Jul 22, 2015
72a0586
Merged DynamicStripReco_v2 from repository cms-tau-pog
andrewj314 Aug 5, 2015
3a3c707
New attempt to add Dynamic Strip Reco to 7_6_X - a new PR was necessa…
andrewj314 Aug 6, 2015
732990d
Added fillDescriptions() method, reverted HLT dumps to previous versi…
andrewj314 Aug 9, 2015
3115aed
Added Christian's alternate fix to the HLT issues. Now passing all te…
andrewj314 Aug 11, 2015
398866a
Per Slava's suggestion, removed modules from cms.Sequence and added t…
andrewj314 Aug 13, 2015
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
1 change: 0 additions & 1 deletion CommonTools/ParticleFlow/python/pfTaus_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
pfTauTagInfoProducer.PFCandidateProducer = jetConfig.ak4PFJets.src
pfTauTagInfoProducer.PFJetTracksAssociatorProducer = 'pfJetTracksAssociatorAtVertex'


pfTausPreSequence = cms.Sequence(
pfJetTracksAssociatorAtVertex +
pfTauPFJets08Region +
Expand Down
15 changes: 13 additions & 2 deletions DataFormats/TauReco/interface/PFTau.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,16 @@ class PFTau : public BaseTau {
/// Retrieve the identified hadronic decay mode according to the number of
/// charged and piZero candidates in the signal cone
hadronicDecayMode decayMode() const;
hadronicDecayMode calculateDecayMode() const;
void setDecayMode(const hadronicDecayMode&);

/// Effect of eta and phi correction of strip on mass of tau candidate
double bendCorrMass() const { return bendCorrMass_; }
void setBendCorrMass(double bendCorrMass) { bendCorrMass_ = bendCorrMass; }
Copy link
Contributor

Choose a reason for hiding this comment

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

use float here and below (to match the internal precision)


/// Size of signal cone
double signalConeSize() const { return signalConeSize_; }
void setSignalConeSize(double signalConeSize) { signalConeSize_ = signalConeSize; }

//Electron rejection
float emFraction() const; // Ecal/Hcal Cluster Energy
float hcalTotOverPLead() const; // total Hcal Cluster E / leadPFChargedHadron P
Expand Down Expand Up @@ -192,7 +199,7 @@ class PFTau : public BaseTau {
CandidatePtr sourceCandidatePtr( size_type i ) const;

/// prints information on this PFTau
void dump(std::ostream& out=std::cout) const;
void dump(std::ostream& out = std::cout) const;

private:
friend class tau::RecoTauConstructor;
Expand Down Expand Up @@ -226,6 +233,10 @@ class PFTau : public BaseTau {

hadronicDecayMode decayMode_;

float bendCorrMass_;

float signalConeSize_;

reco::PFJetRef jetRef_;
PFTauTagInfoRef PFTauTagInfoRef_;
reco::PFCandidatePtr leadPFChargedHadrCand_;
Expand Down
64 changes: 49 additions & 15 deletions DataFormats/TauReco/interface/RecoTauPiZero.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,57 @@ class RecoTauPiZero : public CompositePtrCandidate {
kStrips = 3
};

RecoTauPiZero():CompositePtrCandidate(),algoName_(kUndefined){
this->setPdgId(111); }

RecoTauPiZero(PiZeroAlgorithm algoName):
CompositePtrCandidate(), algoName_(algoName) { this->setPdgId(111); }
RecoTauPiZero()
: CompositePtrCandidate(),
algoName_(kUndefined)
Copy link
Contributor

Choose a reason for hiding this comment

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

initialize data members here instead of the body of the constructor (for all simple initializations)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@slava77 I'm not sure what you mean here - does this mean set bendCorrEta_ = 0 (e.g.) outside of the RecoTauPiZero() : CompositePtrCandidate(), algoName_ brackets?

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant to initialize it in the member initializer list; the comma-separated list between ":" and "{"

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'm afraid I still don't understand - at least, it's not compiling if I do:
RecoTauPiZero()
: CompositePtrCandidate(),
algoName_(kUndefined), bendCorrEta_, bendCorrPhi_
{
bendCorrEta_ = 0.;
bendCorrPhi_ = 0.;
this->setPdgId(111);
}

or if I do:

RecoTauPiZero()
  : CompositePtrCandidate(),
    algoName_(kUndefined), bendCorrEta_ = 0., bendCorrPhi_ = 0.
{
  this->setPdgId(111);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

sigh.
CompositePtrCandidate(), algoName_(kUndefined), bendCorrEta_ (0.), bendCorrPhi_( 0.)

May I suggest to leaf through an entry level book on c++ programming before working on a next PR?

{
this->setPdgId(111);
bendCorrEta_ = 0.;
bendCorrPhi_ = 0.;
}

RecoTauPiZero(PiZeroAlgorithm algoName)
: CompositePtrCandidate(),
algoName_(algoName)
{
this->setPdgId(111);
bendCorrEta_ = 0.;
bendCorrPhi_ = 0.;
}

/// constructor from values
RecoTauPiZero(Charge q, const LorentzVector& p4,
const Point& vtx = Point( 0, 0, 0 ),
int pdgId = 111, int status = 0, bool integerCharge = true,
PiZeroAlgorithm algoName=kUndefined):
CompositePtrCandidate(
q, p4, vtx, pdgId, status, integerCharge ),algoName_(algoName) {}
PiZeroAlgorithm algoName = kUndefined)
: CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge ),
algoName_(algoName)
{
bendCorrEta_ = 0.;
bendCorrPhi_ = 0.;
}

/// constructor from values
RecoTauPiZero(Charge q, const PolarLorentzVector& p4,
const Point& vtx = Point( 0, 0, 0 ),
int pdgId = 111, int status = 0, bool integerCharge = true,
PiZeroAlgorithm algoName=kUndefined):
CompositePtrCandidate(
q, p4, vtx, pdgId, status, integerCharge ),algoName_(algoName) {}
PiZeroAlgorithm algoName=kUndefined)
: CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge ),
algoName_(algoName)
{
bendCorrEta_ = 0.;
bendCorrPhi_ = 0.;
}

/// constructor from a Candidate
explicit RecoTauPiZero(
const Candidate & p, PiZeroAlgorithm algoName=kUndefined):
CompositePtrCandidate(p),algoName_(algoName) { this->setPdgId(111); }
explicit RecoTauPiZero(const Candidate& p, PiZeroAlgorithm algoName = kUndefined)
: CompositePtrCandidate(p),
algoName_(algoName)
{
this->setPdgId(111);
bendCorrEta_ = 0.;
bendCorrPhi_ = 0.;
}

/// destructor
~RecoTauPiZero(){};
Expand All @@ -62,11 +87,20 @@ class RecoTauPiZero : public CompositePtrCandidate {
/// Check whether a given algo produced this pi zero
bool algoIs(PiZeroAlgorithm algo) const;

void print(std::ostream& out=std::cout) const;
/// Size of correction to account for spread of photon energy in eta and phi
/// in case charged pions make nuclear interactions or photons convert within the tracking detector
float bendCorrEta() const { return bendCorrEta_; }
float bendCorrPhi() const { return bendCorrPhi_; }
void setBendCorrEta(float bendCorrEta) { bendCorrEta_ = bendCorrEta; }
void setBendCorrPhi(float bendCorrPhi) { bendCorrPhi_ = bendCorrPhi; }

void print(std::ostream& out = std::cout) const;

private:
PiZeroAlgorithm algoName_;

float bendCorrEta_;
float bendCorrPhi_;
};

std::ostream & operator<<(std::ostream& out, const RecoTauPiZero& c);
Expand Down
28 changes: 7 additions & 21 deletions DataFormats/TauReco/src/PFTau.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ PFTau::PFTau()
hcalTotOverPLead_ = NAN;
hcalMaxOverPLead_ = NAN;
hcal3x3OverPLead_ = NAN;
ecalStripSumEOverPLead_= NAN;
ecalStripSumEOverPLead_ = NAN;
bremsRecoveryEOverPLead_ = NAN;
electronPreIDOutput_ = NAN;
electronPreIDDecision_= NAN;
electronPreIDDecision_ = NAN;
caloComp_ = NAN;
segComp_ = NAN;
muonDecision_ = NAN;
decayMode_=kNull;
decayMode_ = kNull;
bendCorrMass_ = 0.;
Copy link
Contributor

Choose a reason for hiding this comment

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

where is the signalConeSize_ initialization?

}

PFTau::PFTau(Charge q, const LorentzVector& p4, const Point& vtx)
Expand All @@ -40,12 +41,13 @@ PFTau::PFTau(Charge q, const LorentzVector& p4, const Point& vtx)
ecalStripSumEOverPLead_= NAN;
bremsRecoveryEOverPLead_ = NAN;
electronPreIDOutput_ = NAN;
electronPreIDDecision_= NAN;
electronPreIDDecision_ = NAN;

caloComp_ = NAN;
segComp_ = NAN;
muonDecision_ = NAN;
decayMode_=kNull;
decayMode_ = kNull;
bendCorrMass_ = 0.;
}

PFTau* PFTau::clone() const { return new PFTau(*this); }
Expand Down Expand Up @@ -177,22 +179,6 @@ void PFTau::setIsolationTauChargedHadronCandidatesRefs(const PFRecoTauChargedHad

PFTau::hadronicDecayMode PFTau::decayMode() const { return decayMode_; }

PFTau::hadronicDecayMode PFTau::calculateDecayMode() const {
unsigned int nCharged = signalTauChargedHadronCandidates().size();
unsigned int nPiZeros = signalPiZeroCandidates().size();
// If no tracks exist, this is definitely not a tau!
if ( !nCharged ) return kNull;
// Find the maximum number of PiZeros our parameterization can hold
const unsigned int maxPiZeros = kOneProngNPiZero;
// Determine our track index
unsigned int trackIndex = (nCharged - 1)*(maxPiZeros + 1);
// Check if we handle the given number of tracks
if ( trackIndex >= kRareDecayMode ) return kRareDecayMode;

if(nPiZeros>maxPiZeros) nPiZeros=maxPiZeros;
return static_cast<PFTau::hadronicDecayMode>(trackIndex + nPiZeros);
}

void PFTau::setDecayMode(const PFTau::hadronicDecayMode& dm){ decayMode_=dm;}

// Setting information about the isolation region
Expand Down
44 changes: 22 additions & 22 deletions DataFormats/TauReco/src/RecoTauPiZero.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "DataFormats/TauReco/interface/RecoTauPiZero.h"
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
#include "DataFormats/Math/interface/deltaPhi.h"

namespace reco {
Expand Down Expand Up @@ -55,31 +56,30 @@ bool RecoTauPiZero::algoIs(RecoTauPiZero::PiZeroAlgorithm algo) const {
return (algoName_ == algo);
}

namespace {
std::ostream& operator<<(std::ostream& out, const reco::Candidate::LorentzVector& p4)
namespace
{
out << "(mass/pt/eta/phi) (" << std::setiosflags(std::ios::fixed) << std::setprecision(2)
<< p4.mass() << "/" << std::setprecision(1) << p4.pt() << "/" << std::setprecision(2) << p4.eta()
<< "/" << std::setprecision(2) << p4.phi() << ")";
return out;
}
std::string getPFCandidateType(reco::PFCandidate::ParticleType pfCandidateType)
{
if ( pfCandidateType == reco::PFCandidate::X ) return "undefined";
else if ( pfCandidateType == reco::PFCandidate::h ) return "PFChargedHadron";
else if ( pfCandidateType == reco::PFCandidate::e ) return "PFElectron";
else if ( pfCandidateType == reco::PFCandidate::mu ) return "PFMuon";
else if ( pfCandidateType == reco::PFCandidate::gamma ) return "PFGamma";
else if ( pfCandidateType == reco::PFCandidate::h0 ) return "PFNeutralHadron";
else if ( pfCandidateType == reco::PFCandidate::h_HF ) return "HF_had";
else if ( pfCandidateType == reco::PFCandidate::egamma_HF ) return "HF_em";
else assert(0);
}
}

void RecoTauPiZero::print(std::ostream& out) const {
if (!out) return;

out << "RecoTauPiZero: " << this->p4() <<
" nDaughters: " << this->numberOfDaughters() <<
" (gamma/e) (" << this->numberOfGammas() << "/" << this->numberOfElectrons() << ")" <<
" maxDeltaPhi: " << std::setprecision(3) << maxDeltaPhi() <<
" maxDeltaEta: " << std::setprecision(3) << maxDeltaEta() <<
" algo: " << algo() <<
std::endl;

for(size_t i = 0; i < this->numberOfDaughters(); ++i)
{
out << "--- daughter " << i << ": " << daughterPtr(i)->p4() <<
" key: " << daughterPtr(i).key() << std::endl;
void RecoTauPiZero::print(std::ostream& stream) const
{
std::cout << "Pt = " << this->pt() << ", eta = " << this->eta() << ", phi = " << this->phi() << std::endl;
size_t numDaughters = this->numberOfDaughters();
for ( size_t iDaughter = 0; iDaughter < numDaughters; ++iDaughter ) {
const reco::PFCandidate* daughter = dynamic_cast<const reco::PFCandidate*>(this->daughterPtr(iDaughter).get());
std::cout << " daughter #" << iDaughter << " (" << getPFCandidateType(daughter->particleId()) << "):"
<< " Pt = " << daughter->pt() << ", eta = " << daughter->eta() << ", phi = " << daughter->phi() << std::endl;
}
}

Expand Down
20 changes: 11 additions & 9 deletions DataFormats/TauReco/src/classes_def_2.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<lcgdict>

<class name="reco::PFTau" ClassVersion="18">
<class name="reco::PFTau" ClassVersion="19">
<version ClassVersion="19" checksum="4003955973"/>
<version ClassVersion="18" checksum="1318776182"/>
<version ClassVersion="17" checksum="1523260402"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

please put the old indentation back so that only essential changes appear in diffs

<version ClassVersion="16" checksum="2695990650"/>
<version ClassVersion="15" checksum="4105994460"/>
<version ClassVersion="14" checksum="3087106015"/>
<version ClassVersion="13" checksum="1088944403"/>
<version ClassVersion="12" checksum="3369965409"/>
<version ClassVersion="11" checksum="2334259986"/>
<version ClassVersion="16" checksum="2695990650"/>
<version ClassVersion="15" checksum="4105994460"/>
<version ClassVersion="14" checksum="3087106015"/>
<version ClassVersion="13" checksum="1088944403"/>
<version ClassVersion="12" checksum="3369965409"/>
<version ClassVersion="11" checksum="2334259986"/>
<field name="signalPiZeroCandidates_" transient="true"/>
<field name="isolationPiZeroCandidates_" transient="true"/>
<field name="signalTauChargedHadronCandidates_" transient="true"/>
<field name="isolationTauChargedHadronCandidates_" transient="true"/>
<version ClassVersion="10" checksum="2369119060"/>
<version ClassVersion="10" checksum="2369119060"/>
</class>

<class name="std::vector<reco::PFTau>"/>
Expand Down Expand Up @@ -265,7 +266,8 @@ isolationTauChargedHadronCandidates_.clear();
<class name="edm::Wrapper<edm::Association<std::vector<reco::PFTauDecayMode> > >"/>
<class name="edm::Wrapper<edm::Association<std::vector<reco::PFTau> > >"/>

<class name="reco::RecoTauPiZero" ClassVersion="13">
<class name="reco::RecoTauPiZero" ClassVersion="14">
<version ClassVersion="14" checksum="3535311745"/>
<version ClassVersion="13" checksum="3687187514"/>
<version ClassVersion="12" checksum="453348937"/>
<version ClassVersion="11" checksum="2458276705"/>
Expand Down
6 changes: 3 additions & 3 deletions PhysicsTools/PatAlgos/python/cleaningLayer1/tauCleaner_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
preselection = cms.string(
'tauID("decayModeFinding") > 0.5 &'
' tauID("byLooseCombinedIsolationDeltaBetaCorr3Hits") > 0.5 &'
' tauID("againstMuonTight") > 0.5 &'
' tauID("againstElectronMedium") > 0.5'
' tauID("againstMuonTight3") > 0.5 &'
' tauID("againstElectronVLooseMVA5") > 0.5'
),

# overlap checking configurables
Expand All @@ -34,5 +34,5 @@
),

# finalCut (any string-based cut on pat::Tau)
finalCut = cms.string('pt > 20. & abs(eta) < 2.3'),
finalCut = cms.string('pt > 18. & abs(eta) < 2.3'),
)
Loading