Skip to content

Commit

Permalink
HcalEndcapPInsertImagingProtoClusters: use a larger hit spacing thres…
Browse files Browse the repository at this point in the history
…hold (#1595)

### Briefly, what does this PR introduce?
Uses a larger threshold for the distance between the neighboring hits in
the insert, due to the new cell size. Also include "side" field (ie,
left vs right) in the hit merger algorithm

### What kind of change does this PR introduce?
- [ ] Bug fix (issue #__)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [X] Other: change of parameters

### Please check if this PR fulfills the following:
- [X] Tests for the changes have been added
- [X] Documentation has been added / updated
- [X] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
Probably. Including the detector "side" as a field in the hit merger
algorithm probably breaks the code if using a version of the epic
repository from before pull request eic/epic#771
is merged. Therefore this pull request and
eic/epic#771 should be merged at the same time
as one another
### Does this PR change default behavior?
yes. Changes the parameters of the topo clustering and also uses the
"side" field in the hit merger.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
  • Loading branch information
3 people authored Aug 27, 2024
1 parent ea4b742 commit d2aa992
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/detectors/FHCAL/FHCAL.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2023 Friederike Bock, Wouter Deconinck

#include <DD4hep/Detector.h>
#include <Evaluator/DD4hepUnits.h>
#include <JANA/JApplication.h>
#include <TString.h>
#include <math.h>
#include <algorithm>
#include <gsl/pointers>
#include <memory>
#include <stdexcept>
#include <string>

#include "algorithms/calorimetry/CalorimeterHitDigiConfig.h"
Expand All @@ -18,6 +23,7 @@
#include "factories/calorimetry/CalorimeterTruthClustering_factory.h"
#include "factories/calorimetry/HEXPLIT_factory.h"
#include "factories/calorimetry/ImagingTopoCluster_factory.h"
#include "services/geometry/dd4hep/DD4hep_service.h"

extern "C" {
void InitPlugin(JApplication *app) {
Expand Down Expand Up @@ -89,13 +95,20 @@ extern "C" {
app // TODO: Remove me once fixed
));

double side_length=18.89 * dd4hep::mm;
// define the distance between neighbors in terms of the largest possible distance between subcell hits
auto detector = app->GetService<DD4hep_service>()->detector();
double side_length;
try {
side_length = std::max({detector->constant<double>("HcalEndcapPInsertCellSizeLGRight"), detector->constant<double>("HcalEndcapPInsertCellSizeLGLeft")});
} catch (std::runtime_error&) {
side_length = 31. * dd4hep::mm;
}
app->Add(new JOmniFactoryGeneratorT<ImagingTopoCluster_factory>(
"HcalEndcapPInsertImagingProtoClusters", {"HcalEndcapPInsertSubcellHits"}, {"HcalEndcapPInsertImagingProtoClusters"},
{
.neighbourLayersRange = 1,
.localDistXY = {0.76*side_length, 0.76*side_length*sin(M_PI/3)},
.layerDistXY = {0.76*side_length, 0.76*side_length*sin(M_PI/3)},
.localDistXY = {0.5*side_length, 0.5*side_length*sin(M_PI/3)},
.layerDistXY = {0.25*side_length, 0.25*side_length*sin(M_PI/3)},
.layerMode = eicrecon::ImagingTopoClusterConfig::ELayerMode::xy,
.sectorDist = 10.0 * dd4hep::cm,
.minClusterHitEdep = 5.0 * dd4hep::keV,
Expand Down

0 comments on commit d2aa992

Please sign in to comment.