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::getHandle(), connectstrParser::o, ClusterClusterMapping::overlap(), reco::PFBlockElement::SC, reco::PFBlockElementCluster::setSuperClusterRef(), and reco::PFBlockElementSuperCluster::superClusterRef().

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

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