CMS 3D CMS Logo

Functions | Variables
parseEventContent Namespace Reference

Functions

def getTxtEventContentRules ()
 
def List_ECs_forProduct (product)
 
def product_in_EventContent (rules, product)
 
def rule_passes (rule_regexp, product_repr)
 
def rule_to_regexp (rule)
 

Variables

 EventContents
 
 EventContents_def
 
 process
 
 prod
 
 rules_regexp
 
 rules_txt
 

Function Documentation

def parseEventContent.getTxtEventContentRules ( )
returns a dictionary of lists with rules 

Definition at line 142 of file parseEventContent.py.

References edm.print().

143  #TODO: We should where to assign products to Event-Content, on harvesting or on importing part
144  """ returns a dictionary of lists with rules """
145  txt_rules = {}
146  for (ec_name, ec) in EventContents.items():
147  txt_rules[ec_name] = ec["text_rules"]
148  return txt_rules
149 
150 #a test
def parseEventContent.List_ECs_forProduct (   product)
returns a list of EC titles the product belongs to 

Definition at line 134 of file parseEventContent.py.

References product_in_EventContent().

Referenced by cmsPerfSuiteHarvest.assign_event_content_for_product().

134 def List_ECs_forProduct(product):
135  """ returns a list of EC titles the product belongs to """
136  EC_list = []
137  for (ec_name, ec) in EventContents.items():
138  if product_in_EventContent(ec["rules_regexp"], product):
139  EC_list.append(ec_name)
140  return EC_list
141 
def product_in_EventContent(rules, product)
def List_ECs_forProduct(product)
def parseEventContent.product_in_EventContent (   rules,
  product 
)
products are in format {"cpp_type": cpp_type, "module_name": mod_name, "module_label": mod_label,
    "size_uncompressed": size_uncomp, "size_compressed": size_comp}  
--- Some simple doctests ---

>>> 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'})
True

>>> 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'})
False

Definition at line 92 of file parseEventContent.py.

References rule_passes().

Referenced by List_ECs_forProduct().

92 def product_in_EventContent(rules, product):
93  """
94  products are in format {"cpp_type": cpp_type, "module_name": mod_name, "module_label": mod_label,
95  "size_uncompressed": size_uncomp, "size_compressed": size_comp}
96  --- Some simple doctests ---
97 
98  >>> 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'})
99  True
100 
101  >>> 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'})
102  False
103 
104  """
105 
106 
107  product_repr = "%(cpp_type)s_%(module_name)s_%(module_label)s" % product
108  result = "keep"
109 
110  """ rule is in format:
111  > keep *_nuclearInteractionMaker_*_*
112  > keep *_horeco_*_*
113  > drop *
114  """
115  for (rule_name, rule_regexp) in rules:
116 
117  if rule_passes(rule_regexp, product_repr):
118  result = rule_name
119  return result == "keep"
120 
121 
122 #initialize
def product_in_EventContent(rules, product)
def rule_passes(rule_regexp, product_repr)
def parseEventContent.rule_passes (   rule_regexp,
  product_repr 
)
    rule: rule(keep, drop)_A_B_C_D
    product: A_B_C

Definition at line 62 of file parseEventContent.py.

Referenced by product_in_EventContent().

