Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:36:46

0001 #ifndef L1Trigger_DTTriggerPhase2_MuonPathAnalyzerInChamber_h
0002 #define L1Trigger_DTTriggerPhase2_MuonPathAnalyzerInChamber_h
0003 
0004 #include "L1Trigger/DTTriggerPhase2/interface/MuonPathAnalyzer.h"
0005 
0006 // ===============================================================================
0007 // Previous definitions and declarations
0008 // ===============================================================================
0009 namespace {
0010   typedef std::array<cmsdt::LATERAL_CASES, cmsdt::NUM_LAYERS_2SL> TLateralities;
0011 }  // namespace
0012 // ===============================================================================
0013 // Class declarations
0014 // ===============================================================================
0015 
0016 class MuonPathAnalyzerInChamber : public MuonPathAnalyzer {
0017 public:
0018   // Constructors and destructor
0019   MuonPathAnalyzerInChamber(const edm::ParameterSet &pset,
0020                             edm::ConsumesCollector &iC,
0021                             std::shared_ptr<GlobalCoordsObtainer> &globalcoordsobtainer);
0022   ~MuonPathAnalyzerInChamber() override;
0023 
0024   // Main methods
0025   void initialise(const edm::EventSetup &iEventSetup) override;
0026   void run(edm::Event &iEvent,
0027            const edm::EventSetup &iEventSetup,
0028            MuonPathPtrs &inMpath,
0029            std::vector<cmsdt::metaPrimitive> &metaPrimitives) override {};
0030   void run(edm::Event &iEvent,
0031            const edm::EventSetup &iEventSetup,
0032            MuonPathPtrs &inMpath,
0033            std::vector<lat_vector> &lateralities,
0034            std::vector<cmsdt::metaPrimitive> &metaPrimitives) override {};
0035   void run(edm::Event &iEvent,
0036            const edm::EventSetup &iEventSetup,
0037            std::vector<cmsdt::metaPrimitive> &inMPaths,
0038            std::vector<cmsdt::metaPrimitive> &outMPaths) override {};
0039   void run(edm::Event &iEvent,
0040            const edm::EventSetup &iEventSetup,
0041            MuonPathPtrs &inMpath,
0042            MuonPathPtrs &outMPath) override;
0043 
0044   void finish() override;
0045 
0046   // Other public methods
0047   void setBxTolerance(int t) { bxTolerance_ = t; };
0048   void setMinHits4Fit(int h) { minHits4Fit_ = h; };
0049   void setChiSquareThreshold(float ch2Thr) { chiSquareThreshold_ = ch2Thr; };
0050   void setMinimumQuality(cmsdt::MP_QUALITY q) {
0051     if (minQuality_ >= cmsdt::LOWQ)
0052       minQuality_ = q;
0053   };
0054 
0055   int bxTolerance(void) { return bxTolerance_; };
0056   int minHits4Fit(void) { return minHits4Fit_; };
0057   cmsdt::MP_QUALITY minQuality(void) { return minQuality_; };
0058 
0059   bool hasPosRF(int wh, int sec) { return wh > 0 || (wh == 0 && sec % 4 > 1); };
0060 
0061   // Public attributes
0062   DTGeometry const *dtGeo_;
0063   edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomH;
0064 
0065   //shift
0066   std::map<int, float> shiftinfo_;
0067 
0068 private:
0069   // Private methods
0070   void analyze(MuonPathPtr &inMPath, MuonPathPtrs &outMPaths);
0071 
0072   void setCellLayout(MuonPathPtr &mpath);
0073   void buildLateralities(MuonPathPtr &mpath);
0074   void setLateralitiesInMP(MuonPathPtr &mpath, TLateralities lat);
0075   void setWirePosAndTimeInMP(MuonPathPtr &mpath);
0076   void calculateFitParameters(MuonPathPtr &mpath,
0077                               TLateralities lat,
0078                               int present_layer[cmsdt::NUM_LAYERS_2SL],
0079                               int &lat_added);
0080 
0081   void evaluateQuality(MuonPathPtr &mPath);
0082   int totalNumValLateralities_;
0083   std::vector<TLateralities> lateralities_;
0084   std::vector<cmsdt::LATQ_TYPE> latQuality_;
0085 
0086   const bool debug_;
0087   double chi2Th_;
0088   edm::FileInPath shift_filename_;
0089   int bxTolerance_;
0090   cmsdt::MP_QUALITY minQuality_;
0091   float chiSquareThreshold_;
0092   short minHits4Fit_;
0093   int cellLayout_[cmsdt::NUM_LAYERS_2SL];
0094   bool splitPathPerSL_;
0095 
0096   // global coordinates
0097   std::shared_ptr<GlobalCoordsObtainer> globalcoordsobtainer_;
0098 };
0099 
0100 #endif