54 void fillWithRecHits(std::unordered_map<DetId, const HGCRecHit*>&,
DetId,
unsigned int,
float,
int&,
float&);
85 : debug_(iConfig.getParameter<
int>(
"debug")),
86 filterOnEnergyAndCaloP_(iConfig.getParameter<
bool>(
"filterOnEnergyAndCaloP")) {
89 hitMap_ = consumes<std::unordered_map<DetId, const HGCRecHit*>>(hitMapInputTag);
104 eta1_ = ibooker.
book1D(
"eta1",
"eta1", 80, 0., 4.);
105 eta2_ = ibooker.
book1D(
"eta2",
"eta2", 80, 0., 4.);
110 layerEnergy_ = ibooker.
book2D(
"LayerEnergy",
"LayerEnergy", 60, 0., 60., 50, 0., 0.1);
111 layerDistance_ = ibooker.
book2D(
"LayerDistance",
"LayerDistance", 60, 0., 60., 400, -400., 400.);
112 etaPhi_ = ibooker.
book2D(
"EtaPhi",
"EtaPhi", 800, -4., 4., 800, -4., 4.);
113 deltaEtaPhi_ = ibooker.
book2D(
"DeltaEtaPhi",
"DeltaEtaPhi", 100, -0.5, 0.5, 100, -0.5, 0.5);
124 std::string(
"GlobalProfileOnLayer_") + std::to_string(
i),
137 std::string(
"IdealDistanceOnLayer_") + std::to_string(
i),
169 const std::vector<CaloParticle>&
caloParticles = *caloParticleHandle;
173 const auto hitmap = *hitMapHandle;
180 auto theta1 = 2. * atan(
exp(-
eta1));
183 auto theta2 = 2. * atan(
exp(-
eta2));
192 float energy_tmp = 0.;
197 for (
const auto& it_sc : simClusterRefVector) {
199 const std::vector<std::pair<uint32_t, float>>& hits_and_fractions = simCluster.
hits_and_fractions();
200 for (
const auto& it_haf : hits_and_fractions) {
201 if (hitmap.count(it_haf.first))
202 energy += hitmap.at(it_haf.first)->energy() * it_haf.second;
220 IfLogTrace(
debug_ > 0,
"HGCalShowerSeparation") <<
">>> " << simClusterRefVector.
size() << std::endl;
221 for (
const auto& it_sc : simClusterRefVector) {
223 if (simCluster.
energy() < 80 * 0.8)
227 <<
">>> SC.energy(): " << simCluster.
energy() <<
" SC.simEnergy(): " << simCluster.
simEnergy() << std::endl;
228 const std::vector<std::pair<uint32_t, float>>& hits_and_fractions = simCluster.
hits_and_fractions();
230 for (
const auto& it_haf : hits_and_fractions) {
231 if (!hitmap.count(it_haf.first))
235 float globalx = global.
x();
236 float globaly = global.y();
237 float globalz = global.z();
240 auto rho1 = globalz *
tan(theta1);
241 auto rho2 = globalz *
tan(theta2);
242 auto x1 = rho1 *
cos(phi1);
243 auto y1 = rho1 *
sin(phi1);
244 auto x2 = rho2 *
cos(phi2);
245 auto y2 = rho2 *
sin(phi2);
246 auto half_point_x = (
x1 +
x2) / 2.;
247 auto half_point_y = (
y1 +
y2) / 2.;
248 auto half_point =
sqrt((
x1 - half_point_x) * (
x1 - half_point_x) + (
y1 - half_point_y) * (
y1 - half_point_y));
250 auto dn_x = (
x2 -
x1) / d_len;
251 auto dn_y = (
y2 -
y1) / d_len;
252 auto distance = (globalx -
x1) * dn_x + (globaly -
y1) * dn_y;
255 if (hitmap.count(it_haf.first)) {
257 10. * (globaly - half_point_y),
258 hitmap.at(it_haf.first)->energy() * it_haf.second);
260 10. * (globaly - half_point_y),
261 hitmap.at(it_haf.first)->energy() * it_haf.second);
262 globalProfileOnLayer_[hitlayer]->Fill(globalx, globaly, hitmap.at(it_haf.first)->energy() * it_haf.second);
263 globalProfileOnLayer_[55]->Fill(globalx, globaly, hitmap.at(it_haf.first)->energy() * it_haf.second);
270 centers_[hitlayer]->Fill(10. * half_point_x, 10. * half_point_y);
272 <<
">>> " <<
distance <<
" " << hitlayer <<
" " << hitmap.at(it_haf.first)->energy() * it_haf.second
286 desc.add<
int>(
"debug", 1);
287 desc.add<
bool>(
"filterOnEnergyAndCaloP",
false);
290 descriptions.
add(
"hgcalShowerSeparationDefault",
desc);