File indexing completed on 2024-09-07 04:37:32
0001 #ifndef RecoJets_JetAlgorithms_CMSInsideOutAlgorithm_h
0002 #define RecoJets_JetAlgorithms_CMSInsideOutAlgorithm_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <list>
0013 #include <algorithm>
0014
0015 #include "DataFormats/Candidate/interface/Candidate.h"
0016 #include "DataFormats/Math/interface/deltaR.h"
0017 #include <limits>
0018 #include <vector>
0019 #include <list>
0020
0021 #include "fastjet/PseudoJet.hh"
0022
0023 class CMSInsideOutAlgorithm {
0024 public:
0025 typedef reco::Particle::LorentzVector LorentzVector;
0026 typedef std::list<fastjet::PseudoJet>::iterator inputListIter;
0027
0028
0029 class ListIteratorLesserByDeltaR {
0030 public:
0031 ListIteratorLesserByDeltaR(const double& eta, const double& phi) : seedEta_(eta), seedPhi_(phi) {}
0032 bool operator()(const inputListIter& A, const inputListIter& B) const {
0033 double deltaR2A = reco::deltaR2((*A).eta(), seedEta_, (*A).phi(), seedPhi_);
0034 double deltaR2B = reco::deltaR2((*B).eta(), seedEta_, (*B).phi(), seedPhi_);
0035 return fabs(deltaR2A - deltaR2B) > std::numeric_limits<double>::epsilon()
0036 ? deltaR2A < deltaR2B
0037 : reco::deltaPhi((*A).phi(), seedPhi_) < reco::deltaPhi((*B).phi(), seedPhi_);
0038 };
0039
0040 private:
0041 double seedEta_, seedPhi_;
0042 };
0043
0044
0045
0046
0047
0048
0049
0050 CMSInsideOutAlgorithm(double seedObjectPt, double growthParameter, double maxSize, double minSize)
0051 : seedThresholdPt_(seedObjectPt),
0052 growthParameterSquared_(growthParameter * growthParameter),
0053 maxSizeSquared_(maxSize * maxSize),
0054 minSizeSquared_(minSize * minSize) {}
0055
0056
0057 void run(const std::vector<fastjet::PseudoJet>& fInput, std::vector<fastjet::PseudoJet>& fOutput);
0058
0059 private:
0060 double seedThresholdPt_;
0061 double growthParameterSquared_;
0062 double maxSizeSquared_;
0063 double minSizeSquared_;
0064 };
0065
0066 #endif