CMS 3D CMS Logo

Namespaces | Classes | Typedefs | Enumerations | Functions
reco::tau Namespace Reference

Namespaces

 cone
 
 disc
 
 helpers
 
 qcuts
 
 xclean
 

Classes

class  AssociationMatchRefSelector
 
class  Combinatoric
 
class  CombinatoricGenerator
 
class  CombinatoricIterator
 
class  PATTauDiscriminationByMVAIsolationRun2
 
class  PFRecoTauChargedHadronBuilderPlugin
 
class  PFRecoTauChargedHadronFromGenericTrackPlugin
 
class  PFRecoTauChargedHadronFromPFCandidatePlugin
 
class  PFRecoTauChargedHadronQualityPlugin
 
class  PFRecoTauChargedHadronStringQuality
 
class  PFRecoTauDiscriminationByMVAIsolationRun2
 
class  PFRecoTauEnergyAlgorithmPlugin
 
class  PFRecoTauMassPlugin
 
class  RecoTauBuilderCombinatoricPlugin
 
class  RecoTauBuilderConePlugin
 
class  RecoTauBuilderPlugin
 
class  RecoTauChargeCleanerPlugin
 
class  RecoTauChargedHadronMultiplicityCleanerPlugin
 
class  RecoTauCleanerPlugin
 
class  RecoTauConstructor
 
class  RecoTauDiscriminantCleanerPlugin
 
class  RecoTauDiscriminantFromDiscriminator
 
class  RecoTauDiscriminantFunctionPlugin
 
class  RecoTauDiscriminantInvariantWidth
 
class  RecoTauDiscriminantPlugin
 
class  RecoTauDiscriminantVectorFunctionPlugin
 
class  RecoTauDiscriminationBinnedIsolation
 
class  RecoTauDiscriminationBinnedIsolationImpl
 
class  RecoTauElectronRejectionPlugin
 
class  RecoTauEnergyRecoveryPlugin2
 
class  RecoTauEventHolderPlugin
 
class  RecoTauImpactParameterSignificancePlugin
 
class  RecoTauIsolationMasking
 
class  RecoTauLexicographicalRanking
 
class  RecoTauModifierPlugin
 
class  RecoTauNamedPlugin
 
class  RecoTauObjectEmbedder
 
class  RecoTauPhotonFilter
 
class  RecoTauPiZeroBuilderPlugin
 
class  RecoTauPiZeroCombinatoricPlugin
 
class  RecoTauPiZeroQualityPlugin
 
class  RecoTauPiZeroStringQuality
 
class  RecoTauPiZeroStripPlugin
 
class  RecoTauPiZeroStripPlugin2
 
class  RecoTauPiZeroStripPlugin3
 
class  RecoTauPiZeroTrivialPlugin
 
class  RecoTauQualityCuts
 
class  RecoTauRandomCleanerPlugin
 
class  RecoTauSoftTwoProngTausCleanerPlugin
 
class  RecoTauStringCleanerPlugin
 
class  RecoTauTagInfoWorkaroundModifer
 
class  RecoTauTwoProngFilter
 
class  RecoTauVertexAssociator
 
class  SortByDescendingPt
 
class  SortPFCandsDescendingPt
 

Typedefs

typedef tau::CombinatoricGenerator< ChargedHadronListChargedHadronCombo
 
typedef std::vector< reco::PFRecoTauChargedHadronChargedHadronList
 
typedef PFRecoTauChargedHadronFromGenericTrackPlugin< pat::PackedCandidatePFRecoTauChargedHadronFromLostTrackPlugin
 
typedef PFRecoTauChargedHadronFromGenericTrackPlugin< reco::TrackPFRecoTauChargedHadronFromTrackPlugin
 
typedef tau::CombinatoricGenerator< PiZeroListPiZeroCombo
 
typedef std::vector< RecoTauPiZeroPiZeroList
 

Enumerations

enum  {
  kOldDMwoLT, kOldDMwLT, kNewDMwoLT, kNewDMwLT,
  kDBoldDMwLT, kDBnewDMwLT, kPWoldDMwLT, kPWnewDMwLT,
  kDBoldDMwLTwGJ, kDBnewDMwLTwGJ
}
 

Functions

math::XYZPointF atECALEntrance (const reco::Candidate *part, double bField)
 
template<typename RefVectorType , typename BaseView >
RefVectorType castView (const edm::Handle< BaseView > &view)
 Convert a BaseView (View<T>) to a TRefVector. More...
 
unsigned int chargedHadronsInDecayMode (PFTau::hadronicDecayMode mode)
 Reverse mapping of decay modes into multiplicities. More...
 
template<typename Container , class OverlapFunction >
Container cleanOverlaps (const Container &dirty)
 
reco::Candidate::LorentzVector compChargedHadronP4fromPThetaPhi (double, double, double)
 
reco::Candidate::LorentzVector compChargedHadronP4fromPxPyPz (double, double, double)
 
void countHits (const reco::Muon &muon, std::vector< int > &numHitsDT, std::vector< int > &numHitsCSC, std::vector< int > &numHitsRPC)
 
void countMatches (const reco::Muon &muon, std::vector< int > &numMatchesDT, std::vector< int > &numMatchesCSC, std::vector< int > &numMatchesRPC)
 
std::string discPluginName (const std::string &mvaName)
 
float eratio (const reco::PFTau &tau)
 return ratio of energy in ECAL over sum of energy in ECAL and HCAL More...
 
float eratio (const pat::Tau &tau)
 
std::pair< edm::ParameterSet, edm::ParameterSetfactorizePUQCuts (const edm::ParameterSet &inputSet)
 
bool fillIsoMVARun2Inputs (float *mvaInput, const pat::Tau &tau, int mvaOpt, const std::string &nameCharged, const std::string &nameNeutral, const std::string &namePu, const std::string &nameOutside, const std::string &nameFootprint)
 
template<typename Iterator >
std::vector< CandidatePtrfilterPFCandidates (const Iterator &begin, const Iterator &end, int pdgId, bool sort=true)
 
std::vector< CandidatePtrflattenPiZeros (const std::vector< RecoTauPiZero >::const_iterator &, const std::vector< RecoTauPiZero >::const_iterator &)
 Flatten a list of pi zeros into a list of there constituent PFCandidates. More...
 
std::vector< CandidatePtrflattenPiZeros (const std::vector< RecoTauPiZero > &)
 
std::string format_vint (const std::vector< int > &vi)
 
PFTau::hadronicDecayMode getDecayMode (const reco::GenJet *genJet)
 
const reco::TrackgetTrackFromChargedHadron (const reco::PFRecoTauChargedHadron &chargedHadron)
 
template<class Base , class Der >
bool isPtrEqual (const edm::Ptr< Base > &b, const edm::Ptr< Der > &d)
 
template<class Base >
bool isPtrEqual (const edm::Ptr< Base > &b, const edm::Ptr< Base > &d)
 
float lead_track_chi2 (const reco::PFTau &tau)
 return chi2 of the leading track ==> deprecated? <== More...
 
template<typename InputIterator >
InputIterator leadCand (InputIterator begin, InputIterator end)
 
unsigned int n_photons_total (const reco::PFTau &tau)
 return total number of pf photon candidates with pT>500 MeV, which are associated to signal More...
 
unsigned int n_photons_total (const pat::Tau &tau)
 
std::vector< CandidatePtrpfCandidates (const Jet &jet, int particleId, bool sort=true)
 
std::vector< CandidatePtrpfCandidates (const Jet &jet, const std::vector< int > &particleIds, bool sort=true)
 Extract pfCandidates of a that match a list of particle Ids from a PFJet. More...
 
std::vector< CandidatePtrpfCandidatesByPdgId (const Jet &jet, int pdgId, bool sort=true)
 
std::vector< CandidatePtrpfCandidatesByPdgId (const Jet &jet, const std::vector< int > &pdgIds, bool sort=true)
 Extract pfCandidates of a that match a list of PDG Ids from a PFJet. More...
 
std::vector< CandidatePtrpfChargedCands (const Jet &jet, bool sort=true)
 Extract all non-neutral candidates from a PFJet. More...
 
std::vector< CandidatePtrpfGammas (const Jet &jet, bool sort=true)
 Extract all pfGammas from a PFJet. More...
 
unsigned int piZerosInDecayMode (PFTau::hadronicDecayMode mode)
 
float pt_weighted_deta_strip (const reco::PFTau &tau, int dm)
 
float pt_weighted_deta_strip (const pat::Tau &tau, int dm)
 
float pt_weighted_dphi_strip (const reco::PFTau &tau, int dm)
 
float pt_weighted_dphi_strip (const pat::Tau &tau, int dm)
 
float pt_weighted_dr_iso (const reco::PFTau &tau, int dm)
 
float pt_weighted_dr_iso (const pat::Tau &tau, int dm)
 
float pt_weighted_dr_signal (const reco::PFTau &tau, int dm)
 
float pt_weighted_dr_signal (const pat::Tau &tau, int dm)
 
float pt_weighted_dx (const reco::PFTau &tau, int mode=0, int var=0, int decaymode=-1)
 
float pt_weighted_dx (const pat::Tau &tau, int mode=0, int var=0, int decaymode=-1)
 
template<typename T >
float pt_weighted_dx_T (const typename T::Tau_t &tau, int mode, int var, int decaymode)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< PATTauDiscriminationByMVAIsolationRun2 > > s_filler__LINE__ ("PATTauDiscriminationByMVAIsolationRun2")
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< PFRecoTauDiscriminationByMVAIsolationRun2 > > s_filler__LINE__ ("PFRecoTauDiscriminationByMVAIsolationRun2")
 
