CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MassKinFitterCandProducer.cc
Go to the documentation of this file.
6 
8  srcToken_(consumes<reco::CandidateCollection>(cfg.getParameter<edm::InputTag>("src"))),
9  fitter_(f) {
10  if(f == 0) fitter_.reset(new CandMassKinFitter(cfg.getParameter<double>("mass")));
11  produces<reco::CandidateCollection>();
12 }
13 
15  using namespace edm;
16  using namespace reco;
18  evt.getByToken(srcToken_, cands);
19  std::auto_ptr<CandidateCollection> refitted( new CandidateCollection );
20  for( CandidateCollection::const_iterator c = cands->begin(); c != cands->end(); ++ c ) {
21  Candidate * clone = c->clone();
22  fitter_->set( * clone );
23  refitted->push_back( clone );
24  }
25  evt.put( refitted );
26 }
27 
edm::EDGetTokenT< reco::CandidateCollection > srcToken_
T getParameter(std::string const &) const
tuple cfg
Definition: looper.py:259
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
void produce(edm::Event &, const edm::EventSetup &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
double f[11][100]
std::auto_ptr< CandMassKinFitter > fitter_
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
Definition: CandidateFwd.h:21
MassKinFitterCandProducer(const edm::ParameterSet &, CandMassKinFitter *=0)