CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ECALClusterImporter Class Reference
Inheritance diagram for ECALClusterImporter:
BlockElementImporterBase

Public Member Functions

 ECALClusterImporter (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
void importToBlock (const edm::Event &, ElementList &) const override
 
- 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 &)
 

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

Definition at line 15 of file ECALClusterImporter.cc.

Constructor & Destructor Documentation

ECALClusterImporter::ECALClusterImporter ( const edm::ParameterSet conf,
edm::ConsumesCollector sumes 
)
inline

Definition at line 17 of file ECALClusterImporter.cc.

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

void ECALClusterImporter::importToBlock ( const edm::Event e,
BlockElementImporterBase::ElementList elems 
) const
overridevirtual

Implements BlockElementImporterBase.

Definition at line 36 of file ECALClusterImporter.cc.

References _assoc, _src, HLT_25ns14e33_v1_cff::clusters, HLT_25ns14e33_v1_cff::distance, reco::PFBlockElement::ECAL, patCandidatesForDimuonsSequences_cff::ecal, reco::PFBlockElementSuperCluster::fromPFSuperCluster(), edm::Event::getByToken(), python.connectstrParser::o, ClusterClusterMapping::overlap(), reco::PFBlockElement::SC, reco::PFBlockElementCluster::setSuperClusterRef(), and reco::PFBlockElementSuperCluster::superClusterRef().

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

Member Data Documentation

edm::EDGetTokenT<edm::ValueMap<reco::CaloClusterPtr> > ECALClusterImporter::_assoc
private

Definition at line 28 of file ECALClusterImporter.cc.

Referenced by plotting.FakeDuplicate::create(), and importToBlock().

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

Definition at line 27 of file ECALClusterImporter.cc.

Referenced by importToBlock().