|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ROIPHIRZCOLLECTION_H
6 #define ROIPHIRZCOLLECTION_H
22 inline double eta()
const {
25 return std::atanh(
Z / std::sqrt(
R*
R +
Z*
Z ) );
30 return std::atan2(1.,
Z /
R);
32 inline float phi()
const {
35 inline float r()
const {
38 inline float z()
const {
55 inline bool hasMatchingROI(
float phi,
double eta,
double r,
double z,
float roi_phi_width,
double roi_eta_width)
const {
65 float phi = global_position.phi();
67 float z = global_position.z();
68 float r = global_position.perp();
69 if ( std::abs(
phi) >
M_PI - roi_phi_width) {
70 constexpr
float pi_2 = 2*
M_PI;
71 float sign_phi_times_2_pi = std::copysign(pi_2,
phi);
74 this->emplace_back(
ROIPhiRZ{
phi - sign_phi_times_2_pi,
r,
z} );
85 const double R = roi.
r();
86 const double Z = roi.
z();
87 return std::atanh(
Z / std::sqrt(
R*
R +
Z*
Z ) );
90 return std::atan2(1., roi.
z() / roi.
r());
97 static inline double sqr(
double a) {
return a *
a; }
101 static inline double deltaEta(
const ROIPhiRZ &roi,
double other_r,
double other_z,
double other_eta) {
103 double newR = roi.
r() - other_r;
104 double newZ = roi.
z() - other_z;
105 double newEta = std::atanh( newZ / std::sqrt( newR*newR + newZ*newZ ) );
106 double delta_eta = std::abs(newEta - other_eta);
125 return std::upper_bound(
rois.begin(),
rois.end(),
phi-roi_phi_width, [](
float value,
const ROIPhiRZ &element) { return element.phi() >= value; } );
133 for (ROIPhiRZContainer::const_iterator roi_iter = start_roi_iter; roi_iter !=
rois.end() && roi_iter->phi() <
phi + roi_phi_width; ++roi_iter) {
134 if (
deltaEta(*roi_iter,
r,
z ,
eta) < roi_eta_width) {
return true; }
static bool hasMatchingROI(const ROIPhiRZContainer &rois, float phi, double eta, double r, double z, float roi_phi_width, double roi_eta_width)
container for phi sorted ROIs defined by phi, r and z.
static float phi(const ROIPhiRZ &roi)
bool hasMatchingROI(float phi, double eta, double r, double z, float roi_phi_width, double roi_eta_width) const
Test whether there is a matching ROI for the given phi and r,z corrected eta.
static ROIPhiRZContainer::const_iterator lowerPhiBound(const ROIPhiRZContainer &rois, float phi, float roi_phi_width)
Helper function to find the lower bound of ROIs which match |phi - ROI_phi| < ROI_width;.
static double eta(const ROIPhiRZ &roi)
const_iterator lowerPhiBound(float phi, float roi_phi_width) const
void addROI(const Amg::Vector3D &global_position, float roi_phi_width)
static double theta(const ROIPhiRZ &roi)
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
static bool order(const ROIPhiRZ &a, const ROIPhiRZ &b)
Helper function to order ROIs defined by phi,r,z by phi.
static double deltaEta(const ROIPhiRZ &roi, double other_r, double other_z, double other_eta)
Helper function to compute a z position corrected delta eta.
Eigen::Matrix< double, 3, 1 > Vector3D
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
static double sqr(double a)
macros to associate a CLID to a type