Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:37:30

0001 // Author: Marco Rovere - marco.rovere@cern.ch
0002 // Date: 11/2018
0003 
0004 #ifndef RecoHGCal_TICL_ClusterFilterByAlgo_H__
0005 #define RecoHGCal_TICL_ClusterFilterByAlgo_H__
0006 
0007 #include "DataFormats/CaloRecHit/interface/CaloCluster.h"
0008 #include "ClusterFilterBase.h"
0009 
0010 #include <memory>
0011 #include <utility>
0012 
0013 // Filter clusters that belong to a specific algorithm
0014 namespace ticl {
0015   class ClusterFilterByAlgo final : public ClusterFilterBase {
0016   public:
0017     ClusterFilterByAlgo(const edm::ParameterSet& ps)
0018         : ClusterFilterBase(ps), algo_number_(ps.getParameter<std::vector<int>>("algo_number")) {}
0019     ~ClusterFilterByAlgo() override {}
0020 
0021     void filter(const std::vector<reco::CaloCluster>& layerClusters,
0022                 std::vector<float>& layerClustersMask,
0023                 hgcal::RecHitTools& rhtools) const override {
0024       for (size_t i = 0; i < layerClusters.size(); i++) {
0025         if (find(algo_number_.begin(), algo_number_.end(), layerClusters[i].algo()) == algo_number_.end()) {
0026           layerClustersMask[i] = 0.;
0027         }
0028       }
0029     }
0030 
0031   private:
0032     std::vector<int> algo_number_;
0033   };
0034 }  // namespace ticl
0035 
0036 #endif