Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:09:39

0001 #ifndef DTOccupancyClusterBuilder_H
0002 #define DTOccupancyClusterBuilder_H
0003 
0004 /** \class DTOccupancyClusterBuilder
0005  *  Build clusters of layer occupancies (DTOccupancyCluster) to spot problematic layers.
0006  *  It's used by DTOccupancyTest.
0007  *
0008  *  \author G. Cerminara - INFN Torino
0009  */
0010 
0011 #include "DTOccupancyPoint.h"
0012 #include "DTOccupancyCluster.h"
0013 
0014 #include <set>
0015 #include <map>
0016 #include <vector>
0017 #include <string>
0018 
0019 class DTOccupancyClusterBuilder {
0020 public:
0021   /// Constructor
0022   DTOccupancyClusterBuilder();
0023 
0024   /// Destructor
0025   virtual ~DTOccupancyClusterBuilder();
0026 
0027   // Operations
0028   /// Add an occupancy point for a given layer
0029   void addPoint(const DTOccupancyPoint& point);
0030 
0031   /// build the clusters
0032   void buildClusters();
0033 
0034   /// draw a TH2F histograms showing the clusters
0035   void drawClusters(std::string canvasName);
0036 
0037   /// get the cluster correspondig to "normal" cell occupancy.
0038   DTOccupancyCluster getBestCluster() const;
0039 
0040   bool isProblematic(DTLayerId layerId) const;
0041 
0042 protected:
0043 private:
0044   std::pair<DTOccupancyPoint, DTOccupancyPoint> getInitialPair();
0045 
0046   void computePointToPointDistances();
0047 
0048   void computeDistancesToCluster(const DTOccupancyCluster& cluster);
0049 
0050   bool buildNewCluster();
0051 
0052   void sortClusters();
0053 
0054   std::set<DTOccupancyPoint> thePoints;
0055   std::map<double, std::pair<DTOccupancyPoint, DTOccupancyPoint> > theDistances;
0056   std::map<double, DTOccupancyPoint> theDistancesFromTheCluster;
0057   std::vector<DTOccupancyCluster> theClusters;
0058   std::set<DTLayerId> theProblematicLayers;
0059 
0060   double maxMean;
0061   double maxRMS;
0062 };
0063 
0064 #endif