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 
28  e.getByToken(_src,clusters);
29  auto cbegin = clusters->cbegin();
30  auto cend = clusters->cend();
31  for( auto clus = cbegin; clus != cend; ++clus ) {
33  reco::PFClusterRef cref(clusters,std::distance(cbegin,clus));
34  switch( clus->layer() ) {
35  case PFLayer::PS1:
37  break;
38  case PFLayer::PS2:
40  break;
44  break;
48  break;
51  break;
52  case PFLayer::HF_EM:
54  break;
55  case PFLayer::HF_HAD:
57  break;
58  case PFLayer::HGCAL:
60  break;
61  default:
62  throw cms::Exception("InvalidPFLayer")
63  << "Layer given, " << clus->layer() << " is not a valid PFLayer!";
64  }
66  elems.emplace_back(cptr);
67  }
68 }
type
Definition: HCALResponse.h:21
Abstract base class for a PFBlock element (track, cluster...)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
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