Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef GEMRecHit_ME0SegmentAlgorithm_h
0002 #define GEMRecHit_ME0SegmentAlgorithm_h
0003 
0004 /**
0005  * \class ME0SegmentAlgorithm
0006  *
0007  * This algorithm is very basic no attemp to deal with ambiguities , noise etc.
0008  * The ME0 track segments is built out of the rechit's in a the 6 ME0 Layer denoted
0009  * as the ME0 Ensabmle .<BR>
0010  *
0011  *  \authors Marcello Maggi 
0012  *
0013  */
0014 
0015 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0016 #include "RecoLocalMuon/GEMSegment/plugins/ME0SegmentAlgorithmBase.h"
0017 #include "DataFormats/GEMRecHit/interface/ME0RecHit.h"
0018 
0019 #include <deque>
0020 #include <vector>
0021 
0022 class MuonSegFit;
0023 
0024 class ME0SegmentAlgorithm : public ME0SegmentAlgorithmBase {
0025 public:
0026   /// Typedefs
0027   typedef std::vector<HitAndPositionPtrContainer> ProtoSegments;
0028 
0029   /// Constructor
0030   explicit ME0SegmentAlgorithm(const edm::ParameterSet& ps);
0031   /// Destructor
0032   ~ME0SegmentAlgorithm() override;
0033 
0034   /**
0035    * Build segments for all desired groups of hits
0036    */
0037   std::vector<ME0Segment> run(const ME0Chamber* chamber, const HitAndPositionContainer& rechits) override;
0038 
0039 private:
0040   /// Utility functions
0041 
0042   //  Build groups of rechits that are separated in x and y to save time on the segment finding
0043   ProtoSegments clusterHits(const HitAndPositionContainer& rechits);
0044 
0045   // Build groups of rechits that are separated in strip numbers and Z to save time on the segment finding
0046   ProtoSegments chainHits(const ME0Chamber* chamber, const HitAndPositionContainer& rechits);
0047 
0048   bool isGoodToMerge(const ME0Chamber* chamber,
0049                      const HitAndPositionPtrContainer& newChain,
0050                      const HitAndPositionPtrContainer& oldChain);
0051 
0052   // Build track segments in this chamber (this is where the actual segment-building algorithm hides.)
0053   void buildSegments(const ME0Chamber* chamber,
0054                      const HitAndPositionPtrContainer& rechits,
0055                      std::vector<ME0Segment>& me0segs);
0056 
0057   // Member variables
0058   const std::string myName;
0059 
0060   // input from .cfi file
0061   bool debug;
0062   unsigned int minHitsPerSegment;
0063   bool preClustering;
0064   double dXclusBoxMax;
0065   double dYclusBoxMax;
0066   bool preClustering_useChaining;
0067   double dPhiChainBoxMax;
0068   double dEtaChainBoxMax;
0069   double dTimeChainBoxMax;
0070   int maxRecHitsInCluster;
0071 
0072   static constexpr float running_max = std::numeric_limits<float>::max();
0073   std::unique_ptr<MuonSegFit> sfit_;
0074 };
0075 
0076 #endif