CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MassKinFitterCandProducer.cc
Go to the documentation of this file.
1 #include <memory>
2 
8 
10  : srcToken_(consumes<reco::CandidateCollection>(cfg.getParameter<edm::InputTag>("src"))), fitter_(f) {
11  if (f == nullptr)
12  fitter_ = std::make_unique<CandMassKinFitter>(cfg.getParameter<double>("mass"));
13  produces<reco::CandidateCollection>();
14 }
15 
17  using namespace edm;
18  using namespace reco;
21  auto refitted = std::make_unique<CandidateCollection>();
22  for (CandidateCollection::const_iterator c = cands->begin(); c != cands->end(); ++c) {
23  Candidate* clone = c->clone();
24  fitter_->set(*clone);
25  refitted->push_back(clone);
26  }
27  evt.put(std::move(refitted));
28 }
edm::EDGetTokenT< reco::CandidateCollection > srcToken_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const edm::EventSetup & c
tuple cfg
Definition: looper.py:296
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
def move
Definition: eostools.py:511
MassKinFitterCandProducer(const edm::ParameterSet &, CandMassKinFitter *=nullptr)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
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