Skip to content

Commit

Permalink
Add the method thetaMax() for HCal phi-row segmentation needed for SW…
Browse files Browse the repository at this point in the history
… clustering
  • Loading branch information
Archil Durglishvili committed Nov 30, 2024
1 parent 8cc31d8 commit e752b14
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,19 @@ namespace dd4hep {
*/
std::array<double, 2> cellTheta(const CellID& cID) const;

/** Get the vector of cell indexes in a give layer.
/** Get the vector of cell indexes in a given layer.
*/
inline std::vector<int> cellIndexes(const uint layer) const {
if(m_radii.empty()) calculateLayerRadii();
if(!m_cellIndexes.empty()) return m_cellIndexes[layer];
else return std::vector<int>();
}

/** Get the thetaMax needed for SW clustering
* return max theta value of the detector
*/
double thetaMax() const;

/** Get the min and max layer indexes of each HCal part.
* For Endcap, returns the three elements vector, while for Barrel - single element vector.
*/
Expand Down
27 changes: 27 additions & 0 deletions detectorSegmentations/src/FCCSWHCalPhiRow_k4geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,5 +602,32 @@ std::array<double, 2> FCCSWHCalPhiRow_k4geo::cellTheta(const CellID& cID) const
return cTheta;
}

/// determine maximum theta value of the detector. This is used by SW clustering
double FCCSWHCalPhiRow_k4geo::thetaMax() const {
std::vector<std::pair<uint,uint> > minMaxLayerId(getMinMaxLayerId());
if(minMaxLayerId.empty()) return 0.;

// get the first layerId in the Barrel or in the last part of the Endcap
uint layer = minMaxLayerId[minMaxLayerId.size()-1].first;

if(m_radii.empty()) calculateLayerRadii();
if(m_cellEdges.empty()) return 0;

// get the last cell index (which is in the positive-z side)
int idx = abs(m_cellIndexes[layer].back());

// get the z-coordinate of the right-hand edge of the last cell
double zhigh = m_cellEdges[layer][idx].second;

// get the inner radius of the first layer
double Rmin = m_radii[layer] - 0.5*m_layerDepth[layer];

// calculate the minimum theta of the last cell in the first layer -> this is the minimum theta of the detector (Barrel or Endcap)
double thetaMin = std::atan2(Rmin,zhigh); // theta min

return (M_PI - thetaMin); // theta max
}


}
}

0 comments on commit e752b14

Please sign in to comment.