File indexing completed on 2024-04-06 12:31:27
0001 #ifndef TrackingTools_DetLayers_PhiBorderFinder_H
0002 #define TrackingTools_DetLayers_PhiBorderFinder_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <Geometry/CommonDetUnit/interface/GeomDet.h>
0012
0013 #include <DataFormats/GeometrySurface/interface/BoundingBox.h>
0014 #include <DataFormats/GeometrySurface/interface/GeometricSorting.h>
0015
0016 #include <DataFormats/GeometryVector/interface/Pi.h>
0017 #include <Utilities/General/interface/precomputed_value_sort.h>
0018 #include <TrackingTools/DetLayers/interface/simple_stat.h>
0019 #include <TrackingTools/DetLayers/interface/DetRod.h>
0020 #include <FWCore/Utilities/interface/Exception.h>
0021
0022
0023 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0024
0025 #include <vector>
0026
0027 class PhiBorderFinder {
0028 public:
0029 typedef DetRod Det;
0030 typedef geomsort::ExtractPhi<Det, float> DetPhi;
0031
0032 PhiBorderFinder(const std::vector<const Det*>& utheDets);
0033
0034 virtual ~PhiBorderFinder(){};
0035
0036 inline unsigned int nBins() { return theNbins; }
0037
0038
0039 inline bool isPhiPeriodic() const { return isPhiPeriodic_; }
0040
0041
0042 inline bool isPhiOverlapping() const { return isPhiOverlapping_; }
0043
0044
0045
0046 inline const std::vector<double>& phiBorders() const { return thePhiBorders; }
0047
0048
0049 inline const std::vector<double>& phiBins() const { return thePhiBins; }
0050
0051
0052
0053
0054 private:
0055 unsigned int theNbins;
0056 bool isPhiPeriodic_;
0057 bool isPhiOverlapping_;
0058 std::vector<double> thePhiBorders;
0059 std::vector<double> thePhiBins;
0060
0061 inline double positiveRange(double phi) const { return (phi > 0) ? phi : phi + Geom::twoPi(); }
0062
0063 int binIndex(int i) const {
0064 int ind = i % (int)theNbins;
0065 return (ind < 0) ? ind + theNbins : ind;
0066 }
0067 };
0068 #endif