162 hits_.insert(
hits_.end(), (*hits_handle).begin(), (*hits_handle).end());
170 const auto hitmap = *hitMapHandle;
177 auto theta1 = 2. * std::atan(
exp(-
eta1));
180 auto theta2 = 2. * std::atan(
exp(-
eta2));
189 float energy_tmp = 0.;
194 for (
const auto& it_sc : simClusterRefVector) {
196 const std::vector<std::pair<uint32_t, float>>& hits_and_fractions = simCluster.
hits_and_fractions();
197 for (
const auto& it_haf : hits_and_fractions) {
198 if (hitmap.count(it_haf.first)) {
219 IfLogTrace(
debug_ > 0,
"HGCalShowerSeparation") <<
">>> " << simClusterRefVector.
size() << std::endl;
220 for (
const auto& it_sc : simClusterRefVector) {
222 if (simCluster.
energy() < 80 * 0.8)
226 <<
">>> SC.energy(): " << simCluster.
energy() <<
" SC.simEnergy(): " << simCluster.
simEnergy() << std::endl;
227 const std::vector<std::pair<uint32_t, float>>& hits_and_fractions = simCluster.
hits_and_fractions();
229 for (
const auto& it_haf : hits_and_fractions) {
230 if (!hitmap.count(it_haf.first))
234 float globalx = global.
x();
235 float globaly = global.y();
236 float globalz = global.z();
239 auto rho1 = globalz *
tan(theta1);
240 auto rho2 = globalz *
tan(theta2);
241 auto x1 = rho1 *
cos(phi1);
242 auto y1 = rho1 *
sin(phi1);
243 auto x2 = rho2 *
cos(phi2);
244 auto y2 = rho2 *
sin(phi2);
245 auto half_point_x = (
x1 +
x2) / 2.;
246 auto half_point_y = (
y1 +
y2) / 2.;
247 auto half_point =
sqrt((
x1 - half_point_x) * (
x1 - half_point_x) + (
y1 - half_point_y) * (
y1 - half_point_y));
249 auto dn_x = (
x2 -
x1) / d_len;
250 auto dn_y = (
y2 -
y1) / d_len;
251 auto distance = (globalx -
x1) * dn_x + (globaly -
y1) * dn_y;
254 if (hitmap.count(it_haf.first)) {
257 10. * (globalx - half_point_x), 10. * (globaly - half_point_y),
hit->energy() * it_haf.second);
259 10. * (globalx - half_point_x), 10. * (globaly - half_point_y),
hit->energy() * it_haf.second);
268 centers_[hitlayer]->Fill(10. * half_point_x, 10. * half_point_y);
270 <<
">>> " <<
distance <<
" " << hitlayer <<
" " <<
hit->energy() * it_haf.second << std::endl;
MonitorElement * scEnergy_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
bool filterOnEnergyAndCaloP_
#define IfLogTrace(cond, cat)
MonitorElement * layerEnergy_
MonitorElement * deltaEtaPhi_
MonitorElement * energy1_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
Sin< T >::type sin(const T &t)
T const * product() const
MonitorElement * energy2_
std::vector< MonitorElement * > globalProfileOnLayer_
std::vector< MonitorElement * > idealDeltaXY_
std::vector< std::pair< uint32_t, float > > hits_and_fractions() const
Returns list of rechit IDs and fractions for this SimCluster.
float simEnergy() const
returns the accumulated sim energy in the cluster
std::vector< MonitorElement * > profileOnLayer_
MonitorElement * energytot_
Monte Carlo truth information used for tracking validation.
edm::EDGetTokenT< std::vector< CaloParticle > > caloParticles_
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
std::vector< MonitorElement * > distanceOnLayer_
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
size_type size() const
Size of the RefVector.
hgcal::RecHitTools recHitTools_
MonitorElement * layerDistance_
std::vector< edm::EDGetTokenT< HGCRecHitCollection > > hits_token_
std::vector< HGCRecHit > hits_
float energy() const
Energy. Note this is taken from the first SimTrack only.
edm::EDGetTokenT< std::unordered_map< DetId, const unsigned int > > hitMap_
std::vector< MonitorElement * > centers_
std::vector< MonitorElement * > idealDistanceOnLayer_
MonitorElement * showerProfile_