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 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 &)
 
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 15 of file SpecialClusterImporter.cc.

Constructor & Destructor Documentation

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

Definition at line 17 of file SpecialClusterImporter.cc.

References SpecialClusterImporter< T >::importToBlock().

18  :
19  BlockElementImporterBase(conf,sumes),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::ValueMap< reco::CaloClusterPtr > > _assoc
edm::EDGetTokenT< reco::PFClusterCollection > _src
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
BlockElementImporterBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)

Member Function Documentation

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

Implements BlockElementImporterBase.

Definition at line 34 of file SpecialClusterImporter.cc.

References SpecialClusterImporter< T >::_assoc, SpecialClusterImporter< T >::_src, trackingPlots::assoc, fastPrimaryVertexProducer_cfi::clusters, SoftLeptonByDistance_cfi::distance, digitizers_cfi::ecal, reco::PFBlockElementSuperCluster::fromPFSuperCluster(), edm::Event::getByToken(), connectstrParser::o, ClusterClusterMapping::overlap(), reco::PFBlockElement::SC, reco::PFBlockElementCluster::setSuperClusterRef(), and reco::PFBlockElementSuperCluster::superClusterRef().

Referenced by SpecialClusterImporter< T >::SpecialClusterImporter().

35  {
39  e.getByToken(_src,clusters);
40  e.getByToken(_assoc,assoc);
41  auto bclus = clusters->cbegin();
42  auto eclus = clusters->cend();
43  // get all the SCs in the element list
44  auto sc_end = std::partition(elems.begin(),elems.end(),
45  [](const ElementList::value_type& o){
46  return o->type() == reco::PFBlockElement::SC;
47  });
48  ecals.reserve(clusters->size());
49  for( auto clus = bclus; clus != eclus; ++clus ) {
50  reco::PFClusterRef tempref(clusters, std::distance(bclus,clus));
51  reco::PFBlockElementCluster* newelem =
52  new reco::PFBlockElementCluster(tempref,T);
53  for( auto scelem = elems.begin(); scelem != sc_end; ++scelem ) {
54  const reco::PFBlockElementSuperCluster* elem_as_sc =
55  static_cast<const reco::PFBlockElementSuperCluster*>(scelem->get());
56  const reco::SuperClusterRef& this_sc = elem_as_sc->superClusterRef();
57 
58  const bool in_sc = ( elem_as_sc->fromPFSuperCluster() ?
59  // use association map if from PFSC
61  *this_sc,
62  *assoc) :
63  // match by overlapping rechit otherwise
65  *this_sc) );
66  if( in_sc ) {
67  newelem->setSuperClusterRef(this_sc);
68  break;
69  }
70  }
71  ecals.emplace_back(newelem);
72  }
73  elems.reserve(elems.size()+ecals.size());
74  for( auto& ecal : ecals ) {
75  elems.emplace_back(ecal.release());
76  }
77 }
const SuperClusterRef & superClusterRef() const
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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< reco::PFClusterCollection > _src
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
void setSuperClusterRef(const SuperClusterRef &ref)
long double T

Member Data Documentation

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