CMS 3D CMS Logo

L1GTSingleObjectCond.cc
Go to the documentation of this file.
6 
12 
15 
16 #include <cmath>
17 #include <cinttypes>
18 
19 #include <ap_int.h>
20 
21 using namespace l1t;
22 
24 public:
25  explicit L1GTSingleObjectCond(const edm::ParameterSet&);
26  ~L1GTSingleObjectCond() override = default;
27 
29 
30 private:
31  bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override;
32 
35 
37 };
38 
40  : scales_(config.getParameter<edm::ParameterSet>("scales")),
41  collection(config, config, scales_),
42  token_(consumes<P2GTCandidateCollection>(collection.tag())) {
43  produces<P2GTCandidateVectorRef>(collection.tag().instance());
44 }
45 
49 
52  desc.add<edm::ParameterSetDescription>("scales", scalesDesc);
53 
54  descriptions.addWithDefaultLabel(desc);
55 }
56 
59 
60  bool condition_result = false;
61 
62  std::unique_ptr<P2GTCandidateVectorRef> triggerCol = std::make_unique<P2GTCandidateVectorRef>();
63 
64  for (std::size_t idx = 0; idx < col->size(); ++idx) {
65  bool pass{collection.checkObject(col->at(idx))};
66  condition_result |= pass;
67 
68  if (pass) {
69  triggerCol->push_back(P2GTCandidateRef(col, idx));
70  }
71  }
72 
73  if (condition_result) {
74  event.put(std::move(triggerCol), collection.tag().instance());
75  }
76 
77  return condition_result;
78 }
79 
const L1GTSingleCollectionCut collection
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
bool checkObject(const P2GTCandidate &obj) const
std::vector< P2GTCandidate > P2GTCandidateCollection
Definition: P2GTCandidate.h:16
std::string const & instance() const
Definition: InputTag.h:37
const edm::InputTag & tag() const
edm::Ref< P2GTCandidateCollection > P2GTCandidateRef
Definition: P2GTCandidate.h:18
delete x;
Definition: CaloConfig.h:22
Definition: config.py:1
L1GTSingleObjectCond(const edm::ParameterSet &)
const edm::EDGetTokenT< P2GTCandidateCollection > token_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void fillPSetDescription(edm::ParameterSetDescription &desc)
HLT enums.
bool filter(edm::StreamID, edm::Event &, edm::EventSetup const &) const override
col
Definition: cuy.py:1009
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1