00001 #ifndef RecoJets_JetAlgorithms_CATopJetAlgorithm_h
00002 #define RecoJets_JetAlgorithms_CATopJetAlgorithm_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <vector>
00017 #include <list>
00018 #include <functional>
00019 #include <TMath.h>
00020 #include <iostream>
00021
00022 #include "DataFormats/Candidate/interface/Candidate.h"
00023 #include "DataFormats/CaloTowers/interface/CaloTower.h"
00024 #include "DataFormats/CaloTowers/interface/CaloTowerFwd.h"
00025 #include "DataFormats/JetReco/interface/CaloJet.h"
00026 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
00027 #include "DataFormats/JetReco/interface/BasicJet.h"
00028 #include "DataFormats/JetReco/interface/BasicJetCollection.h"
00029 #include "DataFormats/Math/interface/deltaR.h"
00030 #include "RecoJets/JetAlgorithms/interface/JetAlgoHelper.h"
00031 #include "RecoJets/JetAlgorithms/interface/CompoundPseudoJet.h"
00032 #include "DataFormats/Candidate/interface/LeafCandidate.h"
00033 #include "FWCore/Framework/interface/Event.h"
00034
00035 #include "RecoJets/JetAlgorithms/interface/CompoundPseudoJet.h"
00036
00037
00038 #include <fastjet/JetDefinition.hh>
00039 #include <fastjet/PseudoJet.hh>
00040 #include <fastjet/ClusterSequence.hh>
00041 #include <fastjet/ActiveAreaSpec.hh>
00042 #include <fastjet/ClusterSequenceArea.hh>
00043
00044 class CATopJetAlgorithm{
00045 public:
00048 CATopJetAlgorithm(edm::InputTag mSrc,
00049 bool verbose,
00050 int algorithm,
00051 int useAdjacency,
00052 double centralEtaCut,
00053 double ptMin,
00054 const std::vector<double> & sumEtBins,
00055 const std::vector<double> & rBins,
00056 const std::vector<double> & ptFracBins,
00057 const std::vector<double> & deltarBins,
00058 const std::vector<double> & nCellBins,
00059 double seedThreshold,
00060 bool useMaxTower,
00061 double sumEtEtaCut,
00062 double etFrac,
00063 boost::shared_ptr<fastjet::JetDefinition> fjJetDefinition,
00064 bool doAreaFastjet,
00065 boost::shared_ptr<fastjet::ActiveAreaSpec> fjActiveArea,
00066 double voronoiRfact) :
00067 mSrc_ (mSrc ),
00068 verbose_ (verbose ),
00069 algorithm_ (algorithm ),
00070 useAdjacency_ (useAdjacency ),
00071 centralEtaCut_ (centralEtaCut ),
00072 ptMin_ (ptMin ),
00073 sumEtBins_ (sumEtBins ),
00074 rBins_ (rBins ),
00075 ptFracBins_ (ptFracBins ),
00076 deltarBins_ (deltarBins ),
00077 nCellBins_ (nCellBins ),
00078 seedThreshold_ (seedThreshold ),
00079 useMaxTower_ (useMaxTower ),
00080 sumEtEtaCut_ (sumEtEtaCut ),
00081 etFrac_ (etFrac ),
00082 fjJetDefinition_(fjJetDefinition),
00083 doAreaFastjet_ (doAreaFastjet),
00084 fjActiveArea_ (fjActiveArea),
00085 voronoiRfact_ (voronoiRfact)
00086 { }
00087
00089 void run( const std::vector<fastjet::PseudoJet> & cell_particles,
00090 std::vector<CompoundPseudoJet> & hardjetsOutput
00091 );
00092
00093 private:
00094
00095 edm::InputTag mSrc_;
00096 bool verbose_;
00097 int algorithm_;
00098 int useAdjacency_;
00099
00100
00101
00102
00103 double centralEtaCut_;
00104 double ptMin_;
00105 std::vector<double> sumEtBins_;
00106 std::vector<double> rBins_;
00107 std::vector<double> ptFracBins_;
00108 std::vector<double> deltarBins_;
00109 std::vector<double> nCellBins_;
00110
00111 double seedThreshold_;
00112 bool useMaxTower_;
00113 double sumEtEtaCut_;
00114 double etFrac_;
00115 std::string jetType_;
00116 boost::shared_ptr<fastjet::JetDefinition> fjJetDefinition_;
00117 bool doAreaFastjet_;
00118 boost::shared_ptr<fastjet::ActiveAreaSpec> fjActiveArea_;
00119 double voronoiRfact_;
00120
00121
00122 bool adjacentCells(const fastjet::PseudoJet & jet1, const fastjet::PseudoJet & jet2,
00123 const std::vector<fastjet::PseudoJet> & cell_particles,
00124 const fastjet::ClusterSequence & theClusterSequence,
00125 double nCellMin ) const;
00126
00127
00128
00129
00130 bool decomposeJet(const fastjet::PseudoJet & theJet,
00131 const fastjet::ClusterSequence & theClusterSequence,
00132 const std::vector<fastjet::PseudoJet> & cell_particles,
00133 double ptHard, double nCellMin, double deltarcut,
00134 fastjet::PseudoJet & ja, fastjet::PseudoJet & jb,
00135 std::vector<fastjet::PseudoJet> & leftovers) const;
00136
00137 };
00138
00139
00140
00141 #endif