CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 

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.

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, HLT_25ns14e33_v1_cff::clusters, HLT_25ns14e33_v1_cff::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, reco::PFBlockElement::HO, reco::PFBlockElement::NONE, PFLayer::PS1, reco::PFBlockElement::PS1, PFLayer::PS2, and reco::PFBlockElement::PS2.

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  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...)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
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().