1 #ifndef RecoAlgos_ConstrainedFitCandProducer_h
2 #define RecoAlgos_ConstrainedFitCandProducer_h
43 template<
typename Fitter,
typename InputCollection,
typename OutputCollection,
typename Init>
45 src_(cfg.
template getParameter<edm::InputTag>(
"src")),
48 produces<OutputCollection>();
49 std::string alias( cfg.
getParameter<std::string>(
"@module_label"));
50 const std::string setLongLived(
"setLongLived");
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();
57 const std::string setPdgId(
"setPdgId");
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 &)
std::vector< InputItem > InputCollection
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.
ConstrainedFitCandProducer(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
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)
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
static void add(std::auto_ptr< edm::OwnVector< T > > &c, std::auto_ptr< reco::VertexCompositeCandidate > t)