#include <IsoDepositVetoFactory.h>
Static Public Member Functions | |
static reco::isodeposit::AbsVeto * | make (const char *string) |
static reco::isodeposit::AbsVeto * | make (const char *string, reco::isodeposit::EventDependentAbsVeto *&evdep) |
Definition at line 7 of file IsoDepositVetoFactory.h.
reco::isodeposit::AbsVeto * IsoDepositVetoFactory::make | ( | const char * | string | ) | [static] |
Returns a pointer to an AbsVeto defined by the string. The calling code owns the pointer, and must delete it at the end. An exception will be thrown if the resulting AbsVeto depends on the edm::Event
Definition at line 73 of file IsoDepositVetoFactory.cc.
References Exception, and run_regression::ret.
Referenced by pat::helper::IsoDepositIsolator::IsoDepositIsolator(), make(), CandIsolatorFromDeposits::SingleDeposit::SingleDeposit(), and PFCandIsolatorFromDeposits::SingleDeposit::SingleDeposit().
{ reco::isodeposit::EventDependentAbsVeto * evdep = 0; std::auto_ptr<reco::isodeposit::AbsVeto> ret(make(string,evdep)); if (evdep != 0) { throw cms::Exception("Configuration") << "The resulting AbsVeto depends on the edm::Event.\n" << "Please use the two-arguments IsoDepositVetoFactory::make.\n"; } return ret.release(); }
reco::isodeposit::AbsVeto * IsoDepositVetoFactory::make | ( | const char * | string, |
reco::isodeposit::EventDependentAbsVeto *& | evdep | ||
) | [static] |
As above, but will allow also AbsVetos which depend from the edm::Event If the resulting veto is dependent on the edm::Event, the value of the second pointer will be set to non-zero Note that both pointers will point to the same object, so you have to delete it only once.
Definition at line 84 of file IsoDepositVetoFactory.cc.
References Exception, first, make(), match(), run_regression::ret, and dtDQMClient_cfg::threshold.
{ using namespace reco::isodeposit; static boost::regex ecalSwitch("^Ecal(Barrel|Endcaps):(.*)"), threshold("Threshold\\((\\d+\\.\\d+)\\)"), thresholdtransverse("ThresholdFromTransverse\\((\\d+\\.\\d+)\\)"), absthreshold("AbsThreshold\\((\\d+\\.\\d+)\\)"), absthresholdtransverse("AbsThresholdFromTransverse\\((\\d+\\.\\d+)\\)"), cone("ConeVeto\\((\\d+\\.\\d+)\\)"), angleCone("AngleCone\\((\\d+\\.\\d+)\\)"), angleVeto("AngleVeto\\((\\d+\\.\\d+)\\)"), rectangularEtaPhiVeto("RectangularEtaPhiVeto\\(([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+)\\)"), numCrystal("NumCrystalVeto\\((\\d+\\.\\d+)\\)"), numCrystalEtaPhi("NumCrystalEtaPhiVeto\\((\\d+\\.\\d+),(\\d+\\.\\d+)\\)"), otherCandidatesDR("OtherCandidatesByDR\\((\\w+:?\\w*:?\\w*),\\s*(\\d+\\.?|\\d*\\.\\d*)\\)"), otherJetConstituentsDR("OtherJetConstituentsDeltaRVeto\\((\\w+:?\\w*:?\\w*),\\s*(\\d+\\.?|\\d*\\.\\d*),\\s*(\\w+:?\\w*:?\\w*),\\s*(\\d+\\.?|\\d*\\.\\d*)\\)"), otherCand("^(.*?):(.*)"), number("^(\\d+\\.?|\\d*\\.\\d*)$"); boost::cmatch match; //std::cout << "<IsoDepositVetoFactory::make>:" << std::endl; //std::cout << " string = " << string << std::endl; evdep = 0; // by default it does not depend on this if (regex_match(string, match, ecalSwitch)) { return new SwitchingEcalVeto(make(match[2].first), (match[1] == "Barrel") ); } else if (regex_match(string, match, threshold)) { return new ThresholdVeto(atof(match[1].first)); } else if (regex_match(string, match, thresholdtransverse)) { return new ThresholdVetoFromTransverse(atof(((std::string)match[1]).c_str())); } else if (regex_match(string, match, absthreshold)) { return new AbsThresholdVeto(atof(match[1].first)); } else if (regex_match(string, match, absthresholdtransverse)) { return new AbsThresholdVetoFromTransverse(atof(((std::string)match[1]).c_str())); } else if (regex_match(string, match, cone)) { return new ConeVeto(Direction(), atof(match[1].first)); } else if (regex_match(string, match, number)) { return new ConeVeto(Direction(), atof(match[1].first)); } else if (regex_match(string, match, angleCone)) { return new AngleCone(Direction(), atof(match[1].first)); } else if (regex_match(string, match, angleVeto)) { return new AngleConeVeto(Direction(), atof(match[1].first)); } else if (regex_match(string, match, rectangularEtaPhiVeto)) { return new RectangularEtaPhiVeto(Direction(), atof(match[1].first), atof(match[2].first), atof(match[3].first), atof(match[4].first)); } else if (regex_match(string, match, numCrystal)) { return new NumCrystalVeto(Direction(), atof(match[1].first)); } else if (regex_match(string, match, numCrystalEtaPhi)) { return new NumCrystalEtaPhiVeto(Direction(),atof(match[1].first),atof(match[2].first)); } else if (regex_match(string, match, otherCandidatesDR)) { OtherCandidatesDeltaRVeto *ret = new OtherCandidatesDeltaRVeto(edm::InputTag(match[1]), atof(match[2].first)); evdep = ret; return ret; } else if (regex_match(string, match, otherJetConstituentsDR)) { OtherJetConstituentsDeltaRVeto *ret = new OtherJetConstituentsDeltaRVeto(Direction(), edm::InputTag(match[1]), atof(match[2].first), edm::InputTag(match[3]), atof(match[4].first)); evdep = ret; return ret; } else if (regex_match(string, match, otherCand)) { OtherCandVeto *ret = new OtherCandVeto(edm::InputTag(match[1]), make(match[2].first)); evdep = ret; return ret; } else { throw cms::Exception("Not Implemented") << "Veto " << string << " not implemented yet..."; } }