File indexing completed on 2024-04-06 12:19:45
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
0029
0030
0031
0032
0033
0034
0035 class MuonPathAssociator {
0036 public:
0037
0038 MuonPathAssociator(const edm::ParameterSet &pset,
0039 edm::ConsumesCollector &iC,
0040 std::shared_ptr<GlobalCoordsObtainer> &globalcoordsobtainer);
0041 ~MuonPathAssociator();
0042
0043
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
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
0065 DTGeometry const *dtGeo_;
0066 edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomH_;
0067
0068 private:
0069
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
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
0088 edm::FileInPath shift_filename_;
0089 std::map<int, float> shiftinfo_;
0090
0091
0092 std::shared_ptr<GlobalCoordsObtainer> globalcoordsobtainer_;
0093 };
0094
0095 #endif