Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:07

0001 #ifndef DTCLUSTERER_H
0002 #define DTCLUSTERER_H
0003 
0004 /** \class DTClusterer
0005  *
0006  * Description:
0007  *  
0008  *  detailed description
0009  *
0010  * \author : Stefano Lacaprara - INFN LNL <stefano.lacaprara@pd.infn.it>
0011  *
0012  * Modification:
0013  *
0014  */
0015 
0016 /* Base Class Headers */
0017 #include "FWCore/Framework/interface/global/EDProducer.h"
0018 
0019 namespace edm {
0020   class ParameterSet;
0021   class Event;
0022   class EventSetup;
0023 }  // namespace edm
0024 
0025 /* Collaborating Class Declarations */
0026 #include "FWCore/Utilities/interface/InputTag.h"
0027 #include "DataFormats/DTRecHit/interface/DTSLRecCluster.h"
0028 #include "DataFormats/DTRecHit/interface/DTRecHit1DPair.h"
0029 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
0030 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0031 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0032 class DTSuperLayer;
0033 
0034 /* C++ Headers */
0035 #include <vector>
0036 #include <utility>
0037 
0038 /* ====================================================================== */
0039 
0040 /* Class DTClusterer Interface */
0041 
0042 class DTClusterer : public edm::global::EDProducer<> {
0043 public:
0044   /* Constructor */
0045   DTClusterer(const edm::ParameterSet&);
0046 
0047   /* Destructor */
0048   ~DTClusterer() override;
0049 
0050   /* Operations */
0051   void produce(edm::StreamID, edm::Event& event, const edm::EventSetup& setup) const override;
0052 
0053 private:
0054   // build clusters from hits
0055   std::vector<DTSLRecCluster> buildClusters(const DTSuperLayer* sl, std::vector<DTRecHit1DPair>& pairs) const;
0056 
0057   std::vector<std::pair<float, DTRecHit1DPair> > initHits(const DTSuperLayer* sl,
0058                                                           std::vector<DTRecHit1DPair>& pairs) const;
0059 
0060   unsigned int differentLayers(std::vector<DTRecHit1DPair>& hits) const;
0061 
0062 private:
0063   // to sort hits by x
0064   struct sortClusterByX {
0065     bool operator()(const std::pair<float, DTRecHit1DPair>& lhs, const std::pair<float, DTRecHit1DPair>& rhs) const {
0066       return lhs.first < rhs.first;
0067     }
0068   };
0069 
0070 private:
0071   // Switch on verbosity
0072   bool debug;
0073 
0074   unsigned int theMinHits;    // min number of hits to build a cluster
0075   unsigned int theMinLayers;  // min number of layers to build a cluster
0076   edm::EDGetTokenT<DTRecHitCollection> recHits1DToken_;
0077   edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0078 
0079 protected:
0080 };
0081 #endif  // DTCLUSTERER_H