50 produces<edm::ValueMap<reco::MuonMETCorrectionData> > (
"muCorrData");
131 std::vector<reco::MuonMETCorrectionData> v_muCorrData;
133 unsigned int nMuons =
muons_->size();
135 for (
unsigned int iMu = 0; iMu < nMuons; iMu++) {
147 v_muCorrData.push_back( muMETCorrData );
154 if( mu_track->pt() <
minpt_ )
163 deltax = response * mu_track->p() *
sin( outerTrkPosition.Theta() ) *
cos( outerTrkPosition.Phi() );
164 deltay = response * mu_track->p() *
sin( outerTrkPosition.Theta() ) *
sin( outerTrkPosition.Phi() );
177 else v_muCorrData.push_back( muMETCorrData );
182 dataFiller.
insert(
muons_, v_muCorrData.begin(), v_muCorrData.end());
185 iEvent.
put(vm_muCorrData,
"muCorrData");
212 bool haveBeamSpot =
true;
222 if( siTrack.
isNonnull() ) nhits = siTrack->numberOfValidHits();
225 d0 = -1 * globalTrack->dxy( bspot );
226 chi2 = globalTrack->normalizedChi2();
229 if( fabs( d0 ) >
muond0_ )
return false;
238 if( siTrack->ptError() / siTrack->pt() >
muon_dptrel_ )
return false;
247 if( muon->
pt() < 10 )
return false;
252 if( !inputSiliconTrack.
isNonnull() )
return false;
255 unsigned int nMuons =
muons_->size();
256 for (
unsigned int iMu = 0; iMu < nMuons; iMu++)
259 if( iMu == index )
continue;
264 if( !testSiliconTrack.
isNonnull() )
continue;
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 );
293 d0 = -1 * siTrack->dxy( pvtx );
295 double dz = siTrack->dz( pvtx );
300 d0 = -1 * siTrack->dxy( pvtx );
305 bool haveBeamSpot =
true;
309 d0 = -1 * siTrack->dxy( bspot );
317 bool haveBeamSpot =
true;
321 d0 = -1 * siTrack->dxy( bspot );
331 if( fabs( d0 ) > d0cut )
return false;
340 if( (siTrack->ptError() / siTrack->pt()) >
maxPtErr_tight_ )
return false;
344 if( siTrack->numberOfValidHits() <
minhits_ )
return false;
345 if( siTrack->normalizedChi2() >
maxchi2_ )
return false;
346 if( fabs( siTrack->eta() ) >
maxeta_ )
return false;
347 if( siTrack->pt() >
maxpt_ )
return false;
348 if( (siTrack->ptError() / siTrack->pt()) >
maxPtErr_ )
return false;
349 if( fabs( siTrack->eta() ) > 2.5 && siTrack->pt() >
maxpt_eta25_ )
return false;
350 if( fabs( siTrack->eta() ) > 2.0 && siTrack->pt() >
maxpt_eta20_ )
return false;
358 if( !( (siTrack->qualityMask() &
cut) == cut ) )
return false;
360 bool isGoodAlgo =
false;
361 if(
trkAlgos_.size() == 0 ) isGoodAlgo =
true;
364 if( siTrack->algo() ==
trkAlgos_.at(
i) ) isGoodAlgo =
true;
367 if( !isGoodAlgo )
return false;
376 TVector3 outerTrkPosition;
378 outerTrkPosition.SetPtEtaPhi( 999., -10., 2 *
TMath::Pi() );
384 return outerTrkPosition;
387 GlobalPoint tpVertex ( track->vx(), track->vy(), track->vz() );
389 int tpCharge ( track->charge() );
393 const double zdist = 314.;
395 const double radius = 130.;
397 const double corner = 1.479;
408 if( track.
get()->eta() < -corner )
410 tsos = myAP.propagate( fts, *lendcap);
412 else if( fabs(track.
get()->eta()) < corner )
414 tsos = myAP.propagate( fts, *barrel);
416 else if( track.
get()->eta() > corner )
418 tsos = myAP.propagate( fts, *rendcap);
425 outerTrkPosition.SetPtEtaPhi( 999., -10., 2 *
TMath::Pi() );
427 return outerTrkPosition;
441 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
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_
virtual void produce(edm::Event &, const edm::EventSetup &)
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