5 #include <boost/regex.hpp>
8 namespace reco {
namespace isodeposit {
15 virtual bool veto(
double eta,
double phi,
float value)
const override {
16 return (fabs(eta) < 1.479) == (
barrel_) ?
veto_->veto(eta,phi,value) :
false;
19 veto_->centerOn(eta,phi);
29 virtual bool veto(
double eta,
double phi,
float value)
const override {
51 virtual bool veto(
double eta,
double phi,
float value)
const override {
54 while( dPhi < -
M_PI ) dPhi += 2*
M_PI;
55 while( dPhi >=
M_PI ) dPhi -= 2*
M_PI;
57 return ( (fabs(dEta) < 0.0174*
iEta_) && (fabs(dPhi) < 0.0174*
iPhi_) );
59 return ( (fabs(dEta) < 0.00864*fabs(sinh(eta))*
iEta_) &&
60 (fabs(dPhi) < 0.00864*fabs(sinh(eta))*
iPhi_) );
75 std::unique_ptr<reco::isodeposit::AbsVeto>
ret(
make(
string,evdep, iC));
77 throw cms::Exception(
"Configuration") <<
"The resulting AbsVeto depends on the edm::Event.\n"
78 <<
"Please use the two-arguments IsoDepositVetoFactory::make.\n";
85 using namespace reco::isodeposit;
87 ecalSwitch(
"^Ecal(Barrel|Endcaps):(.*)"),
88 threshold(
"Threshold\\((\\d+\\.\\d+)\\)"),
89 thresholdtransverse(
"ThresholdFromTransverse\\((\\d+\\.\\d+)\\)"),
90 absthreshold(
"AbsThreshold\\((\\d+\\.\\d+)\\)"),
91 absthresholdtransverse(
"AbsThresholdFromTransverse\\((\\d+\\.\\d+)\\)"),
92 cone(
"ConeVeto\\((\\d+\\.\\d+)\\)"),
93 angleCone(
"AngleCone\\((\\d+\\.\\d+)\\)"),
94 angleVeto(
"AngleVeto\\((\\d+\\.\\d+)\\)"),
95 rectangularEtaPhiVeto(
"RectangularEtaPhiVeto\\(([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+)\\)"),
96 numCrystal(
"NumCrystalVeto\\((\\d+\\.\\d+)\\)"),
97 numCrystalEtaPhi(
"NumCrystalEtaPhiVeto\\((\\d+\\.\\d+),(\\d+\\.\\d+)\\)"),
98 otherCandidatesDR(
"OtherCandidatesByDR\\((\\w+:?\\w*:?\\w*),\\s*(\\d+\\.?|\\d*\\.\\d*)\\)"),
99 otherJetConstituentsDR(
"OtherJetConstituentsDeltaRVeto\\((\\w+:?\\w*:?\\w*),\\s*(\\d+\\.?|\\d*\\.\\d*),\\s*(\\w+:?\\w*:?\\w*),\\s*(\\d+\\.?|\\d*\\.\\d*)\\)"),
100 otherCand(
"^(.*?):(.*)"),
101 number(
"^(\\d+\\.?|\\d*\\.\\d*)$");
108 if (regex_match(
string,
match, ecalSwitch)) {
112 }
else if (regex_match(
string,
match, thresholdtransverse)) {
114 }
else if (regex_match(
string,
match, absthreshold)) {
116 }
else if (regex_match(
string,
match, absthresholdtransverse)) {
118 }
else if (regex_match(
string,
match, cone)) {
120 }
else if (regex_match(
string,
match, number)) {
122 }
else if (regex_match(
string,
match, angleCone)) {
124 }
else if (regex_match(
string,
match, angleVeto)) {
126 }
else if (regex_match(
string,
match, rectangularEtaPhiVeto)) {
130 }
else if (regex_match(
string,
match, numCrystal)) {
132 }
else if (regex_match(
string,
match, numCrystalEtaPhi)) {
134 }
else if (regex_match(
string,
match, otherCandidatesDR)) {
140 }
else if (regex_match(
string,
match, otherJetConstituentsDR)) {
147 }
else if (regex_match(
string,
match, otherCand)) {
153 throw cms::Exception(
"Not Implemented") <<
"Veto " <<
string <<
" not implemented yet...";
static reco::isodeposit::AbsVeto * make(const char *string, edm::ConsumesCollector &iC)
tuple ret
prodAgent to be discontinued
virtual 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...
bool isBarrel(GeomDetEnumerators::SubDetector m)
std::unique_ptr< AbsVeto > veto_
NumCrystalEtaPhiVeto(const math::XYZVectorD &dir, double iEta, double iPhi)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
virtual void centerOn(double eta, double phi) override
virtual 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...
double dPhi(double phi1, double phi2)
virtual 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...
NumCrystalEtaPhiVeto(Direction dir, double iEta, double iPhi)
Geom::Phi< T > phi() const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
virtual void centerOn(double eta, double phi) override
NumCrystalVeto(Direction dir, double iR)
SwitchingEcalVeto(AbsVeto *veto, bool isBarrel)
double deltaR(const Direction &dir2) const
virtual void centerOn(double eta, double phi) override