CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
trivialCutFlow_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry
4 
5 string_func = """
6 result_type asCandidate(const argument_type& obj) const override final {
7  std::cout << "lol I was written in python!" << std::endl;
8  return obj->pt() < 5.0;
9 }
10 """
11 
12 string_value = """
13 double value(const reco::CandidatePtr& obj) const override final {
14  return obj->pt();
15 }
16 """
17 
18 trivialCutFlow = cms.PSet(
19  idName = cms.string("trivialCutFlow"),
20  cutFlow = cms.VPSet(
21  cms.PSet( cutName = cms.string("MinPtCut"),
22  minPt = cms.double(10.0),
23  needsAdditionalProducts = cms.bool(False),
24  isIgnored = cms.bool(False) ),
25  cms.PSet( cutName = cms.string("MaxAbsEtaCut"),
26  maxEta = cms.double(2.5),
27  needsAdditionalProducts = cms.bool(False),
28  isIgnored = cms.bool(False) ),
29  cms.PSet( cutName = cms.string("ExpressionEvaluatorCut"),
30  realCutName = cms.string("StringMinPtCut"),
31  candidateType = cms.string("NONE"),
32  functionDef = cms.string(string_func),
33  valueDef = cms.string(string_value),
34  needsAdditionalProducts = cms.bool(False),
35  isIgnored = cms.bool(False) )
36  )
37 )
38 
39 central_id_registry.register(trivialCutFlow.idName,
40  '406a42716bb40f14256446a98e25c1de')