CMS 3D CMS Logo

GenericClusterImporter.cc
Go to the documentation of this file.
5 
7 public:
9  edm::ConsumesCollector& sumes) :
10  BlockElementImporterBase(conf,sumes),
11  _src(sumes.consumes<reco::PFClusterCollection>(conf.getParameter<edm::InputTag>("source"))) {}
12 
13  void importToBlock( const edm::Event& ,
14  ElementList& ) const override;
15 
16 private:
18 };
19 
22  "GenericClusterImporter");
23 
27  auto clusters = e.getHandle(_src);
28  auto cbegin = clusters->cbegin();
29  auto cend = clusters->cend();
30  for( auto clus = cbegin; clus != cend; ++clus ) {
32  reco::PFClusterRef cref(clusters,std::distance(cbegin,clus));
33  switch( clus->layer() ) {
34  case PFLayer::PS1:
36  break;
37  case PFLayer::PS2:
39  break;
43  break;
47  break;
50  break;
51  case PFLayer::HF_EM:
53  break;
54  case PFLayer::HF_HAD:
56  break;
57  case PFLayer::HGCAL:
59  break;
60  default:
61  throw cms::Exception("InvalidPFLayer")
62  << "Layer given, " << clus->layer() << " is not a valid PFLayer!";
63  }
65  elems.emplace_back(cptr);
66  }
67 }
type
Definition: HCALResponse.h:21
Abstract base class for a PFBlock element (track, cluster...)
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:539
GenericClusterImporter(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
fixed size matrix
HLT enums.
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
edm::EDGetTokenT< reco::PFClusterCollection > _src
void importToBlock(const edm::Event &, ElementList &) const override