Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:56

0001 #ifndef GEMRecHit_GEMSegmentAlgorithm_h
0002 #define GEMRecHit_GEMSegmentAlgorithm_h
0003 
0004 /**
0005  * \class GEMSegmentAlgorithm
0006  *
0007  * This algorithm is very basic no attemp to deal with ambiguities , noise etc.
0008  * The GEM track segments (actually more correct would be: GEM correlated hits)
0009  * is built out of the rechits in two GEM layers in GE1/1 or GE2/1
0010  * as the GEM Ensabmle .<BR>
0011  *
0012  *  \authors Piet Verwilligen 
0013  *  updated by Jason Lee to use general segment fitter, MuonSegFit
0014  */
0015 
0016 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0017 #include "RecoLocalMuon/GEMSegment/plugins/GEMSegmentAlgorithmBase.h"
0018 #include "DataFormats/GEMRecHit/interface/GEMRecHit.h"
0019 #include "FWCore/Utilities/interface/Exception.h"
0020 #include <deque>
0021 #include <vector>
0022 
0023 class MuonSegFit;
0024 
0025 class GEMSegmentAlgorithm : public GEMSegmentAlgorithmBase {
0026 public:
0027   /// Typedefs
0028   typedef std::vector<const GEMRecHit*> EnsembleHitContainer;
0029   typedef std::vector<EnsembleHitContainer> ProtoSegments;
0030 
0031   /// Constructor
0032   explicit GEMSegmentAlgorithm(const edm::ParameterSet& ps);
0033   /// Destructor
0034   ~GEMSegmentAlgorithm() override;
0035 
0036   /**
0037    * Build segments for all desired groups of hits
0038    */
0039   std::vector<GEMSegment> run(const GEMEnsemble& ensemble, const EnsembleHitContainer& rechits) override;
0040 
0041 private:
0042   /// Utility functions
0043 
0044   //  Build groups of rechits that are separated in x and y to save time on the segment finding
0045   ProtoSegments clusterHits(const GEMEnsemble& ensemble, const EnsembleHitContainer& rechits);
0046 
0047   // Build groups of rechits that are separated in strip numbers and Z to save time on the segment finding
0048   ProtoSegments chainHits(const GEMEnsemble& ensemble, const EnsembleHitContainer& rechits);
0049 
0050   bool isGoodToMerge(const GEMEnsemble& ensemble,
0051                      const EnsembleHitContainer& newChain,
0052                      const EnsembleHitContainer& oldChain);
0053 
0054   // Build track segments in this chamber (this is where the actual segment-building algorithm hides.)
0055   void buildSegments(const GEMEnsemble& ensemble,
0056                      const EnsembleHitContainer& rechits,
0057                      std::vector<GEMSegment>& gemsegs);
0058 
0059   // Member variables
0060   const std::string myName;
0061 
0062   // input from .cfi file
0063   bool debug;
0064   unsigned int minHitsPerSegment;
0065   bool preClustering;
0066   double dXclusBoxMax;
0067   double dYclusBoxMax;
0068   bool preClustering_useChaining;
0069   double dPhiChainBoxMax;
0070   double dEtaChainBoxMax;
0071   int maxRecHitsInCluster;
0072   bool clusterOnlySameBXRecHits;
0073 
0074   EnsembleHitContainer proto_segment;
0075   GEMDetId theChamberId;
0076 
0077   static constexpr float running_max = std::numeric_limits<float>::max();
0078   std::unique_ptr<MuonSegFit> sfit_;
0079 };
0080 
0081 #endif