CMS 3D CMS Logo

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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:540
double f[11][100]
MassKinFitterCandProducer(const edm::ParameterSet &, CandMassKinFitter *=nullptr)
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