static const edm::MakerPluginFactory::PMaker< edm::WorkerMaker< PATTauDiscriminationByMVAIsolationRun2 > > s_maker__LINE__ ("PATTauDiscriminationByMVAIsolationRun2")
 
static const edm::MakerPluginFactory::PMaker< edm::WorkerMaker< PFRecoTauDiscriminationByMVAIsolationRun2 > > s_maker__LINE__ ("PFRecoTauDiscriminationByMVAIsolationRun2")
 
void setChargedHadronP4 (reco::PFRecoTauChargedHadron &chargedHadron, double scaleFactor_neutralPFCands=1.0)
 
template<typename InputIterator >
int sumPFCandCharge (InputIterator begin, InputIterator end)
 Sum the charge of a collection of PFCandidates. More...
 
template<typename InputIterator >
reco::Candidate::LorentzVector sumPFCandP4 (InputIterator begin, InputIterator end)
 
template<typename InputIterator >
double sumPFCandPt (InputIterator begin, InputIterator end)
 Sum the pT of a collection of PFCandidates. More...
 
template<typename InputIterator , typename FunctionPtr , typename ReturnType >
ReturnType sumPFVector (InputIterator begin, InputIterator end, FunctionPtr func, ReturnType init)
 Sum the four vectors in a collection of PFCandidates. More...
 
template<typename InputIterator >
InputIterator takeNElements (const InputIterator &begin, const InputIterator &end, size_t N)
 
PFTau::hadronicDecayMode translateDecayMode (unsigned int nCharged, unsigned int nPiZero)
 
PFTau::hadronicDecayMode translateGenDecayModeToReco (const std::string &genName)
 Convert a genTau decay mode string ('oneProng0Pi0') to the RECO enum. More...
 
std::string translateRecoDecayModeToGen (PFTau::hadronicDecayMode decayMode)
 Convert a RECO enum decay mode to a string ('oneProng0Pi0') More...
 

Typedef Documentation

Definition at line 24 of file RecoTauBuilderCombinatoricPlugin.cc.

Definition at line 23 of file RecoTauBuilderCombinatoricPlugin.cc.

Definition at line 26 of file RecoTauBuilderCombinatoricPlugin.cc.

typedef std::vector< RecoTauPiZero > reco::tau::PiZeroList

Definition at line 25 of file RecoTauBuilderCombinatoricPlugin.cc.

Enumeration Type Documentation

anonymous enum

Function Documentation

math::XYZPointF reco::tau::atECALEntrance ( const reco::Candidate part,
double  bField 
)

Definition at line 108 of file RecoTauCommonUtilities.cc.

References ecalTB2006H4_GenSimDigiReco_cfg::bField, reco::Candidate::charge(), reco::Candidate::energy(), BaseParticlePropagator::getSuccess(), BaseParticlePropagator::particle(), reco::PFCandidate::positionAtECALEntrance(), BaseParticlePropagator::propagateToEcalEntrance(), reco::Candidate::px(), reco::Candidate::py(), reco::Candidate::pz(), reco::Candidate::vertex(), and RawParticle::vertex().

Referenced by leadCand(), reco::tau::PFRecoTauChargedHadronFromPFCandidatePlugin::operator()(), and reco::tau::PFRecoTauChargedHadronFromGenericTrackPlugin< TrackClass >::operator()().

108  {
109  const reco::PFCandidate* pfCand = dynamic_cast<const reco::PFCandidate*>(part);
110  if (pfCand)
111  return pfCand->positionAtECALEntrance();
112 
114  BaseParticlePropagator theParticle =
116  part->py(),
117  part->pz(),
118  part->energy()),
119  math::XYZTLorentzVector(part->vertex().x(),
120  part->vertex().y(),
121  part->vertex().z(),
122  0.)),
123  part->charge(),
124  0.,0.,bField);
125  theParticle.propagateToEcalEntrance(false);
126  if(theParticle.getSuccess()!=0){
127  pos = math::XYZPointF(theParticle.particle().vertex());
128  }
129  return pos;
130 }
virtual double pz() const =0
z coordinate of momentum vector
int getSuccess() const
Has propagation been performed and was barrel or endcap reached ?
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
RawParticle const & particle() const
The particle being propagated.
const math::XYZPointF & positionAtECALEntrance() const
Definition: PFCandidate.h:368
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
virtual double energy() const =0
energy
virtual double py() const =0
y coordinate of momentum vector
bool propagateToEcalEntrance(bool first=true)
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:339
part
Definition: HCALResponse.h:20
virtual int charge() const =0
electric charge
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
virtual const Point & vertex() const =0
vertex position
virtual double px() const =0
x coordinate of momentum vector
template<typename RefVectorType , typename BaseView >
RefVectorType reco::tau::castView ( const edm::Handle< BaseView > &  view)

Convert a BaseView (View<T>) to a TRefVector.

Definition at line 86 of file RecoTauCommonUtilities.h.

References mps_fire::i, and convertSQLitetoXML_cfg::output.

86  {
87  typedef typename RefVectorType::value_type OutputRef;
88  // Double check at compile time that the inheritance is okay. It can still
89  // fail at runtime if you pass it the wrong collection.
90  static_assert(
91  (boost::is_base_of<typename BaseView::value_type,
92  typename RefVectorType::member_type>::value));
93  RefVectorType output;
94  size_t nElements = view->size();
95  output.reserve(nElements);
96  // Cast each of our Refs
97  for (size_t i = 0; i < nElements; ++i) {
98  output.push_back(view->refAt(i).template castTo<OutputRef>());
99  }
100  return output;
101 }
Definition: value.py:1
unsigned int reco::tau::chargedHadronsInDecayMode ( PFTau::hadronicDecayMode  mode)

Reverse mapping of decay modes into multiplicities.

Definition at line 45 of file PFTauDecayModeTools.cc.

References reco::PFTau::kOneProngNPiZero, and mode.

45  {
46  int modeAsInt = static_cast<int>(mode);
47  return (modeAsInt / PFTau::kOneProngNPiZero) + 1;
48 }
reco::PFTau::hadronicDecayMode mode
template<typename Container , class OverlapFunction >
Container reco::tau::cleanOverlaps ( const Container &  dirty)

Definition at line 33 of file RecoTauCleaningTools.h.

References clean, and analyzePatCleaning_cfg::overlaps.

33  {
34  typedef typename Container::const_iterator Iterator;
35  // Output container of clean objects
37  OverlapFunction overlapChecker;
38  for (Iterator candidate = dirty.begin(); candidate != dirty.end();
39  ++candidate) {
40  // Check if this overlaps with a pizero already in the clean list
41  bool overlaps = false;
42  for (Iterator cleaned = clean.begin();
43  cleaned != clean.end() && !overlaps; ++cleaned) {
44  overlaps = overlapChecker(*candidate, *cleaned);
45  }
46  // If it didn't overlap with anything clean, add it to the clean list
47  if (!overlaps)
48  clean.insert(clean.end(), *candidate);
49  }
50  return clean;
51 }
TGeoIterator Iterator
std::vector< T * > clean
Definition: MVATrainer.cc:154
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
reco::Candidate::LorentzVector reco::tau::compChargedHadronP4fromPThetaPhi ( double  chargedHadronP,
double  chargedHadronTheta,
double  chargedHadronPhi 
)

Definition at line 84 of file pfRecoTauChargedHadronAuxFunctions.cc.

References compChargedHadronP4fromPxPyPz().

85 {
86  double chargedHadronPx = chargedHadronP*TMath::Cos(chargedHadronPhi)*TMath::Sin(chargedHadronTheta);
87  double chargedHadronPy = chargedHadronP*TMath::Sin(chargedHadronPhi)*TMath::Sin(chargedHadronTheta);
88  double chargedHadronPz = chargedHadronP*TMath::Cos(chargedHadronTheta);
89  return compChargedHadronP4fromPxPyPz(chargedHadronPx, chargedHadronPy, chargedHadronPz);
90 }
reco::Candidate::LorentzVector compChargedHadronP4fromPxPyPz(double, double, double)
reco::Candidate::LorentzVector reco::tau::compChargedHadronP4fromPxPyPz ( double  chargedHadronPx,
double  chargedHadronPy,
double  chargedHadronPz 
)

Definition at line 76 of file pfRecoTauChargedHadronAuxFunctions.cc.

References mathSSE::sqrt().

Referenced by compChargedHadronP4fromPThetaPhi(), reco::tau::PFRecoTauEnergyAlgorithmPlugin::operator()(), and setChargedHadronP4().

77 {
78  const double chargedPionMass = 0.13957; // GeV
79  double chargedHadronEn = sqrt(chargedHadronPx*chargedHadronPx + chargedHadronPy*chargedHadronPy + chargedHadronPz*chargedHadronPz + chargedPionMass*chargedPionMass);
80  reco::Candidate::LorentzVector chargedHadronP4(chargedHadronPx, chargedHadronPy, chargedHadronPz, chargedHadronEn);
81  return chargedHadronP4;
82 }
T sqrt(T t)
Definition: SSEVec.h:18
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
void reco::tau::countHits ( const reco::Muon muon,
std::vector< int > &  numHitsDT,
std::vector< int > &  numHitsCSC,
std::vector< int > &  numHitsRPC 
)

Definition at line 6 of file RecoTauMuonTools.cc.

