Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:24

0001 #ifndef RecoJets_JetAlgorithms_CompoundPseudoJet_h
0002 #define RecoJets_JetAlgorithms_CompoundPseudoJet_h
0003 
0004 // -*- C++ -*-
0005 //// -*- C++ -*-
0006 //
0007 // Package:    CompoundPseudoJet
0008 // Class:      CompoundPseudoJet
0009 //
0010 /**
0011 
0012 
0013 */
0014 //-------------------------------------------------------------------------------------
0015 //!\class CompoundPseudoJet CompoundPseudoJet.cc RecoJets/JetAlgorithms/interface/CompoundPseudoJet.h
0016 //!\brief CompoundPseudoJet holds an association of fastjet::PseudoJets that represent
0017 //!       a "hard" top jet with subjets.
0018 //!
0019 //-------------------------------------------------------------------------------------
0020 //
0021 // Original Author:  Salvatore Rappoccio
0022 //         Created:  Wed Nov 28 15:31:57 CST 2007
0023 //
0024 //-------------------------------------------------------------------------------------
0025 
0026 #include <fastjet/JetDefinition.hh>
0027 #include <fastjet/PseudoJet.hh>
0028 
0029 #include <vector>
0030 #include <algorithm>
0031 
0032 class CompoundPseudoSubJet {
0033 public:
0034   CompoundPseudoSubJet() {}
0035   CompoundPseudoSubJet(fastjet::PseudoJet const& subjet, std::vector<int> const& constituents)
0036       : subjet_(subjet), subjetArea_(0.0), constituents_(constituents.size()) {
0037     copy(constituents.begin(), constituents.end(), constituents_.begin());
0038   }
0039   CompoundPseudoSubJet(fastjet::PseudoJet const& subjet, double subjetArea, std::vector<int> const& constituents)
0040       : subjet_(subjet), subjetArea_(subjetArea), constituents_(constituents.size()) {
0041     copy(constituents.begin(), constituents.end(), constituents_.begin());
0042   }
0043 
0044   ~CompoundPseudoSubJet() {}
0045 
0046   fastjet::PseudoJet const& subjet() const { return subjet_; }
0047   double subjetArea() const { return subjetArea_; }
0048   std::vector<int> const& constituents() const { return constituents_; }
0049 
0050 protected:
0051   fastjet::PseudoJet subjet_;
0052   double subjetArea_;
0053   std::vector<int> constituents_;
0054 };
0055 
0056 class CompoundPseudoJet {
0057 public:
0058   CompoundPseudoJet() {}
0059   CompoundPseudoJet(fastjet::PseudoJet const& hardJet, std::vector<CompoundPseudoSubJet> const& subjets)
0060       : hardJet_(hardJet), hardJetArea_(0.0), subjets_(subjets.size()) {
0061     copy(subjets.begin(), subjets.end(), subjets_.begin());
0062   }
0063   CompoundPseudoJet(fastjet::PseudoJet const& hardJet,
0064                     double hardJetArea,
0065                     std::vector<CompoundPseudoSubJet> const& subjets)
0066       : hardJet_(hardJet), hardJetArea_(hardJetArea), subjets_(subjets.size()) {
0067     copy(subjets.begin(), subjets.end(), subjets_.begin());
0068   }
0069 
0070   ~CompoundPseudoJet() {}
0071 
0072   fastjet::PseudoJet const& hardJet() const { return hardJet_; }
0073   double hardJetArea() const { return hardJetArea_; }
0074   std::vector<CompoundPseudoSubJet> const& subjets() const { return subjets_; }
0075 
0076 protected:
0077   fastjet::PseudoJet hardJet_;
0078   double hardJetArea_;
0079   std::vector<CompoundPseudoSubJet> subjets_;
0080 };
0081 
0082 inline bool greaterByEtPseudoJet(fastjet::PseudoJet const& j1, fastjet::PseudoJet const& j2) {
0083   return j1.perp() > j2.perp();
0084 }
0085 
0086 #endif