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::getByToken(), 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  {
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:508
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().