References TrackingRecHit::bad, reco::HitPattern::getHitPattern(), reco::HitPattern::getHitType(), reco::HitPattern::getMuonStation(), edm::Ref< C, T, F >::isNonnull(), reco::HitPattern::muonCSCHitFilter(), reco::HitPattern::muonDTHitFilter(), reco::HitPattern::muonHitFilter(), reco::HitPattern::muonRPCHitFilter(), reco::HitPattern::numberOfAllHits(), reco::Muon::outerTrack(), reco::HitPattern::TRACK_HITS, and TrackingRecHit::valid.

Referenced by reco::HitPattern::numberOfAllTrackerHits(), reco::HitPattern::numberOfBadHits(), reco::HitPattern::numberOfInactiveHits(), reco::HitPattern::numberOfLostHits(), reco::HitPattern::numberOfMuonHits(), reco::HitPattern::numberOfTimingHits(), and reco::HitPattern::numberOfValidHits().

7  {
8  if ( muon.outerTrack().isNonnull() ) {
9  const reco::HitPattern &muonHitPattern = muon.outerTrack()->hitPattern();
10  for (int iHit = 0; iHit < muonHitPattern.numberOfAllHits(reco::HitPattern::TRACK_HITS); ++iHit) {
11  uint32_t hit = muonHitPattern.getHitPattern(reco::HitPattern::TRACK_HITS, iHit);
12  if ( hit == 0 ) break;
13  if ( muonHitPattern.muonHitFilter(hit) && (muonHitPattern.getHitType(hit) == TrackingRecHit::valid || muonHitPattern.getHitType(hit) == TrackingRecHit::bad) ) {
14  int muonStation = muonHitPattern.getMuonStation(hit) - 1; // CV: map into range 0..3
15  if ( muonStation >= 0 && muonStation < 4 ) {
16  if ( muonHitPattern.muonDTHitFilter(hit) ) ++numHitsDT[muonStation];
17  else if ( muonHitPattern.muonCSCHitFilter(hit) ) ++numHitsCSC[muonStation];
18  else if ( muonHitPattern.muonRPCHitFilter(hit) ) ++numHitsRPC[muonStation];
19  }
20  }
21  }
22  }
23  }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:792
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:875
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
Definition: Muon.h:51
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:668
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon...
Definition: HitPattern.h:801
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:553
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:688
void reco::tau::countMatches ( const reco::Muon muon,
std::vector< int > &  numMatchesDT,
std::vector< int > &  numMatchesCSC,
std::vector< int > &  numMatchesRPC 
)

Definition at line 38 of file RecoTauMuonTools.cc.

References MuonSubdetId::CSC, MuonSubdetId::DT, reco::Muon::matches(), and MuonSubdetId::RPC.

39  {
40  const std::vector<reco::MuonChamberMatch>& muonSegments = muon.matches();
41  for ( std::vector<reco::MuonChamberMatch>::const_iterator muonSegment = muonSegments.begin();
42  muonSegment != muonSegments.end(); ++muonSegment ) {
43  if ( muonSegment->segmentMatches.empty() ) continue;
44  int muonDetector = muonSegment->detector();
45  int muonStation = muonSegment->station() - 1;
46  assert(muonStation >= 0 && muonStation <= 3);
47  if ( muonDetector == MuonSubdetId::DT ) ++numMatchesDT[muonStation];
48  else if ( muonDetector == MuonSubdetId::CSC ) ++numMatchesCSC[muonStation];
49  else if ( muonDetector == MuonSubdetId::RPC ) ++numMatchesRPC[muonStation];
50  }
51  }
static constexpr int RPC
Definition: MuonSubdetId.h:14
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:144
static constexpr int DT
Definition: MuonSubdetId.h:12
static constexpr int CSC
Definition: MuonSubdetId.h:13
std::string reco::tau::discPluginName ( const std::string &  mvaName)
inline
float reco::tau::eratio ( const reco::PFTau tau)

return ratio of energy in ECAL over sum of energy in ECAL and HCAL

Definition at line 66 of file PFRecoTauClusterVariables.cc.

References reco::PFCandidate::ecalEnergy(), reco::PFCandidate::hcalEnergy(), reco::PFTau::signalCands(), and pileupDistInMC::total.

Referenced by DeepTauId::createInputsV1(), DeepTauId::createTauBlockInputs(), reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::discriminate(), and fillIsoMVARun2Inputs().

66  {
67  float ecal_en_in_signal_pf_cands = 0;
68  float hcal_en_in_signal_pf_cands = 0;
69  for (const auto& signal_cand : tau.signalCands()) {
70  const reco::PFCandidate* signal_pfcand = dynamic_cast<const reco::PFCandidate*>(signal_cand.get());
71  if (signal_pfcand != nullptr) {
72  ecal_en_in_signal_pf_cands += signal_pfcand->ecalEnergy();
73  hcal_en_in_signal_pf_cands += signal_pfcand->hcalEnergy();
74  }
75  // TauReco@MiniAOD: recalculate for PackedCandidate if added to MiniAOD event content
76  }
77  float total = ecal_en_in_signal_pf_cands + hcal_en_in_signal_pf_cands;
78  if(total == 0.){
79  return -1.;
80  }
81  return ecal_en_in_signal_pf_cands/total;
82  }
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:222
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:232
const std::vector< reco::CandidatePtr > & signalCands() const
Candidates in signal region.
Definition: PFTau.cc:78
float reco::tau::eratio ( const pat::Tau tau)

Definition at line 83 of file PFRecoTauClusterVariables.cc.

References pat::Tau::ecalEnergy(), pat::Tau::hcalEnergy(), and pileupDistInMC::total.

83  {
84  float ecal_en_in_signal_cands = tau.ecalEnergy();
85  float hcal_en_in_signal_cands = tau.hcalEnergy();
86  float total = ecal_en_in_signal_cands + hcal_en_in_signal_cands;
87  if(total == 0.){
88  return -1.;
89  }
90  return ecal_en_in_signal_cands/total;
91  }
float hcalEnergy() const
return sum of hcal energies from signal candidates
Definition: Tau.h:337
float ecalEnergy() const
Definition: Tau.h:335
std::pair< edm::ParameterSet, edm::ParameterSet > reco::tau::factorizePUQCuts ( const edm::ParameterSet inputSet)

Definition at line 387 of file RecoTauQualityCuts.cc.

References edm::ParameterSet::copyFrom(), TkAlMuonSelectors_cfi::cut, and edm::ParameterSet::getParameterNames().

Referenced by PFRecoTauDiscriminationByIsolation::PFRecoTauDiscriminationByIsolation().

388 {
389  edm::ParameterSet puCuts;
390  edm::ParameterSet nonPUCuts;
391 
392  std::vector<std::string> inputNames = input.getParameterNames();
393  for(auto const& cut : inputNames ) {
394  if ( cut == "minTrackVertexWeight" ||
395  cut == "maxDeltaZ" ||
396  cut == "maxDeltaZToLeadTrack" ) {
397  puCuts.copyFrom(input, cut);
398  } else {
399  nonPUCuts.copyFrom(input, cut);
400  }
401  }
402  return std::make_pair(puCuts, nonPUCuts);
403 }
static std::string const input
Definition: EdmProvDump.cc:48
void copyFrom(ParameterSet const &from, std::string const &name)
bool reco::tau::fillIsoMVARun2Inputs ( float *  mvaInput,
const pat::Tau tau,
int  mvaOpt,
const std::string &  nameCharged,
const std::string &  nameNeutral,
const std::string &  namePu,
const std::string &  nameOutside,
const std::string &  nameFootprint 
)

Definition at line 171 of file PFRecoTauClusterVariables.cc.

References funct::abs(), tauProducer_cfi::chargedIsoPtSum, pat::Tau::decayMode(), pat::Tau::dxy(), pat::Tau::dxy_Sig(), MillePedeFileConverter_cfg::e, eratio(), reco::LeafCandidate::eta(), f, pat::Tau::flightLength(), pat::Tau::flightLengthSig(), tauProducer_cfi::footprintCorrection, pat::Tau::hasSecondaryVertex(), pat::Tau::ip3d(), pat::Tau::ip3d_Sig(), kDBnewDMwLT, kDBnewDMwLTwGJ, kDBoldDMwLT, kDBoldDMwLTwGJ, kNewDMwLT, kNewDMwoLT, kOldDMwLT, kOldDMwoLT, kPWnewDMwLT, kPWoldDMwLT, pat::Tau::leadingTrackNormChi2(), cmsBatch::log, SiStripPI::max, min(), n_photons_total(), tauProducer_cfi::neutralIsoPtSum, reco::LeafCandidate::p(), reco::LeafCandidate::p4(), tauProducer_cfi::photonPtSumOutsideSignalCone, funct::pow(), reco::LeafCandidate::pt(), pt_weighted_deta_strip(), pt_weighted_dphi_strip(), pt_weighted_dr_iso(), pt_weighted_dr_signal(), tauProducer_cfi::puCorrPtSum, mathSSE::sqrt(), and pat::Tau::tauID().

Referenced by reco::tau::PATTauDiscriminationByMVAIsolationRun2::discriminate().

