|
|
#include <Basic2DGenericPFlowClusterizer.h>
◆ B2DGPF
◆ Basic2DGenericPFlowClusterizer() [1/2]
Basic2DGenericPFlowClusterizer::Basic2DGenericPFlowClusterizer |
( |
const edm::ParameterSet & |
conf | ) |
|
Definition at line 24 of file Basic2DGenericPFlowClusterizer.cc.
47 std::vector<double> rhE_norm;
50 depths =
pset.getParameter<std::vector<int> >(
"depths");
51 rhE_norm =
pset.getParameter<std::vector<double> >(
"recHitEnergyNorm");
54 rhE_norm.push_back(
pset.getParameter<
double>(
"recHitEnergyNorm"));
57 if (rhE_norm.size() !=
depths.size()) {
59 <<
"PFlowClusterizerThreshold mismatch with the numbers of depths";
64 throw cms::Exception(
"InvalidDetectorLayer") <<
"Detector layer : " << det <<
" is not in the list of recognized"
65 <<
" detector layers!";
70 if (conf.
exists(
"allCellsPositionCalc")) {
76 if (conf.
exists(
"positionCalcForConvergence")) {
References PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, PFLayer::HCAL_BARREL1, PFLayer::HCAL_BARREL2, PFLayer::HCAL_ENDCAP, PFLayer::HF_EM, PFLayer::HF_HAD, createfilelist::int, PFLayer::NONE, PFLayer::PS1, and PFLayer::PS2.
◆ ~Basic2DGenericPFlowClusterizer()
Basic2DGenericPFlowClusterizer::~Basic2DGenericPFlowClusterizer |
( |
| ) |
|
|
overridedefault |
◆ Basic2DGenericPFlowClusterizer() [2/2]
Basic2DGenericPFlowClusterizer::Basic2DGenericPFlowClusterizer |
( |
const B2DGPF & |
| ) |
|
|
delete |
◆ buildClusters()
Implements PFClusterBuilderBase.
Definition at line 83 of file Basic2DGenericPFlowClusterizer.cc.
87 for (
const auto& topocluster :
input) {
88 clustersInTopo.clear();
90 const unsigned tolScal =
std::pow(
std::max(1.0, clustersInTopo.size() - 1.0), 2.0);
91 growPFClusters(topocluster, seedable, tolScal, 0, tolScal, clustersInTopo);
107 for (
auto& clusterout : clustersInTopo) {
References _allCellsPosCalc, _convergencePosCalc, PFClusterBuilderBase::_positionCalc, growPFClusters(), input, SiStripPI::max, eostools::move(), convertSQLitetoXML_cfg::output, funct::pow(), prunePFClusters(), and seedPFClustersFromTopo().
◆ growPFClusters()
void Basic2DGenericPFlowClusterizer::growPFClusters |
( |
const reco::PFCluster & |
topo, |
|
|
const std::vector< bool > & |
seedable, |
|
|
const unsigned |
toleranceScaling, |
|
|
const unsigned |
iter, |
|
|
double |
dist, |
|
|
reco::PFClusterCollection & |
clusters |
|
) |
| const |
|
private |
Definition at line 132 of file Basic2DGenericPFlowClusterizer.cc.
139 LOGDRESSED(
"Basic2DGenericPFlowClusterizer:growAndStabilizePFClusters")
140 <<
"reached " <<
_maxIterations <<
" iterations, terminated position "
141 <<
"fit with diff = " <<
diff;
146 std::vector<reco::PFCluster::REPPoint> clus_prev_pos;
149 clus_prev_pos.emplace_back(repp.rho(), repp.eta(), repp.phi());
157 cluster.resetHitsAndFractions();
160 std::vector<double> dist2,
frac;
164 int cell_layer = (
int)refhit->layer();
177 for (
unsigned int j = 0;
j < recHitEnergyNormDepthPair.second.size(); ++
j) {
178 int depth = recHitEnergyNormDepthPair.first[
j];
191 dist2.emplace_back(d2);
193 LOGDRESSED(
"Basic2DGenericPFlowClusterizer:growAndStabilizePFClusters")
194 <<
"Warning! :: pfcluster-topocell distance is too large! d= " << d2;
226 if (dist2[
i] < 100.0 ||
frac[
i] > 0.9999) {
250 clus_prev_pos.clear();
References _allCellsPosCalc, _convergencePosCalc, _excludeOtherSeeds, _maxIterations, _minFracTot, PFClusterBuilderBase::_positionCalc, _recHitEnergyNorms, _showerSigma2, _stoppingTolerance, funct::abs(), bsc_activity_cfg::clusters, reco::deltaR2(), LEDCalibrationChannels::depth, change_name::diff, myMath::fast_expf(), DivergingColor::frac, HLT_FULL_cff::fraction, PFLayer::HCAL_BARREL1, PFLayer::HCAL_BARREL2, PFLayer::HCAL_ENDCAP, mps_fire::i, createfilelist::int, dqmiolumiharvest::j, edm::Ref< C, T, F >::key(), LOGDRESSED, HLT_FULL_cff::recHitEnergyNorm, reco::PFCluster::recHitFractions(), and mathSSE::sqrt().
Referenced by buildClusters().
◆ operator=()
B2DGPF& Basic2DGenericPFlowClusterizer::operator= |
( |
const B2DGPF & |
| ) |
|
|
delete |
◆ prunePFClusters()
◆ seedPFClustersFromTopo()
◆ update()
◆ _allCellsPosCalc
◆ _convergencePosCalc
◆ _excludeOtherSeeds
const bool Basic2DGenericPFlowClusterizer::_excludeOtherSeeds |
|
private |
◆ _layerMap
const std::unordered_map<std::string, int> Basic2DGenericPFlowClusterizer::_layerMap |
|
private |
◆ _maxIterations
const unsigned Basic2DGenericPFlowClusterizer::_maxIterations |
|
private |
◆ _minFracTot
const double Basic2DGenericPFlowClusterizer::_minFracTot |
|
private |
◆ _recHitEnergyNorms
std::unordered_map<int, std::pair<std::vector<int>, std::vector<double> > > Basic2DGenericPFlowClusterizer::_recHitEnergyNorms |
|
private |
◆ _showerSigma2
const double Basic2DGenericPFlowClusterizer::_showerSigma2 |
|
private |
◆ _stoppingTolerance
const double Basic2DGenericPFlowClusterizer::_stoppingTolerance |
|
private |
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
void setSeed(const DetId &id)
std::unique_ptr< PFCPositionCalculatorBase > _convergencePosCalc
static const std::string input
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
void seedPFClustersFromTopo(const reco::PFCluster &, const std::vector< bool > &, reco::PFClusterCollection &) const
void growPFClusters(const reco::PFCluster &, const std::vector< bool > &, const unsigned toleranceScaling, const unsigned iter, double dist, reco::PFClusterCollection &) const
const std::vector< reco::PFRecHitFraction > & recHitFractions() const
vector of rechit fractions
std::unordered_map< int, std::pair< std::vector< int >, std::vector< double > > > _recHitEnergyNorms
const bool _excludeOtherSeeds
const unsigned _maxIterations
const std::unordered_map< std::string, int > _layerMap
bool exists(std::string const ¶meterName) const
checks if a parameter exists
XYZPointD XYZPoint
point in space with cartesian internal representation
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
XYZVectorD XYZVector
spatial vector with cartesian internal representation
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
PFClusterBuilderBase(const edm::ParameterSet &conf)
const double _stoppingTolerance
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
T getParameter(std::string const &) const
VParameterSet const & getParameterSetVector(std::string const &name) const
key_type key() const
Accessor for product key.
Power< A, B >::type pow(const A &a, const B &b)
Abs< T >::type abs(const T &t)
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
std::unique_ptr< PosCalc > _positionCalc
const float _minFractionToKeep
std::unique_ptr< PFCPositionCalculatorBase > _allCellsPosCalc
const double _showerSigma2
ParameterSet const & getParameterSet(std::string const &) const
void prunePFClusters(reco::PFClusterCollection &) const