CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GenericClusterImporter Class Reference
Inheritance diagram for GenericClusterImporter:
BlockElementImporterBase

Public Member Functions

 GenericClusterImporter (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
void importToBlock (const edm::Event &, ElementList &) const override
 
- Public Member Functions inherited from BlockElementImporterBase
 BlockElementImporterBase (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
 BlockElementImporterBase (const BlockElementImporterBase &)=delete
 
const std::string & name () const
 
BlockElementImporterBaseoperator= (const BlockElementImporterBase &)=delete
 
virtual void updateEventSetup (const edm::EventSetup &)
 
virtual ~BlockElementImporterBase ()=default
 

Private Attributes

edm::EDGetTokenT< reco::PFClusterCollection_src
 

Additional Inherited Members

- Public Types inherited from BlockElementImporterBase
typedef std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
 

Detailed Description

Definition at line 6 of file GenericClusterImporter.cc.

Constructor & Destructor Documentation

GenericClusterImporter::GenericClusterImporter ( const edm::ParameterSet conf,
edm::ConsumesCollector sumes 
)
inline

Definition at line 8 of file GenericClusterImporter.cc.

References importToBlock().

9  :
10  BlockElementImporterBase(conf,sumes),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
edm::EDGetTokenT< reco::PFClusterCollection > _src
BlockElementImporterBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)

Member Function Documentation

void GenericClusterImporter::importToBlock ( const edm::Event e,
BlockElementImporterBase::ElementList elems 
) const
overridevirtual

Implements BlockElementImporterBase.

Definition at line 25 of file GenericClusterImporter.cc.

References _src, fastPrimaryVertexProducer_cfi::clusters, SoftLeptonByDistance_cfi::distance, reco::PFBlockElement::ECAL, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, Exception, edm::Event::getHandle(), reco::PFBlockElement::HCAL, PFLayer::HCAL_BARREL1, PFLayer::HCAL_BARREL2, PFLayer::HCAL_ENDCAP, PFLayer::HF_EM, PFLayer::HF_HAD, reco::PFBlockElement::HFEM, reco::PFBlockElement::HFHAD, PFLayer::HGCAL, reco::PFBlockElement::HGCAL, reco::PFBlockElement::HO, reco::PFBlockElement::NONE, PFLayer::PS1, reco::PFBlockElement::PS1, PFLayer::PS2, and reco::PFBlockElement::PS2.

Referenced by GenericClusterImporter().

26  {
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
edm::EDGetTokenT< reco::PFClusterCollection > _src

Member Data Documentation

edm::EDGetTokenT<reco::PFClusterCollection> GenericClusterImporter::_src
private

Definition at line 17 of file GenericClusterImporter.cc.

Referenced by importToBlock().