CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Classes | Typedefs | Functions
reco::tau Namespace Reference

Namespaces

 cone
 
 disc
 
 helpers
 
 qcuts
 
 xclean
 

Classes

class  AssociationMatchRefSelector
 
class  Combinatoric
 
class  CombinatoricGenerator
 
class  CombinatoricIterator
 
class  PFRecoTauChargedHadronBuilderPlugin
 
class  PFRecoTauChargedHadronFromPFCandidatePlugin
 
class  PFRecoTauChargedHadronFromTrackPlugin
 
class  PFRecoTauChargedHadronQualityPlugin
 
class  PFRecoTauChargedHadronStringQuality
 
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  RecoTauStringCleanerPlugin
 
class  RecoTauTagInfoWorkaroundModifer
 
class  RecoTauTwoProngFilter
 
class  RecoTauVertexAssociator
 
class  SortByDescendingPt
 
class  SortPFCandsDescendingPt
 

Typedefs

typedef
tau::CombinatoricGenerator
< ChargedHadronList
ChargedHadronCombo
 
typedef std::vector
< reco::PFRecoTauChargedHadron
ChargedHadronList
 
typedef
tau::CombinatoricGenerator
< PiZeroList
PiZeroCombo
 
typedef std::vector
< RecoTauPiZero
PiZeroList
 

Functions

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)
 
std::string discPluginName (const std::string &mvaName)
 
std::pair< edm::ParameterSet,
edm::ParameterSet
factorizePUQCuts (const edm::ParameterSet &inputSet)
 
template<typename Iterator >
std::vector< PFCandidatePtrfilterPFCandidates (const Iterator &begin, const Iterator &end, int particleId, bool sort=true)
 
