Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:11

0001 #ifndef TkPhase2OTMeasurementDet_H
0002 #define TkPhase2OTMeasurementDet_H
0003 
0004 #include "TrackingTools/MeasurementDet/interface/MeasurementDet.h"
0005 #include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h"
0006 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0007 #include "DataFormats/Common/interface/Handle.h"
0008 #include "DataFormats/Common/interface/DetSetVector.h"
0009 #include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h"
0010 #include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h"
0011 #include "RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h"
0012 
0013 class TrackingRecHit;
0014 class LocalTrajectoryParameters;
0015 
0016 class dso_hidden TkPhase2OTMeasurementDet final : public MeasurementDet {
0017 public:
0018   typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D> Phase2TrackerCluster1DRef;
0019 
0020   typedef edmNew::DetSet<Phase2TrackerCluster1D> detset;
0021   typedef detset::const_iterator const_iterator;
0022   typedef ClusterParameterEstimator<Phase2TrackerCluster1D>::LocalValues LocalValues;
0023 
0024   TkPhase2OTMeasurementDet(const GeomDet* gdet, Phase2OTMeasurementConditionSet& conditionSet);
0025 
0026   void update(Phase2OTMeasurementDetSet& data, const detset& detSet) {
0027     data.update(index(), detSet);
0028     data.setActiveThisEvent(index(), true);
0029   }
0030 
0031   void setEmpty(Phase2OTMeasurementDetSet& data) { data.setEmpty(index()); }
0032   bool isEmpty(const Phase2OTMeasurementDetSet& data) const { return data.empty(index()); }
0033 
0034   ~TkPhase2OTMeasurementDet() override {}
0035 
0036   RecHitContainer recHits(const TrajectoryStateOnSurface&, const MeasurementTrackerEvent& dat) const override;
0037   bool recHits(const TrajectoryStateOnSurface& stateOnThisDet,
0038                const MeasurementEstimator&,
0039                const MeasurementTrackerEvent& data,
0040                RecHitContainer& result,
0041                std::vector<float>&) const override;
0042 
0043   // simple hits
0044   bool recHits(SimpleHitContainer& result,
0045                const TrajectoryStateOnSurface& stateOnThisDet,
0046                const MeasurementEstimator&,
0047                const MeasurementTrackerEvent& data) const override {
0048     assert("not implemented for Pixel yet" == nullptr);
0049   }
0050 
0051   bool measurements(const TrajectoryStateOnSurface& stateOnThisDet,
0052                     const MeasurementEstimator& est,
0053                     const MeasurementTrackerEvent& dat,
0054                     TempMeasurements& result) const override;
0055 
0056   const PixelGeomDetUnit& specificGeomDet() const { return static_cast<PixelGeomDetUnit const&>(fastGeomDet()); }
0057 
0058   TrackingRecHit::RecHitPointer buildRecHit(const Phase2TrackerCluster1DRef& cluster,
0059                                             const LocalTrajectoryParameters& ltp) const;
0060 
0061   /** \brief Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually). */
0062   void setActive(bool active) { conditionSet().setActive(index(), active); }
0063   /** \brief Turn on/off the module for reconstruction for one events.
0064              This per-event flag is cleared by any call to 'update' or 'setEmpty'  */
0065   void setActiveThisEvent(Phase2OTMeasurementDetSet& data, bool active) const {
0066     data.setActiveThisEvent(index(), active);
0067   }
0068   /** \brief Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'. */
0069   bool isActive(const MeasurementTrackerEvent& data) const override { return data.phase2OTData().isActive(index()); }
0070 
0071   bool hasBadComponents(const TrajectoryStateOnSurface& tsos, const MeasurementTrackerEvent& dat) const override;
0072 
0073   //FIXME:just temporary solution for phase2!
0074   /** \brief Sets the list of bad ROCs, identified by the positions of their centers in the local coordinate frame*/
0075   //  void setBadRocPositions(std::vector< LocalPoint > & positions) { badRocPositions_.swap(positions); }
0076   /** \brief Clear the list of bad ROCs */
0077   //  void clearBadRocPositions() { badRocPositions_.clear(); }
0078 
0079   int index() const { return index_; }
0080   void setIndex(int i) { index_ = i; }
0081 
0082 private:
0083   //  std::vector< LocalPoint > badRocPositions_;
0084 
0085   int index_;
0086   Phase2OTMeasurementConditionSet* theDetConditions;
0087   Phase2OTMeasurementConditionSet& conditionSet() { return *theDetConditions; }
0088   const Phase2OTMeasurementConditionSet& conditionSet() const { return *theDetConditions; }
0089 
0090   const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe() const { return conditionSet().cpe(); }
0091 };
0092 
0093 #endif