Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:31

0001 #ifndef TrackingTools_DetLayers_RBorderFinder_H
0002 #define TrackingTools_DetLayers_RBorderFinder_H
0003 
0004 /** \class RBorderFinder
0005  *  Find the R binning of a list of detector according to several 
0006  *  definitions.
0007  *
0008  *  \author N. Amapane - INFN Torino
0009  */
0010 
0011 #include <DataFormats/GeometrySurface/interface/BoundingBox.h>
0012 #include <DataFormats/GeometrySurface/interface/GeometricSorting.h>
0013 
0014 #include <Utilities/General/interface/precomputed_value_sort.h>
0015 #include <Geometry/CommonDetUnit/interface/GeomDet.h>
0016 #include <TrackingTools/DetLayers/interface/ForwardDetRing.h>
0017 #include <TrackingTools/DetLayers/interface/simple_stat.h>
0018 #include <FWCore/Utilities/interface/Exception.h>
0019 
0020 #include <vector>
0021 
0022 class RBorderFinder {
0023 public:
0024   typedef ForwardDetRing Det;  //FIXME!!!
0025   typedef geomsort::ExtractR<Det, float> DetR;
0026 
0027   RBorderFinder(const std::vector<const Det*>& utheDets);
0028 
0029   virtual ~RBorderFinder(){};
0030 
0031   /// Returns true if the Dets are periodic in R.
0032   inline bool isRPeriodic() const { return isRPeriodic_; }
0033 
0034   /// Returns true if any 2 of the Det overlap in R.
0035   inline bool isROverlapping() const { return isROverlapping_; }
0036 
0037   /// The borders, defined for each det as the middle between its lower
0038   /// edge and the previous Det's upper edge.
0039   inline std::vector<double> RBorders() const { return theRBorders; }
0040 
0041   /// The centers of the Dets.
0042   inline std::vector<double> RBins() const { return theRBins; }
0043 
0044   //  inline std::vector<double> etaBorders() {}
0045   //  inline std::vector<double> zBorders() {}
0046 
0047 private:
0048   int theNbins;
0049   bool isRPeriodic_;
0050   bool isROverlapping_;
0051   std::vector<double> theRBorders;
0052   std::vector<double> theRBins;
0053 
0054   inline int binIndex(int i) const { return std::min(std::max(i, 0), theNbins - 1); }
0055 };
0056 #endif