CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  default:
59  throw cms::Exception("InvalidPFLayer")
60  << "Layer given, " << clus->layer() << " is not a valid PFLayer!";
61  }
63  elems.emplace_back(cptr);
64  }
65 }
type
Definition: HCALResponse.h:21
Abstract base class for a PFBlock element (track, cluster...)
void importToBlock(const edm::Event &, ElementList &) const override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
GenericClusterImporter(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
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