CMS 3D CMS Logo

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  auto refitted = std::make_unique<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(std::move(refitted));
26 }
27 
edm::EDGetTokenT< reco::CandidateCollection > srcToken_
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
void produce(edm::Event &, const edm::EventSetup &)
iterator begin()
Definition: OwnVector.h:244
double f[11][100]
iterator end()
Definition: OwnVector.h:249
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
fixed size matrix
HLT enums.
std::unique_ptr< CandMassKinFitter > fitter_
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
Definition: CandidateFwd.h:21
def move(src, dest)
Definition: eostools.py:510
MassKinFitterCandProducer(const edm::ParameterSet &, CandMassKinFitter *=0)