Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RecoLocalTracker_SiPixelClusterizer_SiPixelClusterProducer_h
0002 #define RecoLocalTracker_SiPixelClusterizer_SiPixelClusterProducer_h
0003 
0004 //---------------------------------------------------------------------------
0005 //! \class SiPixelClusterProducer
0006 //!
0007 //! \brief EDProducer to cluster PixelDigis into SiPixelClusters.
0008 //!
0009 //! SiPixelClusterProducer is an EDProducer subclass (i.e., a module)
0010 //! which orchestrates clustering of PixelDigis to SiPixelClusters.
0011 //! Consequently, the input is edm::DetSetVector<PixelDigi> and the output is
0012 //! edm::DetSetVector<SiPixelCluster>.
0013 //!
0014 //! SiPixelClusterProducer invokes one of descendents from PixelClusterizerBase,
0015 //! e.g. PixelThresholdClusterizer (which is the only available option
0016 //! right now).  SiPixelClusterProducer loads the PixelDigis,
0017 //! and then iterates over DetIds, invoking PixelClusterizer's clusterizeDetUnit
0018 //! to perform the clustering.  clusterizeDetUnit() returns a DetSetVector of
0019 //! SiPixelClusters, which are then recorded in the event.
0020 //!
0021 //! The calibrations are not loaded at the moment (v1), although that is
0022 //! being planned for the near future.
0023 //!
0024 //! \author porting from ORCA by Petar Maksimovic (JHU).
0025 //!         DetSetVector implementation by Vincenzo Chiochia (Uni Zurich)
0026 //!         Modify the local container (cache) to improve the speed. D.K. 5/07
0027 //! \version v1, Oct 26, 2005
0028 //!
0029 //---------------------------------------------------------------------------
0030 
0031 #include "PixelClusterizerBase.h"
0032 
0033 //#include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0034 
0035 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0036 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0037 
0038 #include "DataFormats/Common/interface/DetSetVector.h"
0039 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0040 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
0041 #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
0042 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0043 
0044 #include "FWCore/Framework/interface/stream/EDProducer.h"
0045 #include "FWCore/Framework/interface/Event.h"
0046 #include "FWCore/Framework/interface/EventSetup.h"
0047 #include "DataFormats/Common/interface/Handle.h"
0048 #include "FWCore/Framework/interface/ESHandle.h"
0049 
0050 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0051 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0052 #include "FWCore/Utilities/interface/InputTag.h"
0053 
0054 class dso_hidden SiPixelClusterProducer final : public edm::stream::EDProducer<> {
0055 public:
0056   //--- Constructor, virtual destructor (just in case)
0057   explicit SiPixelClusterProducer(const edm::ParameterSet& conf);
0058   ~SiPixelClusterProducer() override;
0059 
0060   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0061 
0062   void setupClusterizer(const edm::ParameterSet& conf);
0063 
0064   //--- The top-level event method.
0065   void produce(edm::Event& e, const edm::EventSetup& c) override;
0066 
0067   //--- Execute the algorithm(s).
0068   template <typename T>
0069   void run(const T& input, const edm::ESHandle<TrackerGeometry>& geom, edmNew::DetSetVector<SiPixelCluster>& output);
0070 
0071 private:
0072   edm::EDGetTokenT<SiPixelClusterCollectionNew> tPixelClusters;
0073   edm::EDGetTokenT<edm::DetSetVector<PixelDigi>> tPixelDigi;
0074   edm::EDPutTokenT<SiPixelClusterCollectionNew> tPutPixelClusters;
0075   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopoToken_;
0076   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeomToken_;
0077   // TO DO: maybe allow a map of pointers?
0078   std::unique_ptr<SiPixelGainCalibrationServiceBase> theSiPixelGainCalibration_;
0079   const std::string clusterMode_;                      // user's choice of the clusterizer
0080   std::unique_ptr<PixelClusterizerBase> clusterizer_;  // what we got (for now, one ptr to base class)
0081   const TrackerTopology* tTopo_;                       // needed to get correct layer number
0082 
0083   //! Optional limit on the total number of clusters
0084   const int32_t maxTotalClusters_;
0085 };
0086 
0087 #endif