47 produces<edm::ValueMap<reco::MuonMETCorrectionData>>(
"muCorrData");
61 std::vector<std::string>
algos = iConfig.
getParameter<std::vector<std::string>>(
"trackAlgos");
74 algos = iConfig.
getParameter<std::vector<std::string>>(
"track_algos");
102 else if (rfType_ == 2)
108 magFieldToken_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
132 auto vm_muCorrData = std::make_unique<edm::ValueMap<reco::MuonMETCorrectionData>>();
134 std::vector<reco::MuonMETCorrectionData> v_muCorrData;
136 unsigned int nMuons =
muons_->size();
138 for (
unsigned int iMu = 0; iMu < nMuons; iMu++) {
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();
215 d0 = -1 * globalTrack->dxy(bspot);
216 chi2 = globalTrack->normalizedChi2();
255 unsigned int nMuons =
muons_->size();
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()));
268 double deltaR = TMath::Sqrt(deltaEta * deltaEta + deltaPhi * deltaPhi);
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());
385 return outerTrkPosition;
388 GlobalPoint tpVertex(track->vx(), track->vy(), track->vz());
390 int tpCharge(track->charge());
394 const double zdist = 314.;
396 const double radius = 130.;
398 const double corner = 1.479;
410 if (track.
get()->eta() < -corner) {
412 }
else if (fabs(track.
get()->eta()) < corner) {
414 }
else if (track.
get()->eta() > corner) {
422 outerTrkPosition.SetPtEtaPhi(999., -10., 2 *
TMath::Pi());
424 return outerTrkPosition;
class TVector3 propagateTrack(const reco::Muon *)
edm::Handle< reco::VertexCollection > vertexHandle_
MuonTCMETValueMapProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isNonnull() const
Checks for non-null.
std::vector< reco::TrackBase::TrackAlgorithm > trackAlgos_
double pt() const final
transverse momentum
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
class TH2D * response_function
Sin< T >::type sin(const T &t)
const reco::VertexCollection * vertices_
void insert(const H &h, I begin, I end)
void produce(edm::Event &, const edm::EventSetup &) override
GlobalPoint globalPosition() const
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)
int trackerLayersWithMeasurement() const
static const double deltaEta
bool isTrackerMuon() const override
bool isCaloMuon() const override
std::vector< reco::TrackBase::TrackAlgorithm > trkAlgos_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
static PlanePointer build(Args &&...args)
Cos< T >::type cos(const T &t)
edm::Handle< reco::MuonCollection > muons_
T const * get() const
Returns C++ pointer to the item.
class MagneticField * bField
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
static constexpr float d0
T const * product() const
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
T getParameter(std::string const &) const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
edm::Handle< reco::BeamSpot > beamSpot_
Structure Point Contains parameters of Gaussian fits to DMRs.
std::vector< int > trkQuality_
static TrackAlgorithm algoByName(const std::string &name)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
~MuonTCMETValueMapProducer() override
bool isGlobalMuon() const override
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Power< A, B >::type pow(const A &a, const B &b)
bool isGoodTrack(const reco::Muon *)
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
double eta() const final
momentum pseudorapidity