CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SpecialClusterImporter< T > Class Template Reference
Inheritance diagram for SpecialClusterImporter< T >:
BlockElementImporterBase

Public Member Functions

void importToBlock (const edm::Event &, ElementList &) const override
 
 SpecialClusterImporter (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
- 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< edm::ValueMap< reco::CaloClusterPtr > > _assoc
 
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

template<reco::PFBlockElement::Type T>
class SpecialClusterImporter< T >

Definition at line 13 of file SpecialClusterImporter.cc.

Constructor & Destructor Documentation

◆ SpecialClusterImporter()

template<reco::PFBlockElement::Type T>
SpecialClusterImporter< T >::SpecialClusterImporter ( const edm::ParameterSet conf,
edm::ConsumesCollector cc 
)
inline

Definition at line 15 of file SpecialClusterImporter.cc.

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

Member Function Documentation

◆ importToBlock()

template<reco::PFBlockElement::Type T>
void SpecialClusterImporter< T >::importToBlock ( const edm::Event e,
BlockElementImporterBase::ElementList elems 
) const
overridevirtual

Implements BlockElementImporterBase.

Definition at line 28 of file SpecialClusterImporter.cc.

References trackingPlots::assoc, bsc_activity_cfg::clusters, HLT_2024v13_cff::distance, MillePedeFileConverter_cfg::e, reco::PFBlockElementSuperCluster::fromPFSuperCluster(), EcalTangentSkim_cfg::o, ClusterClusterMapping::overlap(), l1ctLayer1_patternWriters_cff::partition, reco::PFBlockElement::SC, reco::PFBlockElementCluster::setSuperClusterRef(), and reco::PFBlockElementSuperCluster::superClusterRef().

28  {
30  auto clusters = e.getHandle(_src);
31  auto assoc = e.getHandle(_assoc);
32  auto bclus = clusters->cbegin();
33  auto eclus = clusters->cend();
34  // get all the SCs in the element list
35  auto sc_end = std::partition(elems.begin(), elems.end(), [](const ElementList::value_type& o) {
36  return o->type() == reco::PFBlockElement::SC;
37  });
38  ecals.reserve(clusters->size());
39  for (auto clus = bclus; clus != eclus; ++clus) {
40  reco::PFClusterRef tempref(clusters, std::distance(bclus, clus));
42  for (auto scelem = elems.begin(); scelem != sc_end; ++scelem) {
43  const reco::PFBlockElementSuperCluster* elem_as_sc =
44  static_cast<const reco::PFBlockElementSuperCluster*>(scelem->get());
45  const reco::SuperClusterRef& this_sc = elem_as_sc->superClusterRef();
46 
47  const bool in_sc = (elem_as_sc->fromPFSuperCluster() ?
48  // use association map if from PFSC
49  ClusterClusterMapping::overlap(tempref, *this_sc, *assoc)
50  :
51  // match by overlapping rechit otherwise
52  ClusterClusterMapping::overlap(*tempref, *this_sc));
53  if (in_sc) {
54  newelem->setSuperClusterRef(this_sc);
55  break;
56  }
57  }
58  ecals.emplace_back(newelem);
59  }
60  elems.reserve(elems.size() + ecals.size());
61  for (auto& ecal : ecals) {
62  elems.emplace_back(ecal.release());
63  }
64 }
static bool overlap(const reco::CaloCluster &sc1, const reco::CaloCluster &sc, float minfrac=0.01, bool debug=false)
edm::EDGetTokenT< edm::ValueMap< reco::CaloClusterPtr > > _assoc
const SuperClusterRef & superClusterRef() const
edm::EDGetTokenT< reco::PFClusterCollection > _src
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
void setSuperClusterRef(const SuperClusterRef &ref)
long double T

Member Data Documentation

◆ _assoc

template<reco::PFBlockElement::Type T>
edm::EDGetTokenT<edm::ValueMap<reco::CaloClusterPtr> > SpecialClusterImporter< T >::_assoc
private

Definition at line 24 of file SpecialClusterImporter.cc.

Referenced by plotting.FakeDuplicate::create().

◆ _src

template<reco::PFBlockElement::Type T>
edm::EDGetTokenT<reco::PFClusterCollection> SpecialClusterImporter< T >::_src
private

Definition at line 23 of file SpecialClusterImporter.cc.