CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
l1tpf_calo::SimpleCaloLinkerBase Class Referenceabstract

#include <CaloClusterer.h>

Inheritance diagram for l1tpf_calo::SimpleCaloLinkerBase:
l1tpf_calo::FlatCaloLinker l1tpf_calo::SimpleCaloLinker

Public Member Functions

virtual void clear ()
 
void clearBase ()
 
template<typename Corrector >
void correct (const Corrector &corrector)
 
std::unique_ptr< l1t::PFClusterCollectionfetch () const
 
std::unique_ptr< l1t::PFClusterCollectionfetch (const edm::OrphanHandle< l1t::PFClusterCollection > &ecal, const edm::OrphanHandle< l1t::PFClusterCollection > &hcal) const
 
virtual void run ()=0
 
 SimpleCaloLinkerBase (const edm::ParameterSet &pset, const SingleCaloClusterer &ecal, const SingleCaloClusterer &hcal)
 
virtual ~SimpleCaloLinkerBase ()
 

Protected Attributes

IndexGrid clusterIndex_
 
std::vector< CombinedClusterclusters_
 
const SingleCaloClustererecal_
 
const Gridgrid_
 
const SingleCaloClustererhcal_
 
float hoeCut_
 
float minHadronEt_
 
float minHadronRawEt_
 
float minPhotonEt_
 
bool noEmInHGC_
 

Detailed Description

Definition at line 235 of file CaloClusterer.h.

Constructor & Destructor Documentation

◆ SimpleCaloLinkerBase()

l1tpf_calo::SimpleCaloLinkerBase::SimpleCaloLinkerBase ( const edm::ParameterSet pset,
const SingleCaloClusterer ecal,
const SingleCaloClusterer hcal 
)

Definition at line 410 of file CaloClusterer.cc.

References grid_.

413  : grid_(getGrid(pset.getParameter<std::string>("grid"))),
414  ecal_(ecal),
415  hcal_(hcal),
417  clusters_(),
418  hoeCut_(pset.getParameter<double>("hoeCut")),
419  minPhotonEt_(pset.getParameter<double>("minPhotonEt")),
420  minHadronRawEt_(pset.getParameter<double>("minHadronRawEt")),
421  minHadronEt_(pset.getParameter<double>("minHadronEt")),
422  noEmInHGC_(pset.getParameter<bool>("noEmInHGC")) {
423  if (grid_ != &ecal.raw().grid())
424  throw cms::Exception("LogicError", "Inconsistent grid between ecal and linker\n");
425  if (grid_ != &hcal.raw().grid())
426  throw cms::Exception("LogicError", "Inconsistent grid between hcal and linker\n");
427 }
std::vector< CombinedCluster > clusters_
const SingleCaloClusterer & hcal_
const Grid * getGrid(const std::string &type)
const SingleCaloClusterer & ecal_

◆ ~SimpleCaloLinkerBase()

l1tpf_calo::SimpleCaloLinkerBase::~SimpleCaloLinkerBase ( )
virtual

Definition at line 429 of file CaloClusterer.cc.

429 {}

Member Function Documentation

◆ clear()

virtual void l1tpf_calo::SimpleCaloLinkerBase::clear ( void  )
inlinevirtual

Reimplemented in l1tpf_calo::FlatCaloLinker, and l1tpf_calo::SimpleCaloLinker.

Definition at line 241 of file CaloClusterer.h.

References clearBase().

◆ clearBase()

void l1tpf_calo::SimpleCaloLinkerBase::clearBase ( )
inline

Definition at line 243 of file CaloClusterer.h.

References clusterIndex_, clusters_, and l1tpf_calo::GridData< T >::fill().

Referenced by clear().

243  {
244  clusters_.clear();
245  clusterIndex_.fill(-1);
246  }
std::vector< CombinedCluster > clusters_
void fill(const T &val)

◆ correct()

template<typename Corrector >
void l1tpf_calo::SimpleCaloLinkerBase::correct ( const Corrector &  corrector)
inline

◆ fetch() [1/2]

std::unique_ptr< l1t::PFClusterCollection > l1tpf_calo::SimpleCaloLinkerBase::fetch ( ) const

