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 &cc)
 
void importToBlock (const edm::Event &, ElementList &) const override
 
- Public Member Functions inherited from BlockElementImporterBase
 BlockElementImporterBase (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
 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
 
enum  VetoMode { pfRecTrackCollection = 0, ticlSeedingRegion = 1, pfCandidateCollection = 2 }
 

Detailed Description

Definition at line 5 of file GenericClusterImporter.cc.

Constructor & Destructor Documentation

◆ GenericClusterImporter()

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

Definition at line 7 of file GenericClusterImporter.cc.

9  _src(cc.consumes<reco::PFClusterCollection>(conf.getParameter<edm::InputTag>("source"))) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
BlockElementImporterBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
edm::EDGetTokenT< reco::PFClusterCollection > _src

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.

References _src, bsc_activity_cfg::clusters, HLT_2024v11_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.

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 }
Abstract base class for a PFBlock element (track, cluster...)
edm::EDGetTokenT< reco::PFClusterCollection > _src

Member Data Documentation

◆ _src

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

Definition at line 14 of file GenericClusterImporter.cc.

Referenced by importToBlock().