00001 #ifndef PhysicsTools_PFCandProducer_FastJetAlgo 00002 #define PhysicsTools_PFCandProducer_FastJetAlgo 00003 00004 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00005 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" 00006 #include "DataFormats/JetReco/interface/PFJetCollection.h" 00007 #include "DataFormats/JetReco/interface/Jet.h" 00008 00009 #include "fastjet/PseudoJet.hh" 00010 #include "fastjet/JetDefinition.hh" 00011 00012 #include <iostream> 00013 00014 namespace pf2pat { 00015 00016 00017 //COLIN change name to FastJetAlgo 00018 00019 class FastJetAlgo { 00020 00021 public: 00022 typedef std::vector< fastjet::PseudoJet > PseudoJetCollection; 00023 typedef PseudoJetCollection::const_iterator PJI; 00024 00025 // template it? 00026 typedef reco::PFCandidate InputType; 00027 typedef std::vector<InputType> InputCollection; 00028 typedef edm::Handle< InputCollection > InputHandle; 00029 00030 // template it? 00031 typedef reco::PFJet JetType; 00032 typedef std::vector<JetType> JetCollection; 00033 typedef JetCollection::const_iterator JI; 00034 00035 FastJetAlgo( const edm::ParameterSet& ps ); 00036 00038 void setJetDefinition( const edm::ParameterSet& ps); 00039 00041 void setJetDefinition( const fastjet::JetDefinition& jetDef); 00042 00044 const JetCollection& produce( const InputHandle& inputColl); 00045 00047 void printPseudoJets( std::ostream& out = std::cout) const; 00048 00050 void printJets( std::ostream& out = std::cout) const; 00051 00052 00053 private: 00057 void recoToFastJet(const InputCollection& inputColl); 00058 00060 void runJetClustering(); 00061 00063 const JetCollection& fastJetToReco(); 00064 00067 JetType makeJet( const fastjet::PseudoJet& pseudoJet) const; 00068 00071 reco::Jet::Constituents makeConstituents(const fastjet::PseudoJet& pseudoJet) const; 00072 00074 InputHandle inputHandle_; 00075 00077 PseudoJetCollection input_; 00078 00080 PseudoJetCollection output_; 00081 00083 JetCollection jetCollection_; 00084 00086 fastjet::JetDefinition jetDefinition_; 00087 00089 fastjet::ClusterSequence* clusterSequence_; 00090 00091 }; 00092 00093 } 00094 00095 #endif