Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:56

0001 #ifndef RecoLocalTracker_FTLClusterizer_MTDThresholdClusterizer_H
0002 #define RecoLocalTracker_FTLClusterizer_MTDThresholdClusterizer_H
0003 
0004 //-----------------------------------------------------------------------
0005 //! \class MTDThresholdClusterizer
0006 //! \brief An explicit threshold-based clustering algorithm.
0007 //!
0008 //! A threshold-based clustering algorithm which clusters FTLRecHits
0009 //! into FTLClusters for each DetUnit.  The algorithm is straightforward
0010 //! and purely topological: the clustering process starts with seed hits
0011 //! and continues by adding adjacent hits above the hit threshold.
0012 //! Once the cluster is made, it has to be above the cluster threshold as
0013 //! well.
0014 //!
0015 //! The clusterization is performed on a matrix with size
0016 //! equal to the size of the MTD detector, each cell containing
0017 //! the cahrge and time of the corresponding hit
0018 //! The matrix is reset after each clusterization.
0019 //!
0020 //! The search starts from seed hits, i.e. hits with sufficiently
0021 //! large amplitudes
0022 //!
0023 //! FTLCluster contains a barycenter, but it should be noted that that
0024 //! information is largely useless.  One must use a PositionEstimator
0025 //! class to compute the RecHit position and its error for every given
0026 //! cluster.
0027 //!
0028 //! Sets the MTDArrayBuffer dimensions and pixel thresholds.
0029 //! Makes clusters and stores them in theCache if the option
0030 //! useCache has been set.
0031 //-----------------------------------------------------------------------
0032 
0033 // Base class, defines FTLRecHit and FLTCluster.  The latter includes
0034 // FTLHit, FTLHitPos and Shift as inner classes.
0035 //
0036 #include "RecoLocalFastTime/FTLClusterizer/interface/MTDClusterizerBase.h"
0037 
0038 // The private pixel buffer
0039 #include "MTDArrayBuffer.h"
0040 
0041 // Parameter Set:
0042 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0043 
0044 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0045 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0046 
0047 #include <vector>
0048 
0049 #include "Geometry/MTDGeometryBuilder/interface/MTDGeometry.h"
0050 
0051 class MTDThresholdClusterizer : public MTDClusterizerBase {
0052 public:
0053   MTDThresholdClusterizer(edm::ParameterSet const& conf);
0054   ~MTDThresholdClusterizer() override;
0055 
0056   // Full I/O in DetSet
0057   void clusterize(const FTLRecHitCollection& input,
0058                   const MTDGeometry* geom,
0059                   const MTDTopology* topo,
0060                   FTLClusterCollection& output) override;
0061 
0062   static void fillPSetDescription(edm::ParameterSetDescription& desc);
0063 
0064 private:
0065   std::vector<FTLCluster::FTLHitPos> theSeeds;  // cached seed pixels
0066   std::vector<FTLCluster> theClusters;          // resulting clusters
0067 
0068   //! Clustering-related quantities:
0069   const float theHitThreshold;       // Hit threshold
0070   const float theSeedThreshold;      // MTD cluster seed
0071   const float theClusterThreshold;   // Cluster threshold
0072   const float theTimeThreshold;      // Time compatibility between new hit and seed
0073   const float thePositionThreshold;  // Position threshold between new hit and seed
0074 
0075   //! Geometry-related information
0076   int theNumOfRows;
0077   int theNumOfCols;
0078 
0079   DetId theCurrentId;
0080 
0081   //! Data storage
0082   MTDArrayBuffer theBuffer;  // internal nrow * ncol matrix
0083   bool bufferAlreadySet;     // status of the buffer array
0084 
0085   bool setup(const MTDGeometry* geometry, const MTDTopology* topo, const DetId& id);
0086   void copy_to_buffer(RecHitIterator itr, const MTDGeometry* geom, const MTDTopology* topo);
0087   void clear_buffer(RecHitIterator itr);
0088   FTLCluster make_cluster(const FTLCluster::FTLHitPos& hit);
0089 };
0090 
0091 #endif