2 import FWCore.ParameterSet.Config
as cms
8 process = cms.Process(
"SIZE");
14 import Configuration.EventContent.EventContentCosmics_cff
as eventContent_cosmics
18 "RECO": eventContent.RECOEventContent,
19 "AOD": eventContent.AODEventContent,
20 "RECO_COSMICS": eventContent_cosmics.RECOEventContent,
21 "AOD_COSMICS": eventContent_cosmics.AODEventContent,
23 "RECOSIM": eventContent.RECOSIMEventContent,
24 "AODSIM": eventContent.AODSIMEventContent,
25 "RAW": eventContent.RAWEventContent,
26 "RAWSIM": eventContent.RAWSIMEventContent,
27 "FEVTDEBUG": eventContent.FEVTDEBUGEventContent,
28 "FEVTDEBUGHLT": eventContent.FEVTDEBUGHLTEventContent
34 process = cms.Process("SIZE"); 35 process.load("Configuration.EventContent.EventContent_cff") 36 ## define event conent to be used 37 if options.event_content == "RECO" : 38 local_outputCommands = process.RECOEventContent.outputCommands; + 39 elif options.event_content == "RECOSIM" : 40 local_outputCommands = process.RECOSIMEventContent.outputCommands; + 41 elif options.event_content == "AOD" : 42 local_outputCommands = process.AODEventContent.outputCommands; + 43 elif options.event_content == "AODSIM" : 44 local_outputCommands = process.AODSIMEventContent.outputCommands; + 45 elif options.event_content == "RAW" : 46 local_outputCommands = process.RAWEventContent.outputCommands; + 47 elif options.event_content == "RAWSIM" : 48 local_outputCommands = process.RAWSIMEventContent.outputCommands; 49 elif options.event_content == "FEVTDEBUG" : 50 local_outputCommands = process.FEVTDEBUGEventContent.outputCommands; 51 elif options.event_content == "FEVTDEBUGHLT" : 52 local_outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands; 53 elif options.event_content == "ALL" : 54 local_outputCommands = cms.untracked.vstring('keep *_*_*_*'); 63 rule: rule(keep, drop)_A_B_C_D 68 return rule_regexp.match(product_repr+
"_")
71 """ returns a tuple (rule_name, rule_regexp) e.g. ("keep", <regexp for matching product names> """ 73 (rule_name, rule_test) = rule.split()
78 rule_parts =rule_test.split(
"_")
79 if len(rule_parts) == 4 :
82 rule_test =
"_".
join(rule_parts)
85 rule_test = rule_test.replace(
"*",
".*")
87 rule_regexp = re.compile(
"^"+rule_test+
"$")
89 return (rule_name, rule_regexp)
93 products are in format {"cpp_type": cpp_type, "module_name": mod_name, "module_label": mod_label, 94 "size_uncompressed": size_uncomp, "size_compressed": size_comp} 95 --- Some simple doctests --- 97 >>> product_in_EventContent(rules = rule_to_regexp(['drop *', 'keep *_logErrorHarvester_*_*', 'keep *_hybridSuperClusters_*_*', 'keep recoSuperClusters_correctedHybridSuperClusters_*_*']), product = {'module_name': 'hybridSuperClusters', 'module_label': 'hybridShapeAssoc', 'size_compressed': '65.4852', 'cpp_type': 'recoCaloClustersToOnerecoClusterShapesAssociation', 'size_uncompressed': '272.111'}) 100 >>> product_in_EventContent(rules = rule_to_regexp(['drop *', 'keep *_logErrorHarvester_*_*', 'keep DetIdedmEDCollection_siStripDigis_*_*', 'keep *_siPixelClusters_*_*', 'keep *_siStripClusters_*_*']), product = {'module_name': 'hybridSuperClusters', 'module_label': 'hybridShapeAssoc', 'size_compressed': '65.4852', 'cpp_type': 'recoCaloClustersToOnerecoClusterShapesAssociation', 'size_uncompressed': '272.111'}) 106 product_repr =
"%(cpp_type)s_%(module_name)s_%(module_label)s" % product
109 """ rule is in format: 110 > keep *_nuclearInteractionMaker_*_* 114 for (rule_name, rule_regexp)
in rules:
118 return result ==
"keep" 123 for (ec_name, obj)
in EventContents_def.items():
125 rules_txt = [a
for a
in obj.outputCommands]
128 rules_regexp =
map(rule_to_regexp, rules_txt)
130 EventContents[ec_name] = {
"text_rules": rules_txt,
"rules_regexp": rules_regexp}
134 """ returns a list of EC titles the product belongs to """ 136 for (ec_name, ec)
in EventContents.items():
138 EC_list.append(ec_name)
143 """ returns a dictionary of lists with rules """ 145 for (ec_name, ec)
in EventContents.items():
146 txt_rules[ec_name] = ec[
"text_rules"]
150 if __name__ ==
"__main__":
151 print "==== The event contents data is: === " 153 prod = {
'module_name':
'hybridSuperClusters',
'module_label':
'hybridShapeAssoc',
'size_compressed':
'65.4852',
'cpp_type':
'recoCaloClustersToOnerecoClusterShapesAssociation',
'size_uncompressed':
'272.111'}
def product_in_EventContent(rules, product)
def getTxtEventContentRules()
def List_ECs_forProduct(product)
def rule_passes(rule_regexp, product_repr)
static std::string join(char **cmd)