CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/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.2 2011/03/24 17:02:39 schiefer 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     subjetArea_(0.0),
00045     constituents_(constituents.size() ) 
00046   {
00047     copy( constituents.begin(), constituents.end(), constituents_.begin() );
00048   }
00049   CompoundPseudoSubJet(fastjet::PseudoJet const & subjet,
00050                        double subjetArea,
00051                        std::vector<int> const & constituents ) :
00052     subjet_(subjet),
00053     subjetArea_(subjetArea),
00054     constituents_(constituents.size() ) 
00055   {
00056     copy( constituents.begin(), constituents.end(), constituents_.begin() );
00057   }
00058   
00059   ~CompoundPseudoSubJet() {} 
00060   
00061   fastjet::PseudoJet const & subjet()       const { return subjet_; }
00062   double                     subjetArea()   const { return subjetArea_; }
00063   std::vector<int> const &   constituents() const { return constituents_; }
00064   
00065 protected:
00066   fastjet::PseudoJet         subjet_;
00067   double                     subjetArea_;
00068   std::vector<int>           constituents_;
00069 };
00070 
00071 class CompoundPseudoJet {
00072 
00073 public:
00074   CompoundPseudoJet() {}
00075   CompoundPseudoJet(fastjet::PseudoJet const & hardJet,
00076                     std::vector<CompoundPseudoSubJet> const & subjets )  :
00077     hardJet_(hardJet),
00078     hardJetArea_(0.0),
00079     subjets_(subjets.size())
00080   {
00081     copy( subjets.begin(), subjets.end(),  subjets_.begin() );
00082   }
00083   CompoundPseudoJet(fastjet::PseudoJet const & hardJet,
00084                     double hardJetArea,
00085                     std::vector<CompoundPseudoSubJet> const & subjets )  :
00086     hardJet_(hardJet),
00087     hardJetArea_(hardJetArea),
00088     subjets_(subjets.size())
00089   {
00090     copy( subjets.begin(), subjets.end(),  subjets_.begin() );
00091   }
00092   
00093   ~CompoundPseudoJet() {}
00094   
00095   fastjet::PseudoJet const &              hardJet()     const {return hardJet_;}
00096   double                                  hardJetArea() const {return hardJetArea_;}
00097   std::vector<CompoundPseudoSubJet>const& subjets()     const {return subjets_; }
00098   
00099   
00100 protected:
00101   fastjet::PseudoJet                hardJet_;
00102   double                            hardJetArea_;
00103   std::vector<CompoundPseudoSubJet> subjets_;
00104 };
00105 
00106 
00107 
00108 class GreaterByEtPseudoJet : 
00109   public std::binary_function<fastjet::PseudoJet const &, fastjet::PseudoJet const &, bool> {
00110   
00111 public:
00112   bool operator()( fastjet::PseudoJet const & j1, fastjet::PseudoJet const & j2 ) {
00113     return j1.perp() > j2.perp();
00114   }
00115 };
00116 
00117 #endif