1 #ifndef RecoAlgos_ConstrainedFitCandProducer_h 2 #define RecoAlgos_ConstrainedFitCandProducer_h 44 template <
typename Fitter,
typename InputCollection,
typename OutputCollection,
typename Init>
49 setMassConstraint_(
false),
51 fitterInit_(consumesCollector()),
53 produces<OutputCollection>();
56 std::vector<std::string> vBoolParams =
cfg.template getParameterNamesForType<bool>();
57 bool found =
find(vBoolParams.begin(), vBoolParams.end(), setLongLived) != vBoolParams.end();
60 const std::string setMassConstraint(
"setMassConstraint");
61 found =
find(vBoolParams.begin(), vBoolParams.end(), setMassConstraint) != vBoolParams.end();
65 std::vector<std::string> vIntParams =
cfg.getParameterNamesForType<
int>();
66 found =
find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end();
69 pdgId_ =
cfg.getParameter<
int>(
"setPdgId");
77 static void add(
C*
c, std::unique_ptr<reco::VertexCompositeCandidate>
t) {
c->push_back(*
t); }
88 inline void add(
C*
c, std::unique_ptr<reco::VertexCompositeCandidate>
t) {
94 template <
typename Fitter,
typename InputCollection,
typename OutputCollection,
typename Init>
97 fitterInit_.init(fitter_, evt, es);
100 auto fitted = std::make_unique<OutputCollection>();
101 fitted->reserve(
cands->size());
102 for (
typename InputCollection::const_iterator
c =
cands->begin();
c !=
cands->end(); ++
c) {
103 auto clone = std::make_unique<reco::VertexCompositeCandidate>(*c);
106 clone->setLongLived();
107 if (setMassConstraint_)
108 clone->setMassConstraint();
110 clone->setPdgId(pdgId_);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< InputCollection > srcToken_
S make(const edm::ParameterSet &cfg)
static void add(edm::OwnVector< T > *c, std::unique_ptr< reco::VertexCompositeCandidate > t)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void add(C *c, std::unique_ptr< reco::VertexCompositeCandidate > t)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static void add(C *c, std::unique_ptr< reco::VertexCompositeCandidate > t)
def template(fileName, svg, replaceme="REPLACEME")
ConstrainedFitCandProducer(const edm::ParameterSet &)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
void produce(edm::Event &, const edm::EventSetup &) override
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects