22 #include <boost/regex.hpp>
28 using namespace reco::isodeposit;
31 static boost::regex re(
"^[+-]?(\\d+\\.?|\\d*\\.\\d*)$");
32 return regex_match(str.c_str(), re);
35 return atof(str.c_str());
39 src_(iConfig.getParameter<edm::
InputTag>(
"src")),
40 deltaR_(iConfig.getParameter<double>(
"deltaR")),
41 weightExpr_(iConfig.getParameter<std::string>(
"weight")),
42 skipDefaultVeto_(iConfig.getParameter<bool>(
"skipDefaultVeto"))
54 else throw cms::Exception(
"Not Implemented") <<
"Mode '" << mode <<
"' not implemented. " <<
55 "Supported modes are 'sum', 'sumRelative', 'count'." <<
57 "New methods can be easily implemented if requested.";
58 typedef std::vector<std::string>
vstring;
59 vstring vetos = iConfig.
getParameter< vstring >(
"vetos");
61 for (vstring::const_iterator it = vetos.begin(), ed = vetos.end(); it != ed; ++it) {
77 for (AbsVetos::iterator it = vetos_.begin(), ed = vetos_.end(); it != ed; ++it) {
86 for (EventDependentAbsVetos::iterator it = evdepVetos_.begin(), ed = evdepVetos_.end(); it != ed; ++it) {
87 (*it)->setEvent(iEvent,iSetup);
95 for (AbsVetos::iterator it = vetos_.begin(), ed = vetos_.end(); it != ed; ++it) {
96 (*it)->centerOn(eta,
phi);
98 double weight = (usesFunction_ ? weightExpr_(*cand) : weight_);
109 throw cms::Exception(
"Logic error") <<
"Should not happen at " << __FILE__ <<
", line " << __LINE__;
115 typedef std::vector<edm::ParameterSet> VPSet;
117 for (VPSet::const_iterator it = depPSets.begin(), ed = depPSets.end(); it != ed; ++it) {
120 if (
sources_.size() == 0)
throw cms::Exception(
"Configuration Error") <<
"Please specify at least one deposit!";
121 produces<CandDoubleMap>();
127 for (it = begin; it !=
end; ++it) it->cleanup();
134 for (it = begin; it !=
end; ++it) it->open(event, eventSetup);
139 event.put(std::auto_ptr<CandDoubleMap>(
new CandDoubleMap()));
147 iterator_i depI = map.
begin();
148 iterator_i depIEnd = map.
end();
149 for (; depI != depIEnd; ++depI){
150 std::vector<double> retV(depI.size(),0);
152 event.get(depI.id(), candH);
155 iterator_ii depII = depI.
begin();
156 iterator_ii depIIEnd = depI.end();
158 for (; depII != depIIEnd; ++depII,++iRet){
160 for (it = begin; it !=
end; ++it) sum += it->compute(candV.
refAt(iRet));
163 filler.
insert(candH, retV.begin(), retV.end());
T getParameter(std::string const &) const
double candEnergy() const
Get energy or pT attached to cand trajectory.
bool isNumber(const std::string &str)
double sum2Within(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
double compute(const reco::CandidateBaseRef &cand)
const_iterator end() const
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
std::vector< SingleDeposit > sources_
double countWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
RefToBase< value_type > refAt(size_type i) const
double maxWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
edm::ValueMap< double > CandDoubleMap
double sumWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
double toNumber(const std::string &str)
double nearestDR(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
void open(const edm::Event &iEvent, const edm::EventSetup &iSetup)
reco::isodeposit::AbsVetos vetos_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
SingleDeposit(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual ~CandIsolatorFromDeposits()
destructor
const_iterator begin() const
CandIsolatorFromDeposits(const edm::ParameterSet &)
constructor with config
std::vector< std::string > vstring
static reco::isodeposit::AbsVeto * make(const char *string)
const_iterator begin() const
reco::isodeposit::EventDependentAbsVetos evdepVetos_
virtual void produce(edm::Event &, const edm::EventSetup &)
build deposits