7 : dr_(conf.getParameter<double>(
"dR_multicluster")),
8 dr_byLayer_coefficientA_(conf.existsAs<
std::vector<double>>(
"dR_multicluster_byLayer_coefficientA")
9 ? conf.getParameter<
std::vector<double>>(
"dR_multicluster_byLayer_coefficientA")
10 :
std::vector<double>()),
11 dr_byLayer_coefficientB_(conf.existsAs<
std::vector<double>>(
"dR_multicluster_byLayer_coefficientB")
12 ? conf.getParameter<
std::vector<double>>(
"dR_multicluster_byLayer_coefficientB")
13 :
std::vector<double>()),
14 ptC3dThreshold_(conf.getParameter<double>(
"minPt_multicluster")),
15 cluster_association_input_(conf.getParameter<
string>(
"cluster_association")) {
26 <<
"Multicluster dR: " <<
dr_ <<
"\nMulticluster minimum transverse-momentum: " <<
ptC3dThreshold_;
28 id_ = std::unique_ptr<HGCalTriggerClusterIdentificationBase>{
41 const std::vector<std::pair<GlobalPoint, double>>& seeds)
const {
42 std::map<int, l1t::HGCalMulticluster> mapSeedMulticluster;
43 std::vector<l1t::HGCalMulticluster> multiclustersTmp;
45 for (
const auto& clu : clustersPtrs) {
48 double radiusCoefficientA =
50 double radiusCoefficientB =
53 double minDist = radiusCoefficientA + radiusCoefficientB * (
kMidRadius_ -
std::abs(clu->eta()));
55 std::vector<pair<int, double>> targetSeedsEnergy;
59 double seedEnergy = seeds[
iseed].second;
61 if (z_side * seedPosition.
z() < 0)
67 targetSeedsEnergy.emplace_back(
iseed, seedEnergy);
71 if (targetSeedsEnergy.empty()) {
72 targetSeedsEnergy.emplace_back(
iseed, seedEnergy);
74 targetSeedsEnergy.at(0).first =
iseed;
75 targetSeedsEnergy.at(0).second = seedEnergy;
81 if (targetSeedsEnergy.empty())
84 double totalTargetSeedEnergy = 0;
85 for (
const auto& energy : targetSeedsEnergy) {
86 totalTargetSeedEnergy += energy.second;
89 for (
const auto& energy : targetSeedsEnergy) {
90 double seedWeight = 1;
92 seedWeight = energy.second / totalTargetSeedEnergy;
93 if (mapSeedMulticluster[energy.first].size() == 0) {
96 mapSeedMulticluster[energy.first].addConstituent(clu,
true, seedWeight);
101 for (
const auto& mclu : mapSeedMulticluster)
102 multiclustersTmp.emplace_back(mclu.second);
104 return multiclustersTmp;
108 const std::vector<std::pair<GlobalPoint, double>>& seedPositionsEnergy,
112 std::vector<l1t::HGCalMulticluster> multiclustersTmp =
clusterSeedMulticluster(clustersPtrs, seedPositionsEnergy);
120 for (
auto& multicluster : multiclusters_in) {
123 double sumPt = multicluster.sumPt();
126 multicluster.setP4(multiclusterP4);
132 multicluster.setHwQual(
id_->decision(multicluster));
134 multicluster.saveHOverE();
136 multiclusters_out.
push_back(0, multicluster);
T getParameter(std::string const &) const
void finalizeClusters(std::vector< l1t::HGCalMulticluster > &, l1t::HGCalMulticlusterBxCollection &, const HGCalTriggerGeometryBase &) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
std::unique_ptr< HGCalTriggerClusterIdentificationBase > id_
static double kMidRadius_
const GlobalPoint & centreProj() const
std::vector< l1t::HGCalMulticluster > clusterSeedMulticluster(const std::vector< edm::Ptr< l1t::HGCalCluster >> &clustersPtrs, const std::vector< std::pair< GlobalPoint, double >> &seeds) const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
HGCalTriggerTools triggerTools_
std::string cluster_association_input_
void clusterizeHisto(const std::vector< edm::Ptr< l1t::HGCalCluster >> &clustersPtr, const std::vector< std::pair< GlobalPoint, double >> &seedPositionsEnergy, const HGCalTriggerGeometryBase &triggerGeometry, l1t::HGCalMulticlusterBxCollection &multiclusters) const
Abs< T >::type abs(const T &t)
std::vector< double > dr_byLayer_coefficientB_
float dR(const l1t::HGCalCluster &clu, const GlobalPoint &seed) const
HGCalHistoClusteringImpl(const edm::ParameterSet &conf)
ClusterAssociationStrategy cluster_association_strategy_
void fillShapes(l1t::HGCalMulticluster &, const HGCalTriggerGeometryBase &) const
T get(const Candidate &c)
std::vector< double > dr_byLayer_coefficientA_
void push_back(int bx, T object)