Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef LayerWithHits_H
0002 #define LayerWithHits_H
0003 
0004 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0005 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
0006 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
0007 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
0008 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0009 #include "DataFormats/Common/interface/DetSetAlgorithm.h"
0010 #include "TrackingTools/DetLayers/interface/DetLayer.h"
0011 
0012 class LayerWithHits {
0013 public:
0014   LayerWithHits(const DetLayer* dl, const std::vector<const TrackingRecHit*>& theInputHits)
0015       : theDetLayer(dl), theHits(theInputHits) {}
0016 
0017   /// Usage:
0018   ///  edm::ESHandle<TrackerTopology> httopo;
0019   ///  iSetup.get<TrackerTopologyRcd>().get(httopo);
0020   ///  const TrackerTopology& ttopo = *httopo;
0021   ///  LayerWithHits( theLayer, collrphi, ttopo.tibDetIdLayerComparator(1) );
0022   template <typename DSTV, typename SEL>
0023   LayerWithHits(const DetLayer* dl, DSTV const& allhits, SEL const& sel) {
0024     theDetLayer = dl;
0025     edmNew::copyDetSetRange(allhits, theHits, sel);
0026   }
0027 
0028   //destructor
0029   ~LayerWithHits() {}
0030 
0031   /// return the recHits of the Layer
0032   const std::vector<const TrackingRecHit*>& recHits() const { return theHits; }
0033 
0034   //detlayer
0035   const DetLayer* layer() const { return theDetLayer; }
0036 
0037 private:
0038   const DetLayer* theDetLayer;
0039   std::vector<const TrackingRecHit*> theHits;
0040 };
0041 #endif