CMS 3D CMS Logo

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

Namespaces

 cone
 
 disc
 
 helpers
 
 qcuts
 
 xclean
 

Classes

class  AssociationMatchRefSelector
 
class  Combinatoric
 
class  CombinatoricGenerator
 
class  CombinatoricIterator
 
class  RecoTauBuilderCombinatoricPlugin
 
class  RecoTauBuilderConePlugin
 
class  RecoTauBuilderPlugin
 
class  RecoTauCleanerPlugin
 
class  RecoTauConstructor
 
class  RecoTauDiscriminantCleanerPlugin
 
class  RecoTauDiscriminantFromDiscriminator
 
class  RecoTauDiscriminantFunctionPlugin
 
class  RecoTauDiscriminantInvariantWidth
 
class  RecoTauDiscriminantPlugin
 
class  RecoTauDiscriminantVectorFunctionPlugin
 
class  RecoTauDiscriminationBinnedIsolation
 
class  RecoTauDiscriminationBinnedIsolationImpl
 
class  RecoTauElectronRejectionPlugin
 
class  RecoTauEventHolderPlugin
 
class  RecoTauImpactParameterSignificancePlugin
 
class  RecoTauIsolationMasking
 
class  RecoTauLexicographicalRanking
 
class  RecoTauModifierPlugin
 
class  RecoTauMVAHelper
 
class  RecoTauNamedPlugin
 
class  RecoTauObjectEmbedder
 
class  RecoTauPhotonFilter
 
class  RecoTauPiZeroBuilderPlugin
 
class  RecoTauPiZeroCombinatoricPlugin
 
class  RecoTauPiZeroQualityPlugin
 
class  RecoTauPiZeroStringQuality
 
class  RecoTauPiZeroStripPlugin
 
class  RecoTauPiZeroTrivialPlugin
 
class  RecoTauQualityCuts
 
class  RecoTauRandomCleanerPlugin
 
class  RecoTauStringCleanerPlugin
 
class  RecoTauTagInfoWorkaroundModifer
 
class  RecoTauTwoProngFilter
 
class  SortByDescendingPt
 
class  SortPFCandsDescendingPt
 

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)
 
std::string discPluginName (const std::string &mvaName)
 
template<typename Iterator >
std::vector< PFCandidatePtrfilterPFCandidates (const Iterator &begin, const Iterator &end, int particleId, bool sort=true)
 
std::vector< PFCandidatePtrflattenPiZeros (const std::vector< RecoTauPiZero > &)
 Flatten a list of pi zeros into a list of there constituent PFCandidates. More...
 
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)
 
template<typename InputIterator >
int sumPFCandCharge (InputIterator begin, InputIterator end)
 Sum the PT 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...
 

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

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

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

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

25  {
26  int modeAsInt = static_cast<int>(mode);
27  return (modeAsInt / PFTau::kOneProngNPiZero) + 1;
28 }
int mode
Definition: AMPTWrapper.h:139
template<typename Container , class OverlapFunction >
Container reco::tau::cleanOverlaps ( const Container &  dirty)

Definition at line 34 of file RecoTauCleaningTools.h.

References clean, and analyzePatCleaning_cfg::overlaps.

Referenced by RecoTauCleanerImpl< Prod >::produce().

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

Definition at line 24 of file RecoTauDiscriminantPlugins.h.

Referenced by reco::tau::RecoTauMVAHelper::loadDiscriminantPlugins(), and PFTauMVAInputDiscriminantTranslator::PFTauMVAInputDiscriminantTranslator().

24  {
25  return "RecoTauDiscrimination" + mvaName;
26 }
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:38
std::vector< PFCandidatePtr > reco::tau::flattenPiZeros ( const std::vector< RecoTauPiZero > &  piZeros)

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

Definition at line 15 of file RecoTauCommonUtilities.cc.

References convertSQLitetoXML_cfg::output.

Referenced by reco::tau::xclean::CrossCleanPtrs::CrossCleanPtrs(), and reco::tau::RecoTauPhotonFilter::operator()().

15  {
16  std::vector<PFCandidatePtr> output;
17 
18  for(std::vector<RecoTauPiZero>::const_iterator piZero = piZeros.begin();
19  piZero != piZeros.end(); ++piZero) {
20  for(size_t iDaughter = 0; iDaughter < piZero->numberOfDaughters();
21  ++iDaughter) {
22  output.push_back(PFCandidatePtr(piZero->daughterPtr(iDaughter)));
23  }
24  }
25  return output;
26 }
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
PFTau::hadronicDecayMode reco::tau::getDecayMode ( const reco::GenJet genJet)

Definition at line 60 of file PFTauDecayModeTools.cc.

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

Referenced by PFTauDiscriminants::PFTauDiscriminantManager::mainTrack(), and tautools::RecoTauDecayModeTruthMatchPlugin::operator()().

60  {
61  if (!genJet)
62  return reco::PFTau::kNull;
64 }
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 131 of file RecoTauCommonUtilities.h.

References begin, and end.

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

132  {
133  double max_pt = 0;
134  InputIterator max_cand = begin;
135  for(InputIterator cand = begin; cand != end; ++cand) {
136  if( (*cand)->pt() > max_pt ) {
137  max_pt = (*cand)->pt();
138  max_cand = cand;
139  }
140  }
141  return max_cand;
142  }
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
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 28 of file RecoTauCommonUtilities.cc.

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

