CMS 3D CMS Logo

IsoDepositVetos.cc
Go to the documentation of this file.
3 
4 #include <cmath>
5 #include <iostream>
6 
7 using namespace reco::isodeposit;
8 
9 bool ConeVeto::veto(double eta, double phi, float value) const {
10  return (vetoDir_.deltaR2(Direction(eta, phi)) < dR2_);
11 }
12 void ConeVeto::centerOn(double eta, double phi) { vetoDir_ = Direction(eta, phi); }
14 
15 bool ThresholdVeto::veto(double eta, double phi, float value) const { return (value <= threshold_); }
16 void ThresholdVeto::centerOn(double eta, double phi) {}
17 
19 
20 bool ThresholdVetoFromTransverse::veto(double eta, double phi, float value) const {
21  return (value / sin(2 * atan(exp(-eta))) <= threshold_); // convert Et to E
22 }
23 void ThresholdVetoFromTransverse::centerOn(double eta, double phi) {}
24 
26 
27 bool AbsThresholdVeto::veto(double eta, double phi, float value) const { return (fabs(value) <= threshold_); }
28 void AbsThresholdVeto::centerOn(double eta, double phi) {}
29 
31 
32 bool AbsThresholdVetoFromTransverse::veto(double eta, double phi, float value) const {
33  return (fabs(value / sin(2 * atan(exp(-eta)))) <= threshold_); // convert Et to E
34 }
35 void AbsThresholdVetoFromTransverse::centerOn(double eta, double phi) {}
36 
38 
39 bool ConeThresholdVeto::veto(double eta, double phi, float value) const {
40  return (value <= threshold_) || (vetoDir_.deltaR2(Direction(eta, phi)) < dR2_);
41 }
42 void ConeThresholdVeto::centerOn(double eta, double phi) { vetoDir_ = Direction(eta, phi); }
43 
45 
46 AngleConeVeto::AngleConeVeto(const math::XYZVectorD& dir, double angle) : vetoDir_(dir.Unit()), cosTheta_(cos(angle)) {}
47 AngleConeVeto::AngleConeVeto(Direction dir, double angle) : vetoDir_(0, 0, 1), cosTheta_(cos(angle)) {
48  vetoDir_ = math::RhoEtaPhiVectorD(1, dir.eta(), dir.phi()).Unit();
49 }
50 bool AngleConeVeto::veto(double eta, double phi, float value) const {
52  return (vetoDir_.Dot(tmp.Unit()) > cosTheta_);
53 }
54 void AngleConeVeto::centerOn(double eta, double phi) { vetoDir_ = math::RhoEtaPhiVectorD(1, eta, phi).Unit(); }
55 
57 
58 AngleCone::AngleCone(const math::XYZVectorD& dir, double angle) : coneDir_(dir.Unit()), cosTheta_(cos(angle)) {}
59 AngleCone::AngleCone(Direction dir, double angle) : coneDir_(0, 0, 1), cosTheta_(cos(angle)) {
60  coneDir_ = math::RhoEtaPhiVectorD(1, dir.eta(), dir.phi()).Unit();
61 }
62 bool AngleCone::veto(double eta, double phi, float value) const {
64  return (coneDir_.Dot(tmp.Unit()) < cosTheta_);
65 }
66 void AngleCone::centerOn(double eta, double phi) { coneDir_ = math::RhoEtaPhiVectorD(1, eta, phi).Unit(); }
67 
69 
71  const math::XYZVectorD& dir, double etaMin, double etaMax, double phiMin, double phiMax)
72  : vetoDir_(dir.eta(), dir.phi()), etaMin_(etaMin), etaMax_(etaMax), phiMin_(phiMin), phiMax_(phiMax) {}
73 
75  : vetoDir_(dir.eta(), dir.phi()), etaMin_(etaMin), etaMax_(etaMax), phiMin_(phiMin), phiMax_(phiMax) {}
76 
77 bool RectangularEtaPhiVeto::veto(double eta, double phi, float value) const {
78  //vetoDir_.phi() is already [0,2*M_PI], make sure the vetoDir phi is
79  //also assuming that the etaMin_ and etaMax_ are set correctly by user
80  //or possible user only wants a limit in one directions
81  //so should be able to set phi or eta to something extreme (-100,100) e.g.
82  double dPhi = phi - vetoDir_.phi();
83  double dEta = eta - vetoDir_.eta();
84  while (dPhi < -M_PI)
85  dPhi += 2 * M_PI;
86  while (dPhi >= M_PI)
87  dPhi -= 2 * M_PI;
88  return (etaMin_ < dEta) && (dEta < etaMax_) && (phiMin_ < dPhi) && (dPhi < phiMax_);
89 }
90 
91 void RectangularEtaPhiVeto::centerOn(double eta, double phi) { vetoDir_ = Direction(eta, phi); }
reco::isodeposit::AngleCone::AngleCone
AngleCone(const math::XYZVectorD &dir, double angle)
Definition: IsoDepositVetos.cc:58
reco::isodeposit::ConeThresholdVeto::centerOn
void centerOn(double eta, double phi) override
Definition: IsoDepositVetos.cc:42
reco::isodeposit::RectangularEtaPhiVeto::RectangularEtaPhiVeto
RectangularEtaPhiVeto(const math::XYZVectorD &dir, double etaMin, double etaMax, double phiMin, double phiMax)
Definition: IsoDepositVetos.cc:70
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition: ALCARECOTkAlBeamHalo_cff.py:32
reco::isodeposit::ConeVeto::veto
bool veto(double eta, double phi, float value) const override
Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum.
Definition: IsoDepositVetos.cc:9
IsoDepositVetos.h
reco::isodeposit::AngleCone::coneDir_
math::XYZVectorD coneDir_
Definition: IsoDepositVetos.h:94
reco::isodeposit::AbsThresholdVetoFromTransverse::centerOn
void centerOn(double eta, double phi) override
Definition: IsoDepositVetos.cc:35
reco::isodeposit::RectangularEtaPhiVeto::vetoDir_
Direction vetoDir_
Definition: IsoDepositVetos.h:106
reco::isodeposit::ThresholdVetoFromTransverse::veto
bool veto(double eta, double phi, float value) const override
Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum.
Definition: IsoDepositVetos.cc:20
reco::isodeposit::RectangularEtaPhiVeto::phiMax_
double phiMax_
Definition: IsoDepositVetos.h:107
reco::isodeposit::Direction::eta
double eta() const
Definition: IsoDepositDirection.h:34
reco::isodeposit::RectangularEtaPhiVeto::phiMin_
double phiMin_
Definition: IsoDepositVetos.h:107
reco::isodeposit::ThresholdVeto::veto
bool veto(double eta, double phi, float value) const override
Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum.
Definition: IsoDepositVetos.cc:15
reco::isodeposit::ConeVeto::dR2_
float dR2_
Definition: IsoDepositVetos.h:18
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13703
reco::isodeposit::AngleConeVeto::vetoDir_
math::XYZVectorD vetoDir_
Definition: IsoDepositVetos.h:82
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
reco::isodeposit::RectangularEtaPhiVeto::etaMax_
double etaMax_
Definition: IsoDepositVetos.h:107
IsoDepositDirection.h
reco::isodeposit::RectangularEtaPhiVeto::veto
bool veto(double eta, double phi, float value) const override
Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum.
Definition: IsoDepositVetos.cc:77
reco::isodeposit::AbsThresholdVeto::centerOn
void centerOn(double eta, double phi) override
Definition: IsoDepositVetos.cc:28
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
reco::isodeposit::ConeVeto::centerOn
void centerOn(double eta, double phi) override
Definition: IsoDepositVetos.cc:12
reco::isodeposit::Direction::deltaR2
double deltaR2(const Direction &dir2) const
Definition: IsoDepositDirection.h:46
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
reco::isodeposit::AngleConeVeto::cosTheta_
float cosTheta_
Definition: IsoDepositVetos.h:83
reco::isodeposit
Definition: IsoDeposit.h:31
PVValHelper::eta
Definition: PVValidationHelpers.h:70
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition: AlignmentTrackSelector_cfi.py:18
AlignmentTrackSelector_cfi.phiMax
phiMax
Definition: AlignmentTrackSelector_cfi.py:17
math::RhoEtaPhiVectorD
ROOT::Math::DisplacementVector3D< ROOT::Math::CylindricalEta3D< double > > RhoEtaPhiVectorD
spatial vector with cylindrical internal representation using pseudorapidity
Definition: Vector3D.h:10
reco::isodeposit::ConeVeto::vetoDir_
Direction vetoDir_
Definition: IsoDepositVetos.h:17
reco::isodeposit::ThresholdVeto::centerOn
void centerOn(double eta, double phi) override
Definition: IsoDepositVetos.cc:16
reco::isodeposit::ThresholdVetoFromTransverse::centerOn
void centerOn(double eta, double phi) override
Definition: IsoDepositVetos.cc:23
math::XYZVectorD
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition: Vector3D.h:8
reco::isodeposit::AbsThresholdVetoFromTransverse::threshold_
float threshold_
Definition: IsoDepositVetos.h:58
reco::isodeposit::AngleConeVeto::centerOn
void centerOn(double eta, double phi) override
Definition: IsoDepositVetos.cc:54
reco::isodeposit::RectangularEtaPhiVeto::centerOn
void centerOn(double eta, double phi) override
Definition: IsoDepositVetos.cc:91
reco::isodeposit::AngleConeVeto::veto
bool veto(double eta, double phi, float value) const override
Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum.
Definition: IsoDepositVetos.cc:50
reco::isodeposit::ConeThresholdVeto::dR2_
float dR2_
Definition: IsoDepositVetos.h:70
reco::isodeposit::AbsThresholdVeto::veto
bool veto(double eta, double phi, float value) const override
Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum.
Definition: IsoDepositVetos.cc:27
value
Definition: value.py:1
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
reco::isodeposit::AngleConeVeto::AngleConeVeto
AngleConeVeto(const math::XYZVectorD &dir, double angle)
Definition: IsoDepositVetos.cc:46
reco::isodeposit::AbsThresholdVeto::threshold_
float threshold_
Definition: IsoDepositVetos.h:48
reco::isodeposit::RectangularEtaPhiVeto::etaMin_
double etaMin_
Definition: IsoDepositVetos.h:107
reco::isodeposit::AbsThresholdVetoFromTransverse::veto
bool veto(double eta, double phi, float value) const override
Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum.
Definition: IsoDepositVetos.cc:32
reco::isodeposit::ConeThresholdVeto::threshold_
float threshold_
Definition: IsoDepositVetos.h:71
HLT_FULL_cff.dEta
dEta
Definition: HLT_FULL_cff.py:13702
reco::isodeposit::AngleCone::cosTheta_
float cosTheta_
Definition: IsoDepositVetos.h:95
reco::isodeposit::Direction
Definition: IsoDepositDirection.h:19
reco::isodeposit::AngleCone::centerOn
void centerOn(double eta, double phi) override
Definition: IsoDepositVetos.cc:66
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
reco::isodeposit::ConeThresholdVeto::veto
bool veto(double eta, double phi, float value) const override
Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum.
Definition: IsoDepositVetos.cc:39
reco::isodeposit::ThresholdVeto::threshold_
float threshold_
Definition: IsoDepositVetos.h:28
reco::isodeposit::ThresholdVetoFromTransverse::threshold_
float threshold_
Definition: IsoDepositVetos.h:38
reco::isodeposit::AngleCone::veto
bool veto(double eta, double phi, float value) const override
Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum.
Definition: IsoDepositVetos.cc:62
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
reco::isodeposit::ConeThresholdVeto::vetoDir_
Direction vetoDir_
Definition: IsoDepositVetos.h:69
reco::isodeposit::Direction::phi
double phi() const
Definition: IsoDepositDirection.h:35
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23