47 produces<edm::ValueMap<reco::MuonMETCorrectionData>>(
"muCorrData");
61 std::vector<std::string>
algos = iConfig.
getParameter<std::vector<std::string>>(
"trackAlgos");
108 magFieldToken_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
132 auto vm_muCorrData = std::make_unique<edm::ValueMap<reco::MuonMETCorrectionData>>();
134 std::vector<reco::MuonMETCorrectionData> v_muCorrData;
138 for (
unsigned int iMu = 0; iMu <
nMuons; iMu++) {
146 if (
mu->isGlobalMuon() ||
mu->isTrackerMuon() ||
mu->isCaloMuon())
147 mu_track =
mu->innerTrack();
149 v_muCorrData.push_back(muMETCorrData);
155 if (mu_track->pt() <
minpt_)
164 deltax = response * mu_track->p() *
sin(outerTrkPosition.Theta()) *
cos(outerTrkPosition.Phi());
165 deltay = response * mu_track->p() *
sin(outerTrkPosition.Theta()) *
sin(outerTrkPosition.Phi());
173 v_muCorrData.push_back(
177 v_muCorrData.push_back(
181 v_muCorrData.push_back(muMETCorrData);
186 dataFiller.
insert(
muons_, v_muCorrData.begin(), v_muCorrData.end());
199 bool haveBeamSpot =
true;
201 haveBeamSpot =
false;
213 nhits = siTrack->numberOfValidHits();
256 for (
unsigned int iMu = 0; iMu <
nMuons; iMu++) {
266 double deltaEta = inputSiliconTrack.
get()->eta() - testSiliconTrack.
get()->eta();
267 double deltaPhi = acos(
cos(inputSiliconTrack.
get()->phi() - testSiliconTrack.
get()->phi()));
290 double dz = siTrack->dz(pvtx);
294 d0 = -1 * siTrack->dxy(pvtx);
298 bool haveBeamSpot =
true;
300 haveBeamSpot =
false;
303 d0 = -1 * siTrack->dxy(bspot);
307 bool haveBeamSpot =
true;
309 haveBeamSpot =
false;
312 d0 = -1 * siTrack->dxy(bspot);
322 if (fabs(
d0) > d0cut)
339 if (siTrack->numberOfValidHits() <
minhits_)
341 if (siTrack->normalizedChi2() >
maxchi2_)
343 if (fabs(siTrack->eta()) >
maxeta_)
345 if (siTrack->pt() >
maxpt_)
347 if ((siTrack->ptError() / siTrack->pt()) >
maxPtErr_)
349 if (fabs(siTrack->eta()) > 2.5 && siTrack->pt() >
maxpt_eta25_)
351 if (fabs(siTrack->eta()) > 2.0 && siTrack->pt() >
maxpt_eta20_)
359 if (!((siTrack->qualityMask() &
cut) ==
cut))
362 bool isGoodAlgo =
false;
378 TVector3 outerTrkPosition;
380 outerTrkPosition.SetPtEtaPhi(999., -10., 2 *
TMath::Pi());
384 if (!
track.isNonnull()) {
385 return outerTrkPosition;
390 int tpCharge(
track->charge());
394 const double zdist = 314.;
396 const double radius = 130.;
398 const double corner = 1.479;
422 outerTrkPosition.SetPtEtaPhi(999., -10., 2 *
TMath::Pi());
424 return outerTrkPosition;
430 return p.trackerLayersWithMeasurement();
class TVector3 propagateTrack(const reco::Muon *)
edm::Handle< reco::VertexCollection > vertexHandle_
T getParameter(std::string const &) const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
MuonTCMETValueMapProducer(const edm::ParameterSet &)
std::vector< reco::TrackBase::TrackAlgorithm > trackAlgos_
const Point & position() const
position
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
class TH2D * response_function
Sin< T >::type sin(const T &t)
const reco::VertexCollection * vertices_
T const * product() const
void insert(const H &h, I begin, I end)
void produce(edm::Event &, const edm::EventSetup &) override
bool isNonnull() const
Checks for non-null.
const class MagneticField * bField
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool isGoodMuon(const reco::Muon *)
bool isGoodCaloMuon(const reco::Muon *, const unsigned int)
int nLayers(const reco::TrackRef)
static const double deltaEta
static PlanePointer build(Args &&... args)
std::vector< reco::TrackBase::TrackAlgorithm > trkAlgos_
T const * product() const
GlobalPoint globalPosition() const
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Cos< T >::type cos(const T &t)
edm::Handle< reco::MuonCollection > muons_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Namespace of DDCMS conversion namespace.
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
static constexpr float d0
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::Handle< reco::BeamSpot > beamSpot_
Structure Point Contains parameters of Gaussian fits to DMRs.
std::vector< int > trkQuality_
T const * get() const
Returns C++ pointer to the item.
static TrackAlgorithm algoByName(const std::string &name)
~MuonTCMETValueMapProducer() override
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Power< A, B >::type pow(const A &a, const B &b)
bool isGoodTrack(const reco::Muon *)