156 if (
input.regions.empty())
159 const int eventNumber =
input.ev.eventAuxiliary().event();
179 std::vector<std::pair<int, int>> layerIdx2layerandSoa;
181 layerIdx2layerandSoa.reserve(
input.layerClusters.size());
182 unsigned int layerIdx = 0;
183 for (
auto const &lc :
input.layerClusters) {
184 if (
input.mask[layerIdx] == 0.) {
186 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Skipping masked cluster: " << layerIdx;
188 layerIdx2layerandSoa.emplace_back(-1, -1);
192 const auto firstHitDetId = lc.hitsAndFractions()[0].first;
196 auto detId = lc.hitsAndFractions()[0].first;
201 float sum_sqr_x = 0.;
202 float sum_sqr_y = 0.;
203 float ref_x = lc.x();
204 float ref_y = lc.y();
205 float invClsize = 1. / lc.hitsAndFractions().size();
206 for (
auto const &hitsAndFractions : lc.hitsAndFractions()) {
209 sum_sqr_x += (
point.x() - ref_x) * (
point.x() - ref_x);
211 sum_sqr_y += (
point.y() - ref_y) * (
point.y() - ref_y);
218 float radius_x =
sqrt((sum_sqr_x - (
sum_x *
sum_x) * invClsize) * invClsize);
219 float radius_y =
sqrt((sum_sqr_y - (
sum_y *
sum_y) * invClsize) * invClsize);
222 <<
"cluster rx: " << std::setw(5) << radius_x <<
", ry: " << std::setw(5) << radius_y
223 <<
", r: " << std::setw(5) << (radius_x + radius_y) <<
", cells: " << std::setw(4)
224 << lc.hitsAndFractions().size();
229 if (invClsize == 1.) {
234 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Single cell cluster in silicon, rx: " << std::setw(5)
235 << radius_x <<
", ry: " << std::setw(5) << radius_y;
240 radius_x = radius_y =
point.perp() * eta_phi_window.second;
243 <<
"Single cell cluster in scintillator. rx: " << std::setw(5) << radius_x <<
", ry: " << std::setw(5)
244 << radius_y <<
", eta-span: " << std::setw(5) << eta_phi_window.first <<
", phi-span: " << std::setw(5)
245 << eta_phi_window.second;
261 clusters_[
layer].layerClusterOriginalIdx.emplace_back(layerIdx++);
273 int maxLayer = 2 * lastLayerPerSide - 1;
274 std::vector<int> numberOfClustersPerLayer(maxLayer, 0);
275 for (
int i = 0;
i <= maxLayer;
i++) {
278 for (
int i = 0;
i <= maxLayer;
i++) {
284 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Reconstructed " << nTracksters <<
" tracksters" << std::endl;
289 result.resize(nTracksters);
296 for (
unsigned int lc = 0; lc < thisLayer.x.size(); ++lc) {
298 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Trackster " << thisLayer.clusterIndex[lc];
300 if (thisLayer.clusterIndex[lc] >= 0) {
302 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
" adding lcIdx: " << thisLayer.layerClusterOriginalIdx[lc];
304 result[thisLayer.clusterIndex[lc]].vertices().push_back(thisLayer.layerClusterOriginalIdx[lc]);
305 result[thisLayer.clusterIndex[lc]].vertex_multiplicity().push_back(1);
307 for (
auto [follower_lyrIdx, follower_soaIdx] : thisLayer.followers[lc]) {
308 std::array<unsigned int, 2> edge = {
309 {(
unsigned int)thisLayer.layerClusterOriginalIdx[lc],
310 (
unsigned int)
clusters_[follower_lyrIdx].layerClusterOriginalIdx[follower_soaIdx]}};
311 result[thisLayer.clusterIndex[lc]].edges().push_back(edge);
318 std::remove_if(std::begin(
result),
326 input.layerClustersTime,
333 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Barycenter: " <<
t.barycenter();
334 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"LCs: " <<
t.vertices().size();
336 edm::LogVerbatim(
"PatternRecognitionbyCLUE3D") <<
"Regressed: " <<
t.regressed_energy();
Log< level::Info, true > LogVerbatim
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
const int minNumLayerCluster_
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)
std::vector< ClustersOnLayer > clusters_
void calculateDistanceToHigher(const TILES &, const int layerId, const std::vector< std::pair< int, int >> &)
static std::string const input
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
void assignPCAtoTracksters(std::vector< Trackster > &, const std::vector< reco::CaloCluster > &, const edm::ValueMap< std::pair< float, float >> &, double, bool energyWeight=true)
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 >> &)
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