|
|
#include <RealisticSimClusterMapper.h>
Definition at line 14 of file RealisticSimClusterMapper.h.
◆ RealisticSimClusterMapper() [1/2]
◆ ~RealisticSimClusterMapper()
RealisticSimClusterMapper::~RealisticSimClusterMapper |
( |
| ) |
|
|
inlineoverride |
◆ RealisticSimClusterMapper() [2/2]
◆ buildClusters()
Implements InitialClusteringStepBase.
Definition at line 52 of file RealisticSimClusterMapper.cc.
63 std::unordered_map<uint32_t, size_t> detIdToIndex(
hits.size());
64 for (uint32_t
i = 0;
i <
hits.size(); ++
i) {
65 detIdToIndex[
hits[
i].detId()] =
i;
74 for (
unsigned int ic = 0; ic < simClusters.size(); ++ic) {
75 const auto& sc = simClusters[ic];
76 const auto& hitsAndFractions = sc.hits_and_fractions();
77 for (
const auto& hAndF : hitsAndFractions) {
78 auto itr = detIdToIndex.find(hAndF.first);
79 if (
itr == detIdToIndex.end()) {
82 auto hitId =
itr->second;
85 float associatedEnergy =
fraction * ref->energy();
97 unsigned int nClusters = realisticClusters.size();
101 for (
unsigned ic = 0; ic <
nClusters; ++ic) {
102 float highest_energy = 0.0f;
106 float energyCorrection = 1.f;
107 float timeRealisticSC = -99.;
108 if (realisticClusters[ic].isVisible()) {
109 int pdgId = simClusters[ic].pdgId();
114 unsigned int etabin = std::floor(((abseta -
calibMinEta_) * egamma_bin_norm));
116 }
else if (isHadron(
pdgId) and !(isPi0(
pdgId)) and
120 unsigned int etabin = std::floor(((abseta -
calibMinEta_) * hadron_bin_norm));
124 std::vector<float> timeHits;
125 const auto& hitsIdsAndFractions = realisticClusters[ic].hitsIdsAndFractions();
126 for (
const auto& idAndF : hitsIdsAndFractions) {
131 const float hit_energy =
fraction * ref->energy();
132 if (hit_energy > highest_energy || highest_energy == 0.0) {
133 highest_energy = hit_energy;
137 if (ref->time() > -1.) {
139 std::array<float, 3> scPosition = realisticClusters[ic].getCenterOfGravity(rhLayer);
140 float distanceSquared =
141 std::pow((ref->position().x() - scPosition[0]), 2) +
std::pow((ref->position().y() - scPosition[1]), 2);
References funct::abs(), reco::PFCluster::addRecHitFraction(), calibMaxEta_, calibMinEta_, RealisticHitToClusterAssociator::computeAssociation(), egammaCalib_, relativeConstraints::empty, PVValHelper::eta, exclusiveFraction_, f, RealisticHitToClusterAssociator::filterHitsByDistance(), RealisticHitToClusterAssociator::findAndMergeInvisibleClusters(), RealisticHitToClusterAssociator::findCentersOfGravity(), dqmdumpme::first, hgcalsimclustertime::ComputeClusterTime::fixSizeHighestDensity(), DetId::Forward, ForwardEmpty, HLT_2018_cff::fraction, spr::getEnergy(), hgcal::RecHitTools::getGeometryType(), hgcal::RecHitTools::getLayer(), hgcal::RecHitTools::getLayerWithOffset(), hgcal::RecHitTools::getPosition(), hadronCalib_, hfClusterShapes_cfi::hits, reco::CaloCluster::hitsAndFractions(), mps_fire::i, RealisticHitToClusterAssociator::init(), input, RealisticHitToClusterAssociator::insertHitEnergy(), RealisticHitToClusterAssociator::insertHitPosition(), RealisticHitToClusterAssociator::insertLayerId(), RealisticHitToClusterAssociator::insertSimClusterIdAndFraction(), invisibleFraction_, hgcal::RecHitTools::lastLayerEE(), hgcal::RecHitTools::lastLayerFH(), InitialClusteringStepBase::makeRefhit(), maxDforTimingSquared_, maxDistance_, maxDistanceFilter_, heavyionUCCDQM_cfi::nClusters, numberOfLayers(), or, convertSQLitetoXML_cfg::output, EgammaValidation_cff::pdgId, funct::pow(), RealisticHitToClusterAssociator::realisticClusters(), rhtools_, SurveyInfoScenario_cff::seed, reco::CaloCluster::setCorrectedEnergy(), reco::CaloCluster::setEnergy(), reco::CaloCluster::setSeed(), reco::PFCluster::setTime(), simClusterH_, timeOffset_, and useMCFractionsForExclEnergy_.
◆ operator=()
◆ update()
◆ updateEvent()
void RealisticSimClusterMapper::updateEvent |
( |
const edm::Event & |
ev | ) |
|
|
finalvirtual |
◆ calibMaxEta_
const float RealisticSimClusterMapper::calibMaxEta_ = 3.0 |
|
private |
◆ calibMinEta_
const float RealisticSimClusterMapper::calibMinEta_ = 1.4 |
|
private |
◆ egammaCalib_
std::vector<double> RealisticSimClusterMapper::egammaCalib_ |
|
private |
◆ exclusiveFraction_
const float RealisticSimClusterMapper::exclusiveFraction_ = 0.7f |
|
private |
◆ hadronCalib_
std::vector<double> RealisticSimClusterMapper::hadronCalib_ |
|
private |
◆ invisibleFraction_
const float RealisticSimClusterMapper::invisibleFraction_ = 0.3f |
|
private |
◆ maxDforTimingSquared_
const float RealisticSimClusterMapper::maxDforTimingSquared_ = 4.0f |
|
private |
◆ maxDistance_
const float RealisticSimClusterMapper::maxDistance_ = 10.f |
|
private |
◆ maxDistanceFilter_
const bool RealisticSimClusterMapper::maxDistanceFilter_ = false |
|
private |
◆ minNHitsforTiming_
const unsigned int RealisticSimClusterMapper::minNHitsforTiming_ = 3 |
|
private |
◆ rhtools_
◆ simClusterH_
◆ simClusterToken_
◆ timeOffset_
const float RealisticSimClusterMapper::timeOffset_ |
|
private |
◆ useMCFractionsForExclEnergy_
const bool RealisticSimClusterMapper::useMCFractionsForExclEnergy_ = false |
|
private |
edm::Handle< SimClusterCollection > simClusterH_
const bool maxDistanceFilter_
void setSeed(const DetId &id)
std::vector< SimCluster > SimClusterCollection
void setTime(float time, float timeError=0)
static const std::string input
void findCentersOfGravity()
std::vector< double > hadronCalib_
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
void setCorrectedEnergy(double cenergy)
InitialClusteringStepBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
std::vector< double > egammaCalib_
edm::EDGetTokenT< SimClusterCollection > simClusterToken_
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
std::pair< float, float > fixSizeHighestDensity(std::vector< float > &time, std::vector< float > weight=std::vector< float >(), unsigned int minNhits=3, float deltaT=0.210, float timeWidthBy=0.5)
void insertLayerId(unsigned int layerId, unsigned int hitIndex)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
void insertHitPosition(float x, float y, float z, unsigned int hitIndex)
double getEnergy(HBHERecHitCollection::const_iterator hit, int useRaw=0, bool debug=false)
const std::vector< RealisticCluster > & realisticClusters() const
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
const unsigned int minNHitsforTiming_
void computeAssociation(float exclusiveFraction, bool useMCFractionsForExclEnergy, unsigned int fhOffset, unsigned int bhOffset)
std::vector< std::pair< float, float > >::iterator itr
void init(std::size_t numberOfHits, std::size_t numberOfSimClusters, std::size_t numberOfLayers)
const bool useMCFractionsForExclEnergy_
const float maxDforTimingSquared_
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
T getParameter(std::string const &) const
void setEnergy(double energy)
const float exclusiveFraction_
void insertSimClusterIdAndFraction(unsigned int scIdx, float fraction, unsigned int hitIndex, float associatedEnergy)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void insertHitEnergy(float energy, unsigned int hitIndex)
void findAndMergeInvisibleClusters(float invisibleFraction, float exclusiveFraction)
Power< A, B >::type pow(const A &a, const B &b)
Abs< T >::type abs(const T &t)
hgcal::RecHitTools rhtools_
const map< TString, int > numberOfLayers(TString Year="2018")
void filterHitsByDistance(float maxDistance)
const float invisibleFraction_