1 #ifndef CandAlgos_CandCombiner_h 2 #define CandAlgos_CandCombiner_h 43 if (
cfg.exists(
"name"))
47 if (
cfg.exists(
"roles"))
48 roles_ =
cfg.getParameter<std::vector<std::string> >(
"roles");
50 roles_ = std::vector<std::string>();
52 const std::vector<std::string>
roles()
const {
return roles_; }
71 string decay(
cfg.getParameter<
string>(
"decay"));
76 else if (
label->mode_ == ConjInfo::kMinus)
84 if (lists != 2 && lists != 3)
87 const string setLongLived(
"setLongLived");
88 vector<string> vBoolParams =
cfg.getParameterNamesForType<
bool>();
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");
97 vector<string> vIntParams =
cfg.getParameterNamesForType<
int>();
98 found =
find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end();
101 pdgId_ =
cfg.getParameter<
int>(
"setPdgId");
110 std::vector<edm::EDGetTokenT<CandidateView> >
tokens_;
134 combinerInit_(consumesCollector()),
142 produces<OutputCollection>();
150 combinerInit_.init(combiner_.setup(), evt, es);
152 std::vector<edm::Handle<CandidateView> > colls(
n);
153 for (
int i = 0;
i <
n; ++
i)
156 std::unique_ptr<OutputCollection>
out = combiner_.combine(colls, names_.roles());
158 typename OutputCollection::iterator
i =
out->begin(),
e =
out->end();
159 for (;
i !=
e; ++
i) {
164 i->setMassConstraint();
~CandCombiner() override
destructor
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< CompositeCandidate > CompositeCandidateCollection
collection of Candidate objects
S make(const edm::ParameterSet &cfg)
int pdgId_
which pdgId to set
void produce(edm::Event &evt, const edm::EventSetup &es) override
process an event
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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 > roles_
std::vector< edm::EDGetTokenT< CandidateView > > tokens_
RoleNames(const edm::ParameterSet &cfg)
const std::vector< std::string > roles() const
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
Init combinerInit_
combiner utility
bool setLongLived_
set long lived flag
std::vector< cand::parser::ConjInfo > labels_
label vector
::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup > combiner_
std::vector< int > dauCharge_
daughter charges
CandCombinerBase(const edm::ParameterSet &cfg)
bool setMassConstraint_
set mass constraint flag