CMS 3D CMS Logo

MassKinFitterCandProducer.cc
Go to the documentation of this file.
6 
8  : srcToken_(consumes<reco::CandidateCollection>(cfg.getParameter<edm::InputTag>("src"))), fitter_(f) {
9  if (f == nullptr)
10  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 }
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:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
iterator begin()
Definition: OwnVector.h:280
double f[11][100]
iterator end()
Definition: OwnVector.h:285
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
fixed size matrix
HLT enums.
void produce(edm::Event &, const edm::EventSetup &) override
std::unique_ptr< CandMassKinFitter > fitter_
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
Definition: CandidateFwd.h:21
def move(src, dest)
Definition: eostools.py:511
MassKinFitterCandProducer(const edm::ParameterSet &, CandMassKinFitter *=0)