52 produces<edm::ValueMap<reco::MuonMETCorrectionData> > (
"muCorrData");
66 std::vector<std::string>
algos = iConfig.
getParameter<std::vector<std::string> >(
"trackAlgos");
79 algos = iConfig.
getParameter<std::vector<std::string> >(
"track_algos");
107 else if( rfType_ == 2 )
142 auto vm_muCorrData = std::make_unique<edm::ValueMap<reco::MuonMETCorrectionData>>();
144 std::vector<reco::MuonMETCorrectionData> v_muCorrData;
148 for (
unsigned int iMu = 0; iMu <
nMuons; iMu++) {
160 v_muCorrData.push_back( muMETCorrData );
167 if( mu_track->pt() <
minpt_ )
176 deltax = response * mu_track->p() *
sin( outerTrkPosition.Theta() ) *
cos( outerTrkPosition.Phi() );
177 deltay = response * mu_track->p() *
sin( outerTrkPosition.Theta() ) *
sin( outerTrkPosition.Phi() );
190 else v_muCorrData.push_back( muMETCorrData );
195 dataFiller.
insert(
muons_, v_muCorrData.begin(), v_muCorrData.end());
209 bool haveBeamSpot =
true;
219 if( siTrack.
isNonnull() ) nhits = siTrack->numberOfValidHits();
222 d0 = -1 * globalTrack->dxy( bspot );
223 chi2 = globalTrack->normalizedChi2();
226 if( fabs( d0 ) >
muond0_ )
return false;
235 if( siTrack->ptError() / siTrack->pt() >
muon_dptrel_ )
return false;
244 if( muon->
pt() < 10 )
return false;
249 if( !inputSiliconTrack.
isNonnull() )
return false;
253 for (
unsigned int iMu = 0; iMu <
nMuons; iMu++)
256 if( iMu == index )
continue;
261 if( !testSiliconTrack.
isNonnull() )
continue;
263 double deltaEta = inputSiliconTrack.
get()->eta() - testSiliconTrack.
get()->eta();
264 double deltaPhi = acos(
cos( inputSiliconTrack.
get()->phi() - testSiliconTrack.
get()->phi() ) );
265 double deltaR = TMath::Sqrt( deltaEta * deltaEta + deltaPhi * deltaPhi );
290 double dz = siTrack->dz( pvtx );
295 d0 = -1 * siTrack->dxy( pvtx );
300 bool haveBeamSpot =
true;
304 d0 = -1 * siTrack->dxy( bspot );
312 bool haveBeamSpot =
true;
316 d0 = -1 * siTrack->dxy( bspot );
326 if( fabs( d0 ) > d0cut )
return false;
335 if( (siTrack->ptError() / siTrack->pt()) >
maxPtErr_tight_ )
return false;
339 if( siTrack->numberOfValidHits() <
minhits_ )
return false;
340 if( siTrack->normalizedChi2() >
maxchi2_ )
return false;
341 if( fabs( siTrack->eta() ) >
maxeta_ )
return false;
342 if( siTrack->pt() >
maxpt_ )
return false;
343 if( (siTrack->ptError() / siTrack->pt()) >
maxPtErr_ )
return false;
344 if( fabs( siTrack->eta() ) > 2.5 && siTrack->pt() >
maxpt_eta25_ )
return false;
345 if( fabs( siTrack->eta() ) > 2.0 && siTrack->pt() >
maxpt_eta20_ )
return false;
353 if( !( (siTrack->qualityMask() &
cut) == cut ) )
return false;
355 bool isGoodAlgo =
false;
356 if(
trkAlgos_.empty() ) isGoodAlgo =
true;
359 if( siTrack->algo() ==
trkAlgos_.at(
i) ) isGoodAlgo =
true;
362 if( !isGoodAlgo )
return false;
371 TVector3 outerTrkPosition;
373 outerTrkPosition.SetPtEtaPhi( 999., -10., 2 *
TMath::Pi() );
379 return outerTrkPosition;
382 GlobalPoint tpVertex ( track->vx(), track->vy(), track->vz() );
384 int tpCharge ( track->charge() );
388 const double zdist = 314.;
390 const double radius = 130.;
392 const double corner = 1.479;
407 else if( fabs(track.
get()->eta()) < corner )
420 outerTrkPosition.SetPtEtaPhi( 999., -10., 2 *
TMath::Pi() );
422 return outerTrkPosition;
436 if(
vertices_->begin()->isFake() )
return false;
class TVector3 propagateTrack(const reco::Muon *)
T getParameter(std::string const &) const
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 eta() const final
momentum pseudorapidity
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
double pt() const final
transverse momentum
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)
int trackerLayersWithMeasurement() const
static const double deltaEta
bool isTrackerMuon() const override
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
std::vector< reco::TrackBase::TrackAlgorithm > trkAlgos_
bool isGlobalMuon() const override
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.
double deltaR(double eta1, double eta2, double phi1, double phi2)
T const * product() const
XYZPointD XYZPoint
point in space with cartesian internal representation
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
edm::Handle< reco::BeamSpot > beamSpot_
std::vector< int > trkQuality_
static TrackAlgorithm algoByName(const std::string &name)
const Point & position() const
position
bool isCaloMuon() const override
~MuonTCMETValueMapProducer() override
T const * product() const
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