299 BSPosition = recoBeamSpotHandle->position();
301 recoBeamSpotHandle->position().y(),
302 recoBeamSpotHandle->position().z());
307 if (
Muon.isValid()) {
310 std::sort(mymuons.begin(),mymuons.end(),
PtGreater());
311 nmuon = mymuons.size();
312 typedef reco::MuonCollection::const_iterator muiter;
314 for (muiter
i=mymuons.begin();
i!=mymuons.end();
i++)
328 if (
i->globalTrack().isNonnull())
331 muonD0[imu] =
i->globalTrack()->dxy(BSPosition);
338 if (
i->innerTrack().isNonnull())
muonNValidTrkHits[imu] =
i->innerTrack()->numberOfValidHits();
341 if (
i->isGlobalMuon()!=0)
muonNValidMuonHits[imu] =
i->globalTrack()->hitPattern().numberOfValidMuonHits();
350 myMucands1 = * MuCands1;
352 std::sort(myMucands1.begin(),myMucands1.end(),
PtGreater());
358 if (MuCands2.isValid()) {
360 myMucands2 = * MuCands2;
361 std::sort(myMucands2.begin(),myMucands2.end(),
PtGreater());
363 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
365 for (cand
i=myMucands2.begin();
i!=myMucands2.end();
i++) {
376 muonl2dr[imu2c] = fabs(tk->dxy(BSPosition));
381 muonl2dz[imu2c] = tk->dz(BSPosition);
385 muonl2nstat[imu2c] = tk->hitPattern().muonStationsWithAnyHits();
386 muonl2ndtcscstat[imu2c] = tk->hitPattern().dtStationsWithAnyHits() + tk->hitPattern().cscStationsWithAnyHits();
394 double l2_err0 = tk->error(0);
395 double l2_abspar0 = fabs(tk->parameter(0));
424 if (MuCands1.isValid()) {
425 typedef l1extra::L1MuonParticleCollection::const_iterator candl1;
426 for (candl1
j=myMucands1.begin();
j!=myMucands1.end();
j++) {
427 if((
j->pt() == l1->pt()) &&
428 (
j->eta() == l1->eta()) &&
429 (
j->phi() == l1->phi()) &&
430 (
j->gmtMuonCand().quality() == l1->gmtMuonCand().quality()))
437 else {imu1idx = -999;}
447 if (MuCands3.isValid()) {
449 myMucands3 = * MuCands3;
450 std::sort(myMucands3.begin(),myMucands3.end(),
PtGreater());
452 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
455 for (cand
i=myMucands3.begin();
i!=myMucands3.end();
i++) {
461 typedef reco::MuonTrackLinksCollection::const_iterator l3muon;
467 if (MuCands2.isValid()) {
468 typedef reco::RecoChargedCandidateCollection::const_iterator candl2;
469 for (candl2
i=myMucands2.begin();
i!=myMucands2.end();
i++) {
471 if ( tkl2 == staTrack ) {
break;}
475 else {imu2idx = -999;}
490 muonl3dr[imu3c] = fabs( (- (candref->vx()-BSPosition.x()) * candref->py() + (candref->vy()-BSPosition.y()) * candref->px() ) / candref->pt() );
492 muonl3globaldrsign[imu3c] = ( tk->dxyError() > 0. ? muonl3globaldr[imu3c] / tk->dxyError() : -999. );
496 muonl3dz[imu3c] = (candref->vz()-BSPosition.z()) - ((candref->vx()-BSPosition.x())*candref->px()+(candref->vy()-BSPosition.y())*candref->py())/candref->pt() * candref->pz()/candref->pt();
499 muonl3vtxz[imu3c] = candref->vz() - ( candref->vx()*candref->px() + candref->vy()*candref->py() )/candref->pt() * candref->pz()/candref->pt();
512 double l3_err0 = tk->error(0);
513 double l3_abspar0 = fabs(tk->parameter(0));
550 int imu3c2nd = imu3c + 1;
552 for (cand
j=
i;
j!=myMucands3.end();
j++)
if (
i!=
j) {
577 else {nmu3cand = 0;
nDiMu = 0;}
580 if (DiMuVtxCands3.isValid()) {
581 myDimuvtxcands3 = * DiMuVtxCands3;
583 typedef reco::VertexCollection::const_iterator cand;
585 for (cand ivtx = myDimuvtxcands3.begin(); ivtx != myDimuvtxcands3.end(); ++ivtx) {
594 if(fabs(
muonl3pt[
j] - vertextkRef2->pt()) < 0.0001 && fabs(
muonl3eta[
j] - vertextkRef2->eta()) < 0.0001 && fabs(
muonl3phi[
j] - vertextkRef2->phi()) < 0.0001) dimuvtx2nd[idimu3c] =
j;
597 vertextkRef1->py() + vertextkRef2->py(),
600 GlobalPoint vtxPos (vpoint.x(), vpoint.y(), vpoint.z());
602 GlobalError vtxErr (verr.At(0,0),verr.At(1,0),verr.At(1,1),verr.At(2,0),verr.At(2,1),verr.At(2,2));
603 GlobalPoint vtxDisFromBS(-1*((vtxBS.x0() - vtxPos.x()) + (vtxPos.z() - vtxBS.z0())*vtxBS.dxdz()),
604 -1*((vtxBS.y0() - vtxPos.y()) + (vtxPos.z() - vtxBS.z0())*vtxBS.dydz()), 0.0);
605 dimuvtxr[idimu3c] = vtxDisFromBS.perp();
612 float mu1ipsig = -1.0;
613 float mu2ipsig = -1.0;
639 if (MuNoVtxCands2.isValid()) {
640 muNoVtxMucands2 = * MuNoVtxCands2;
641 std::sort(muNoVtxMucands2.begin(),muNoVtxMucands2.end(),
PtGreater());
642 nmu2cand = muNoVtxMucands2.size();
643 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
645 for (cand
i=muNoVtxMucands2.begin();
i!=muNoVtxMucands2.end();
i++) {
657 muonl2novtxndtcscstat[imu2c] = tk->hitPattern().dtStationsWithAnyHits() + tk->hitPattern().cscStationsWithAnyHits();
659 double l2_err0 = tk->error(0);
660 double l2_abspar0 = fabs(tk->parameter(0));
671 if (MuCands1.isValid()) {
672 typedef l1extra::L1MuonParticleCollection::const_iterator candl1;
673 for (candl1
j=myMucands1.begin();
j!=myMucands1.end();
j++) {
674 if((
j->pt() == l1->pt()) &&
675 (
j->eta() == l1->eta()) &&
676 (
j->phi() == l1->phi()) &&
677 (
j->gmtMuonCand().quality() == l1->gmtMuonCand().quality()))
682 else {imu1idx = -999;}
694 if (oniaPixelCands.
isValid()) {
695 myOniaPixelCands = * oniaPixelCands;
696 std::sort(myOniaPixelCands.begin(),myOniaPixelCands.end(),
PtGreater());
698 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
700 for (cand
i=myOniaPixelCands.begin();
i!=myOniaPixelCands.end();
i++) {
715 else {nOniaPixelCand = 0;}
719 if (oniaTrackCands.
isValid()) {
720 myOniaTrackCands = * oniaTrackCands;
721 std::sort(myOniaTrackCands.begin(),myOniaTrackCands.end(),
PtGreater());
723 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
725 for (cand
i=myOniaTrackCands.begin();
i!=myOniaTrackCands.end();
i++) {
740 else {nOniaTrackCand = 0;}
746 for (
unsigned int i=0;
i<trkmucands->size(); ++
i ){
748 if (muon.isTrackerMuon()) {
753 if ( !muon.innerTrack().isNull() ){
765 if (pfMuon.isValid()) {
767 mypfmuons = * pfMuon;
768 std::sort(mypfmuons.begin(),mypfmuons.end(),
PtGreater());
770 typedef reco::PFCandidateCollection::const_iterator muiter;
772 for (muiter
i=mypfmuons.begin();
i!=mypfmuons.end();
i++)
int * muonl2novtxndtcscstat
float * oniaPixelNormChi2
const PerigeeTrajectoryError & perigeeError() const
float * muonl3globaldrsign
const FreeTrajectoryState & theState() const
Global3DPoint GlobalPoint
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
math::Error< dimension >::type Error
covariance error matrix (3x3)
std::vector< Vertex > VertexCollection
collection of Vertex objects
math::XYZPoint Point
point in the space
float * oniaTrackNormChi2
std::vector< Muon > MuonCollection
collection of Muon objects
Container::value_type value_type
const PerigeeTrajectoryParameters & perigeeParameters() const
double transverseImpactParameter() const
float * dimuvtxmu2dipsigmin
math::XYZPoint Point
point in the space
double transverseImpactParameterError() const
int validChambers(const reco::TrackRef &track)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
float * muonl2novtxdrsign
virtual bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb)
float * dimuvtxmu2dipsigmax
XYZVectorD XYZVector
spatial vector with cartesian internal representation
int * muonl2novtxnchambers
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
virtual float distance() const
virtual bool status() const