1 #ifndef RecoAlgos_ConstrainedFitCandProducer_h
2 #define RecoAlgos_ConstrainedFitCandProducer_h
43 template<
typename Fitter,
typename InputCollection,
typename OutputCollection,
typename Init>
48 produces<OutputCollection>();
51 std::vector<std::string> vBoolParams = cfg.template getParameterNamesForType<bool>();
52 bool found =
find(vBoolParams.begin(), vBoolParams.end(), setLongLived) != vBoolParams.end();
53 if(found)
setLongLived_ = cfg.template getParameter<bool>(
"setLongLived");
54 const std::string setMassConstraint(
"setMassConstraint");
55 found =
find(vBoolParams.begin(), vBoolParams.end(), setMassConstraint) != vBoolParams.end();
59 found =
find(vIntParams.begin(), vIntParams.end(), setPdgId) != vIntParams.end();
67 static void add(
C*
c, std::unique_ptr<reco::VertexCompositeCandidate>
t) { c->push_back(*t); }
71 struct Adder<edm::OwnVector<T> > {
76 inline void add(
C*
c, std::unique_ptr<reco::VertexCompositeCandidate>
t) {
82 template<
typename Fitter,
typename InputCollection,
typename OutputCollection,
typename Init>
84 Init::init(fitter_, evt, es);
87 auto fitted = std::make_unique<OutputCollection>();
88 fitted->reserve(cands->size());
89 for(
typename InputCollection::const_iterator
c = cands->begin();
c != cands->end(); ++
c) {
90 auto clone = std::make_unique<reco::VertexCompositeCandidate>(*c);
92 if(setLongLived_)
clone->setLongLived();
93 if(setMassConstraint_)
clone->setMassConstraint();
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< InputCollection > srcToken_
S make(const edm::ParameterSet &cfg)
static void add(edm::OwnVector< T > *c, std::unique_ptr< reco::VertexCompositeCandidate > t)
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)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
pdgId_(cfg.getParameter< std::vector< int > >("matchPDGId"))
static void add(C *c, std::unique_ptr< reco::VertexCompositeCandidate > t)
ConstrainedFitCandProducer(const edm::ParameterSet &)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
volatile std::atomic< bool > shutdown_flag false
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects