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(std::auto_ptr<C> &
c, std::auto_ptr<reco::VertexCompositeCandidate>
t) { c->push_back(*t); }
71 struct Adder<edm::OwnVector<T> > {
72 static void add(std::auto_ptr<
edm::OwnVector<T> > &
c, std::auto_ptr<reco::VertexCompositeCandidate>
t) {
c->push_back(t); }
76 inline void add(std::auto_ptr<C> &
c, std::auto_ptr<reco::VertexCompositeCandidate>
t) {
82 template<
typename Fitter,
typename InputCollection,
typename OutputCollection,
typename Init>
87 std::auto_ptr<OutputCollection> fitted(
new OutputCollection);
88 fitted->reserve(cands->size());
89 for(
typename InputCollection::const_iterator
c = cands->begin();
c != cands->end(); ++
c) {
92 if(setLongLived_) clone->setLongLived();
93 if(setMassConstraint_) clone->setMassConstraint();
94 if(setPdgId_) clone->setPdgId(
pdgId_);
T getParameter(std::string const &) const
std::vector< ProtoJet > OutputCollection
void produce(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< InputItem > InputCollection
edm::EDGetTokenT< InputCollection > srcToken_
S make(const edm::ParameterSet &cfg)
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
pdgId_(cfg.getParameter< std::vector< int > >("matchPDGId"))
ConstrainedFitCandProducer(const edm::ParameterSet &)
static void add(std::auto_ptr< C > &c, std::auto_ptr< reco::VertexCompositeCandidate > t)
void add(std::auto_ptr< C > &c, std::auto_ptr< reco::VertexCompositeCandidate > t)
volatile std::atomic< bool > shutdown_flag false
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
static void add(std::auto_ptr< edm::OwnVector< T > > &c, std::auto_ptr< reco::VertexCompositeCandidate > t)