◆ fetch() [2/2]

std::unique_ptr< l1t::PFClusterCollection > l1tpf_calo::SimpleCaloLinkerBase::fetch ( const edm::OrphanHandle< l1t::PFClusterCollection > &  ecal,
const edm::OrphanHandle< l1t::PFClusterCollection > &  hcal 
) const

Definition at line 436 of file CaloClusterer.cc.

References funct::abs(), cms::cuda::assert(), SiStripPI::max, displacedMuons_cfi::photon, and runTheMatrix::ret.

438  {
439  bool setRefs = (ecal.isValid() && hcal.isValid());
440  auto ret = std::make_unique<l1t::PFClusterCollection>();
441  for (const CombinedCluster &cluster : clusters_) {
442  if (cluster.et > 0) {
443  bool photon = (cluster.hcal_et < hoeCut_ * cluster.ecal_et);
444  if (photon && noEmInHGC_) {
445  if (std::abs(cluster.eta) > 1.5 && std::abs(cluster.eta) < 3.0) { // 1.5-3 = eta range of HGCal
446  continue;
447  }
448  }
449  if (cluster.et > (photon ? minPhotonEt_ : minHadronEt_)) {
450  ret->emplace_back(cluster.et,
451  cluster.eta,
452  cluster.phi,
453  cluster.ecal_et > 0 ? std::max(cluster.et - cluster.ecal_et, 0.f) / cluster.ecal_et : -1,
454  photon);
455  if (setRefs) {
456  for (const auto &pair : cluster.constituents) {
457  assert(pair.first != 0);
458  if (pair.first > 0) { // 1+hcal index
459  ret->back().addConstituent(edm::Ptr<l1t::PFCluster>(hcal, +pair.first - 1), pair.second);
460  } else { // -1-ecal index
461  ret->back().addConstituent(edm::Ptr<l1t::PFCluster>(ecal, -pair.first + 1), pair.second);
462  }
463  }
464  }
465  }
466  }
467  }
468  return ret;
469 }
std::vector< CombinedCluster > clusters_
ret
prodAgent to be discontinued
assert(be >=bs)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ run()

virtual void l1tpf_calo::SimpleCaloLinkerBase::run ( )
pure virtual

Member Data Documentation

◆ clusterIndex_

IndexGrid l1tpf_calo::SimpleCaloLinkerBase::clusterIndex_
protected

Definition at line 263 of file CaloClusterer.h.

Referenced by clearBase().

◆ clusters_

std::vector<CombinedCluster> l1tpf_calo::SimpleCaloLinkerBase::clusters_
protected

Definition at line 264 of file CaloClusterer.h.

Referenced by clearBase(), and correct().

◆ ecal_

const SingleCaloClusterer& l1tpf_calo::SimpleCaloLinkerBase::ecal_
protected

Definition at line 262 of file CaloClusterer.h.

◆ grid_

const Grid* l1tpf_calo::SimpleCaloLinkerBase::grid_
protected

Definition at line 261 of file CaloClusterer.h.

Referenced by SimpleCaloLinkerBase().

◆ hcal_

const SingleCaloClusterer & l1tpf_calo::SimpleCaloLinkerBase::hcal_
protected

Definition at line 262 of file CaloClusterer.h.

◆ hoeCut_

float l1tpf_calo::SimpleCaloLinkerBase::hoeCut_
protected

Definition at line 265 of file CaloClusterer.h.

◆ minHadronEt_

float l1tpf_calo::SimpleCaloLinkerBase::minHadronEt_
protected

Definition at line 265 of file CaloClusterer.h.

◆ minHadronRawEt_

float l1tpf_calo::SimpleCaloLinkerBase::minHadronRawEt_
protected

Definition at line 265 of file CaloClusterer.h.

◆ minPhotonEt_

float l1tpf_calo::SimpleCaloLinkerBase::minPhotonEt_
protected

Definition at line 265 of file CaloClusterer.h.

◆ noEmInHGC_

bool l1tpf_calo::SimpleCaloLinkerBase::noEmInHGC_
protected

Definition at line 266 of file CaloClusterer.h.