174  {
175  int tauDecayMode = tau.decayMode();
176 
178  && (tauDecayMode == 0 || tauDecayMode == 1 || tauDecayMode == 2 || tauDecayMode == 10))
179  ||
181  && (tauDecayMode == 0 || tauDecayMode == 1 || tauDecayMode == 2 || tauDecayMode == 5 || tauDecayMode == 6 || tauDecayMode == 10 || tauDecayMode == 11))
182  ) {
183 
184  float chargedIsoPtSum = tau.tauID(nameCharged);
185  float neutralIsoPtSum = tau.tauID(nameNeutral);
186  float puCorrPtSum = tau.tauID(namePu);
187  float photonPtSumOutsideSignalCone = tau.tauID(nameOutside);
188  float footprintCorrection = tau.tauID(nameFootprint);
189 
190  float decayDistX = tau.flightLength().x();
191  float decayDistY = tau.flightLength().y();
192  float decayDistZ = tau.flightLength().z();
193  float decayDistMag = std::sqrt(decayDistX*decayDistX + decayDistY*decayDistY + decayDistZ*decayDistZ);
194 
195  // --- The following 5 variables differ slightly between AOD & MiniAOD
196  // because they are recomputed using packedCandidates saved in the tau
197  float nPhoton = reco::tau::n_photons_total(tau);
198  float ptWeightedDetaStrip = reco::tau::pt_weighted_deta_strip(tau, tauDecayMode);
199  float ptWeightedDphiStrip = reco::tau::pt_weighted_dphi_strip(tau, tauDecayMode);
200  float ptWeightedDrSignal = reco::tau::pt_weighted_dr_signal(tau, tauDecayMode);
201  float ptWeightedDrIsolation = reco::tau::pt_weighted_dr_iso(tau, tauDecayMode);
202  // ---
203  float leadingTrackChi2 = tau.leadingTrackNormChi2();
204  float eRatio = reco::tau::eratio(tau);
205 
206  // Difference between measured and maximally allowed Gottfried-Jackson angle
207  float gjAngleDiff = -999;
208  if ( tauDecayMode == 10 ) {
209  double mTau = 1.77682;
210  double mAOne = tau.p4().M();
211  double pAOneMag = tau.p();
212  double argumentThetaGJmax = (std::pow(mTau,2) - std::pow(mAOne,2) ) / ( 2 * mTau * pAOneMag );
213  double argumentThetaGJmeasured = ( tau.p4().px() * decayDistX + tau.p4().py() * decayDistY + tau.p4().pz() * decayDistZ ) / ( pAOneMag * decayDistMag );
214  if ( std::abs(argumentThetaGJmax) <= 1. && std::abs(argumentThetaGJmeasured) <= 1. ) {
215  double thetaGJmax = std::asin( argumentThetaGJmax );
216  double thetaGJmeasured = std::acos( argumentThetaGJmeasured );
217  gjAngleDiff = thetaGJmeasured - thetaGJmax;
218  }
219  }
220 
221  if ( mvaOpt == kOldDMwoLT || mvaOpt == kNewDMwoLT ) {
222  mvaInput[0] = std::log(std::max(1.f, (float)tau.pt()));
223  mvaInput[1] = std::abs((float)tau.eta());
224  mvaInput[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
225  mvaInput[3] = std::log(std::max(1.e-2f, neutralIsoPtSum - 0.125f*puCorrPtSum));
226  mvaInput[4] = std::log(std::max(1.e-2f, puCorrPtSum));
227  mvaInput[5] = tauDecayMode;
228  } else if ( mvaOpt == kOldDMwLT || mvaOpt == kNewDMwLT ) {
229  mvaInput[0] = std::log(std::max(1.f, (float)tau.pt()));
230  mvaInput[1] = std::abs((float)tau.eta());
231  mvaInput[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
232  mvaInput[3] = std::log(std::max(1.e-2f, neutralIsoPtSum - 0.125f*puCorrPtSum));
233  mvaInput[4] = std::log(std::max(1.e-2f, puCorrPtSum));
234  mvaInput[5] = tauDecayMode;
235  mvaInput[6] = std::copysign(+1.f, tau.dxy());
236  mvaInput[7] = std::sqrt(std::min(1.f, std::abs(tau.dxy())));
237  mvaInput[8] = std::min(10.f, std::abs(tau.dxy_Sig()));
238  mvaInput[9] = ( tau.hasSecondaryVertex() ) ? 1. : 0.;
239  mvaInput[10] = std::sqrt(decayDistMag);
240  mvaInput[11] = std::min(10.f, tau.flightLengthSig());
241  } else if ( mvaOpt == kDBoldDMwLT || mvaOpt == kDBnewDMwLT ) {
242  mvaInput[0] = std::log(std::max(1.f, (float)tau.pt()));
243  mvaInput[1] = std::abs((float)tau.eta());
244  mvaInput[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
245  mvaInput[3] = std::log(std::max(1.e-2f, neutralIsoPtSum));
246  mvaInput[4] = std::log(std::max(1.e-2f, puCorrPtSum));
247  mvaInput[5] = std::log(std::max(1.e-2f, photonPtSumOutsideSignalCone));
248  mvaInput[6] = tauDecayMode;
249  mvaInput[7] = std::min(30.f, nPhoton);
250  mvaInput[8] = std::min(0.5f, ptWeightedDetaStrip);
251  mvaInput[9] = std::min(0.5f, ptWeightedDphiStrip);
252  mvaInput[10] = std::min(0.5f, ptWeightedDrSignal);
253  mvaInput[11] = std::min(0.5f, ptWeightedDrIsolation);
254  mvaInput[12] = std::min(100.f, leadingTrackChi2);
255  mvaInput[13] = std::min(1.f, eRatio);
256  mvaInput[14] = std::copysign(+1.f, tau.dxy());
257  mvaInput[15] = std::sqrt(std::min(1.f, std::abs(tau.dxy())));
258  mvaInput[16] = std::min(10.f, std::abs(tau.dxy_Sig()));
259  mvaInput[17] = std::copysign(+1.f, tau.ip3d());
260  mvaInput[18] = std::sqrt(std::min(1.f, std::abs(tau.ip3d())));
261  mvaInput[19] = std::min(10.f, std::abs(tau.ip3d_Sig()));
262  mvaInput[20] = ( tau.hasSecondaryVertex() ) ? 1. : 0.;
263  mvaInput[21] = std::sqrt(decayDistMag);
264  mvaInput[22] = std::min(10.f, tau.flightLengthSig());
265  } else if ( mvaOpt == kPWoldDMwLT || mvaOpt == kPWnewDMwLT ) {
266  mvaInput[0] = std::log(std::max(1.f, (float)tau.pt()));
267  mvaInput[1] = std::abs((float)tau.eta());
268  mvaInput[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
269  mvaInput[3] = std::log(std::max(1.e-2f, neutralIsoPtSum));
270  mvaInput[4] = std::log(std::max(1.e-2f, footprintCorrection));
271  mvaInput[5] = std::log(std::max(1.e-2f, photonPtSumOutsideSignalCone));
272  mvaInput[6] = tauDecayMode;
273  mvaInput[7] = std::min(30.f, nPhoton);
274  mvaInput[8] = std::min(0.5f, ptWeightedDetaStrip);
275  mvaInput[9] = std::min(0.5f, ptWeightedDphiStrip);
276  mvaInput[10] = std::min(0.5f, ptWeightedDrSignal);
277  mvaInput[11] = std::min(0.5f, ptWeightedDrIsolation);
278  mvaInput[12] = std::min(100.f, leadingTrackChi2);
279  mvaInput[13] = std::min(1.f, eRatio);
280  mvaInput[14] = std::copysign(+1.f, tau.dxy());
281  mvaInput[15] = std::sqrt(std::min(1.f, std::abs(tau.dxy())));
282  mvaInput[16] = std::min(10.f, std::abs(tau.dxy_Sig()));
283  mvaInput[17] = std::copysign(+1.f, tau.ip3d());
284  mvaInput[18] = std::sqrt(std::min(1.f, std::abs(tau.ip3d())));
285  mvaInput[19] = std::min(10.f, std::abs(tau.ip3d_Sig()));
286  mvaInput[20] = ( tau.hasSecondaryVertex() ) ? 1. : 0.;
287  mvaInput[21] = std::sqrt(decayDistMag);
288  mvaInput[22] = std::min(10.f, tau.flightLengthSig());
289  } else if ( mvaOpt == kDBoldDMwLTwGJ || mvaOpt == kDBnewDMwLTwGJ ) {
290  mvaInput[0] = std::log(std::max(1.f, (float)tau.pt()));
291  mvaInput[1] = std::abs((float)tau.eta());
292  mvaInput[2] = std::log(std::max(1.e-2f, chargedIsoPtSum));
293  mvaInput[3] = std::log(std::max(1.e-2f, neutralIsoPtSum));
294  mvaInput[4] = std::log(std::max(1.e-2f, puCorrPtSum));
295  mvaInput[5] = std::log(std::max(1.e-2f, photonPtSumOutsideSignalCone));
296  mvaInput[6] = tauDecayMode;
297  mvaInput[7] = std::min(30.f, nPhoton);
298  mvaInput[8] = std::min(0.5f, ptWeightedDetaStrip);
299  mvaInput[9] = std::min(0.5f, ptWeightedDphiStrip);
300  mvaInput[10] = std::min(0.5f, ptWeightedDrSignal);
301  mvaInput[11] = std::min(0.5f, ptWeightedDrIsolation);
302  mvaInput[12] = std::min(1.f, eRatio);
303  mvaInput[13] = std::copysign(+1.f, tau.dxy());
304  mvaInput[14] = std::sqrt(std::min(1.f, std::abs(tau.dxy())));
305  mvaInput[15] = std::min(10.f, std::abs(tau.dxy_Sig()));
306  mvaInput[16] = std::copysign(+1.f, tau.ip3d());
307  mvaInput[17] = std::sqrt(std::min(1.f, std::abs(tau.ip3d())));
308  mvaInput[18] = std::min(10.f, std::abs(tau.ip3d_Sig()));
309  mvaInput[19] = ( tau.hasSecondaryVertex() ) ? 1. : 0.;
310  mvaInput[20] = std::sqrt(decayDistMag);
311  mvaInput[21] = std::min(10.f, tau.flightLengthSig());
312  mvaInput[22] = std::max(-1.f, gjAngleDiff);
313  }
314 
315  return true;
316  }
317  return false;
318  }
unsigned int n_photons_total(const reco::PFTau &tau)
return total number of pf photon candidates with pT>500 MeV, which are associated to signal ...
double eta() const final
momentum pseudorapidity
float pt_weighted_dr_signal(const reco::PFTau &tau, int dm)
float dxy() const
Definition: Tau.h:315
double pt() const final
transverse momentum
float ip3d_Sig() const
float tauID(const std::string &name) const
float ip3d() const
Definition: Tau.h:328
float pt_weighted_deta_strip(const reco::PFTau &tau, int dm)
T sqrt(T t)
Definition: SSEVec.h:18
const pat::tau::TauPFEssential::Vector & flightLength() const
Definition: Tau.h:322
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float pt_weighted_dr_iso(const reco::PFTau &tau, int dm)
double f[11][100]
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
bool hasSecondaryVertex() const
Definition: Tau.h:321
T min(T a, T b)
Definition: MathUtil.h:58
double p() const final
magnitude of momentum vector
float pt_weighted_dphi_strip(const reco::PFTau &tau, int dm)
int decayMode() const
reconstructed tau decay mode (specific to PFTau)
Definition: Tau.h:366
float eratio(const reco::PFTau &tau)
return ratio of energy in ECAL over sum of energy in ECAL and HCAL
float flightLengthSig() const
Definition: Tau.h:323
float dxy_Sig() const
float leadingTrackNormChi2() const
return normalized chi2 of leading track
Definition: Tau.h:339
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
template<typename Iterator >
std::vector<CandidatePtr> reco::tau::filterPFCandidates ( const Iterator begin,
const Iterator end,
int  pdgId,
bool  sort = true 
)

Filter a collection of objects that are convertible to CandidatePtrs by PFCandidate ID

Definition at line 42 of file RecoTauCommonUtilities.h.

References funct::abs(), end, flattenPiZeros(), metsig::jet, convertSQLitetoXML_cfg::output, common_cff::pdgId, pfCandidates(), pfCandidatesByPdgId(), pfChargedCands(), pfGammas(), and jetUpdater_cfi::sort.

Referenced by pfCandidatesByPdgId(), and pfChargedCands().

43  {
44  std::vector<CandidatePtr> output;
45  for(Iterator iter = begin; iter != end; ++iter) {
46  reco::CandidatePtr ptr(*iter);
47  if (std::abs(ptr->pdgId()) == pdgId)
48  output.push_back(ptr);
49  }
50  if (sort) std::sort(output.begin(), output.end(), SortPFCandsDescendingPt());
51  return output;
52 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define end
Definition: vmac.h:39
std::vector< CandidatePtr > reco::tau::flattenPiZeros ( const std::vector< RecoTauPiZero >::const_iterator &  piZerosBegin,
const std::vector< RecoTauPiZero >::const_iterator &  piZerosEnd 
)

Flatten a list of pi zeros into a list of there constituent PFCandidates.

Definition at line 35 of file RecoTauCommonUtilities.cc.

References convertSQLitetoXML_cfg::output.

Referenced by filterPFCandidates(), flattenPiZeros(), reco::tau::xclean::CrossCleanPtrs< PtrIter >::initialize(), and reco::tau::RecoTauPhotonFilter::operator()().

35  {
36  std::vector<CandidatePtr> output;
37 
38  for(std::vector<RecoTauPiZero>::const_iterator piZero = piZerosBegin;
39  piZero != piZerosEnd; ++piZero) {
40  for(size_t iDaughter = 0; iDaughter < piZero->numberOfDaughters();
41  ++iDaughter) {
42  output.push_back(CandidatePtr(piZero->daughterPtr(iDaughter)));
43  }
44  }
45  return output;
46 }
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
std::vector< CandidatePtr > reco::tau::flattenPiZeros ( const std::vector< RecoTauPiZero > &  piZeros)

Definition at line 49 of file RecoTauCommonUtilities.cc.

References flattenPiZeros().

49  {
50  return flattenPiZeros(piZeros.begin(), piZeros.end());
51 }
std::vector< CandidatePtr > flattenPiZeros(const std::vector< RecoTauPiZero >::const_iterator &, const std::vector< RecoTauPiZero >::const_iterator &)
Flatten a list of pi zeros into a list of there constituent PFCandidates.
std::string reco::tau::format_vint ( const std::vector< int > &  vi)

Definition at line 25 of file RecoTauMuonTools.cc.

References edm::numEntries().

26  {
27  std::ostringstream os;
28  os << "{ ";
29  unsigned numEntries = vi.size();
30  for ( unsigned iEntry = 0; iEntry < numEntries; ++iEntry ) {
31  os << vi[iEntry];
32  if ( iEntry < (numEntries - 1) ) os << ", ";
33  }
34  os << " }";
35  return os.str();
36  }
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
PFTau::hadronicDecayMode reco::tau::getDecayMode ( const reco::GenJet genJet)

Definition at line 80 of file PFTauDecayModeTools.cc.

References JetMCTagUtils::genTauDecayMode(), reco::PFTau::kNull, and translateGenDecayModeToReco().

Referenced by tautools::RecoTauDecayModeTruthMatchPlugin::operator()().

80  {
81  if (!genJet)
82  return reco::PFTau::kNull;
84 }
std::string genTauDecayMode(const reco::CompositePtrCandidate &c)
Definition: JetMCTag.cc:81
PFTau::hadronicDecayMode translateGenDecayModeToReco(const std::string &genName)
Convert a genTau decay mode string (&#39;oneProng0Pi0&#39;) to the RECO enum.
const reco::Track * reco::tau::getTrackFromChargedHadron ( const reco::PFRecoTauChargedHadron chargedHadron)

Definition at line 11 of file pfRecoTauChargedHadronAuxFunctions.cc.

References pat::PackedCandidate::bestTrack(), edm::Ptr< T >::get(), reco::PFRecoTauChargedHadron::getChargedPFCandidate(), reco::PFRecoTauChargedHadron::getLostTrackCandidate(), reco::PFRecoTauChargedHadron::getTrack(), and edm::Ptr< T >::isNonnull().

Referenced by reco::tau::RecoTauSoftTwoProngTausCleanerPlugin::operator()(), reco::tau::PFRecoTauEnergyAlgorithmPlugin::operator()(), and setChargedHadronP4().

11  {
12  // Charged hadron made from track (reco::Track) - RECO/AOD only
13  if ( chargedHadron.getTrack().isNonnull()) {
14  return chargedHadron.getTrack().get();
15  }
16  // In MiniAOD, even isolated tracks are saved as candidates, so the track Ptr doesn't exist
17  const pat::PackedCandidate* chargedPFPCand = dynamic_cast<const pat::PackedCandidate*> (chargedHadron.getChargedPFCandidate().get());
18  if (chargedPFPCand != nullptr) {
19  return chargedPFPCand->bestTrack();
20  }
21  const pat::PackedCandidate* lostTrackCand = dynamic_cast<const pat::PackedCandidate*> (chargedHadron.getLostTrackCandidate().get());
22  if (lostTrackCand != nullptr) {
23  return lostTrackCand->bestTrack();
24  }
25  return nullptr;
26 }
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:159
const reco::Track * bestTrack() const override
return a pointer to the track if present. otherwise, return a null pointer
const TrackPtr & getTrack() const
reference to reco::Track
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
const CandidatePtr & getChargedPFCandidate() const
reference to "charged" PFCandidate (either charged PFCandidate or PFNeutralHadron) ...
const CandidatePtr & getLostTrackCandidate() const
reference to "lostTrack Candidate" when chadron built with tracks stored as pat::PackedCandidates ...
template<class Base , class Der >
bool reco::tau::isPtrEqual ( const edm::Ptr< Base > &  b,
const edm::Ptr< Der > &  d 
)

Definition at line 101 of file PFRecoTauEnergyAlgorithmPlugin.cc.

References b.

Referenced by reco::tau::PFRecoTauEnergyAlgorithmPlugin::operator()().

101  {
102  return edm::Ptr<Der>(b) == d;
103 }
double b
Definition: hdecay.h:120
template<class Base >
bool reco::tau::isPtrEqual ( const edm::Ptr< Base > &  b,
const edm::Ptr< Base > &  d 
)

Definition at line 106 of file PFRecoTauEnergyAlgorithmPlugin.cc.

References edmIntegrityCheck::d.

106  {
107  return b == d;
108 }
float reco::tau::lead_track_chi2 ( const reco::PFTau tau)

return chi2 of the leading track ==> deprecated? <==

Definition at line 45 of file PFRecoTauClusterVariables.cc.

References edm::Ptr< T >::get(), pat::PackedCandidate::hasTrackDetails(), edm::Ptr< T >::isNonnull(), edm::Ref< C, T, F >::isNonnull(), reco::PFTau::leadChargedHadrCand(), reco::TrackBase::normalizedChi2(), pfDeepBoostedJetPreprocessParams_cfi::pfcand, pat::PackedCandidate::pseudoTrack(), and reco::PFCandidate::trackRef().

Referenced by reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::discriminate().

45  {
46  float LeadingTracknormalizedChi2 = 0;
47  const reco::CandidatePtr& leadingCharged = tau.leadChargedHadrCand();
48  if (leadingCharged.isNonnull()) {
49  const reco::PFCandidate* pfcand = dynamic_cast<const reco::PFCandidate*>(leadingCharged.get());
50  if (pfcand != nullptr) {
51  reco::TrackRef tref = pfcand->trackRef();
52  if (tref.isNonnull()) {
53  LeadingTracknormalizedChi2 = tref->normalizedChi2();
54  }
55  }
56  else {
57  const pat::PackedCandidate* patcand = dynamic_cast<const pat::PackedCandidate*>(leadingCharged.get());
58  if (patcand != nullptr && patcand->hasTrackDetails()) {
59  LeadingTracknormalizedChi2 = patcand->pseudoTrack().normalizedChi2();
60  }
61  }
62  }
63  return LeadingTracknormalizedChi2;
64  }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:600
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:159
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:442
const CandidatePtr & leadChargedHadrCand() const
Definition: PFTau.cc:67
virtual const reco::Track & pseudoTrack() const
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
template<typename InputIterator >
InputIterator reco::tau::leadCand ( InputIterator  begin,
InputIterator  end 
)

Definition at line 145 of file RecoTauCommonUtilities.h.

References atECALEntrance(), begin, ecalTB2006H4_GenSimDigiReco_cfg::bField, and end.

Referenced by convertToPFCandidatePtr(), reco::tau::RecoTauConstructor::get(), reco::tau::RecoTauVertexAssociator::getLeadCand(), reco::tau::RecoTauVertexAssociator::getLeadTrack(), reco::tau::RecoTauVertexAssociator::getLeadTrackRef(), pat::Tau::muonDecision(), reco::tau::RecoTauQualityCuts::setPV(), and reco::PFTau::~PFTau().

146  {
147  double max_pt = 0;
148  InputIterator max_cand = begin;
149  for(InputIterator cand = begin; cand != end; ++cand) {
150  if( (*cand)->pt() > max_pt ) {
151  max_pt = (*cand)->pt();
152  max_cand = cand;
153  }
154  }
155  return max_cand;
156  }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
unsigned int reco::tau::n_photons_total ( const reco::PFTau tau)

return total number of pf photon candidates with pT>500 MeV, which are associated to signal

Definition at line 146 of file PFRecoTauClusterVariables.cc.

References reco::PFTau::isolationGammaCands(), and reco::PFTau::signalGammaCands().

Referenced by DeepTauId::createInputsV1(), DeepTauId::createTauBlockInputs(), reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::discriminate(), fillIsoMVARun2Inputs(), and pt_weighted_dr_iso().

146  {
147  unsigned int n_photons = 0;
148  for (auto& cand : tau.signalGammaCands()) {
149  if (cand->pt() > 0.5)
150  ++n_photons;
151  }
152  for (auto& cand : tau.isolationGammaCands()) {
153  if (cand->pt() > 0.5)
154  ++n_photons;
155  }
156  return n_photons;
157  }
const std::vector< reco::CandidatePtr > & signalGammaCands() const
Gamma candidates in signal region.
Definition: PFTau.cc:84
const std::vector< reco::CandidatePtr > & isolationGammaCands() const
Gamma candidates in isolation region.
Definition: PFTau.cc:93
unsigned int reco::tau::n_photons_total ( const pat::Tau tau)

Definition at line 158 of file PFRecoTauClusterVariables.cc.

References pat::Tau::isolationGammaCands(), and pat::Tau::signalGammaCands().

158  {
159  unsigned int n_photons = 0;
160  for (auto& cand : tau.signalGammaCands()) {
161  if (cand->pt() > 0.5)
162  ++n_photons;
163  }
164  for (auto& cand : tau.isolationGammaCands()) {
165  if (cand->pt() > 0.5)
166  ++n_photons;
167  }
168  return n_photons;
169  }
reco::CandidatePtrVector signalGammaCands() const
reco::CandidatePtrVector isolationGammaCands() const
std::vector< reco::CandidatePtr > reco::tau::pfCandidates ( const Jet jet,
int  particleId,
bool  sort = true 
)

Extract pfCandidates of a given particle Id from a PFJet. If sort is true, candidates will be sorted by descending PT. Internally translates to pdgId

Definition at line 53 of file RecoTauCommonUtilities.cc.

References pfCandidatesByPdgId().

Referenced by filterPFCandidates(), reco::tau::RecoTauPiZeroStripPlugin::operator()(), reco::tau::PFRecoTauChargedHadronFromPFCandidatePlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), reco::tau::RecoTauPiZeroStripPlugin3::operator()(), and pfGammas().

54  {
55  return pfCandidatesByPdgId(jet, translateTypeToAbsPdgId(particleId), sort);
56 }
std::vector< CandidatePtr > pfCandidatesByPdgId(const Jet &jet, int pdgId, bool sort=true)
std::vector< CandidatePtr > reco::tau::pfCandidates ( const Jet jet,
const std::vector< int > &  particleIds,
bool  sort = true 
)

Extract pfCandidates of a that match a list of particle Ids from a PFJet.

Definition at line 58 of file RecoTauCommonUtilities.cc.

References pfCandidatesByPdgId().

60  {
61  std::vector<int> pdgIds;
62  for (auto particleId : particleIds)
63  pdgIds.push_back(translateTypeToAbsPdgId(particleId));
64  return pfCandidatesByPdgId(jet, pdgIds, sort);
65 }
std::vector< CandidatePtr > pfCandidatesByPdgId(const Jet &jet, int pdgId, bool sort=true)
std::vector< reco::CandidatePtr > reco::tau::pfCandidatesByPdgId ( const Jet jet,
int  pdgId,
bool  sort = true 
)

Extract pfCandidates of a given PDG Id from a PFJet. If sort is true, candidates will be sorted by descending PT

Definition at line 67 of file RecoTauCommonUtilities.cc.

References reco::CompositePtrCandidate::daughterPtrVector(), filterPFCandidates(), common_cff::pdgId, and jetUpdater_cfi::sort.

Referenced by filterPFCandidates(), reco::tau::RecoTauBuilderCombinatoricPlugin::operator()(), reco::tau::RecoTauBuilderConePlugin::operator()(), and pfCandidates().

68  {
69  CandPtrs pfCands = jet.daughterPtrVector();
70  CandPtrs selectedPFCands = filterPFCandidates(
71  pfCands.begin(), pfCands.end(), pdgId, sort);
72  return selectedPFCands;
73 }
std::vector< reco::CandidatePtr > CandPtrs
std::vector< CandidatePtr > filterPFCandidates(const Iterator &begin, const Iterator &end, int pdgId, bool sort=true)
std::vector< reco::CandidatePtr > reco::tau::pfCandidatesByPdgId ( const Jet jet,
const std::vector< int > &  pdgIds,
bool  sort = true 
)

Extract pfCandidates of a that match a list of PDG Ids from a PFJet.

Definition at line 75 of file RecoTauCommonUtilities.cc.

References reco::CompositePtrCandidate::daughterPtrVector(), filterPFCandidates(), convertSQLitetoXML_cfg::output, common_cff::pdgId, and jetUpdater_cfi::sort.

76  {
77  const CandPtrs& pfCands = jet.daughterPtrVector();
79  // Get each desired candidate type, unsorted for now
80  for(std::vector<int>::const_iterator pdgId = pdgIds.begin();
81  pdgId != pdgIds.end(); ++pdgId) {
82  CandPtrs&& selectedPFCands = filterPFCandidates(pfCands.begin(), pfCands.end(), *pdgId, false);
83  output.insert(output.end(), selectedPFCands.begin(), selectedPFCands.end());
84  }
85  if (sort) std::sort(output.begin(), output.end(), SortPFCandsDescendingPt());
86  return output;
87 }
std::vector< reco::CandidatePtr > CandPtrs
std::vector< CandidatePtr > filterPFCandidates(const Iterator &begin, const Iterator &end, int pdgId, bool sort=true)
std::vector< reco::CandidatePtr > reco::tau::pfChargedCands ( const Jet jet,
bool  sort = true 
)

Extract all non-neutral candidates from a PFJet.

Definition at line 93 of file RecoTauCommonUtilities.cc.

References reco::CompositePtrCandidate::daughterPtrVector(), filterPFCandidates(), convertSQLitetoXML_cfg::output, and jetUpdater_cfi::sort.

Referenced by filterPFCandidates(), reco::tau::RecoTauVertexAssociator::getLeadCand(), reco::tau::RecoTauBuilderCombinatoricPlugin::operator()(), and reco::tau::RecoTauBuilderConePlugin::operator()().

94  {
95  const CandPtrs& pfCands = jet.daughterPtrVector();
97  CandPtrs&& mus = filterPFCandidates(pfCands.begin(), pfCands.end(), 13, false);
98  CandPtrs&& es = filterPFCandidates(pfCands.begin(), pfCands.end(), 11, false);
99  CandPtrs&& chs = filterPFCandidates(pfCands.begin(), pfCands.end(), 211, false);
100  output.reserve(mus.size() + es.size() + chs.size());
101  output.insert(output.end(), mus.begin(), mus.end());
102  output.insert(output.end(), es.begin(), es.end());
103  output.insert(output.end(), chs.begin(), chs.end());
104  if (sort) std::sort(output.begin(), output.end(), SortPFCandsDescendingPt());
105  return output;
106 }
std::vector< reco::CandidatePtr > CandPtrs
std::vector< CandidatePtr > filterPFCandidates(const Iterator &begin, const Iterator &end, int pdgId, bool sort=true)
std::vector< reco::CandidatePtr > reco::tau::pfGammas ( const Jet jet,
bool  sort = true 
)
unsigned int reco::tau::piZerosInDecayMode ( PFTau::hadronicDecayMode  mode)

Definition at line 50 of file PFTauDecayModeTools.cc.

References reco::PFTau::kOneProngNPiZero, and mode.

50  {
51  int modeAsInt = static_cast<int>(mode);
52  return (modeAsInt % PFTau::kOneProngNPiZero);
53 }
reco::PFTau::hadronicDecayMode mode
float reco::tau::pt_weighted_deta_strip ( const reco::PFTau tau,
int  dm 
)
inline

return sum of pt weighted values of deta relative to tau candidate for all pf photon candidates, which are associated to signal

Definition at line 40 of file PFRecoTauClusterVariables.h.

References pt_weighted_dx().

Referenced by DeepTauId::createInputsV1(), DeepTauId::createTauBlockInputs(), reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::discriminate(), and fillIsoMVARun2Inputs().

40  {
41  return pt_weighted_dx(tau, dm==10 ? 2 : 1, 1, dm);
42  }
float pt_weighted_dx(const pat::Tau &tau, int mode=0, int var=0, int decaymode=-1)
float reco::tau::pt_weighted_deta_strip ( const pat::Tau tau,
int  dm 
)
inline

Definition at line 43 of file PFRecoTauClusterVariables.h.

References pt_weighted_dx().

43  {
44  return pt_weighted_dx(tau, dm==10 ? 2 : 1, 1, dm);
45  }
float pt_weighted_dx(const pat::Tau &tau, int mode=0, int var=0, int decaymode=-1)
float reco::tau::pt_weighted_dphi_strip ( const reco::PFTau tau,
int  dm 
)
inline

return sum of pt weighted values of dphi relative to tau candidate for all pf photon candidates, which are associated to signal

Definition at line 48 of file PFRecoTauClusterVariables.h.

References pt_weighted_dx().

Referenced by DeepTauId::createInputsV1(), DeepTauId::createTauBlockInputs(), reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::discriminate(), and fillIsoMVARun2Inputs().

48  {
49  return pt_weighted_dx(tau, dm==10 ? 2 : 1, 2, dm);
50  }
float pt_weighted_dx(const pat::Tau &tau, int mode=0, int var=0, int decaymode=-1)
float reco::tau::pt_weighted_dphi_strip ( const pat::Tau tau,
int  dm 
)
inline

Definition at line 51 of file PFRecoTauClusterVariables.h.

References pt_weighted_dx().

51  {
52  return pt_weighted_dx(tau, dm==10 ? 2 : 1, 2, dm);
53  }
float pt_weighted_dx(const pat::Tau &tau, int mode=0, int var=0, int decaymode=-1)
float reco::tau::pt_weighted_dr_iso ( const reco::PFTau tau,
int  dm 
)
inline

return sum of pt weighted values of dr relative to tau candidate for all pf photon candidates, which are inside an isolation conde but not associated to signal

Definition at line 56 of file PFRecoTauClusterVariables.h.

References pt_weighted_dx().

Referenced by DeepTauId::createInputsV1(), DeepTauId::createTauBlockInputs(), reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::discriminate(), and fillIsoMVARun2Inputs().

56  {
57  return pt_weighted_dx(tau, 2, 0, dm);
58  }
float pt_weighted_dx(const pat::Tau &tau, int mode=0, int var=0, int decaymode=-1)
float reco::tau::pt_weighted_dr_iso ( const pat::Tau tau,
int  dm 
)
inline

Definition at line 59 of file PFRecoTauClusterVariables.h.

References n_photons_total(), pt_weighted_dx(), and metsig::tau.

59  {
60  return pt_weighted_dx(tau, 2, 0, dm);
61  }
float pt_weighted_dx(const pat::Tau &tau, int mode=0, int var=0, int decaymode=-1)
float reco::tau::pt_weighted_dr_signal ( const reco::PFTau tau,
int  dm 
)
inline

return sum of pt weighted values of dr relative to tau candidate for all pf photon candidates, which are associated to signal

Definition at line 32 of file PFRecoTauClusterVariables.h.

References pt_weighted_dx().

Referenced by DeepTauId::createInputsV1(), DeepTauId::createTauBlockInputs(), reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::discriminate(), and fillIsoMVARun2Inputs().

32  {
33  return pt_weighted_dx(tau, 0, 0, dm);
34  }
float pt_weighted_dx(const pat::Tau &tau, int mode=0, int var=0, int decaymode=-1)
float reco::tau::pt_weighted_dr_signal ( const pat::Tau tau,
int  dm 
)
inline

Definition at line 35 of file PFRecoTauClusterVariables.h.

References pt_weighted_dx().

35  {
36  return pt_weighted_dx(tau, 0, 0, dm);
37  }
float pt_weighted_dx(const pat::Tau &tau, int mode=0, int var=0, int decaymode=-1)
float reco::tau::pt_weighted_dx ( const reco::PFTau tau,
int  mode = 0,
int  var = 0,
int  decaymode = -1 
)

return sum of pt weighted values of distance to tau candidate for all pf photon candidates, which are associated to signal; depending on var the distance is in 0=:dr, 1=:deta, 2=:dphi

Definition at line 139 of file PFRecoTauClusterVariables.cc.

References runTauDisplay::decaymode, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, metsig::tau, and JetChargeProducer_cfi::var.

Referenced by pt_weighted_deta_strip(), pt_weighted_dphi_strip(), pt_weighted_dr_iso(), and pt_weighted_dr_signal().

float reco::tau::pt_weighted_dx ( const pat::Tau tau,
int  mode = 0,
int  var = 0,
int  decaymode = -1 
)
template<typename T >
float reco::tau::pt_weighted_dx_T ( const typename T::Tau_t &  tau,
int  mode,
int  var,
int  decaymode 
)

return sum of pt weighted values of distance to tau candidate for all pf photon candidates, which are associated to signal; depending on var the distance is in 0=:dr, 1=:deta, 2=:dphi

Definition at line 95 of file PFRecoTauClusterVariables.cc.

References funct::abs(), egammaForCoreTracking_cff::cands, reco::deltaPhi(), reco::deltaR(), runTauDisplay::dr, RemoveAddSevLevel::flag, SiStripPI::max, min(), EnergyCorrector::pt, and metsig::tau.

95  {
96  float sum_pt = 0.;
97  float sum_dx_pt = 0.;
98  float signalrad = std::max(0.05, std::min(0.1, 3./std::max(1., tau.pt())));
99  int is3prong = (decaymode==10);
100  const auto& cands = getGammas_T<T>(tau, mode < 2);
101  for (const auto& cand : cands) {
102  // only look at electrons/photons with pT > 0.5
103  if (cand->pt() < 0.5){
104  continue;
105  }
106  float dr = reco::deltaR(cand->eta(), cand->phi(), tau.eta(), tau.phi());
107  float deta = std::abs(cand->eta() - tau.eta());
108  float dphi = std::abs(reco::deltaPhi(cand->phi(), tau.phi()));
109  float pt = cand->pt();
110  bool flag = isInside(pt, deta, dphi);
111  if(is3prong==0){
112  if (mode == 2 || (mode == 0 && dr < signalrad) || (mode == 1 && dr > signalrad)) {
113  sum_pt += pt;
114  if (var == 0)
115  sum_dx_pt += pt * dr;
116  else if (var == 1)
117  sum_dx_pt += pt * deta;
118  else if (var == 2)
119  sum_dx_pt += pt * dphi;
120  }
121  }
122  else if(is3prong==1){
123  if( (mode==2 && flag==false) || (mode==1 && flag==true) || mode==0){
124  sum_pt += pt;
125  if (var == 0)
126  sum_dx_pt += pt * dr;
127  else if (var == 1)
128  sum_dx_pt += pt * deta;
129  else if (var == 2)
130  sum_dx_pt += pt * dphi;
131  }
132  }
133  }
134  if (sum_pt > 0.){
135  return sum_dx_pt/sum_pt;
136  }
137  return 0.;
138  }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< PATTauDiscriminationByMVAIsolationRun2 > > reco::tau::s_filler__LINE__ ( "PATTauDiscriminationByMVAIsolationRun2"  )
static
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< PFRecoTauDiscriminationByMVAIsolationRun2 > > reco::tau::s_filler__LINE__ ( "PFRecoTauDiscriminationByMVAIsolationRun2"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< PATTauDiscriminationByMVAIsolationRun2 > > reco::tau::s_maker__LINE__ ( "PATTauDiscriminationByMVAIsolationRun2"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< PFRecoTauDiscriminationByMVAIsolationRun2 > > reco::tau::s_maker__LINE__ ( "PFRecoTauDiscriminationByMVAIsolationRun2"  )
static
void reco::tau::setChargedHadronP4 ( reco::PFRecoTauChargedHadron chargedHadron,
double  scaleFactor_neutralPFCands = 1.0 
)

Definition at line 28 of file pfRecoTauChargedHadronAuxFunctions.cc.

References reco::PFRecoTauChargedHadron::algoIs(), compChargedHadronP4fromPxPyPz(), reco::PFRecoTauChargedHadron::getChargedPFCandidate(), reco::PFRecoTauChargedHadron::getLostTrackCandidate(), reco::PFRecoTauChargedHadron::getNeutralPFCandidates(), getTrackFromChargedHadron(), edm::Ptr< T >::isNonnull(), reco::PFRecoTauChargedHadron::kChargedPFCandidate, reco::PFRecoTauChargedHadron::kPFNeutralHadron, reco::PFRecoTauChargedHadron::kTrack, reco::TrackBase::p(), electrons_cff::ptRatio, reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), reco::LeafCandidate::setP4(), and HiIsolationCommonParameters_cff::track.

Referenced by reco::tau::RecoTauConstructor::addTauChargedHadron(), reco::tau::PFRecoTauEnergyAlgorithmPlugin::operator()(), reco::tau::PFRecoTauChargedHadronFromPFCandidatePlugin::operator()(), reco::tau::PFRecoTauChargedHadronFromGenericTrackPlugin< TrackClass >::operator()(), and PFRecoTauChargedHadronProducer::produce().

29 {
30  double chargedHadronP = 0.;
31  double chargedHadronPx = 0.;
32  double chargedHadronPy = 0.;
33  double chargedHadronPz = 0.;
34  double SumNeutrals = 0.;
37  const reco::CandidatePtr& chargedPFCand = chargedHadron.getChargedPFCandidate();
38  assert(chargedPFCand.isNonnull());
39  chargedHadronP += chargedPFCand->p();
40  chargedHadronPx = chargedPFCand->px();
41  chargedHadronPy = chargedPFCand->py();
42  chargedHadronPz = chargedPFCand->pz();
43  } else if ( chargedHadron.algoIs(reco::PFRecoTauChargedHadron::kTrack) ) {
44  const reco::Track* track = getTrackFromChargedHadron(chargedHadron);
45  if (track != nullptr) {
46  chargedHadronP += track->p();
47  chargedHadronPx = track->px();
48  chargedHadronPy = track->py();
49  chargedHadronPz = track->pz();
50  } else { // lost tracks from MiniAOD that don't have track information saved
51  const reco::CandidatePtr& lostTrack = chargedHadron.getLostTrackCandidate();
52  assert(lostTrack.isNonnull());
53  chargedHadronP += lostTrack->p();
54  chargedHadronPx = lostTrack->px();
55  chargedHadronPy = lostTrack->py();
56  chargedHadronPz = lostTrack->pz();
57  }
58  } else assert(0);
59  const std::vector<reco::CandidatePtr>& neutralPFCands = chargedHadron.getNeutralPFCandidates();
60  for ( std::vector<reco::CandidatePtr>::const_iterator neutralPFCand = neutralPFCands.begin();
61  neutralPFCand != neutralPFCands.end(); ++neutralPFCand ) {
62  SumNeutrals += (*neutralPFCand)->p();
63  }
64  double noNeutrals=chargedHadronP;
65  chargedHadronP+=scaleFactor_neutralPFCands*SumNeutrals;
66  double ptRatio=chargedHadronP/noNeutrals;
67  chargedHadronPx*=ptRatio;
68  chargedHadronPy*=ptRatio;
69  chargedHadronPz*=ptRatio;
70 
71 
72  reco::Candidate::LorentzVector chargedHadronP4 = compChargedHadronP4fromPxPyPz(chargedHadronPx, chargedHadronPy, chargedHadronPz);
73  chargedHadron.setP4(chargedHadronP4);
74 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:654
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:666
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:678
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
const reco::Track * getTrackFromChargedHadron(const reco::PFRecoTauChargedHadron &chargedHadron)
bool algoIs(PFRecoTauChargedHadronAlgorithm algo) const
Check whether a given algo produced this charged hadron.
const CandidatePtr & getChargedPFCandidate() const
reference to "charged" PFCandidate (either charged PFCandidate or PFNeutralHadron) ...
void setP4(const LorentzVector &p4) final
set 4-momentum
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:672
const std::vector< CandidatePtr > & getNeutralPFCandidates() const
references to additional neutral PFCandidates
const CandidatePtr & getLostTrackCandidate() const
reference to "lostTrack Candidate" when chadron built with tracks stored as pat::PackedCandidates ...
reco::Candidate::LorentzVector compChargedHadronP4fromPxPyPz(double, double, double)
template<typename InputIterator >
int reco::tau::sumPFCandCharge ( InputIterator  begin,
InputIterator  end 
)

Sum the charge of a collection of PFCandidates.

Definition at line 140 of file RecoTauCommonUtilities.h.

References reco::Candidate::charge(), and sumPFVector().

141  {
142  return sumPFVector(begin, end, &Candidate::charge, 0);
143  }
ReturnType sumPFVector(InputIterator begin, InputIterator end, FunctionPtr func, ReturnType init)
Sum the four vectors in a collection of PFCandidates.
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
template<typename InputIterator >
reco::Candidate::LorentzVector reco::tau::sumPFCandP4 ( InputIterator  begin,
InputIterator  end 
)

Definition at line 127 of file RecoTauCommonUtilities.h.

References reco::Candidate::p4(), and sumPFVector().

128  {
131 }
ReturnType sumPFVector(InputIterator begin, InputIterator end, FunctionPtr func, ReturnType init)
Sum the four vectors in a collection of PFCandidates.
double p4[4]
Definition: TauolaWrapper.h:92
#define end
Definition: vmac.h:39
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
#define begin
Definition: vmac.h:32
template<typename InputIterator >
double reco::tau::sumPFCandPt ( InputIterator  begin,
InputIterator  end 
)

Sum the pT of a collection of PFCandidates.

Definition at line 134 of file RecoTauCommonUtilities.h.

References reco::Candidate::pt(), and sumPFVector().

Referenced by reco::tau::RecoTauConstructor::get().

135  {
136  return sumPFVector(begin, end, &Candidate::pt, 0.0);
137  }
ReturnType sumPFVector(InputIterator begin, InputIterator end, FunctionPtr func, ReturnType init)
Sum the four vectors in a collection of PFCandidates.
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
template<typename InputIterator , typename FunctionPtr , typename ReturnType >
ReturnType reco::tau::sumPFVector ( InputIterator  begin,
InputIterator  end,
FunctionPtr  func,
ReturnType  init 
)

Sum the four vectors in a collection of PFCandidates.

Definition at line 117 of file RecoTauCommonUtilities.h.

References end, jets_cff::func, init, and convertSQLitetoXML_cfg::output.

Referenced by sumPFCandCharge(), sumPFCandP4(), and sumPFCandPt().

118  {
120  for(InputIterator cand = begin; cand != end; ++cand) {
121  //#define CALL_MEMBER_FN(object,ptrToMember) ((object).*(ptrToMember))
122  output += ((**cand).*(func))();
123  }
124  return output;
125  }
int init
Definition: HydjetWrapper.h:67
std::map< DetId, double > ReturnType
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
template<typename InputIterator >
InputIterator reco::tau::takeNElements ( const InputIterator &  begin,
const InputIterator &  end,
size_t  N 
)

Definition at line 109 of file RecoTauCommonUtilities.h.

References begin, and N.

Referenced by reco::tau::RecoTauPiZeroCombinatoricPlugin::operator()(), reco::tau::RecoTauBuilderCombinatoricPlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), and reco::tau::RecoTauPiZeroStripPlugin3::operator()().

110  {
111  size_t input_size = end - begin;
112  return (N > input_size) ? end : begin + N;
113 }
#define end
Definition: vmac.h:39
#define N
Definition: blowfish.cc:9
#define begin
Definition: vmac.h:32
PFTau::hadronicDecayMode reco::tau::translateDecayMode ( unsigned int  nCharged,
unsigned int  nPiZero 
)

Definition at line 55 of file PFTauDecayModeTools.cc.

References reco::PFTau::kNull, reco::PFTau::kOneProngNPiZero, reco::PFTau::kRareDecayMode, RecoTauCombinatoricProducer_cfi::maxPiZeros, and hpstanc_transforms::nPiZeros.

Referenced by reco::tau::RecoTauObjectEmbedder< T >::operator()(), reco::tau::RecoTauDiscriminantInvariantWidth::RecoTauDiscriminantInvariantWidth(), and RecoTauMVATransform::RecoTauMVATransform().

56  {
57  // If no tracks exist, this is definitely not a tau!
58  if(!nCharged) return PFTau::kNull;
59  // Find the maximum number of PiZeros our parameterization can hold
60  const unsigned int maxPiZeros = PFTau::kOneProngNPiZero;
61  // Determine our track index
62  unsigned int trackIndex = (nCharged-1)*(maxPiZeros+1);
63  // Check if we handle the given number of tracks
64  if(trackIndex >= PFTau::kRareDecayMode) return PFTau::kRareDecayMode;
65 
66  nPiZeros = (nPiZeros <= maxPiZeros) ? nPiZeros : maxPiZeros;
67  return static_cast<PFTau::hadronicDecayMode>(trackIndex + nPiZeros);
68 }
const unsigned int kNull
PFTau::hadronicDecayMode reco::tau::translateGenDecayModeToReco ( const std::string &  genName)

Convert a genTau decay mode string ('oneProng0Pi0') to the RECO enum.

Definition at line 70 of file PFTauDecayModeTools.cc.

Referenced by getDecayMode().

71  {
72  return decayModeStringToId(name.c_str(), dmTranslatorMap);
73 }
std::string reco::tau::translateRecoDecayModeToGen ( PFTau::hadronicDecayMode  decayMode)

Convert a RECO enum decay mode to a string ('oneProng0Pi0')

Definition at line 75 of file PFTauDecayModeTools.cc.

75  {
76  return decayModeIdToString(decayMode, dmTranslatorMap);
77 }