CMS 3D CMS Logo

PackedCandidatesTrackLiteModifier.cc
Go to the documentation of this file.
8 
10 
11 #include <vector>
12 
14 public:
16  ~PackedCandidatesTrackLiteModifier() override = default;
17 
18  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
19  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
20 
21 private:
24  const unsigned int covSchema_;
25  const unsigned int covVersion_;
26  const unsigned int nHits_;
27  const unsigned int nPixelHits_;
28 };
29 
30 //____________________________________________________________________________||
32  : inputCandidates_(
33  consumes<pat::PackedCandidateCollection>(iConfig.getParameter<edm::InputTag>("inputCandidates"))),
34  outputCandidates_(produces<pat::PackedCandidateCollection>("")),
35  covSchema_(iConfig.getParameter<unsigned int>("covSchema")),
36  covVersion_(iConfig.getParameter<unsigned int>("covVersion")),
37  nHits_(iConfig.getParameter<unsigned int>("nHits")),
38  nPixelHits_(iConfig.getParameter<unsigned int>("nPixelHits")) {}
39 
42  const edm::EventSetup &iSetup) const {
43  auto const &packedCandidates = iEvent.get(inputCandidates_);
44 
46  output.reserve(packedCandidates.size());
47  for (auto const &cand : packedCandidates) {
48  output.push_back(pat::PackedCandidate(cand));
49 
50  if (!output.back().hasTrackDetails() && output.back().fromTrackCandidate())
51  output.back().setTrackPropertiesLite(covSchema_, covVersion_, nHits_, nPixelHits_);
52  }
53 
55 };
56 
59 
60  desc.add<edm::InputTag>("inputCandidates", edm::InputTag("packedPFCandidates"));
61  desc.add<unsigned int>("covSchema", 1025);
62  desc.add<unsigned int>("covVersion", 1);
63  desc.add<unsigned int>("nHits", 8);
64  desc.add<unsigned int>("nPixelHits", 3);
65 
66  descriptions.addWithDefaultLabel(desc);
67 }
68 
69 //____________________________________________________________________________||
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< pat::PackedCandidateCollection > inputCandidates_
std::vector< pat::PackedCandidate > PackedCandidateCollection
Definition: HeavyIon.h:7
const edm::EDPutTokenT< pat::PackedCandidateCollection > outputCandidates_
~PackedCandidatesTrackLiteModifier() override=default
int iEvent
Definition: GenABIO.cc:224
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HLT enums.
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
PackedCandidatesTrackLiteModifier(const edm::ParameterSet &)
Definition: output.py:1
def move(src, dest)
Definition: eostools.py:511