Referenced by PFMETAnalyzer::analyze(), PFElectronTranslator::fillMVAValueMap(), reco::tau::RecoTauBuilderCombinatoricPlugin::operator()(), reco::tau::RecoTauBuilderConePlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin::operator()(), pfCandidates(), pfChargedCands(), pfGammas(), FSPFProducer::produce(), RecoMuonFromPFProducer::produce(), PFElectronTranslator::produce(), GsfElectronLinker::produce(), PFMET::produce(), PFPileUp::produce(), pat::PATPFParticleProducer::produce(), PFPhotonTranslator::produce(), and PFMETAnalyzer::validateMET().

29  {
30  PFCandPtrs pfCands = jet.getPFConstituents();
31  PFCandPtrs selectedPFCands = filterPFCandidates(
32  pfCands.begin(), pfCands.end(), particleId, sort);
33  return selectedPFCands;
34 }
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 36 of file RecoTauCommonUtilities.cc.

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

37  {
39  // Get each desired candidate type, unsorted for now
40  for(std::vector<int>::const_iterator particleId = particleIds.begin();
41  particleId != particleIds.end(); ++particleId) {
42  PFCandPtrs selectedPFCands = pfCandidates(jet, *particleId, false);
43  output.insert(output.end(), selectedPFCands.begin(), selectedPFCands.end());
44  }
45  if (sort) std::sort(output.begin(), output.end(), SortPFCandsDescendingPt());
46  return output;
47 }
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 53 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::RecoTauBuilderCombinatoricPlugin::operator()(), and reco::tau::RecoTauBuilderConePlugin::operator()().

54  {
59  output.reserve(mus.size() + es.size() + chs.size());
60  output.insert(output.end(), mus.begin(), mus.end());
61  output.insert(output.end(), es.begin(), es.end());
62  output.insert(output.end(), chs.begin(), chs.end());
63  if (sort) std::sort(output.begin(), output.end(), SortPFCandsDescendingPt());
64  return output;
65 }
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 30 of file PFTauDecayModeTools.cc.

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

30  {
31  int modeAsInt = static_cast<int>(mode);
32  return (modeAsInt % PFTau::kOneProngNPiZero);
33 }
int mode
Definition: AMPTWrapper.h:139
template<typename InputIterator >
int reco::tau::sumPFCandCharge ( InputIterator  begin,
InputIterator  end 
)

Sum the PT of a collection of PFCandidates.

Definition at line 126 of file RecoTauCommonUtilities.h.

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

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

127  {
129  }
ReturnType sumPFVector(InputIterator begin, InputIterator end, FunctionPtr func, ReturnType init)
Sum the four vectors in a collection of PFCandidates.
double charge(const std::vector< uint8_t > &Ampls)
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
template<typename InputIterator >
reco::Candidate::LorentzVector reco::tau::sumPFCandP4 ( InputIterator  begin,
InputIterator  end 
)

Definition at line 113 of file RecoTauCommonUtilities.h.

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

114  {
117 }
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:38
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:39
#define begin
Definition: vmac.h:31
template<typename InputIterator >
double reco::tau::sumPFCandPt ( InputIterator  begin,
InputIterator  end 
)

Sum the PT of a collection of PFCandidates.

Definition at line 120 of file RecoTauCommonUtilities.h.

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

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

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

References end, init, and convertSQLitetoXML_cfg::output.

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

104  {
105  ReturnType output = init;
106  for(InputIterator cand = begin; cand != end; ++cand) {
107  //#define CALL_MEMBER_FN(object,ptrToMember) ((object).*(ptrToMember))
108  output += ((**cand).*(func))();
109  }
110  return output;
111  }
int init
Definition: HydjetWrapper.h:63
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
template<typename InputIterator >
InputIterator reco::tau::takeNElements ( const InputIterator &  begin,
const InputIterator &  end,
size_t  N 
)

Definition at line 95 of file RecoTauCommonUtilities.h.

References begin, and MultiGaussianStateTransform::N.

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

96  {
97  size_t input_size = end - begin;
98  return (N > input_size) ? end : begin + N;
99 }
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
PFTau::hadronicDecayMode reco::tau::translateDecayMode ( unsigned int  nCharged,
unsigned int  nPiZero 
)

Definition at line 35 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(), RecoTauMVADiscriminator::RecoTauMVADiscriminator(), and RecoTauMVATransform::RecoTauMVATransform().

36  {
37  // If no tracks exist, this is definitely not a tau!
38  if(!nCharged) return PFTau::kNull;
39  // Find the maximum number of PiZeros our parameterization can hold
40  const unsigned int maxPiZeros = PFTau::kOneProngNPiZero;
41  // Determine our track index
42  unsigned int trackIndex = (nCharged-1)*(maxPiZeros+1);
43  // Check if we handle the given number of tracks
44  if(trackIndex >= PFTau::kRareDecayMode) return PFTau::kRareDecayMode;
45 
46  nPiZeros = (nPiZeros <= maxPiZeros) ? nPiZeros : maxPiZeros;
47  return static_cast<PFTau::hadronicDecayMode>(trackIndex + nPiZeros);
48 }
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 50 of file PFTauDecayModeTools.cc.

References newFWLiteAna::found, and reco::PFTau::kRareDecayMode.

Referenced by getDecayMode().

51  {
52  std::map<std::string, reco::PFTau::hadronicDecayMode>::const_iterator
53  found = dmTranslator.find(name);
54  if (found != dmTranslator.end()) {
55  return found->second;
56  } else
58 }