1 #ifndef CandAlgos_CandCombiner_h
2 #define CandAlgos_CandCombiner_h
50 roles_ = std::vector<std::string>();
52 const std::vector<std::string>
roles()
const {
return roles_; }
76 else if (
label->mode_ == ConjInfo::kMinus)
84 if (lists != 2 && lists != 3)
87 const string setLongLived(
"setLongLived");
89 found =
find(vBoolParams.begin(), vBoolParams.end(), setLongLived) != vBoolParams.end();
92 const string setMassConstraint(
"setMassConstraint");
93 found =
find(vBoolParams.begin(), vBoolParams.end(), setMassConstraint) != vBoolParams.end();
96 const string setPdgId(
"setPdgId");
98 found =
find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end();
110 std::vector<edm::EDGetTokenT<CandidateView> >
tokens_;
137 cfg.existsAs<bool>(
"checkCharge") ? cfg.getParameter<bool>(
"checkCharge") :
true,
138 cfg.existsAs<bool>(
"checkOverlap") ? cfg.getParameter<bool>(
"checkOverlap") :
true,
141 produces<OutputCollection>();
151 std::vector<edm::Handle<CandidateView> > colls(n);
152 for (
int i = 0;
i <
n; ++
i)
155 std::unique_ptr<OutputCollection>
out = combiner_.combine(colls, names_.roles());
157 typename OutputCollection::iterator i = out->begin(),
e = out->end();
158 for (; i !=
e; ++
i) {
163 i->setMassConstraint();
~CandCombiner() override
destructor
const std::vector< std::string > roles() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EventSetup & c
std::vector< CompositeCandidate > CompositeCandidateCollection
collection of Candidate objects
bool getByToken(EDGetToken token, Handle< PROD > &result) const
S make(const edm::ParameterSet &cfg)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
int pdgId_
which pdgId to set
void setRoles(const role_collection &roles)
set the roles
void produce(edm::Event &evt, const edm::EventSetup &es) override
process an event
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
void set(reco::CompositeCandidate &c) const
std::vector< std::string > roles_
std::vector< edm::EDGetTokenT< CandidateView > > tokens_
RoleNames(const edm::ParameterSet &cfg)
Functor that operates on <T>
CandCombiner(const edm::ParameterSet &cfg)
constructor from parameter settypedef
std::string name_
Name of this candidate.
bool decayParser(const std::string &iValue, std::vector< ConjInfo > &oStrings)
bool setPdgId_
set pdgId flag
void setName(std::string name)
set the name of the candidate
T getParameter(std::string const &) const
bool setLongLived_
set long lived flag
std::vector< cand::parser::ConjInfo > labels_
label vector
::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup > combiner_
combiner utility
std::vector< int > dauCharge_
daughter charges
CandCombinerBase(const edm::ParameterSet &cfg)
bool setMassConstraint_
set mass constraint flag