std::vector< PFCandidatePtrflattenPiZeros (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< PFCandidatePtrflattenPiZeros (const std::vector< RecoTauPiZero > &)
 
PFTau::hadronicDecayMode getDecayMode (const reco::GenJet *genJet)
 
template<typename InputIterator >
InputIterator leadPFCand (InputIterator begin, InputIterator end)
 
std::vector< PFCandidatePtrpfCandidates (const PFJet &jet, int particleId, bool sort=true)
 
std::vector< PFCandidatePtrpfCandidates (const PFJet &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< PFCandidatePtrpfChargedCands (const PFJet &jet, bool sort=true)
 Extract all non-neutral candidates from a PFJet. More...
 
std::vector< PFCandidatePtrpfGammas (const PFJet &jet, bool sort=true)
 Extract all pfGammas from a PFJet. More...
 
unsigned int piZerosInDecayMode (PFTau::hadronicDecayMode mode)
 
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.

Function Documentation

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 74 of file RecoTauCommonUtilities.h.

References i, convertSQLitetoXML_cfg::output, and relativeConstraints::value.

74  {
75  typedef typename RefVectorType::value_type OutputRef;
76  // Double check at compile time that the inheritance is okay. It can still
77  // fail at runtime if you pass it the wrong collection.
78  BOOST_STATIC_ASSERT(
79  (boost::is_base_of<typename BaseView::value_type,
80  typename RefVectorType::member_type>::value));
81  RefVectorType output;
82  size_t nElements = view->size();
83  output.reserve(nElements);
84  // Cast each of our Refs
85  for (size_t i = 0; i < nElements; ++i) {
86  output.push_back(view->refAt(i).template castTo<OutputRef>());
87  }
88  return output;
89 }
int i
Definition: DBlmapReader.cc:9
Container::value_type value_type
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 alignBH_cfg::mode.

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

Definition at line 35 of file RecoTauCleaningTools.h.

References clean, and analyzePatCleaning_cfg::overlaps.

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

Definition at line 58 of file pfRecoTauChargedHadronAuxFunctions.cc.

References compChargedHadronP4fromPxPyPz().

59 {
60  double chargedHadronPx = chargedHadronP*TMath::Cos(chargedHadronPhi)*TMath::Sin(chargedHadronTheta);
61  double chargedHadronPy = chargedHadronP*TMath::Sin(chargedHadronPhi)*TMath::Sin(chargedHadronTheta);
62  double chargedHadronPz = chargedHadronP*TMath::Cos(chargedHadronTheta);
63  return compChargedHadronP4fromPxPyPz(chargedHadronPx, chargedHadronPy, chargedHadronPz);
64 }
reco::Candidate::LorentzVector compChargedHadronP4fromPxPyPz(double, double, double)
reco::Candidate::LorentzVector reco::tau::compChargedHadronP4fromPxPyPz ( double  chargedHadronPx,
double  chargedHadronPy,
double  chargedHadronPz 
)

Definition at line 50 of file pfRecoTauChargedHadronAuxFunctions.cc.

References mathSSE::sqrt().

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

51 {
52  const double chargedPionMass = 0.13957; // GeV
53  double chargedHadronEn = sqrt(chargedHadronPx*chargedHadronPx + chargedHadronPy*chargedHadronPy + chargedHadronPz*chargedHadronPz + chargedPionMass*chargedPionMass);
54  reco::Candidate::LorentzVector chargedHadronP4(chargedHadronPx, chargedHadronPy, chargedHadronPz, chargedHadronEn);
55  return chargedHadronP4;
56 }
T sqrt(T t)
Definition: SSEVec.h:48
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
std::string reco::tau::discPluginName ( const std::string &  mvaName)
inline
std::pair< edm::ParameterSet, edm::ParameterSet > reco::tau::factorizePUQCuts ( const edm::ParameterSet inputSet)

Definition at line 317 of file RecoTauQualityCuts.cc.

References edm::ParameterSet::copyFrom(), GOODCOLL_filter_cfg::cut, edm::ParameterSet::getParameterNames(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by PFRecoTauDiscriminationByIsolation::PFRecoTauDiscriminationByIsolation().

318 {
319  edm::ParameterSet puCuts;
320  edm::ParameterSet nonPUCuts;
321 
322  std::vector<std::string> inputNames = input.getParameterNames();
323  BOOST_FOREACH( const std::string& cut, inputNames ) {
324  if ( cut == "minTrackVertexWeight" ||
325  cut == "maxDeltaZ" ||
326  cut == "maxDeltaZToLeadTrack" ) {
327  puCuts.copyFrom(input, cut);
328  } else {
329  nonPUCuts.copyFrom(input, cut);
330  }
331  }
332  return std::make_pair(puCuts, nonPUCuts);
333 }
static std::string const input
Definition: EdmProvDump.cc:43
void copyFrom(ParameterSet const &from, std::string const &name)
template<typename Iterator >
std::vector<PFCandidatePtr> reco::tau::filterPFCandidates ( const Iterator begin,
const Iterator end,
int  particleId,
bool  sort = true 
)

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

Definition at line 40 of file RecoTauCommonUtilities.h.

References end, convertSQLitetoXML_cfg::output, and python.multivaluedict::sort().

Referenced by pfCandidates().

41  {
42  std::vector<PFCandidatePtr> output;
43  for(Iterator iter = begin; iter != end; ++iter) {
44  reco::PFCandidatePtr ptr(*iter);
45  if (ptr->particleId() == particleId)
46  output.push_back(ptr);
47  }
48  if (sort) std::sort(output.begin(), output.end(), SortPFCandsDescendingPt());
49  return output;
50 }
#define end
Definition: vmac.h:37
std::vector< PFCandidatePtr > 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 16 of file RecoTauCommonUtilities.cc.

References convertSQLitetoXML_cfg::output.

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

16  {
17  std::vector<PFCandidatePtr> output;
18 
19  for(std::vector<RecoTauPiZero>::const_iterator piZero = piZerosBegin;
20  piZero != piZerosEnd; ++piZero) {
21  for(size_t iDaughter = 0; iDaughter < piZero->numberOfDaughters();
22  ++iDaughter) {
23  output.push_back(PFCandidatePtr(piZero->daughterPtr(iDaughter)));
24  }
25  }
26  return output;
27 }
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
std::vector< PFCandidatePtr > reco::tau::flattenPiZeros ( const std::vector< RecoTauPiZero > &  piZeros)

Definition at line 30 of file RecoTauCommonUtilities.cc.

References flattenPiZeros().

30  {
31  return flattenPiZeros(piZeros.begin(), piZeros.end());
32 }
std::vector< PFCandidatePtr > 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.
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.
template<typename InputIterator >
InputIterator reco::tau::leadPFCand ( InputIterator  begin,
InputIterator  end 
)

Definition at line 132 of file RecoTauCommonUtilities.h.

References begin, and end.

Referenced by reco::tau::RecoTauConstructor::get(), reco::tau::RecoTauVertexAssociator::getLeadTrack(), and reco::tau::RecoTauBuilderConePlugin::operator()().

133  {
134  double max_pt = 0;
135  InputIterator max_cand = begin;
136  for(InputIterator cand = begin; cand != end; ++cand) {
137  if( (*cand)->pt() > max_pt ) {
138  max_pt = (*cand)->pt();
139  max_cand = cand;
140  }
141  }
142  return max_cand;
143  }
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
std::vector< reco::PFCandidatePtr > reco::tau::pfCandidates ( const PFJet &  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

Definition at line 34 of file RecoTauCommonUtilities.cc.

References filterPFCandidates(), reco::PFJet::getPFConstituents(), and python.multivaluedict::sort().

Referenced by JetTester_HeavyIons::analyze(), JetAnalyzer_HeavyIons::analyze(), MCEmbeddingValidationAnalyzer::analyze(), PFRecoTauDiscriminationByIsolation::beginEvent(), GEDGsfElectronProducer::fillGsfElectronValueMap(), PFElectronTranslator::fillMVAValueMap(), GreedyMuonPFCandidateFilter::filter(), ChargedHadronTrackResolutionFilter::filter(), InconsistentMuonPFCandidateFilter::filter(), MuonBadTrackFilter::filter(), FixedGridEnergyDensity::fixedGridRho(), GEDGsfElectronProducer::matchWithPFCandidates(), reco::tau::RecoTauBuilderCombinatoricPlugin::operator()(), reco::tau::RecoTauBuilderConePlugin::operator()(), reco::tau::PFRecoTauChargedHadronFromPFCandidatePlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), reco::tau::RecoTauPiZeroStripPlugin3::operator()(), pfCandidates(), pfChargedCands(), pfGammas(), PFMuonCaloCleaner::produce(), FSPFProducer::produce(), reco::ParticleFlowForChargedMETProducer::produce(), PFElectronTranslator::produce(), JVFJetIdProducer::produce(), PFMET::produce(), HLTMhtProducer::produce(), NoPileUpPFMEtProducer::produce(), HLTHtMhtProducer::produce(), MuonPFCandidateCleaner::produce(), PFLinker::produce(), PFPileUp::produce(), HLTTrackMETProducer::produce(), BoostedTauSeedsProducer::produce(), NoPileUpPFMEtDataProducer::produce(), pat::PATPFParticleProducer::produce(), cms::METSignificanceProducer::produce(), FFTJetPFPileupCleaner::produce(), SoftKillerProducer::produce(), MuonProducer::produce(), reco::modules::HICaloCompatibleTrackSelector::produce(), and PFPhotonTranslator::produce().

35  {
36  PFCandPtrs pfCands = jet.getPFConstituents();
37  PFCandPtrs selectedPFCands = filterPFCandidates(
38  pfCands.begin(), pfCands.end(), particleId, sort);
39  return selectedPFCands;
40 }
std::vector< reco::PFCandidatePtr > PFCandPtrs
std::vector< PFCandidatePtr > filterPFCandidates(const Iterator &begin, const Iterator &end, int particleId, bool sort=true)
std::vector< reco::PFCandidatePtr > reco::tau::pfCandidates ( const PFJet &  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 42 of file RecoTauCommonUtilities.cc.

References convertSQLitetoXML_cfg::output, pfCandidates(), and python.multivaluedict::sort().

43  {
45  // Get each desired candidate type, unsorted for now
46  for(std::vector<int>::const_iterator particleId = particleIds.begin();
47  particleId != particleIds.end(); ++particleId) {
48  PFCandPtrs selectedPFCands = pfCandidates(jet, *particleId, false);
49  output.insert(output.end(), selectedPFCands.begin(), selectedPFCands.end());
50  }
51  if (sort) std::sort(output.begin(), output.end(), SortPFCandsDescendingPt());
52  return output;
53 }
std::vector< reco::PFCandidatePtr > PFCandPtrs
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
std::vector< reco::PFCandidatePtr > reco::tau::pfChargedCands ( const PFJet &  jet,
bool  sort = true 
)

Extract all non-neutral candidates from a PFJet.

Definition at line 59 of file RecoTauCommonUtilities.cc.

References reco::PFCandidate::e, reco::PFCandidate::h, reco::PFCandidate::mu, convertSQLitetoXML_cfg::output, pfCandidates(), and python.multivaluedict::sort().

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

60  {
65  output.reserve(mus.size() + es.size() + chs.size());
66  output.insert(output.end(), mus.begin(), mus.end());
67  output.insert(output.end(), es.begin(), es.end());
68  output.insert(output.end(), chs.begin(), chs.end());
69  if (sort) std::sort(output.begin(), output.end(), SortPFCandsDescendingPt());
70  return output;
71 }
std::vector< reco::PFCandidatePtr > PFCandPtrs
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
std::vector< reco::PFCandidatePtr > reco::tau::pfGammas ( const PFJet &  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 alignBH_cfg::mode.

50  {
51  int modeAsInt = static_cast<int>(mode);
52  return (modeAsInt % PFTau::kOneProngNPiZero);
53 }
void reco::tau::setChargedHadronP4 ( reco::PFRecoTauChargedHadron chargedHadron,
double  scaleFactor_neutralPFCands = 1.0 
)

Definition at line 10 of file pfRecoTauChargedHadronAuxFunctions.cc.

References reco::PFRecoTauChargedHadron::algoIs(), assert(), compChargedHadronP4fromPxPyPz(), reco::PFRecoTauChargedHadron::getChargedPFCandidate(), reco::PFRecoTauChargedHadron::getNeutralPFCandidates(), reco::PFRecoTauChargedHadron::getTrack(), edm::Ptr< T >::isNonnull(), reco::PFRecoTauChargedHadron::kChargedPFCandidate, reco::PFRecoTauChargedHadron::kPFNeutralHadron, reco::PFRecoTauChargedHadron::kTrack, and reco::LeafCandidate::setP4().

Referenced by reco::tau::RecoTauConstructor::addTauChargedHadron(), reco::tau::PFRecoTauEnergyAlgorithmPlugin::operator()(), reco::tau::PFRecoTauChargedHadronFromPFCandidatePlugin::operator()(), reco::tau::PFRecoTauChargedHadronFromTrackPlugin::operator()(), and PFRecoTauChargedHadronProducer::produce().

11 {
12  double chargedHadronP = 0.;
13  double chargedHadronPx = 0.;
14  double chargedHadronPy = 0.;
15  double chargedHadronPz = 0.;
16  double SumNeutrals = 0.;
19  const reco::PFCandidatePtr& chargedPFCand = chargedHadron.getChargedPFCandidate();
20  assert(chargedPFCand.isNonnull());
21  chargedHadronP += chargedPFCand->p();
22  chargedHadronPx = chargedPFCand->px();
23  chargedHadronPy = chargedPFCand->py();
24  chargedHadronPz = chargedPFCand->pz();
25  } else if ( chargedHadron.algoIs(reco::PFRecoTauChargedHadron::kTrack) ) {
26  const reco::PFRecoTauChargedHadron::TrackPtr& track = chargedHadron.getTrack();
27  assert(track.isNonnull());
28  chargedHadronP += track->p();
29  chargedHadronPx = track->px();
30  chargedHadronPy = track->py();
31  chargedHadronPz = track->pz();
32  } else assert(0);
33  const std::vector<reco::PFCandidatePtr>& neutralPFCands = chargedHadron.getNeutralPFCandidates();
34  for ( std::vector<reco::PFCandidatePtr>::const_iterator neutralPFCand = neutralPFCands.begin();
35  neutralPFCand != neutralPFCands.end(); ++neutralPFCand ) {
36  SumNeutrals += (*neutralPFCand)->p();
37  }
38  double noNeutrals=chargedHadronP;
39  chargedHadronP+=scaleFactor_neutralPFCands*SumNeutrals;
40  double ptRatio=chargedHadronP/noNeutrals;
41  chargedHadronPx*=ptRatio;
42  chargedHadronPy*=ptRatio;
43  chargedHadronPz*=ptRatio;
44 
45 
46  reco::Candidate::LorentzVector chargedHadronP4 = compChargedHadronP4fromPxPyPz(chargedHadronPx, chargedHadronPy, chargedHadronPz);
47  chargedHadron.setP4(chargedHadronP4);
48 }
assert(m_qm.get())
virtual void setP4(const LorentzVector &p4)
set 4-momentum
const TrackPtr & getTrack() const
reference to reco::Track
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:169
const std::vector< PFCandidatePtr > & getNeutralPFCandidates() const
references to additional neutral PFCandidates
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
bool algoIs(PFRecoTauChargedHadronAlgorithm algo) const
Check whether a given algo produced this charged hadron.
const PFCandidatePtr & getChargedPFCandidate() const
reference to &quot;charged&quot; PFCandidate (either charged PFCandidate or PFNeutralHadron) ...
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 127 of file RecoTauCommonUtilities.h.

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

128  {
130  }
ReturnType sumPFVector(InputIterator begin, InputIterator end, FunctionPtr func, ReturnType init)
Sum the four vectors in a collection of PFCandidates.
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
template<typename InputIterator >
reco::Candidate::LorentzVector reco::tau::sumPFCandP4 ( InputIterator  begin,
InputIterator  end 
)

Definition at line 114 of file RecoTauCommonUtilities.h.

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

115  {
118 }
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:37
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
#define begin
Definition: vmac.h:30
template<typename InputIterator >
double reco::tau::sumPFCandPt ( InputIterator  begin,
InputIterator  end 
)

Sum the pT of a collection of PFCandidates.

Definition at line 121 of file RecoTauCommonUtilities.h.

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

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

122  {
123  return sumPFVector(begin, end, &PFCandidate::pt, 0.0);
124  }
ReturnType sumPFVector(InputIterator begin, InputIterator end, FunctionPtr func, ReturnType init)
Sum the four vectors in a collection of PFCandidates.
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
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 104 of file RecoTauCommonUtilities.h.

References end, init, and convertSQLitetoXML_cfg::output.

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

105  {
107  for(InputIterator cand = begin; cand != end; ++cand) {
108  //#define CALL_MEMBER_FN(object,ptrToMember) ((object).*(ptrToMember))
109  output += ((**cand).*(func))();
110  }
111  return output;
112  }
int init
Definition: HydjetWrapper.h:67
std::map< DetId, double > ReturnType
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
template<typename InputIterator >
InputIterator reco::tau::takeNElements ( const InputIterator &  begin,
const InputIterator &  end,
size_t  N 
)

Definition at line 96 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()().

97  {
98  size_t input_size = end - begin;
99  return (N > input_size) ? end : begin + N;
100 }
#define end
Definition: vmac.h:37
#define N
Definition: blowfish.cc:9
#define begin
Definition: vmac.h:30
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, and reco::PFTau::kRareDecayMode.

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
unsigned int nCharged(const GenJet &jet)
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 }