CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/JetReco/interface/PattRecoTree.h

Go to the documentation of this file.
00001 
00012 #ifndef DataFormats_JetReco_PattRecoTree_h
00013 #define DataFormats_JetReco_PattRecoTree_h
00014 
00015 #include "DataFormats/JetReco/interface/PattRecoNode.h"
00016 
00017 namespace reco {
00018     template<typename ScaleType, class Cluster>
00019     class PattRecoTree
00020     {
00021     public:
00022         typedef PattRecoNode<Cluster> Node;
00023 
00024         inline PattRecoTree() : sparse_(false) {}
00025 
00026         // Inspectors
00027         inline bool isSparse() const {return sparse_;}
00028         inline const std::vector<Node>& getNodes() const {return nodes_;}
00029         inline const std::vector<ScaleType>& getScales() const
00030         {return scales_;}
00031 
00032         // Modifiers
00033         inline void setSparse(const bool b) {sparse_ = b;}
00034 
00035         inline void clear()
00036         {nodes_.clear(); scales_.clear(); sparse_ = false;}
00037 
00038         inline void reserveNodes(const unsigned n) {nodes_.reserve(n);}
00039         inline void reserveScales(const unsigned n) {scales_.reserve(n);}
00040         inline void addNode(const Node& node) {nodes_.push_back(node);}
00041         inline void addScale(const double s)
00042         {scales_.push_back(static_cast<ScaleType>(s));}
00043 
00044     private:
00045         std::vector<Node> nodes_;
00046         std::vector<ScaleType> scales_;
00047         bool sparse_;
00048     };
00049 }
00050 
00051 #endif // JetReco_PattRecoTree_h