Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef TrackAssociator_CaloDetIdAssociator_h
0002 #define TrackAssociator_CaloDetIdAssociator_h 1
0003 // -*- C++ -*-
0004 //
0005 // Package:    TrackAssociator
0006 // Class:      CaloDetIdAssociator
0007 //
0008 /*
0009 
0010  Description: <one line class summary>
0011 
0012  Implementation:
0013      <Notes on implementation>
0014 */
0015 //
0016 // Original Author:  Dmytro Kovalskyi
0017 //         Created:  Fri Apr 21 10:59:41 PDT 2006
0018 //
0019 //
0020 
0021 #include "TrackingTools/TrackAssociator/interface/DetIdAssociator.h"
0022 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0023 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0024 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
0025 #include "DataFormats/DetId/interface/DetId.h"
0026 
0027 class CaloDetIdAssociator : public DetIdAssociator {
0028 public:
0029   CaloDetIdAssociator() : DetIdAssociator(72, 70, 0.087), geometry_(nullptr){};
0030   CaloDetIdAssociator(const int nPhi, const int nEta, const double etaBinSize, CaloGeometry const* geom)
0031       : DetIdAssociator(nPhi, nEta, etaBinSize), geometry_(geom){};
0032 
0033   const GeomDet* getGeomDet(const DetId& id) const override { return nullptr; };
0034 
0035   const char* name() const override { return "CaloTowers"; }
0036 
0037 protected:
0038   void check_setup() const override;
0039 
0040   GlobalPoint getPosition(const DetId& id) const override;
0041 
0042   void getValidDetIds(unsigned int subDetectorIndex, std::vector<DetId>&) const override;
0043 
0044   std::pair<const_iterator, const_iterator> getDetIdPoints(const DetId& id,
0045                                                            std::vector<GlobalPoint>& points) const override;
0046 
0047   bool insideElement(const GlobalPoint& point, const DetId& id) const override {
0048     return geometry_->getSubdetectorGeometry(id)->getGeometry(id)->inside(point);
0049   };
0050 
0051   bool crossedElement(const GlobalPoint&,
0052                       const GlobalPoint&,
0053                       const DetId& id,
0054                       const double tolerance = -1,
0055                       const SteppingHelixStateInfo* = nullptr) const override;
0056   const CaloGeometry* geometry_;
0057   std::vector<GlobalPoint> dummy_;
0058 };
0059 #endif