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.

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 }

References grid_.

◆ ~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.

241 { clearBase(); }

References clearBase().

◆ clearBase()

void l1tpf_calo::SimpleCaloLinkerBase::clearBase ( )
inline

Definition at line 243 of file CaloClusterer.h.

243  {
244  clusters_.clear();
245  clusterIndex_.fill(-1);
246  }

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

Referenced by clear().

◆ correct()

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

Definition at line 250 of file CaloClusterer.h.

250  {
251  for (CombinedCluster &c : clusters_) {
252  c.et = corrector(c);
253  }
254  }

References c, clusters_, and pfClustersFromHGC3DClusters_cfi::corrector.

Referenced by KalmanMuonCorrector.KalmanMuonCorrector::correct_all(), and JetReCalibrator.JetReCalibrator::correctAll().

◆ 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.

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 }

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

◆ 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.

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
l1tpf_calo::SimpleCaloLinkerBase::clusterIndex_
IndexGrid clusterIndex_
Definition: CaloClusterer.h:263
l1tpf_calo::GridData::fill
void fill(const T &val)
Definition: CaloClusterer.h:135
l1tpf_calo::getGrid
const Grid * getGrid(const std::string &type)
Definition: CaloClusterer.cc:155
hcal
Definition: ConfigurationDatabase.cc:13
l1tpf_calo::SimpleCaloLinkerBase::minHadronEt_
float minHadronEt_
Definition: CaloClusterer.h:265
cms::cuda::assert
assert(be >=bs)
l1tpf_calo::SimpleCaloLinkerBase::hcal_
const SingleCaloClusterer & hcal_
Definition: CaloClusterer.h:262
ecal
Definition: ElectronicsMappingGPU.h:13
hltEgammaHLTExtra_cfi.hcal
hcal
Definition: hltEgammaHLTExtra_cfi.py:42
pfClustersFromHGC3DClusters_cfi.corrector
corrector
Definition: pfClustersFromHGC3DClusters_cfi.py:5
ecal::raw
Definition: ElectronicsMappingGPU.h:14
hcal::raw
Definition: DeclsForKernels.h:14
l1tpf_calo::SimpleCaloLinkerBase::fetch
std::unique_ptr< l1t::PFClusterCollection > fetch() const
Definition: CaloClusterer.cc:431
l1tpf_calo::SimpleCaloLinkerBase::clearBase
void clearBase()
Definition: CaloClusterer.h:243
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
l1tpf_calo::SimpleCaloLinkerBase::ecal_
const SingleCaloClusterer & ecal_
Definition: CaloClusterer.h:262
l1tpf_calo::SimpleCaloLinkerBase::minHadronRawEt_
float minHadronRawEt_
Definition: CaloClusterer.h:265
l1tpf_calo::SimpleCaloLinkerBase::minPhotonEt_
float minPhotonEt_
Definition: CaloClusterer.h:265
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Ptr
Definition: AssociationVector.h:31
l1tpf_calo::SimpleCaloLinkerBase::grid_
const Grid * grid_
Definition: CaloClusterer.h:261
l1tpf_calo::SimpleCaloLinkerBase::noEmInHGC_
bool noEmInHGC_
Definition: CaloClusterer.h:266
edm::OrphanHandle
Definition: EDProductfwd.h:39
bsc_activity_cfg.ecal
ecal
Definition: bsc_activity_cfg.py:25
cms::Exception
Definition: Exception.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
l1tpf_calo::SimpleCaloLinkerBase::hoeCut_
float hoeCut_
Definition: CaloClusterer.h:265
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
l1tpf_calo::SimpleCaloLinkerBase::clusters_
std::vector< CombinedCluster > clusters_
Definition: CaloClusterer.h:264
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27