/////////////////////////////////////////////////////// // // File: MuonVariables01.cc // Author: Vladimir Rekovic // Date: 07/31/2001 // Revision: 0.0 // //////////////////////////////////////////////////////// #include "HighLevelObjects/MuonVariables.hh" #include "MuonObjects/CdfMuon.hh" #include "TrackingObjects/Tracks/CdfTrack.hh" #include "TrackingObjects/Storable/CdfTrackView.hh" namespace MuonVariables { // access momentum (COT only) HepPoint3D muoCotMomentum(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } //Check if parent track is CotStandAloneAlg return ((*tTrack).algorithm().value() == CdfTrack::CotStandAloneAlg ? tTrack->momentum() : 999); } // access Pt (COT only) double muoCotPt(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } //Check if parent track is CotStandAloneAlg return ((*tTrack).algorithm().value() == CdfTrack::CotStandAloneAlg ? tTrack->pt() : 999); } // access z0 (COT only) double muoCotZ0(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } // If parent track is COTStandAlone return z0, if not return 999 return ((tTrack->algorithm().value() == CdfTrack::CotStandAloneAlg) ? tTrack->z0() : 999); } // access d0 (COT only) double muoCotD0(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } // If parent track is COTStandAlone return d0, if not return 999 return ((tTrack->algorithm().value() == CdfTrack::CotStandAloneAlg) ? tTrack->d0() : 999); } // access phi0 (COT only) Angle muoCotPhi0(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } // If parent track is COTStandAlone return phi0, if not return 0.0 return ((tTrack->algorithm().value() == CdfTrack::CotStandAloneAlg) ? tTrack->phi0() : Angle(0.0)); } // acess ChiSquqred (COT only) double muoCotChiSquared(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } // If parent track is COTStandAlone return chiSquared, if not return 999 return ((tTrack->algorithm().value() == CdfTrack::CotStandAloneAlg) ? tTrack->chiSquared() : 999); } // access lambda (COUT only) double muoCotLambda(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } // If parent track is COTStandAlone return lambda, if not return 999 return ((tTrack->algorithm().value() == CdfTrack::CotStandAloneAlg) ? tTrack->lambda() : 999); } // access sigma of lambda (COT only) double muoCotSigmaLambda(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } // If parent track is COTStandAlone return sigmaLambda, if not return 999 return ((tTrack->algorithm().value() == CdfTrack::CotStandAloneAlg) ? tTrack->sigmaLambda() : 999); } // access curvature (COT only) double muoCotCurvature(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } // If parent track is COTStandAlone return curvature, if not return 999 return ((tTrack->algorithm().value() == CdfTrack::CotStandAloneAlg) ? tTrack->curvature() : 999); } // access sigma of curvature (COT only) double muoCotSigmaCurvature(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } // If parent track is COTStandAlone return sigmaCurvature, if not return 999 return ((tTrack->algorithm().value() == CdfTrack::CotStandAloneAlg) ? tTrack->sigmaCurvature() : 999); } // access charge (COT only) double muoCotCharge(const CdfMuon& muonObject) { // Find the track from which bestTrack was derived, i.e. parent CdfTrack_clnk tTrack = muonObject.bestTrack(); while(! tTrack->parent().is_null()) { tTrack = tTrack->parent(); } // If parent track is COTStandAlone return curvature, if not return 999 return ((tTrack->algorithm().value() == CdfTrack::CotStandAloneAlg) ? tTrack->charge() : 999); } }