Go to the documentation of this file.00001 #ifndef RecoJets_JetAlgorithms_CMSInsideOutAlgorithm_h
00002 #define RecoJets_JetAlgorithms_CMSInsideOutAlgorithm_h
00003
00013 #include <list>
00014 #include <algorithm>
00015
00016 #include "DataFormats/Candidate/interface/Candidate.h"
00017 #include "DataFormats/Math/interface/deltaR.h"
00018 #include <limits>
00019 #include <vector>
00020 #include <list>
00021
00022 #include "fastjet/PseudoJet.hh"
00023
00024
00025
00026
00027 class CMSInsideOutAlgorithm {
00028 public:
00029 typedef reco::Particle::LorentzVector LorentzVector;
00030 typedef std::list<fastjet::PseudoJet>::iterator inputListIter;
00031
00032
00033 class ListIteratorLesserByDeltaR {
00034 public: ListIteratorLesserByDeltaR(const double& eta, const double& phi):seedEta_(eta),seedPhi_(phi){}
00035 bool operator()(const inputListIter& A, const inputListIter& B) const {
00036 double deltaR2A = reco::deltaR2( (*A).eta(), seedEta_, (*A).phi(), seedPhi_ );
00037 double deltaR2B = reco::deltaR2( (*B).eta(), seedEta_, (*B).phi(), seedPhi_ );
00038 return
00039 fabs(deltaR2A - deltaR2B) > std::numeric_limits<double>::epsilon() ? deltaR2A < deltaR2B :
00040 reco::deltaPhi((*A).phi(), seedPhi_) < reco::deltaPhi((*B).phi(), seedPhi_);
00041 };
00042 private:
00043 double seedEta_, seedPhi_;
00044 };
00045
00052 CMSInsideOutAlgorithm(double seedObjectPt, double growthParameter, double maxSize, double minSize):
00053 seedThresholdPt_(seedObjectPt),
00054 growthParameterSquared_(growthParameter*growthParameter),
00055 maxSizeSquared_(maxSize*maxSize),
00056 minSizeSquared_(minSize*minSize){};
00057
00058
00059
00061 void run(const std::vector<fastjet::PseudoJet>& fInput, std::vector<fastjet::PseudoJet> & fOutput);
00062
00063 private:
00064 double seedThresholdPt_;
00065 double growthParameterSquared_;
00066 double maxSizeSquared_;
00067 double minSizeSquared_;
00068 };
00069
00070 #endif