Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:10

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry
0004 
0005 string_func = """
0006 result_type asCandidate(const argument_type& obj) const override final { 
0007   std::cout << "lol I was written in python!" << std::endl;
0008   return obj->pt() < 5.0;
0009 }  
0010 """
0011 
0012 string_value = """
0013 double value(const reco::CandidatePtr& obj) const override final { 
0014   return obj->pt();
0015 }  
0016 """
0017 
0018 trivialCutFlow = cms.PSet(
0019     idName = cms.string("trivialCutFlow"),
0020     cutFlow = cms.VPSet(
0021         cms.PSet( cutName = cms.string("MinPtCut"),
0022                   minPt = cms.double(10.0),
0023                   needsAdditionalProducts = cms.bool(False),
0024                   isIgnored = cms.bool(False)                ),
0025         cms.PSet( cutName = cms.string("MaxAbsEtaCut"),
0026                   maxEta = cms.double(2.5),
0027                   needsAdditionalProducts = cms.bool(False),
0028                   isIgnored = cms.bool(False)                ),
0029         cms.PSet( cutName = cms.string("ExpressionEvaluatorCut"),
0030                   realCutName = cms.string("StringMinPtCut"),
0031                   candidateType = cms.string("NONE"),
0032                   functionDef = cms.string(string_func),
0033                   valueDef = cms.string(string_value),
0034                   needsAdditionalProducts = cms.bool(False),
0035                   isIgnored = cms.bool(False)                )
0036     )
0037 )
0038 
0039 central_id_registry.register(trivialCutFlow.idName,
0040                              '406a42716bb40f14256446a98e25c1de')