CMS 3D CMS Logo

MuIsoDepositVetos.cc

Go to the documentation of this file.
00001 #define USE_MUISODEPOSIT_REQUIRED 1
00002 #include "DataFormats/MuonReco/interface/MuIsoDepositVetos.h"
00003 #include "DataFormats/MuonReco/interface/Direction.h"
00004 
00005 #include <cmath>
00006 #include <iostream>
00007 
00008 using namespace std;
00009 using namespace reco::muisodeposit;
00010 
00011 bool ConeVeto::veto(double eta, double phi, float value) const {
00012   return ( vetoDir_.deltaR2(Direction(eta,phi)) < dR2_ );
00013 }
00014 void ConeVeto::centerOn(double eta, double phi) { 
00015         vetoDir_ = Direction(eta,phi);
00016 }
00018 
00019 bool ThresholdVeto::veto(double eta, double phi, float value) const {
00020     return (value <= threshold_);
00021 }
00022 void ThresholdVeto::centerOn(double eta, double phi) { }
00023 
00025 
00026 bool ConeThresholdVeto::veto(double eta, double phi, float value) const {
00027   return (value <= threshold_) || ( vetoDir_.deltaR2(Direction(eta,phi)) < dR2_ );
00028 }
00029 void ConeThresholdVeto::centerOn(double eta, double phi) { 
00030         vetoDir_ = Direction(eta,phi);
00031 }
00032 
00034 
00035 AngleConeVeto::AngleConeVeto(math::XYZVectorD dir, double angle) : vetoDir_(dir.Unit()), cosTheta_(cos(angle)) {
00036 }
00037 AngleConeVeto::AngleConeVeto(Direction dir, double angle) : vetoDir_(0,0,1), cosTheta_(cos(angle)) {
00038     vetoDir_ = math::RhoEtaPhiVectorD(1, dir.eta(), dir.phi()).Unit(); 
00039 }
00040 bool AngleConeVeto::veto(double eta, double phi, float value) const {
00041     math::RhoEtaPhiVectorD tmp(1, eta, phi); 
00042     return ( vetoDir_.Dot(tmp.Unit()) > cosTheta_ );
00043 }
00044 void AngleConeVeto::centerOn(double eta, double phi) { 
00045         vetoDir_ = math::RhoEtaPhiVectorD(1, eta, phi).Unit(); 
00046 }
00047 
00049 
00050 AngleCone::AngleCone(math::XYZVectorD dir, double angle) : coneDir_(dir.Unit()), cosTheta_(cos(angle)) {
00051 }
00052 AngleCone::AngleCone(Direction dir, double angle) : coneDir_(0,0,1), cosTheta_(cos(angle)) {
00053     coneDir_ = math::RhoEtaPhiVectorD(1, dir.eta(), dir.phi()).Unit(); 
00054 }
00055 bool AngleCone::veto(double eta, double phi, float value) const {
00056     math::RhoEtaPhiVectorD tmp(1, eta, phi); 
00057     return ( coneDir_.Dot(tmp.Unit()) < cosTheta_ );
00058 }
00059 void AngleCone::centerOn(double eta, double phi) { 
00060         coneDir_ = math::RhoEtaPhiVectorD(1, eta, phi).Unit(); 
00061 }
00062 
00064 
00065 bool RectangularEtaPhiVeto::veto(double eta, double phi, float value) const  {
00066     return (etaMin_ < eta) && (eta < etaMax_) && 
00067            (phiMin_ < phi) && (phi < phiMax_); 
00068 }

Generated on Tue Jun 9 17:31:21 2009 for CMSSW by  doxygen 1.5.4