CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/RecoJets/JetAlgorithms/interface/CompoundPseudoJet.h

Go to the documentation of this file.
00001 #ifndef RecoJets_JetAlgorithms_CompoundPseudoJet_h
00002 #define RecoJets_JetAlgorithms_CompoundPseudoJet_h
00003 
00004 
00005 
00006 // -*- C++ -*-
00008 //
00009 // Package:    CompoundPseudoJet
00010 // Class:      CompoundPseudoJet
00011 //
00016 //-------------------------------------------------------------------------------------
00021 //-------------------------------------------------------------------------------------
00022 //
00023 // Original Author:  Salvatore Rappoccio
00024 //         Created:  Wed Nov 28 15:31:57 CST 2007
00025 // $Id: CompoundPseudoJet.h,v 1.1 2008/10/31 19:00:22 srappocc Exp $
00026 //
00027 //-------------------------------------------------------------------------------------
00028 
00029 
00030 
00031 
00032 #include <fastjet/JetDefinition.hh>
00033 #include <fastjet/PseudoJet.hh>
00034 
00035 #include <vector>
00036 #include <algorithm>
00037 
00038 class CompoundPseudoSubJet {
00039  public:
00040   CompoundPseudoSubJet() {}
00041   CompoundPseudoSubJet( fastjet::PseudoJet const & subjet,
00042                      std::vector<int> const & constituents ) :
00043     subjet_(subjet),
00044     constituents_(constituents.size() ) 
00045       {
00046         copy( constituents.begin(), constituents.end(), constituents_.begin() );
00047       }
00048 
00049   ~CompoundPseudoSubJet() {} 
00050 
00051   fastjet::PseudoJet const & subjet()       const { return subjet_; }
00052   std::vector<int> const &   constituents() const { return constituents_; }
00053 
00054  protected:
00055   fastjet::PseudoJet         subjet_;
00056   std::vector<int>           constituents_;
00057 };
00058 
00059 class CompoundPseudoJet {
00060 
00061  public:
00062   CompoundPseudoJet() {}
00063   CompoundPseudoJet(fastjet::PseudoJet const & hardJet,
00064                  std::vector<CompoundPseudoSubJet> const & subjets )  :
00065     hardJet_(hardJet),
00066     subjets_(subjets.size())
00067     {
00068       copy( subjets.begin(), subjets.end(),  subjets_.begin() );
00069     }
00070 
00071   ~CompoundPseudoJet() {}
00072 
00073   fastjet::PseudoJet const &              hardJet() const { return hardJet_; }
00074   std::vector<CompoundPseudoSubJet> const &  subjets() const { return subjets_; }
00075 
00076 
00077  protected:
00078   fastjet::PseudoJet                    hardJet_;
00079   std::vector<CompoundPseudoSubJet>    subjets_;
00080 };
00081 
00082 
00083 
00084 class GreaterByEtPseudoJet : 
00085   public std::binary_function<fastjet::PseudoJet const &, fastjet::PseudoJet const &, bool> {
00086 
00087 public:
00088   bool operator()( fastjet::PseudoJet const & j1, fastjet::PseudoJet const & j2 ) {
00089     return j1.perp() > j2.perp();
00090   }
00091 };
00092 
00093 #endif