CMS 3D CMS Logo

RecoTauBuilderCombinatoricPlugin.cc
Go to the documentation of this file.
1 #include <vector>
2 
5 
9 
11 
18 
19 #include <algorithm>
20 
21 namespace reco { namespace tau {
22 
23 typedef std::vector<reco::PFRecoTauChargedHadron> ChargedHadronList;
25 typedef std::vector<RecoTauPiZero> PiZeroList;
27 
29 {
30  public:
33 
35  const reco::JetBaseRef&,
36  const std::vector<reco::PFRecoTauChargedHadron>&,
37  const std::vector<RecoTauPiZero>&,
38  const std::vector<CandidatePtr>&) const override;
39 
40  private:
42 
44 
45  struct decayModeInfo
46  {
47  uint32_t maxPiZeros_;
48  uint32_t maxPFCHs_;
49  uint32_t nCharged_;
50  uint32_t nPiZeros_;
51  };
52  std::vector<decayModeInfo> decayModesToBuild_;
53 
59 
61 };
62 
64  : RecoTauBuilderPlugin(pset, std::move(iC)),
65  qcuts_(pset.getParameterSet("qualityCuts").getParameterSet("signalQualityCuts")),
66  isolationConeSize_(pset.getParameter<double>("isolationConeSize")),
67  signalConeSize_(pset.getParameter<std::string>("signalConeSize")),
68  minAbsPhotonSumPt_insideSignalCone_(pset.getParameter<double>("minAbsPhotonSumPt_insideSignalCone")),
69  minRelPhotonSumPt_insideSignalCone_(pset.getParameter<double>("minRelPhotonSumPt_insideSignalCone")),
70  minAbsPhotonSumPt_outsideSignalCone_(pset.getParameter<double>("minAbsPhotonSumPt_outsideSignalCone")),
71  minRelPhotonSumPt_outsideSignalCone_(pset.getParameter<double>("minRelPhotonSumPt_outsideSignalCone"))
72 {
73  typedef std::vector<edm::ParameterSet> VPSet;
74  const VPSet& decayModes = pset.getParameter<VPSet>("decayModes");
75  for ( VPSet::const_iterator decayMode = decayModes.begin();
76  decayMode != decayModes.end(); ++decayMode ) {
78  info.nCharged_ = decayMode->getParameter<uint32_t>("nCharged");
79  info.nPiZeros_ = decayMode->getParameter<uint32_t>("nPiZeros");
80  info.maxPFCHs_ = decayMode->getParameter<uint32_t>("maxTracks");
81  info.maxPiZeros_ = decayMode->getParameter<uint32_t>("maxPiZeros");
82  decayModesToBuild_.push_back(info);
83  }
84 
85  verbosity_ = pset.getParameter<int>("verbosity");
86 }
87 
88 // define template specialization for cross-cleaning
89 namespace xclean
90 {
91  template<>
93  {
94  // Get the list of objects we need to clean
95  for ( ChargedHadronCombo::combo_iterator chargedHadron = chargedHadronsBegin; chargedHadron != chargedHadronsEnd; ++chargedHadron ) {
96  // CV: Remove PFGammas that are merged into TauChargedHadrons from isolation PiZeros, but not from signal PiZeros.
97  // The overlap between PFGammas contained in signal PiZeros and merged into TauChargedHadrons
98  // is resolved by RecoTauConstructor::addTauChargedHadron,
99  // which gives preference to PFGammas that are within PiZeros and removes those PFGammas from TauChargedHadrons.
100  if ( mode_ == kRemoveChargedDaughterOverlaps ) {
101  if ( chargedHadron->getChargedPFCandidate().isNonnull() ) toRemove_.insert(reco::CandidatePtr(chargedHadron->getChargedPFCandidate()));
102  } else if ( mode_ == kRemoveChargedAndNeutralDaughterOverlaps ) {
103  const reco::CompositePtrCandidate::daughters& daughters = chargedHadron->daughterPtrVector();
104  for ( reco::CompositePtrCandidate::daughters::const_iterator daughter = daughters.begin();
105  daughter != daughters.end(); ++daughter ) {
106  toRemove_.insert(reco::CandidatePtr(*daughter));
107  }
108  } else assert(0);
109  }
110  }
111 
112  template<>
113  inline void CrossCleanPtrs<PiZeroList::const_iterator>::initialize(const PiZeroList::const_iterator& piZerosBegin, const PiZeroList::const_iterator& piZerosEnd)
114  {
115  for(auto const& ptr : flattenPiZeros(piZerosBegin, piZerosEnd) ) {
116  toRemove_.insert(CandidatePtr(ptr));
117  }
118  }
119 
120  template<>
122  {
123  //std::cout << "<CrossCleanPtrs<ChargedHadronCombo>::initialize>:" << std::endl;
124  for ( ChargedHadronCombo::combo_iterator chargedHadron = chargedHadronsBegin; chargedHadron != chargedHadronsEnd; ++chargedHadron ) {
125  const reco::CompositePtrCandidate::daughters& daughters = chargedHadron->daughterPtrVector();
126  for ( reco::CompositePtrCandidate::daughters::const_iterator daughter = daughters.begin();
127  daughter != daughters.end(); ++daughter ) {
128  //std::cout << " adding PFCandidate = " << daughter->id() << ":" << daughter->key() << std::endl;
129  toRemove_.insert(reco::CandidatePtr(*daughter));
130  }
131  }
132  }
133 
134  template<>
135  inline void CrossCleanPtrs<ChargedHadronList::const_iterator>::initialize(const ChargedHadronList::const_iterator& chargedHadronsBegin, const ChargedHadronList::const_iterator& chargedHadronsEnd)
136  {
137  //std::cout << "<CrossCleanPtrs<ChargedHadronList>::initialize>:" << std::endl;
138  for ( ChargedHadronList::const_iterator chargedHadron = chargedHadronsBegin; chargedHadron != chargedHadronsEnd; ++chargedHadron ) {
139  const reco::CompositePtrCandidate::daughters& daughters = chargedHadron->daughterPtrVector();
140  for ( reco::CompositePtrCandidate::daughters::const_iterator daughter = daughters.begin();
141  daughter != daughters.end(); ++daughter ) {
142  //std::cout << " adding PFCandidate = " << daughter->id() << ":" << daughter->key() << std::endl;
143  toRemove_.insert(reco::CandidatePtr(*daughter));
144  }
145  }
146  }
147 }
148 
149 namespace
150 {
151  // auxiliary class for sorting pizeros by descending transverse momentum
152  class SortPi0sDescendingPt
153  {
154  public:
155  bool operator()(const RecoTauPiZero& a, const RecoTauPiZero& b) const
156  {
157  return a.pt() > b.pt();
158  }
159  };
160 
161  double square(double x)
162  {
163  return x*x;
164  }
165 }
166 
169  const reco::JetBaseRef& jet,
170  const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons,
171  const std::vector<RecoTauPiZero>& piZeros,
172  const std::vector<CandidatePtr>& regionalExtras) const
173 {
174  if ( verbosity_ ) {
175  std::cout << "<RecoTauBuilderCombinatoricPlugin::operator()>:" << std::endl;
176  std::cout << " processing jet: Pt = " << jet->pt() << ", eta = " << jet->eta() << ", phi = " << jet->eta() << ","
177  << " mass = " << jet->mass() << ", area = " << jet->jetArea() << std::endl;
178  }
179 
180  // Define output.
182 
183  // Update the primary vertex used by the quality cuts. The PV is supplied by
184  // the base class.
185  qcuts_.setPV( primaryVertex(jet) );
186 
187  typedef std::vector<CandidatePtr> CandPtrs;
188 
189  if ( verbosity_ ) {
190  std::cout << "#chargedHadrons = " << chargedHadrons.size() << std::endl;
191  int idx = 0;
192  for ( ChargedHadronList::const_iterator chargedHadron = chargedHadrons.begin();
193  chargedHadron != chargedHadrons.end(); ++chargedHadron ) {
194  std::cout << "chargedHadron #" << idx << ":" << std::endl;
195  chargedHadron->print(std::cout);
196  ++idx;
197  }
198  std::cout << "#piZeros = " << piZeros.size() << std::endl;
199  idx = 0;
200  for ( PiZeroList::const_iterator piZero = piZeros.begin();
201  piZero != piZeros.end(); ++piZero ) {
202  std::cout << "piZero #" << idx << ":" << std::endl;
203  piZero->print(std::cout);
204  ++idx;
205  }
206  }
207 
208  CandPtrs pfchs = qcuts_.filterCandRefs(pfChargedCands(*jet));
209  CandPtrs pfnhs = qcuts_.filterCandRefs(pfCandidatesByPdgId(*jet, 130));
210  CandPtrs pfgammas = qcuts_.filterCandRefs(pfCandidatesByPdgId(*jet, 22));
211 
214  CandPtrs regionalJunk = qcuts_.filterCandRefs(regionalExtras);
215 
216  // Loop over the decay modes we want to build
217  for ( std::vector<decayModeInfo>::const_iterator decayMode = decayModesToBuild_.begin();
218  decayMode != decayModesToBuild_.end(); ++decayMode ) {
219  // Find how many piZeros are in this decay mode
220  size_t piZerosToBuild = decayMode->nPiZeros_;
221  // Find how many tracks are in this decay mode
222  size_t tracksToBuild = decayMode->nCharged_;
223  if ( verbosity_ ) {
224  std::cout << "piZerosToBuild = " << piZerosToBuild << std::endl;
225  std::cout << "#piZeros = " << piZeros.size() << std::endl;
226  std::cout << "tracksToBuild = " << tracksToBuild << std::endl;
227  std::cout << "#chargedHadrons = " << chargedHadrons.size() << std::endl;
228  }
229 
230  // Skip decay mode if jet doesn't have the multiplicity to support it
231  if ( chargedHadrons.size() < tracksToBuild ) continue;
232 
233  // Find the start and end of potential signal tracks
234  ChargedHadronList::const_iterator chargedHadron_begin = chargedHadrons.begin();
235  ChargedHadronList::const_iterator chargedHadron_end = chargedHadrons.end();
236  chargedHadron_end = takeNElements(chargedHadron_begin, chargedHadron_end, decayMode->maxPFCHs_);
237 
238  // Build our track combo generator
239  ChargedHadronCombo trackCombos(chargedHadron_begin, chargedHadron_end, tracksToBuild);
240 
241  CandPtrs::iterator pfch_end = pfchs.end();
242  pfch_end = takeNElements(pfchs.begin(), pfch_end, decayMode->maxPFCHs_);
243 
244  //-------------------------------------------------------
245  // Begin combinatoric loop for this decay mode
246  //-------------------------------------------------------
247 
248  // Loop over the different combinations of tracks
249  for ( ChargedHadronCombo::iterator trackCombo = trackCombos.begin();
250  trackCombo != trackCombos.end(); ++trackCombo ) {
252  trackCombo->combo_begin(), trackCombo->combo_end(),
254 
255  PiZeroList cleanSignalPiZeros = signalPiZeroXCleaner(piZeros);
256 
257  // CV: sort collection of cross-cleaned pi0s by descending Pt
258  std::sort(cleanSignalPiZeros.begin(), cleanSignalPiZeros.end(), SortPi0sDescendingPt());
259 
260  // Skip decay mode if we don't have enough remaining clean pizeros to
261  // build it.
262  if ( cleanSignalPiZeros.size() < piZerosToBuild ) continue;
263 
264  // Find the start and end of potential signal tracks
265  PiZeroList::iterator signalPiZero_begin = cleanSignalPiZeros.begin();
266  PiZeroList::iterator signalPiZero_end = cleanSignalPiZeros.end();
267  signalPiZero_end = takeNElements(signalPiZero_begin, signalPiZero_end, decayMode->maxPiZeros_);
268 
269  // Build our piZero combo generator
270  PiZeroCombo piZeroCombos(signalPiZero_begin, signalPiZero_end, piZerosToBuild);
271  // Loop over the different combinations of PiZeros
272  for ( PiZeroCombo::iterator piZeroCombo = piZeroCombos.begin();
273  piZeroCombo != piZeroCombos.end(); ++piZeroCombo ) {
274  // Output tau
276  jet, getPFCands(), true,
277  &signalConeSize_,
279  // Reserve space in our collections
280  tau.reserve(
282  RecoTauConstructor::kChargedHadron, tracksToBuild);
283  tau.reserve(
285  RecoTauConstructor::kGamma, 2*piZerosToBuild); // k-factor = 2
286  tau.reservePiZero(RecoTauConstructor::kSignal, piZerosToBuild);
287 
289  trackCombo->combo_begin(), trackCombo->combo_end(),
291 
292  PiZeroList precleanedIsolationPiZeros = isolationPiZeroXCleaner(piZeros);
293  std::set<reco::CandidatePtr> toRemove;
294  for ( PiZeroCombo::combo_iterator signalPiZero = piZeroCombo->combo_begin();
295  signalPiZero != piZeroCombo->combo_end(); ++signalPiZero ) {
296  toRemove.insert(signalPiZero->daughterPtrVector().begin(), signalPiZero->daughterPtrVector().end());
297  }
298  PiZeroList cleanIsolationPiZeros;
299  for(auto const& precleanedPiZero : precleanedIsolationPiZeros ) {
300  std::set<reco::CandidatePtr> toCheck(precleanedPiZero.daughterPtrVector().begin(), precleanedPiZero.daughterPtrVector().end());
301  std::vector<reco::CandidatePtr> cleanDaughters;
302  std::set_difference(toCheck.begin(), toCheck.end(), toRemove.begin(), toRemove.end(), std::back_inserter(cleanDaughters));
303  // CV: piZero is signal piZero if at least one daughter overlaps
304  if ( cleanDaughters.size() == precleanedPiZero.daughterPtrVector().size() ) {
305  cleanIsolationPiZeros.push_back(precleanedPiZero);
306  }
307  }
308  if ( verbosity_ ) {
309  std::cout << "#cleanIsolationPiZeros = " << cleanIsolationPiZeros.size() << std::endl;
310  int idx = 0;
311  for ( PiZeroList::const_iterator piZero = cleanIsolationPiZeros.begin();
312  piZero != cleanIsolationPiZeros.end(); ++piZero ) {
313  std::cout << "piZero #" << idx << ":" << std::endl;
314  piZero->print(std::cout);
315  ++idx;
316  }
317  }
318 
319  // FIXME - are all these reserves okay? will they get propagated to the
320  // dataformat size if they are wrong?
321  tau.reserve(
323  RecoTauConstructor::kChargedHadron, chargedHadrons.size() - tracksToBuild);
324  tau.reserve(
327  (piZeros.size() - piZerosToBuild)*2);
328  tau.reservePiZero(
330  (piZeros.size() - piZerosToBuild));
331 
332  // Get signal PiZero constituents and add them to the tau.
333  // The sub-gammas are automatically added.
334  tau.addPiZeros(
336  piZeroCombo->combo_begin(), piZeroCombo->combo_end());
337 
338  // Set signal and isolation components for charged hadrons, after
339  // converting them to a PFCandidateRefVector
340  //
341  // NOTE: signal ChargedHadrons need to be added **after** signal PiZeros
342  // to avoid double-counting PFGammas as part of PiZero and merged with ChargedHadron
343  //
346  trackCombo->combo_begin(), trackCombo->combo_end());
347 
348  // Now build isolation collections
349  // Load our isolation tools
350  using namespace reco::tau::cone;
351  CandPtrDRFilter isolationConeFilter(tau.p4(), -0.1, isolationConeSize_);
352 
353  // Cross cleaning predicate: Remove any PFCandidatePtrs that are contained within existing ChargedHadrons or PiZeros.
354  // The predicate will return false for any object that overlaps with chargedHadrons or cleanPiZeros.
355  // 1.) to select charged PFCandidates within jet that are not signalPFChargedHadrons
356  typedef xclean::CrossCleanPtrs<ChargedHadronCombo::combo_iterator> pfChargedHadronXCleanerType;
357  pfChargedHadronXCleanerType pfChargedHadronXCleaner_comboChargedHadrons(trackCombo->combo_begin(), trackCombo->combo_end());
358  // And this cleaning filter predicate with our Iso cone filter
359  xclean::PredicateAND<CandPtrDRFilter, pfChargedHadronXCleanerType> pfCandFilter_comboChargedHadrons(isolationConeFilter, pfChargedHadronXCleaner_comboChargedHadrons);
360  // 2.) to select neutral PFCandidates within jet
361  xclean::CrossCleanPtrs<ChargedHadronList::const_iterator> pfChargedHadronXCleaner_allChargedHadrons(chargedHadrons.begin(), chargedHadrons.end());
362  xclean::CrossCleanPtrs<PiZeroList::const_iterator> piZeroXCleaner(piZeros.begin(), piZeros.end());
364  pfCandXCleanerType pfCandXCleaner_allChargedHadrons(pfChargedHadronXCleaner_allChargedHadrons, piZeroXCleaner);
365  // And this cleaning filter predicate with our Iso cone filter
366  xclean::PredicateAND<CandPtrDRFilter, pfCandXCleanerType> pfCandFilter_allChargedHadrons(isolationConeFilter, pfCandXCleaner_allChargedHadrons);
367 
368  ChargedHadronDRFilter isolationConeFilterChargedHadron(tau.p4(), -0.1, isolationConeSize_);
369  PiZeroDRFilter isolationConeFilterPiZero(tau.p4(), -0.1, isolationConeSize_);
370 
371  // Additionally make predicates to select the different PF object types
372  // of the regional junk objects to add
374  CandPtrDRFilter> RegionalJunkConeAndIdFilter;
375 
376  xclean::FilterCandByAbsPdgId
377  pfchCandSelector(211);
378  xclean::FilterCandByAbsPdgId
379  pfgammaCandSelector(22);
380  xclean::FilterCandByAbsPdgId
381  pfnhCandSelector(130);
382 
383  RegionalJunkConeAndIdFilter pfChargedJunk(
384  pfchCandSelector, // select charged stuff from junk
385  isolationConeFilter); // only take those in iso cone
386 
387  RegionalJunkConeAndIdFilter pfGammaJunk(
388  pfgammaCandSelector, // select gammas from junk
389  isolationConeFilter); // only take those in iso cone
390 
391  RegionalJunkConeAndIdFilter pfNeutralJunk(
392  pfnhCandSelector, // select neutral stuff from junk
393  isolationConeFilter); // select stuff in iso cone
394 
395  tau.addPiZeros(
397  boost::make_filter_iterator(
398  isolationConeFilterPiZero,
399  cleanIsolationPiZeros.begin(), cleanIsolationPiZeros.end()),
400  boost::make_filter_iterator(
401  isolationConeFilterPiZero,
402  cleanIsolationPiZeros.end(), cleanIsolationPiZeros.end()));
403 
404  // Filter the isolation candidates in a DR cone
405  //
406  // NOTE: isolation ChargedHadrons need to be added **after** signal and isolation PiZeros
407  // to avoid double-counting PFGammas as part of PiZero and merged with ChargedHadron
408  //
409  if ( verbosity_ >= 2 ) {
410  std::cout << "adding isolation PFChargedHadrons from trackCombo:" << std::endl;
411  }
414  boost::make_filter_iterator(
415  isolationConeFilterChargedHadron,
416  trackCombo->remainder_begin(), trackCombo->remainder_end()),
417  boost::make_filter_iterator(
418  isolationConeFilterChargedHadron,
419  trackCombo->remainder_end(), trackCombo->remainder_end()));
420 
421  // Add all the candidates that weren't included in the combinatoric
422  // generation
423  if ( verbosity_ >= 2 ) {
424  std::cout << "adding isolation PFChargedHadrons not considered in trackCombo:" << std::endl;
425  }
426  tau.addPFCands(
428  boost::make_filter_iterator(
429  pfCandFilter_comboChargedHadrons,
430  pfch_end, pfchs.end()),
431  boost::make_filter_iterator(
432  pfCandFilter_comboChargedHadrons,
433  pfchs.end(), pfchs.end()));
434  // Add all charged candidates that are in the iso cone but weren't in the
435  // original PFJet
436  if ( verbosity_ >= 2 ) {
437  std::cout << "adding isolation PFChargedHadrons from 'regional junk':" << std::endl;
438  }
439  tau.addPFCands(
441  boost::make_filter_iterator(
442  pfChargedJunk, regionalJunk.begin(), regionalJunk.end()),
443  boost::make_filter_iterator(
444  pfChargedJunk, regionalJunk.end(), regionalJunk.end()));
445 
446  // Add all PFGamma constituents of the jet that are not part of a PiZero
447  if ( verbosity_ >= 2 ) {
448  std::cout << "adding isolation PFGammas not considered in PiZeros:" << std::endl;
449  }
450  tau.addPFCands(
452  boost::make_filter_iterator(
453  pfCandFilter_allChargedHadrons,
454  pfgammas.begin(), pfgammas.end()),
455  boost::make_filter_iterator(
456  pfCandFilter_allChargedHadrons,
457  pfgammas.end(), pfgammas.end()));
458  // Add all gammas that are in the iso cone but weren't in the
459  // orginal PFJet
460  tau.addPFCands(
462  boost::make_filter_iterator(
463  pfGammaJunk, regionalJunk.begin(), regionalJunk.end()),
464  boost::make_filter_iterator(
465  pfGammaJunk, regionalJunk.end(), regionalJunk.end()));
466 
467  // Add all the neutral hadron candidates to the isolation collection
468  tau.addPFCands(
470  boost::make_filter_iterator(
471  pfCandFilter_allChargedHadrons,
472  pfnhs.begin(), pfnhs.end()),
473  boost::make_filter_iterator(
474  pfCandFilter_allChargedHadrons,
475  pfnhs.end(), pfnhs.end()));
476  // Add all the neutral hadrons from the region collection that are in
477  // the iso cone to the tau
478  tau.addPFCands(
480  boost::make_filter_iterator(
481  pfNeutralJunk, regionalJunk.begin(), regionalJunk.end()),
482  boost::make_filter_iterator(
483  pfNeutralJunk, regionalJunk.end(), regionalJunk.end()));
484 
485  std::auto_ptr<reco::PFTau> tauPtr = tau.get(true);
486 
487  // Set event vertex position for tau
488  reco::VertexRef primaryVertexRef = primaryVertex(*tauPtr);
489  if ( primaryVertexRef.isNonnull() ) {
490  tauPtr->setVertex(primaryVertexRef->position());
491  }
492 
493  double tauEn = tauPtr->energy();
494  double tauPz = tauPtr->pz();
495  const double chargedPionMass = 0.13957; // GeV
496  double tauMass = std::max(tauPtr->mass(), chargedPionMass);
497  double bendCorrMass2 = 0.;
498  const std::vector<RecoTauPiZero>& piZeros = tauPtr->signalPiZeroCandidates();
499  for (auto const& piZero : piZeros ) {
500  double piZeroEn = piZero.energy();
501  double piZeroPx = piZero.px();
502  double piZeroPy = piZero.py();
503  double piZeroPz = piZero.pz();
504  double tau_wo_piZeroPx = tauPtr->px() - piZeroPx;
505  double tau_wo_piZeroPy = tauPtr->py() - piZeroPy;
506  // CV: Compute effect of varying strip four-vector by eta and phi correction on tau mass
507  // (derrivative of tau mass by strip eta, phi has been computed using Mathematica)
508  bendCorrMass2 += square(((piZeroPz*tauEn - piZeroEn*tauPz)/tauMass)*piZero.bendCorrEta());
509  bendCorrMass2 += square(((piZeroPy*tau_wo_piZeroPx - piZeroPx*tau_wo_piZeroPy)/tauMass)*piZero.bendCorrPhi());
510  }
511  //edm::LogPrint("RecoTauBuilderCombinatoricPlugin") << "bendCorrMass2 = " << sqrt(bendCorrMass2) << std::endl;
512  tauPtr->setBendCorrMass(sqrt(bendCorrMass2));
513 
514  output.push_back(tauPtr);
515  }
516  }
517  }
518 
519  return output.release();
520 }
521 
522 }} // end namespace reco::tau
523 
527  "RecoTauBuilderCombinatoricPlugin");
reco::VertexRef primaryVertex(const reco::JetBaseRef &jet) const
Get primary vertex associated to this jet.
std::vector< CandidatePtr > pfCandidatesByPdgId(const Jet &jet, int pdgId, bool sort=true)
T getParameter(std::string const &) const
static AlgebraicMatrix initialize()
InputIterator takeNElements(const InputIterator &begin, const InputIterator &end, size_t N)
static const TGPicture * info(bool iBackgroundIsBlack)
std::auto_ptr< reco::PFTau > get(bool setupLeadingCandidates=true)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
void reserve(Region region, ParticleType type, size_t size)
Reserve a set amount of space for a given RefVector.
void addTauChargedHadrons(Region region, const InputIterator &begin, const InputIterator &end)
Add a list of charged hadrons to the input collection.
CombinatoricIterator< T > end()
Coll filterCandRefs(const Coll &refcoll, bool invert=false) const
Filter a ref vector of Candidates.
std::vector< reco::PFRecoTauChargedHadron > ChargedHadronList
ParameterSet const & getParameterSet(ParameterSetID const &id)
boost::ptr_vector< reco::PFTau > output_type
double pt() const final
transverse momentum
std::auto_ptr< output_type > return_type
RecoTauBuilderCombinatoricPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
std::vector< CandidatePtr > pfChargedCands(const Jet &jet, bool sort=true)
Extract all non-neutral candidates from a PFJet.
tau::CombinatoricGenerator< PiZeroList > PiZeroCombo
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.
void addPiZeros(Region region, const InputIterator &begin, const InputIterator &end)
Add a list of pizeros to the input collection.
std::vector< reco::CandidatePtr > CandPtrs
void setPV(const reco::VertexRef &vtx) const
Update the primary vertex.
T sqrt(T t)
Definition: SSEVec.h:18
const reco::Candidate::LorentzVector & p4() const
void addPFCands(Region region, ParticleType type, const InputIterator &begin, const InputIterator &end)
tau::CombinatoricGenerator< ChargedHadronList > ChargedHadronCombo
std::vector< CandidatePtr > daughters
collection of references to daughters
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
void reservePiZero(Region region, size_t size)
Reserve a set amount of space for the PiZeros.
double b
Definition: hdecay.h:120
static double square(double x)
fixed size matrix
double a
Definition: hdecay.h:121
return_type operator()(const reco::JetBaseRef &, const std::vector< reco::PFRecoTauChargedHadron > &, const std::vector< RecoTauPiZero > &, const std::vector< CandidatePtr > &) const override
#define DEFINE_EDM_PLUGIN(factory, type, name)
const edm::Handle< edm::View< reco::Candidate > > & getPFCands() const
Hack to be able to convert Ptrs to Refs.
std::vector< RecoTauPiZero > PiZeroList
def move(src, dest)
Definition: eostools.py:511
iterator::value_type::ValueIter combo_iterator
Transform a pizero to remove given candidates.
CombinatoricIterator< T > begin()