136 if (
input.regions.empty())
139 const int eventNumber =
input.ev.eventAuxiliary().event();
150 std::vector<std::pair<int, int>> layerIdx2layerandSoa;
152 layerIdx2layerandSoa.reserve(
input.layerClusters.size());
153 unsigned int layerIdx = 0;
154 for (
auto const &lc :
input.layerClusters) {
155 if (
input.mask[layerIdx] == 0.) {
157 edm::LogVerbatim(
"PatternRecogntionbyCLUE3D") <<
"Skipping masked clustrer: " << layerIdx;
159 layerIdx2layerandSoa.emplace_back(-1, -1);
163 const auto firstHitDetId = lc.hitsAndFractions()[0].first;
168 layerIdx2layerandSoa.emplace_back(layer,
clusters_[layer].
x.size());
171 float sum_sqr_x = 0.;
172 float sum_sqr_y = 0.;
173 float ref_x = lc.x();
174 float ref_y = lc.y();
175 float invClsize = 1. / lc.hitsAndFractions().size();
176 for (
auto const &hitsAndFractions : lc.hitsAndFractions()) {
178 sum_x +=
point.x() - ref_x;
179 sum_sqr_x += (
point.x() - ref_x) * (
point.x() - ref_x);
180 sum_y +=
point.y() - ref_y;
181 sum_sqr_y += (
point.y() - ref_y) * (
point.y() - ref_y);
188 float radius_x =
sqrt((sum_sqr_x - (sum_x * sum_x) * invClsize) * invClsize);
189 float radius_y =
sqrt((sum_sqr_y - (sum_y * sum_y) * invClsize) * invClsize);
199 clusters_[
layer].layerClusterOriginalIdx.emplace_back(layerIdx++);
204 for (
unsigned int layer = 0; layer <
clusters_.size(); layer++) {
209 int maxLayer = 2 * lastLayerPerSide - 1;
210 std::vector<int> numberOfClustersPerLayer(maxLayer, 0);
211 for (
int i = 0;
i <= maxLayer;
i++) {
214 for (
int i = 0;
i <= maxLayer;
i++) {
220 edm::LogVerbatim(
"PatternRecogntionbyCLUE3D") <<
"Reconstructed " << nTracksters <<
" tracksters" << std::endl;
225 result.resize(nTracksters);
232 for (
unsigned int lc = 0; lc < thisLayer.x.size(); ++lc) {
234 edm::LogVerbatim(
"PatternRecogntionbyCLUE3D") <<
"Trackster " << thisLayer.clusterIndex[lc];
236 if (thisLayer.clusterIndex[lc] >= 0) {
238 edm::LogVerbatim(
"PatternRecogntionbyCLUE3D") <<
" adding lcIdx: " << thisLayer.layerClusterOriginalIdx[lc];
240 result[thisLayer.clusterIndex[lc]].vertices().push_back(thisLayer.layerClusterOriginalIdx[lc]);
241 result[thisLayer.clusterIndex[lc]].vertex_multiplicity().push_back(1);
243 for (
auto [follower_lyrIdx, follower_soaIdx] : thisLayer.followers[lc]) {
244 std::array<unsigned int, 2> edge = {
245 {(
unsigned int)thisLayer.layerClusterOriginalIdx[lc],
246 (
unsigned int)
clusters_[follower_lyrIdx].layerClusterOriginalIdx[follower_soaIdx]}};
247 result[thisLayer.clusterIndex[lc]].edges().push_back(edge);
262 input.layerClustersTime,
269 edm::LogVerbatim(
"PatternRecogntionbyCLUE3D") <<
"Barycenter: " <<
t.barycenter();
272 edm::LogVerbatim(
"PatternRecogntionbyCLUE3D") <<
"Regressed: " <<
t.regressed_energy();
Log< level::Info, true > LogVerbatim
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
const int minNumLayerCluster_
void dumpTracksters(const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int, const std::vector< Trackster > &) const
void energyRegressionAndID(const std::vector< reco::CaloCluster > &layerClusters, const tensorflow::Session *, std::vector< Trackster > &result)
std::vector< ClustersOnLayer > clusters_
void calculateDistanceToHigher(const TILES &, const int layerId, const std::vector< std::pair< int, int >> &)
constexpr std::array< uint8_t, layerIndexSize > layer
static std::string const input
bool getData(T &iHolder) const
void assignPCAtoTracksters(std::vector< Trackster > &, const std::vector< reco::CaloCluster > &, const edm::ValueMap< std::pair< float, float >> &, double, bool energyWeight=true)
hgcal::RecHitTools rhtools_
int findAndAssignTracksters(const TILES &, const std::vector< std::pair< int, int >> &)
void dumpClusters(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 >> &)
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