1 #ifndef RecoAlgos_ConstrainedFitCandProducer_h
2 #define RecoAlgos_ConstrainedFitCandProducer_h
43 template <
typename Fitter,
typename InputCollection,
typename OutputCollection,
typename Init>
48 setMassConstraint_(
false),
51 produces<OutputCollection>();
54 std::vector<std::string> vBoolParams =
cfg.template getParameterNamesForType<bool>();
55 bool found =
find(vBoolParams.begin(), vBoolParams.end(), setLongLived) != vBoolParams.end();
58 const std::string setMassConstraint(
"setMassConstraint");
59 found =
find(vBoolParams.begin(), vBoolParams.end(), setMassConstraint) != vBoolParams.end();
63 std::vector<std::string> vIntParams =
cfg.getParameterNamesForType<
int>();
64 found =
find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end();
67 pdgId_ =
cfg.getParameter<
int>(
"setPdgId");
75 static void add(
C*
c, std::unique_ptr<reco::VertexCompositeCandidate>
t) {
c->push_back(*
t); }
86 inline void add(
C*
c, std::unique_ptr<reco::VertexCompositeCandidate>
t) {
92 template <
typename Fitter,
typename InputCollection,
typename OutputCollection,
typename Init>
98 auto fitted = std::make_unique<OutputCollection>();
99 fitted->reserve(
cands->size());
100 for (
typename InputCollection::const_iterator
c =
cands->begin();
c !=
cands->end(); ++
c) {
101 auto clone = std::make_unique<reco::VertexCompositeCandidate>(*
c);
104 clone->setLongLived();
105 if (setMassConstraint_)
106 clone->setMassConstraint();
108 clone->setPdgId(pdgId_);