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 BlockElementImporterBase &)=delete
 
 BlockElementImporterBase (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
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 5 of file GenericClusterImporter.cc.

Constructor & Destructor Documentation

◆ GenericClusterImporter()

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

Definition at line 7 of file GenericClusterImporter.cc.

8  : BlockElementImporterBase(conf, sumes),

Member Function Documentation

◆ importToBlock()

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

Implements BlockElementImporterBase.

Definition at line 19 of file GenericClusterImporter.cc.

19  {
20  auto clusters = e.getHandle(_src);
21  auto cbegin = clusters->cbegin();
22  auto cend = clusters->cend();
23  for (auto clus = cbegin; clus != cend; ++clus) {
25  reco::PFClusterRef cref(clusters, std::distance(cbegin, clus));
26  switch (clus->layer()) {
27  case PFLayer::PS1:
29  break;
30  case PFLayer::PS2:
32  break;
36  break;
40  break;
43  break;
44  case PFLayer::HF_EM:
46  break;
47  case PFLayer::HF_HAD:
49  break;
50  case PFLayer::HGCAL:
52  break;
53  default:
54  throw cms::Exception("InvalidPFLayer") << "Layer given, " << clus->layer() << " is not a valid PFLayer!";
55  }
57  elems.emplace_back(cptr);
58  }
59 }

References _src, bsc_activity_cfg::clusters, HLT_2018_cff::distance, MillePedeFileConverter_cfg::e, reco::PFBlockElement::ECAL, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, Exception, 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.

Member Data Documentation

◆ _src

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

Definition at line 14 of file GenericClusterImporter.cc.

Referenced by importToBlock().

reco::PFClusterCollection
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
reco::PFBlockElement::HO
Definition: PFBlockElement.h:42
PFLayer::HCAL_ENDCAP
Definition: PFLayer.h:37
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
reco::PFBlockElement::HCAL
Definition: PFBlockElement.h:36
reco::PFBlockElement::HGCAL
Definition: PFBlockElement.h:43
BlockElementImporterBase::BlockElementImporterBase
BlockElementImporterBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
Definition: BlockElementImporterBase.h:17
edm::Ref< PFClusterCollection >
PFLayer::ECAL_BARREL
Definition: PFLayer.h:33
reco::PFBlockElement::Type
Type
Definition: PFBlockElement.h:30
PFLayer::PS1
Definition: PFLayer.h:31
PFLayer::HCAL_BARREL2
Definition: PFLayer.h:36
PFLayer::HF_EM
Definition: PFLayer.h:38
PFLayer::HCAL_BARREL1
Definition: PFLayer.h:35
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
PFLayer::HGCAL
Definition: PFLayer.h:40
reco::PFBlockElement::NONE
Definition: PFBlockElement.h:31
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
PFLayer::HF_HAD
Definition: PFLayer.h:39
reco::PFBlockElement::HFEM
Definition: PFBlockElement.h:39
GenericClusterImporter::_src
edm::EDGetTokenT< reco::PFClusterCollection > _src
Definition: GenericClusterImporter.cc:14
reco::PFBlockElement::ECAL
Definition: PFBlockElement.h:35
reco::PFBlockElement::HFHAD
Definition: PFBlockElement.h:40
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
type
type
Definition: HCALResponse.h:21
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
Exception
Definition: hltDiff.cc:246
reco::PFBlockElement::PS1
Definition: PFBlockElement.h:33
PFLayer::ECAL_ENDCAP
Definition: PFLayer.h:32
PFLayer::PS2
Definition: PFLayer.h:30
edm::InputTag
Definition: InputTag.h:15
reco::PFBlockElement::PS2
Definition: PFBlockElement.h:34
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37