50 produces<edm::ValueMap<reco::MuonMETCorrectionData> > (
"muCorrData");
99 else if( rfType_ == 2 )
136 std::vector<reco::MuonMETCorrectionData> v_muCorrData;
138 unsigned int nMuons =
muons_->size();
140 for (
unsigned int iMu = 0; iMu < nMuons; iMu++) {
152 v_muCorrData.push_back( muMETCorrData );
159 if( mu_track->pt() <
minpt_ )
168 deltax = response * mu_track->p() *
sin( outerTrkPosition.Theta() ) *
cos( outerTrkPosition.Phi() );
169 deltay = response * mu_track->p() *
sin( outerTrkPosition.Theta() ) *
sin( outerTrkPosition.Phi() );
182 else v_muCorrData.push_back( muMETCorrData );
187 dataFiller.
insert(
muons_, v_muCorrData.begin(), v_muCorrData.end());
190 iEvent.
put(vm_muCorrData,
"muCorrData");
201 bool haveBeamSpot =
true;
211 if( siTrack.
isNonnull() ) nhits = siTrack->numberOfValidHits();
214 d0 = -1 * globalTrack->dxy( bspot );
215 chi2 = globalTrack->normalizedChi2();
218 if( fabs( d0 ) >
muond0_ )
return false;
227 if( siTrack->ptError() / siTrack->pt() >
muon_dptrel_ )
return false;
236 if( muon->
pt() < 10 )
return false;
241 if( !inputSiliconTrack.
isNonnull() )
return false;
244 unsigned int nMuons =
muons_->size();
245 for (
unsigned int iMu = 0; iMu < nMuons; iMu++)
248 if( iMu == index )
continue;
253 if( !testSiliconTrack.
isNonnull() )
continue;
255 double deltaEta = inputSiliconTrack.
get()->eta() - testSiliconTrack.
get()->eta();
256 double deltaPhi = acos(
cos( inputSiliconTrack.
get()->phi() - testSiliconTrack.
get()->phi() ) );
257 double deltaR = TMath::Sqrt( deltaEta * deltaEta + deltaPhi * deltaPhi );
282 d0 = -1 * siTrack->dxy( pvtx );
284 double dz = siTrack->dz( pvtx );
289 d0 = -1 * siTrack->dxy( pvtx );
294 bool haveBeamSpot =
true;
298 d0 = -1 * siTrack->dxy( bspot );
306 bool haveBeamSpot =
true;
310 d0 = -1 * siTrack->dxy( bspot );
320 if( fabs( d0 ) > d0cut )
return false;
329 if( (siTrack->ptError() / siTrack->pt()) >
maxPtErr_tight_ )
return false;
333 if( siTrack->numberOfValidHits() <
minhits_ )
return false;
334 if( siTrack->normalizedChi2() >
maxchi2_ )
return false;
335 if( fabs( siTrack->eta() ) >
maxeta_ )
return false;
336 if( siTrack->pt() >
maxpt_ )
return false;
337 if( (siTrack->ptError() / siTrack->pt()) >
maxPtErr_ )
return false;
338 if( fabs( siTrack->eta() ) > 2.5 && siTrack->pt() >
maxpt_eta25_ )
return false;
339 if( fabs( siTrack->eta() ) > 2.0 && siTrack->pt() >
maxpt_eta20_ )
return false;
347 if( !( (siTrack->qualityMask() &
cut) == cut ) )
return false;
349 bool isGoodAlgo =
false;
350 if(
trkAlgos_.size() == 0 ) isGoodAlgo =
true;
353 if( siTrack->algo() ==
trkAlgos_.at(
i) ) isGoodAlgo =
true;
356 if( !isGoodAlgo )
return false;
365 TVector3 outerTrkPosition;
367 outerTrkPosition.SetPtEtaPhi( 999., -10., 2 *
TMath::Pi() );
373 return outerTrkPosition;
376 GlobalPoint tpVertex ( track->vx(), track->vy(), track->vz() );
378 int tpCharge ( track->charge() );
382 const double zdist = 314.;
384 const double radius = 130.;
386 const double corner = 1.479;
397 if( track.
get()->eta() < -corner )
399 tsos = myAP.propagate( fts, *lendcap);
401 else if( fabs(track.
get()->eta()) < corner )
403 tsos = myAP.propagate( fts, *barrel);
405 else if( track.
get()->eta() > corner )
407 tsos = myAP.propagate( fts, *rendcap);
414 outerTrkPosition.SetPtEtaPhi( 999., -10., 2 *
TMath::Pi() );
416 return outerTrkPosition;
430 if(
vertices_->begin()->isFake() )
return false;
class TVector3 propagateTrack(const reco::Muon *)
TkRotation< Scalar > RotationType
T getParameter(std::string const &) const
edm::Handle< reco::VertexCollection > vertexHandle_
MuonTCMETValueMapProducer(const edm::ParameterSet &)
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool isTrackerMuon() 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)
bool isGlobalMuon() const
virtual void produce(edm::Event &, const edm::EventSetup &) override
GlobalPoint globalPosition() const
std::vector< int > trkAlgos_
bool isGoodMuon(const reco::Muon *)
bool isGoodCaloMuon(const reco::Muon *, const unsigned int)
int nLayers(const reco::TrackRef)
Point3DBase< Scalar, GlobalTag > PositionType
bool isNonnull() const
Checks for non-null.
~MuonTCMETValueMapProducer()
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
int trackerLayersWithMeasurement() const
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
static PlanePointer build(Args &&...args)
Cos< T >::type cos(const T &t)
edm::Handle< reco::MuonCollection > muons_
class MagneticField * bField
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
double deltaR(double eta1, double eta2, double phi1, double phi2)
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
T const * product() const
edm::Handle< reco::BeamSpot > beamSpot_
std::vector< int > trkQuality_
T const * get() const
Returns C++ pointer to the item.
virtual float pt() const GCC11_FINAL
transverse momentum
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Power< A, B >::type pow(const A &a, const B &b)
bool isGoodTrack(const reco::Muon *)
tuple AnalyticalPropagator
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector