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.
1 /* \class MassKinFitterCandProducer
2  *
3  * \author Luca Lista, INFN
4  *
5  */
9 #include <vector>
10 
12 public:
13  explicit MassKinFitterCandProducer( const edm::ParameterSet & );
14 
15 private:
18  void produce( edm::Event &, const edm::EventSetup & );
19 };
20 
27 
29  src_( cfg.getParameter<edm::InputTag>( "src" ) ),
30  fitter_( cfg.getParameter<double>( "mass" ) ) {
31  produces<reco::CandidateCollection>();
32 }
33 
35  using namespace edm;
36  using namespace reco;
38  evt.getByLabel( src_, cands );
39  std::auto_ptr<CandidateCollection> refitted( new CandidateCollection );
40  for( CandidateCollection::const_iterator c = cands->begin(); c != cands->end(); ++ c ) {
41  Candidate * clone = c->clone();
42  fitter_.set( * clone );
43  refitted->push_back( clone );
44  }
45  evt.put( refitted );
46 }
47 
49 
51 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void produce(edm::Event &, const edm::EventSetup &)
reco::FitQuality set(reco::Candidate &) const
MassKinFitterCandProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
T * clone(const T *tp)
Definition: Ptr.h:42