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 &sumes)
 
- 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< 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
 

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 sumes 
)
inline

Definition at line 15 of file SpecialClusterImporter.cc.

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.

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 }

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

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.

reco::PFClusterCollection
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
reco::PFBlockElementCluster::setSuperClusterRef
void setSuperClusterRef(const SuperClusterRef &ref)
Definition: PFBlockElementCluster.h:32
reco::PFBlockElementSuperCluster
Cluster Element.
Definition: PFBlockElementSuperCluster.h:15
reco::PFBlockElement::SC
Definition: PFBlockElement.h:41
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
BlockElementImporterBase::BlockElementImporterBase
BlockElementImporterBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
Definition: BlockElementImporterBase.h:17
edm::Ref< PFClusterCollection >
trackingPlots.assoc
assoc
Definition: trackingPlots.py:184
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
ClusterClusterMapping::overlap
static bool overlap(const reco::CaloCluster &sc1, const reco::CaloCluster &sc, float minfrac=0.01, bool debug=false)
Definition: ClusterClusterMapping.cc:4
BlockElementImporterBase::ElementList
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
Definition: BlockElementImporterBase.h:16
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
goodZToMuMu_cfi.overlap
overlap
Definition: goodZToMuMu_cfi.py:108
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
reco::PFBlockElementSuperCluster::superClusterRef
const SuperClusterRef & superClusterRef() const
Definition: PFBlockElementSuperCluster.h:36
ClusterClusterMapping
Definition: ClusterClusterMapping.h:12
SpecialClusterImporter::_src
edm::EDGetTokenT< reco::PFClusterCollection > _src
Definition: SpecialClusterImporter.cc:23
SpecialClusterImporter::_assoc
edm::EDGetTokenT< edm::ValueMap< reco::CaloClusterPtr > > _assoc
Definition: SpecialClusterImporter.cc:24
T
long double T
Definition: Basic3DVectorLD.h:48
edm::ValueMap
Definition: ValueMap.h:107
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bsc_activity_cfg.ecal
ecal
Definition: bsc_activity_cfg.py:25
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7799
edm::InputTag
Definition: InputTag.h:15
reco::PFBlockElementSuperCluster::fromPFSuperCluster
bool fromPFSuperCluster() const
Definition: PFBlockElementSuperCluster.h:86
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37