Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:17

0001 #include "RecoMuon/TrackerSeedGenerator/interface/L1MuonRegionProducer.h"
0002 
0003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0004 #include "RecoTracker/TkTrackingRegions/interface/RectangularEtaPhiTrackingRegion.h"
0005 #include "RecoTracker/TkTrackingRegions/interface/GlobalTrackingRegion.h"
0006 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTCand.h"
0007 #include "RecoMuon/TrackerSeedGenerator/interface/L1MuonPixelTrackFitter.h"
0008 #include "MagneticField/Engine/interface/MagneticField.h"
0009 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0010 #include "RecoTracker/Record/interface/TrackerMultipleScatteringRecord.h"
0011 #include "RecoTracker/TkMSParametrization/interface/MultipleScatteringParametrisationMaker.h"
0012 
0013 using namespace std;
0014 
0015 L1MuonRegionProducer::L1MuonRegionProducer(const edm::ParameterSet& cfg, edm::ConsumesCollector iC)
0016     : theFieldToken(iC.esConsumes()), theMSMakerToken(iC.esConsumes()) {
0017   edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
0018 
0019   thePtMin = regionPSet.getParameter<double>("ptMin");
0020   theOriginRadius = regionPSet.getParameter<double>("originRadius");
0021   theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
0022   theOrigin = GlobalPoint(regionPSet.getParameter<double>("originXPos"),
0023                           regionPSet.getParameter<double>("originYPos"),
0024                           regionPSet.getParameter<double>("originZPos"));
0025 }
0026 
0027 void L1MuonRegionProducer::setL1Constraint(const L1MuGMTCand& muon) {
0028   thePhiL1 = muon.phiValue() + 0.021817;
0029   theEtaL1 = muon.etaValue();
0030   theChargeL1 = muon.charge();
0031 }
0032 
0033 std::vector<std::unique_ptr<TrackingRegion> > L1MuonRegionProducer::regions(const edm::EventSetup& iSetup) const {
0034   const auto& field = iSetup.getData(theFieldToken);
0035   const auto& msmaker = iSetup.getData(theMSMakerToken);
0036   double dx = cos(thePhiL1);
0037   double dy = sin(thePhiL1);
0038   double dz = sinh(theEtaL1);
0039   GlobalVector direction(dx, dy, dz);  // muon direction
0040 
0041   std::vector<std::unique_ptr<TrackingRegion> > result;
0042   double bending = L1MuonPixelTrackFitter::getBending(1. / thePtMin, theEtaL1, theChargeL1);
0043   bending = fabs(bending);
0044   double errBending = L1MuonPixelTrackFitter::getBendingError(1. / thePtMin, theEtaL1);
0045 
0046   result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
0047                                                                      theOrigin,
0048                                                                      thePtMin,
0049                                                                      theOriginRadius,
0050                                                                      theOriginHalfLength,
0051                                                                      0.15,
0052                                                                      bending + 3 * errBending,
0053                                                                      field,
0054                                                                      &msmaker));
0055 
0056   return result;
0057 }