159 if (
input.regions.empty())
162 const int eventNumber =
input.ev.eventAuxiliary().event();
184 std::vector<std::pair<int, int>> layerIdx2layerandSoa;
186 layerIdx2layerandSoa.reserve(
input.layerClusters.size());
187 unsigned int layerIdx = 0;
188 for (
auto const &lc :
input.layerClusters) {
189 if (
input.mask[layerIdx] == 0.) {
191 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Skipping masked cluster: " << layerIdx;
193 layerIdx2layerandSoa.emplace_back(-1, -1);
197 const auto firstHitDetId = lc.hitsAndFractions()[0].first;
201 auto detId = lc.hitsAndFractions()[0].first;
203 layerIdx2layerandSoa.emplace_back(
layer, layerClusterIndexInLayer);
206 float sum_sqr_x = 0.;
207 float sum_sqr_y = 0.;
208 float ref_x = lc.x();
209 float ref_y = lc.y();
210 float invClsize = 1. / lc.hitsAndFractions().size();
211 for (
auto const &hitsAndFractions : lc.hitsAndFractions()) {
214 sum_sqr_x += (
point.x() - ref_x) * (
point.x() - ref_x);
216 sum_sqr_y += (
point.y() - ref_y) * (
point.y() - ref_y);
223 float radius_x =
sqrt((sum_sqr_x - (
sum_x *
sum_x) * invClsize) * invClsize);
224 float radius_y =
sqrt((sum_sqr_y - (
sum_y *
sum_y) * invClsize) * invClsize);
227 <<
"cluster rx: " << std::setw(5) << radius_x <<
", ry: " << std::setw(5) << radius_y
228 <<
", r: " << std::setw(5) << (radius_x + radius_y) <<
", cells: " << std::setw(4)
229 << lc.hitsAndFractions().size();
234 if (invClsize == 1.) {
239 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Single cell cluster in silicon, rx: " << std::setw(5)
240 << radius_x <<
", ry: " << std::setw(5) << radius_y;
245 radius_x = radius_y =
point.perp() * eta_phi_window.second;
248 <<
"Single cell cluster in scintillator. rx: " << std::setw(5) << radius_x <<
", ry: " << std::setw(5)
249 << radius_y <<
", eta-span: " << std::setw(5) << eta_phi_window.first <<
", phi-span: " << std::setw(5)
250 << eta_phi_window.second;
269 clusters_[
layer].layerClusterOriginalIdx.emplace_back(layerIdx++);
281 int maxLayer = 2 * lastLayerPerSide - 1;
282 std::vector<int> numberOfClustersPerLayer(maxLayer, 0);
283 for (
int i = 0;
i <= maxLayer;
i++) {
286 for (
int i = 0;
i <= maxLayer;
i++) {
292 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Reconstructed " << nTracksters <<
" tracksters" << std::endl;
297 result.resize(nTracksters);
304 for (
unsigned int lc = 0; lc < thisLayer.x.size(); ++lc) {
306 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Trackster " << thisLayer.clusterIndex[lc];
308 if (thisLayer.clusterIndex[lc] >= 0) {
310 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
" adding lcIdx: " << thisLayer.layerClusterOriginalIdx[lc];
312 result[thisLayer.clusterIndex[lc]].vertices().push_back(thisLayer.layerClusterOriginalIdx[lc]);
313 result[thisLayer.clusterIndex[lc]].vertex_multiplicity().push_back(1);
315 for (
auto [follower_lyrIdx, follower_soaIdx] : thisLayer.followers[lc]) {
316 std::array<unsigned int, 2> edge = {
317 {(
unsigned int)thisLayer.layerClusterOriginalIdx[lc],
318 (
unsigned int)
clusters_[follower_lyrIdx].layerClusterOriginalIdx[follower_soaIdx]}};
319 result[thisLayer.clusterIndex[lc]].edges().push_back(edge);
324 size_t tracksterIndex = 0;
328 return static_cast<int>(
v.vertices().size()) <
337 auto const &hadProb =
348 input.layerClustersTime,
354 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Barycenter: " <<
t.barycenter();
355 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"LCs: " <<
t.vertices().size();
357 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)
void energyRegressionAndID(const std::vector< reco::CaloCluster > &layerClusters, const tensorflow::Session *, std::vector< Trackster > &result)
const std::vector< int > minNumLayerCluster_
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_
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_
void assignPCAtoTracksters(std::vector< Trackster > &, const std::vector< reco::CaloCluster > &, const edm::ValueMap< std::pair< float, float >> &, double, bool computeLocalTime=false, bool energyWeight=true)
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