Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:43

0001 /** \class reco::PattRecoTree
0002  *
0003  * \short Class for storing FFTJet sparse clustering trees
0004  *
0005  * This is a pure storage class with limited functionality.
0006  * Applications should use fftjet::SparseClusteringTree
0007  *
0008  * \author Igor Volobouev, TTU, June 16, 2010
0009  ************************************************************/
0010 
0011 #ifndef DataFormats_JetReco_PattRecoTree_h
0012 #define DataFormats_JetReco_PattRecoTree_h
0013 
0014 #include "DataFormats/JetReco/interface/PattRecoNode.h"
0015 
0016 #include <vector>
0017 
0018 namespace reco {
0019   template <typename ScaleType, class Cluster>
0020   class PattRecoTree {
0021   public:
0022     typedef PattRecoNode<Cluster> Node;
0023 
0024     inline PattRecoTree() : sparse_(false) {}
0025 
0026     // Inspectors
0027     inline bool isSparse() const { return sparse_; }
0028     inline const std::vector<Node>& getNodes() const { return nodes_; }
0029     inline const std::vector<ScaleType>& getScales() const { return scales_; }
0030 
0031     // Modifiers
0032     inline void setSparse(const bool b) { sparse_ = b; }
0033 
0034     inline void clear() {
0035       nodes_.clear();
0036       scales_.clear();
0037       sparse_ = false;
0038     }
0039 
0040     inline void reserveNodes(const unsigned n) { nodes_.reserve(n); }
0041     inline void reserveScales(const unsigned n) { scales_.reserve(n); }
0042     inline void addNode(const Node& node) { nodes_.push_back(node); }
0043     inline void addScale(const double s) { scales_.push_back(static_cast<ScaleType>(s)); }
0044 
0045   private:
0046     std::vector<Node> nodes_;
0047     std::vector<ScaleType> scales_;
0048     bool sparse_;
0049   };
0050 }  // namespace reco
0051 
0052 #endif  // JetReco_PattRecoTree_h