62 def rule_passes(rule_regexp, product_repr):
63  """
64  rule: rule(keep, drop)_A_B_C_D
65  product: A_B_C
66  """
67  #we have altered the rules to have "*" as the 4th parameter (if split by _)
68  # so all the D's will pass
69  return rule_regexp.match(product_repr+"_")
70 
def rule_passes(rule_regexp, product_repr)
def parseEventContent.rule_to_regexp (   rule)
returns a tuple (rule_name, rule_regexp) e.g. ("keep", <regexp for matching product names>  

Definition at line 71 of file parseEventContent.py.

References join().

71 def rule_to_regexp(rule):
72  """ returns a tuple (rule_name, rule_regexp) e.g. ("keep", <regexp for matching product names> """
73  #this part might be moved out and regular expression cached
74  (rule_name, rule_test) = rule.split()
75 
76  # we create a regexp out of rule
77 
78  #we ignore the 4th rule:
79  rule_parts =rule_test.split("_")
80  if len(rule_parts) == 4 :
81  # we replace the last one to asterix
82  rule_parts[3] = "*"
83  rule_test = "_".join(rule_parts)
84 
85  # make a regexp
86  rule_test = rule_test.replace("*", ".*")
87 
88  rule_regexp = re.compile("^"+rule_test+"$")
89 
90  return (rule_name, rule_regexp)
91 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Variable Documentation

parseEventContent.EventContents

Definition at line 123 of file parseEventContent.py.

parseEventContent.EventContents_def

Definition at line 18 of file parseEventContent.py.

parseEventContent.process

Definition at line 9 of file parseEventContent.py.

parseEventContent.prod

Definition at line 154 of file parseEventContent.py.

Referenced by edm::Principal.adjustIndexesAfterProductRegistryAddition(), edm::Principal.adjustToNewProductRegistry(), TestPythiaDecays.analyze(), edm::Principal.applyToResolvers(), edm::PoolOutputModule.beginJob(), edm::Principal.clearPrincipal(), BareRootProductGetter.createNewBuffer(), edm::RootFile.dropOnInput(), edm::Event.emplaceImpl(), HGCalTriggerNtupleGenTau.fill(), edm::EventPrincipal.fillEventPrincipal(), edm::LuminosityBlockPrincipal.fillLuminosityBlockPrincipal(), edm::RunPrincipal.fillRunPrincipal(), edm::PoolOutputModule.fillSelectedItemList(), SimpleFlatTableProducer< T >.fillTable(), FirstObjectSimpleFlatTableProducer< T >.fillTable(), edm::ProvenanceAdaptor.fixProcessHistory(), G4ProcessHelper.G4ProcessHelper(), fwlite::LuminosityBlockBase.getByLabelImpl(), fwlite::RunBase.getByLabelImpl(), fwlite::EventBase.getByLabelImpl(), edm::Ptr< PileUpPFCandidate >.getData_(), BareRootProductGetter.getIt(), edm::refitem::GetRefPtrImpl< C, T, F, KEY >.getRefPtr_(), edm::refitem::GetRefPtrImpl< C, T, F, unsigned int >.getRefPtr_(), edm::root::FWLiteDelayedReader.getTheProduct(), TrackProducer.getTransient(), TrackProducerWithSCAssociation.getTransient(), HadronicProcessHelper.HadronicProcessHelper(), MLP_Epoch(), edm::RootTree.numberOfBranchesToAdd(), edm::RefToBaseProd< T >.operator->(), omtf::CscPacker.pack(), edm::Principal.Principal(), SeedingLayersEDProducer.produce(), ValidHitPairFilterProducer.produce(), PixelTrackFilterByKinematicsProducer.produce(), CaloTowersReCreator.produce(), ClusterShapeTrackFilterProducer.produce(), HIPixelTrackFilterProducer.produce(), OscarProducer.produce(), EcalElectronicsMappingBuilder.produce(), CaloTowersCreator.produce(), ConeIsolation.produce(), TrackFitterProducer.produce(), KFBasedPixelFitterProducer.produce(), HcalHistogramRawToDigi.produce(), HIProtoTrackFilterProducer.produce(), ParticleTowerProducer.produce(), OscarMTProducer.produce(), HcalRawToDigi.produce(), PixelFitterByHelixProjectionsProducer.produce(), ImpactParameter.produce(), CastorRawToDigi.produce(), EcalTrigTowerConstituentsMapBuilder.produce(), PixelFitterByConformalMappingAndLineProducer.produce(), CaloTowerConstituentsMapBuilder.produce(), TrackMCQuality.produce(), MuMuForEmbeddingSelector.produce(), EcalTrigPrimESProducer.produceBadStrip(), EcalTrigPrimESProducer.produceBadTT(), EcalTrigPrimESProducer.produceBadX(), EcalTrigPrimESProducer.produceFineGrainEB(), EcalTrigPrimESProducer.produceFineGrainEBGroup(), EcalTrigPrimESProducer.produceFineGrainEEstrip(), EcalTrigPrimESProducer.produceFineGrainEEtower(), EcalTrigPrimESProducer.produceLinearizationConst(), EcalTrigPrimESProducer.produceLUT(), EcalTrigPrimESProducer.produceLutGroup(), EcalTrigPrimESProducer.producePedestals(), EcalTrigPrimESProducer.producePhysicsConst(), EcalTrigPrimESProducer.produceSlidingWindow(), EcalTrigPrimSpikeESProducer.produceSpike(), EcalTrigPrimESProducer.produceSpike(), EcalTrigPrimESProducer.produceWeight(), EcalTrigPrimESProducer.produceWeightGroup(), edm::AliasProductResolver.productWasFetchedAndIsValid_(), edm::ParentProcessProductResolver.productWasFetchedAndIsValid_(), edm::Event.putImpl(), edm::Principal.readAllFromSourceAndMergeImmediately(), edm::Principal.recombine(), edm::RootFile.RootFile(), omtf::RpcPacker.RpcPacker(), omtf::RpcUnpacker.RpcUnpacker(), edm::ScheduleItems.ScheduleItems(), edm::DataManagingProductResolver.setFailedStatus(), HGCalTriggerBackendAlgorithmBase.setGeometry(), edm::StreamerOutputModuleBase.setHltMask(), edm::WorkerManager.setOnDemandProducts(), edm::MergeableRunProductProcesses.setProcessesWithMergeableRunProducts(), RandomClusterAlgo.setProduces(), SingleCellClusterAlgo< FECODEC, DATA >.setProduces(), FullModuleSumAlgo< FECODEC, DATA >.setProduces(), HGCTowerAlgo< FECODEC, DATA >.setProduces(), HGCClusterAlgo< FECODEC, DATA >.setProduces(), HGCalTriggerBackend::HGCalTriggerSimCluster< FECODEC, DATA >.setProduces(), gen::TauolappInterface.setRandomEngine(), TFWLiteSelectorBasic.setupNewFile(), IPTools.signedImpactParameter3D(), IPTools.signedTransverseImpactParameter(), edm::SingleChoiceNoProcessProductResolver.SingleChoiceNoProcessProductResolver(), edm::Principal.size(), TestPythiaDecays.TestPythiaDecays(), TrackListCombiner.TrackListCombiner(), edm::SubProcessParentageHelper.update(), KinematicConstrainedVertexUpdatorT< nTrk, nConstraint >.update(), fwlite::internal::BranchMapReaderStrategyV8.updateFile(), fwlite::internal::BranchMapReaderStrategyV11.updateFile(), fwlite::internal::BranchMapReaderStrategyV17.updateFile(), fwlite::internal::BranchMapReaderStrategyV1.updateMap(), edm::RootOutputFile.writeProductDescriptionRegistry(), l1t::stage1::CaloSetup.~CaloSetup(), l1t::stage2::GTSetup.~GTSetup(), and SimpleFlatTableProducerBase< T, T >.~SimpleFlatTableProducerBase().

parseEventContent.rules_regexp

Definition at line 129 of file parseEventContent.py.

parseEventContent.rules_txt

Definition at line 126 of file parseEventContent.py.