153 if (
input.regions.empty())
156 const int eventNumber =
input.ev.eventAuxiliary().event();
178 std::vector<std::pair<int, int>> layerIdx2layerandSoa;
180 layerIdx2layerandSoa.reserve(
input.layerClusters.size());
181 unsigned int layerIdx = 0;
182 for (
auto const &lc :
input.layerClusters) {
183 if (
input.mask[layerIdx] == 0.) {
185 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Skipping masked cluster: " << layerIdx;
187 layerIdx2layerandSoa.emplace_back(-1, -1);
191 const auto firstHitDetId = lc.hitsAndFractions()[0].first;
195 auto detId = lc.hitsAndFractions()[0].first;
197 layerIdx2layerandSoa.emplace_back(
layer, layerClusterIndexInLayer);
200 float sum_sqr_x = 0.;
201 float sum_sqr_y = 0.;
202 float ref_x = lc.x();
203 float ref_y = lc.y();
204 float invClsize = 1. / lc.hitsAndFractions().size();
205 for (
auto const &hitsAndFractions : lc.hitsAndFractions()) {
208 sum_sqr_x += (
point.x() - ref_x) * (
point.x() - ref_x);
210 sum_sqr_y += (
point.y() - ref_y) * (
point.y() - ref_y);
217 float radius_x =
sqrt((sum_sqr_x - (
sum_x *
sum_x) * invClsize) * invClsize);
218 float radius_y =
sqrt((sum_sqr_y - (
sum_y *
sum_y) * invClsize) * invClsize);
221 <<
"cluster rx: " << std::setw(5) << radius_x <<
", ry: " << std::setw(5) << radius_y
222 <<
", r: " << std::setw(5) << (radius_x + radius_y) <<
", cells: " << std::setw(4)
223 << lc.hitsAndFractions().size();
228 if (invClsize == 1.) {
233 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Single cell cluster in silicon, rx: " << std::setw(5)
234 << radius_x <<
", ry: " << std::setw(5) << radius_y;
239 radius_x = radius_y =
point.perp() * eta_phi_window.second;
242 <<
"Single cell cluster in scintillator. rx: " << std::setw(5) << radius_x <<
", ry: " << std::setw(5)
243 << radius_y <<
", eta-span: " << std::setw(5) << eta_phi_window.first <<
", phi-span: " << std::setw(5)
244 << eta_phi_window.second;
263 clusters_[
layer].layerClusterOriginalIdx.emplace_back(layerIdx++);
275 int maxLayer = 2 * lastLayerPerSide - 1;
276 std::vector<int> numberOfClustersPerLayer(maxLayer, 0);
277 for (
int i = 0;
i <= maxLayer;
i++) {
280 for (
int i = 0;
i <= maxLayer;
i++) {
286 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Reconstructed " << nTracksters <<
" tracksters" << std::endl;
291 result.resize(nTracksters);
298 for (
unsigned int lc = 0; lc < thisLayer.x.size(); ++lc) {
300 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Trackster " << thisLayer.clusterIndex[lc];
302 if (thisLayer.clusterIndex[lc] >= 0) {
304 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
" adding lcIdx: " << thisLayer.layerClusterOriginalIdx[lc];
306 result[thisLayer.clusterIndex[lc]].vertices().push_back(thisLayer.layerClusterOriginalIdx[lc]);
307 result[thisLayer.clusterIndex[lc]].vertex_multiplicity().push_back(1);
309 for (
auto [follower_lyrIdx, follower_soaIdx] : thisLayer.followers[lc]) {
310 std::array<unsigned int, 2> edge = {
311 {(
unsigned int)thisLayer.layerClusterOriginalIdx[lc],
312 (
unsigned int)
clusters_[follower_lyrIdx].layerClusterOriginalIdx[follower_soaIdx]}};
313 result[thisLayer.clusterIndex[lc]].edges().push_back(edge);
318 size_t tracksterIndex = 0;
322 return static_cast<int>(
v.vertices().size()) <
331 input.layerClustersTime,
340 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Barycenter: " <<
t.barycenter();
341 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"LCs: " <<
t.vertices().size();
343 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Regressed: " <<
t.regressed_energy();
Log< level::Info, true > LogVerbatim
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const std::vector< int > minNumLayerCluster_
void assignPCAtoTracksters(std::vector< Trackster > &tracksters, const std::vector< reco::CaloCluster > &layerClusters, const edm::ValueMap< std::pair< float, float >> &layerClustersTime, double z_limit_em, hgcal::RecHitTools const &rhTools, bool computeLocalTime=false, bool energyWeight=true, bool clean=false, int minLayer=10, int maxLayer=10)
std::vector< ClustersOnLayer > clusters_
void calculateDistanceToHigher(const TILES &, const int layerId, const std::vector< std::pair< int, int >> &)
static std::string const input
hgcal::RecHitTools rhtools_
const bool usePCACleaning_
Abs< T >::type abs(const T &t)
int findAndAssignTracksters(const TILES &, const std::vector< std::pair< int, int >> &)
void dumpClusters(const TILES &tiles, const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int) const
void calculateLocalDensity(const TILES &, const int layerId, const std::vector< std::pair< int, int >> &)
const bool computeLocalTime_
std::vector< int > tracksterSeedAlgoId_
std::vector< float > layersPosZ_
int sum_x
More diagnostics.
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
void dumpTracksters(const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int, const std::vector< Trackster > &) const