122 std::unordered_map<uint32_t, size_t> detIdToIndex(
hits.size());
123 for (uint32_t
i = 0;
i <
hits.size(); ++
i) {
124 detIdToIndex[
hits[
i].detId()] =
i;
133 for (
unsigned int ic = 0; ic <
simClusters.size(); ++ic) {
135 const auto& hitsAndFractions = sc.hits_and_fractions();
136 for (
const auto& hAndF : hitsAndFractions) {
137 auto itr = detIdToIndex.find(hAndF.first);
138 if (itr == detIdToIndex.end()) {
141 auto hitId = itr->second;
144 float associatedEnergy =
fraction * ref->energy();
156 unsigned int nClusters = realisticClusters.size();
160 for (
unsigned ic = 0; ic <
nClusters; ++ic) {
161 float highest_energy = 0.0f;
165 float energyCorrection = 1.f;
166 float timeRealisticSC = -99.;
167 if (realisticClusters[ic].isVisible()) {
173 unsigned int etabin = std::floor(((abseta -
calibMinEta_) * egamma_bin_norm));
175 }
else if (isHadron(
pdgId) and !(isPi0(
pdgId)) and
179 unsigned int etabin = std::floor(((abseta -
calibMinEta_) * hadron_bin_norm));
183 std::vector<float> timeHits;
184 const auto& hitsIdsAndFractions = realisticClusters[ic].hitsIdsAndFractions();
185 for (
const auto& idAndF : hitsIdsAndFractions) {
190 const float hit_energy =
fraction * ref->energy();
191 if (hit_energy > highest_energy || highest_energy == 0.0) {
192 highest_energy = hit_energy;
196 if (ref->time() > -1.) {
198 std::array<float, 3> scPosition = realisticClusters[ic].getCenterOfGravity(rhLayer);
199 float distanceSquared =
200 std::pow((ref->position().x() - scPosition[0]), 2) +
std::pow((ref->position().y() - scPosition[1]), 2);
202 timeHits.push_back(ref->time());
void insertLayerId(unsigned int layerId, unsigned int hitIndex)
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
constexpr uint32_t numberOfLayers
double getEnergy(HBHERecHitCollection::const_iterator hit, int useRaw=0, bool debug=false)
void setTime(float time, float timeError=0)
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
void setEnergy(double energy)
const float exclusiveFraction_
static std::string const input
void setSeed(const DetId &id)
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)
hgcal::RecHitTools rhtools_
void init(std::size_t numberOfHits, std::size_t numberOfSimClusters, std::size_t numberOfLayers)
const std::vector< RealisticCluster > & realisticClusters() const
void setCorrectedEnergy(double cenergy)
const float invisibleFraction_
void insertSimClusterIdAndFraction(unsigned int scIdx, float fraction, unsigned int hitIndex, float associatedEnergy)
void computeAssociation(float exclusiveFraction, bool useMCFractionsForExclEnergy, unsigned int fhOffset, unsigned int bhOffset)
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
Abs< T >::type abs(const T &t)
void findAndMergeInvisibleClusters(float invisibleFraction, float exclusiveFraction)
void insertHitPosition(float x, float y, float z, unsigned int hitIndex)
const bool useMCFractionsForExclEnergy_
void insertHitEnergy(float energy, unsigned int hitIndex)
std::vector< double > egammaCalib_
const bool maxDistanceFilter_
void findCentersOfGravity()
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
std::vector< double > hadronCalib_
const float maxDforTimingSquared_
void filterHitsByDistance(float maxDistance)
edm::Handle< SimClusterCollection > simClusterH_
std::vector< SimCluster > SimClusterCollection
Power< A, B >::type pow(const A &a, const B &b)