CMS 3D CMS Logo

CMSInsideOutAlgorithm.h
Go to the documentation of this file.
1 #ifndef RecoJets_JetAlgorithms_CMSInsideOutAlgorithm_h
2 #define RecoJets_JetAlgorithms_CMSInsideOutAlgorithm_h
3 
12 #include <list>
13 #include <algorithm>
14 
17 #include <limits>
18 #include <vector>
19 #include <list>
20 
21 #include "fastjet/PseudoJet.hh"
22 
24 public:
26  typedef std::list<fastjet::PseudoJet>::iterator inputListIter;
27  // binary predicate to sort a std::list of std::list<InputItem> iterators by increasing deltaR
28  // from a eta-phi point specified in the ctor
30  public:
31  ListIteratorLesserByDeltaR(const double& eta, const double& phi) : seedEta_(eta), seedPhi_(phi) {}
32  bool operator()(const inputListIter& A, const inputListIter& B) const {
33  double deltaR2A = reco::deltaR2((*A).eta(), seedEta_, (*A).phi(), seedPhi_);
34  double deltaR2B = reco::deltaR2((*B).eta(), seedEta_, (*B).phi(), seedPhi_);
35  return fabs(deltaR2A - deltaR2B) > std::numeric_limits<double>::epsilon()
36  ? deltaR2A < deltaR2B
37  : reco::deltaPhi((*A).phi(), seedPhi_) < reco::deltaPhi((*B).phi(), seedPhi_);
38  };
39 
40  private:
41  double seedEta_, seedPhi_;
42  };
43 
50  CMSInsideOutAlgorithm(double seedObjectPt, double growthParameter, double maxSize, double minSize)
51  : seedThresholdPt_(seedObjectPt),
52  growthParameterSquared_(growthParameter * growthParameter),
53  maxSizeSquared_(maxSize * maxSize),
54  minSizeSquared_(minSize * minSize){};
55 
57  void run(const std::vector<fastjet::PseudoJet>& fInput, std::vector<fastjet::PseudoJet>& fOutput);
58 
59 private:
64 };
65 
66 #endif
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
std::list< fastjet::PseudoJet >::iterator inputListIter
reco::Particle::LorentzVector LorentzVector
CMSInsideOutAlgorithm(double seedObjectPt, double growthParameter, double maxSize, double minSize)
static const std::string B
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
ListIteratorLesserByDeltaR(const double &eta, const double &phi)
bool operator()(const inputListIter &A, const inputListIter &B) const
void run(const std::vector< fastjet::PseudoJet > &fInput, std::vector< fastjet::PseudoJet > &fOutput)
Build from input candidate collection.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21