Skip to content

Commit

Permalink
Added check of d1 > d_curv1 for small encap modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerio Pia committed Feb 7, 2025
1 parent 478c28d commit 1090f5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/SANDClustering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ void updateCluster(const dg_cell& incomplete_cell, double distance,
double x;
double y;
if (isbarrel == 0) {
x = -999;
x = -99999;
y = incomplete_cell.y;
} else {
x = incomplete_cell.x;
y = -999;
y = -99999;
}

reco_cell reco_cell_from_incomplete = {incomplete_cell.id, incomplete_cell.z,
Expand Down Expand Up @@ -750,6 +750,7 @@ cluster Create_cluster(const SANDGeoManager* sand_geo, std::vector<dg_cell> cell
d1 = sand_geo->compute_cell_d1(cell_info.length(), cell.ps1.at(0).tdc, cell.ps2.at(0).tdc);
d2 = sand_geo->compute_cell_d2(cell_info.length(), cell.ps1.at(0).tdc, cell.ps2.at(0).tdc);

std::cout << d1 << " " << d2 << " " << cell_info.length() << std::endl;
double cell_E = sand_reco::ecal::reco::EfromADC(
cell.ps1.at(0).adc, cell.ps2.at(0).adc, d1, d2, cell.lay);

Expand Down
15 changes: 7 additions & 8 deletions src/SANDGeoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,13 @@ int SANDGeoManager::get_endcap_hit_pos(const double& d1,
const auto sec_angle = (d_curv1 - d1) / cell_rad;
local[1] = -0.5 * ec_mod.l_vert() - cell_rad * std::cos(sec_angle);
local[2] = -ec_mod.mod_dz() + ec_mod.rmax() - cell_rad * std::sin(sec_angle);
} else if (d1 > d_curv1 && d1 <= d_hor1 && ec_mod.n_sections() == 5) {
local[1] = -0.5 * ec_mod.l_vert() - ec_mod.rmax() + depth;
local[2] = -ec_mod.mod_dz() + ec_mod.rmax() + ec_mod.l_hor() - (d_hor1 - d1);
} else {
reco_x = -999999;
reco_y = -999999;
reco_z = -999999;
return -999;
} else if (d1 > d_curv1) {
if (ec_mod.n_sections() == 5 && d1 <= d_hor1) {
local[1] = -0.5 * ec_mod.l_vert() - ec_mod.rmax() + depth;
local[2] = -ec_mod.mod_dz() + ec_mod.rmax() + ec_mod.l_hor() - (d_hor1 - d1);
} else {
return -999;
}
}

geo_->LocalToMaster(local, master);
Expand Down

0 comments on commit 1090f5a

Please sign in to comment.