CMS 3D CMS Logo

List of all members | Public Member Functions
Basic2DClusterForEachSeed Class Reference

#include <Basic2DClusterForEachSeed.h>

Inheritance diagram for Basic2DClusterForEachSeed:
InitialClusteringStepBase

Public Member Functions

 Basic2DClusterForEachSeed (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
void buildClusters (const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, const std::vector< bool > &, reco::PFClusterCollection &) override
 
 ~Basic2DClusterForEachSeed () override=default
 
- Public Member Functions inherited from InitialClusteringStepBase
 InitialClusteringStepBase (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
 InitialClusteringStepBase (const ICSB &)=delete
 
std::ostream & operator<< (std::ostream &o) const
 
ICSBoperator= (const ICSB &)=delete
 
void reset ()
 
virtual void update (const edm::EventSetup &)
 
virtual void updateEvent (const edm::Event &)
 
virtual ~InitialClusteringStepBase ()=default
 

Additional Inherited Members

- Protected Types inherited from InitialClusteringStepBase
typedef std::tuple< std::vector< int >, std::vector< double >, std::vector< double > > I3tuple
 
- Protected Member Functions inherited from InitialClusteringStepBase
reco::PFRecHitRef makeRefhit (const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
 
- Protected Attributes inherited from InitialClusteringStepBase
const std::unordered_map< std::string, int > _layerMap
 
unsigned _nClustersFound
 
unsigned _nSeeds
 
std::unordered_map< int, I3tuple_thresholds
 

Detailed Description

Definition at line 7 of file Basic2DClusterForEachSeed.h.

Constructor & Destructor Documentation

◆ Basic2DClusterForEachSeed()

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

Definition at line 9 of file Basic2DClusterForEachSeed.h.

10  : InitialClusteringStepBase(conf, sumes) {}

◆ ~Basic2DClusterForEachSeed()

Basic2DClusterForEachSeed::~Basic2DClusterForEachSeed ( )
overridedefault

Member Function Documentation

◆ buildClusters()

void Basic2DClusterForEachSeed::buildClusters ( const edm::Handle< reco::PFRecHitCollection > &  input,
const std::vector< bool > &  rechitMask,
const std::vector< bool > &  seedable,
reco::PFClusterCollection output 
)
overridevirtual

Implements InitialClusteringStepBase.

Definition at line 3 of file Basic2DClusterForEachSeed.cc.

6  {
7  auto const& hits = *input;
8 
9  // loop over seeds and make clusters
10  reco::PFCluster cluster;
11  for (unsigned int hit = 0; hit < hits.size(); ++hit) {
12  if (!rechitMask[hit] || !seedable[hit])
13  continue; // if not seed, ignore.
14  cluster.reset();
15 
16  // seed
17  auto refhit = makeRefhit(input, hit);
18  auto rhf = reco::PFRecHitFraction(refhit, 1.0); // entire rechit energy should go to a cluster
19 
20  // add the hit to the cluster
21  cluster.addRecHitFraction(rhf);
22 
23  // extract
24  const auto rh_energy = refhit->energy();
25 
26  // fill cluster information
27  cluster.setSeed(refhit->detId());
28  cluster.setEnergy(rh_energy);
29  cluster.setTime(refhit->time());
30  cluster.setLayer(refhit->layer());
31  cluster.setPosition(math::XYZPoint(refhit->position().x(), refhit->position().y(), refhit->position().z()));
32  cluster.calculatePositionREP();
33  cluster.setDepth(refhit->depth());
34 
35  output.push_back(cluster);
36 
37  } // looping over seeds ends
38 }

References reco::PFCluster::addRecHitFraction(), reco::PFCluster::calculatePositionREP(), hfClusterShapes_cfi::hits, input, InitialClusteringStepBase::makeRefhit(), convertSQLitetoXML_cfg::output, reco::PFCluster::reset(), reco::PFCluster::setDepth(), reco::CaloCluster::setEnergy(), reco::PFCluster::setLayer(), reco::CaloCluster::setPosition(), reco::CaloCluster::setSeed(), and reco::PFCluster::setTime().

reco::CaloCluster::setSeed
void setSeed(const DetId &id)
Definition: CaloCluster.h:146
reco::PFCluster::setTime
void setTime(float time, float timeError=0)
Definition: PFCluster.h:84
input
static const std::string input
Definition: EdmProvDump.cc:48
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
reco::PFRecHitFraction
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
Definition: PFRecHitFraction.h:18
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
reco::PFCluster::setLayer
void setLayer(PFLayer::Layer layer)
set layer
Definition: PFCluster.cc:49
InitialClusteringStepBase::InitialClusteringStepBase
InitialClusteringStepBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
Definition: InitialClusteringStepBase.h:28
InitialClusteringStepBase::makeRefhit
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
Definition: InitialClusteringStepBase.h:103
reco::CaloCluster::setPosition
void setPosition(const math::XYZPoint &p)
Definition: CaloCluster.h:140
reco::PFCluster::reset
void reset()
resets clusters parameters
Definition: PFCluster.cc:17
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::PFCluster::calculatePositionREP
void calculatePositionREP()
computes posrep_ once and for all
Definition: PFCluster.h:95
reco::PFCluster::addRecHitFraction
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
Definition: PFCluster.cc:33
reco::CaloCluster::setEnergy
void setEnergy(double energy)
Definition: CaloCluster.h:136
reco::PFCluster
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
reco::PFCluster::setDepth
void setDepth(double depth)
Definition: PFCluster.h:89
hit
Definition: SiStripHitEffFromCalibTree.cc:88