Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-12 01:51:33

0001 #ifndef Phase2L1Trigger_DTTrigger_MuonPathAssociator_h
0002 #define Phase2L1Trigger_DTTrigger_MuonPathAssociator_h
0003 
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006 #include "FWCore/Framework/interface/Run.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "FWCore/Framework/interface/FrameworkfwdMostUsed.h"
0009 
0010 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0011 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0012 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
0013 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0014 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
0015 
0016 #include "L1Trigger/DTTriggerPhase2/interface/MuonPath.h"
0017 #include "L1Trigger/DTTriggerPhase2/interface/constants.h"
0018 #include "L1Trigger/DTTriggerPhase2/interface/GlobalCoordsObtainer.h"
0019 
0020 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0021 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0022 #include "Geometry/DTGeometry/interface/DTLayer.h"
0023 
0024 #include <iostream>
0025 #include <fstream>
0026 
0027 // ===============================================================================
0028 // Previous definitions and declarations
0029 // ===============================================================================
0030 
0031 // ===============================================================================
0032 // Class declarations
0033 // ===============================================================================
0034 
0035 class MuonPathAssociator {
0036 public:
0037   // Constructors and destructor
0038   MuonPathAssociator(const edm::ParameterSet &pset,
0039                      edm::ConsumesCollector &iC,
0040                      std::shared_ptr<GlobalCoordsObtainer> &globalcoordsobtainer);
0041   ~MuonPathAssociator();
0042 
0043   // Main methods
0044   void initialise(const edm::EventSetup &iEventSetup);
0045   void run(edm::Event &iEvent,
0046            const edm::EventSetup &iEventSetup,
0047            edm::Handle<DTDigiCollection> digis,
0048            std::vector<cmsdt::metaPrimitive> &inMPaths,
0049            std::vector<cmsdt::metaPrimitive> &outMPaths);
0050 
0051   void finish();
0052 
0053   // Other public methods
0054 
0055   bool shareFit(cmsdt::metaPrimitive first, cmsdt::metaPrimitive second);
0056   bool isNotAPrimo(cmsdt::metaPrimitive first, cmsdt::metaPrimitive second);
0057   void removeSharingFits(std::vector<cmsdt::metaPrimitive> &chamberMPaths,
0058                          std::vector<cmsdt::metaPrimitive> &allMPaths);
0059   void removeSharingHits(std::vector<cmsdt::metaPrimitive> &firstMPaths,
0060                          std::vector<cmsdt::metaPrimitive> &secondMPaths,
0061                          std::vector<cmsdt::metaPrimitive> &allMPaths);
0062   void printmPC(cmsdt::metaPrimitive mP);
0063 
0064   // Public attributes
0065   DTGeometry const *dtGeo_;
0066   edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomH_;
0067 
0068 private:
0069   // Private methods
0070   void correlateMPaths(edm::Handle<DTDigiCollection> digis,
0071                        std::vector<cmsdt::metaPrimitive> &inMPaths,
0072                        std::vector<cmsdt::metaPrimitive> &outMPaths);
0073 
0074   bool hasPosRF(int wh, int sec) { return wh > 0 || (wh == 0 && sec % 4 > 1); }
0075 
0076   // Private attributes
0077   const bool debug_;
0078   bool clean_chi2_correlation_;
0079   bool useBX_correlation_;
0080   bool allow_confirmation_;
0081   double dT0_correlate_TP_;
0082   double dBX_correlate_TP_;
0083   double dTanPsi_correlate_TP_;
0084   double minx_match_2digis_;
0085   double chi2corTh_;
0086 
0087   //shift
0088   edm::FileInPath shift_filename_;
0089   std::map<int, float> shiftinfo_;
0090 
0091   // global coordinates
0092   std::shared_ptr<GlobalCoordsObtainer> globalcoordsobtainer_;
0093 };
0094 
0095 #endif