Reimplemented from DQMEDAnalyzer.
Definition at line 166 of file HGCalShowerSeparation.cc.
179 const std::vector<CaloParticle>&
caloParticles = *caloParticleHandle;
184 const auto& rechitsEE = *recHitHandleEE;
185 const auto& rechitsFH = *recHitHandleFH;
186 const auto& rechitsBH = *recHitHandleBH;
188 std::map<DetId, const HGCRecHit*> hitmap;
189 for (
unsigned int i = 0;
i < rechitsEE.size(); ++
i) {
190 hitmap[rechitsEE[
i].detid()] = &rechitsEE[
i];
192 for (
unsigned int i = 0;
i < rechitsFH.size(); ++
i) {
193 hitmap[rechitsFH[
i].detid()] = &rechitsFH[
i];
195 for (
unsigned int i = 0;
i < rechitsBH.size(); ++
i) {
196 hitmap[rechitsBH[
i].detid()] = &rechitsBH[
i];
204 auto theta1 = 2. * atan(
exp(-
eta1));
207 auto theta2 = 2. * atan(
exp(-
eta2));
216 float energy_tmp = 0.;
221 for (
const auto& it_sc : simClusterRefVector) {
223 const std::vector<std::pair<uint32_t, float> >& hits_and_fractions = simCluster.
hits_and_fractions();
224 for (
const auto& it_haf : hits_and_fractions) {
225 if (hitmap.count(it_haf.first))
226 energy += hitmap[it_haf.first]->energy() * it_haf.second;
244 IfLogTrace(
debug_ > 0,
"HGCalShowerSeparation") <<
">>> " << simClusterRefVector.
size() << std::endl;
245 for (
const auto& it_sc : simClusterRefVector) {
247 if (simCluster.
energy() < 80 * 0.8)
251 <<
">>> SC.energy(): " << simCluster.
energy() <<
" SC.simEnergy(): " << simCluster.
simEnergy() << std::endl;
252 const std::vector<std::pair<uint32_t, float> >& hits_and_fractions = simCluster.
hits_and_fractions();
254 for (
const auto& it_haf : hits_and_fractions) {
255 if (!hitmap.count(it_haf.first))
259 float globalx = global.
x();
260 float globaly = global.y();
261 float globalz = global.z();
264 auto rho1 = globalz *
tan(theta1);
265 auto rho2 = globalz *
tan(theta2);
266 auto x1 = rho1 *
cos(phi1);
267 auto y1 = rho1 *
sin(phi1);
268 auto x2 = rho2 *
cos(phi2);
269 auto y2 = rho2 *
sin(phi2);
270 auto half_point_x = (
x1 +
x2) / 2.;
271 auto half_point_y = (
y1 +
y2) / 2.;
272 auto half_point =
sqrt((
x1 - half_point_x) * (
x1 - half_point_x) + (
y1 - half_point_y) * (
y1 - half_point_y));
274 auto dn_x = (
x2 -
x1) / d_len;
275 auto dn_y = (
y2 -
y1) / d_len;
276 auto distance = (globalx -
x1) * dn_x + (globaly -
y1) * dn_y;
279 if (hitmap.count(it_haf.first)) {
281 10. * (globaly - half_point_y),
282 hitmap[it_haf.first]->energy() * it_haf.second);
284 10. * (globaly - half_point_y),
285 hitmap[it_haf.first]->energy() * it_haf.second);
286 globalProfileOnLayer_[hitlayer]->Fill(globalx, globaly, hitmap[it_haf.first]->energy() * it_haf.second);
294 centers_[hitlayer]->Fill(10. * half_point_x, 10. * half_point_y);
296 <<
">>> " <<
distance <<
" " << hitlayer <<
" " << hitmap[it_haf.first]->energy() * it_haf.second
References funct::abs(), caloTruthCellsProducer_cfi::caloParticles, caloParticles_, centers_, funct::cos(), KineDebug3::count(), debug_, deltaEtaPhi_, HLT_2018_cff::distance, distanceOnLayer_, HCALHighEnergyHPDFilter_cfi::energy, SimCluster::energy(), energy1_, energy2_, energytot_, HLT_2018_cff::eta1, eta1_, HLT_2018_cff::eta2, eta2_, etaPhi_, JetChargeProducer_cfi::exp, dqm::impl::MonitorElement::Fill(), filterOnEnergyAndCaloP_, relativeConstraints::geom, edm::EventSetup::get(), get, hgcal::RecHitTools::getLayerWithOffset(), hgcal::RecHitTools::getPosition(), globalProfileOnLayer_, SimCluster::hits_and_fractions(), mps_fire::i, idealDeltaXY_, idealDistanceOnLayer_, iEvent, IfLogTrace, layerDistance_, layerEnergy_, or, profileOnLayer_, recHitsBH_, recHitsEE_, recHitsFH_, recHitTools_, scEnergy_, hgcal::RecHitTools::setGeometry(), showerProfile_, SimCluster::simEnergy(), funct::sin(), edm::RefVector< C, T, F >::size(), findQualityFiles::size, mathSSE::sqrt(), funct::tan(), PV3DBase< T, PVType, FrameType >::x(), testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, testProducerWithPsetDescEmpty_cfi::y1, and testProducerWithPsetDescEmpty_cfi::y2.