Skip to content

Commit

Permalink
Remove module duplicates. Use more general regex for ESRget
Browse files Browse the repository at this point in the history
  • Loading branch information
gartung committed Jul 8, 2021
1 parent 6b960a7 commit 6df3623
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
18 changes: 10 additions & 8 deletions Utilities/StaticAnalyzers/scripts/callgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
farg = re.compile(r"\(.*?\)")
tmpl = re.compile(r'<.*?>')
toplevelfuncs = set()
epfuncre = re.compile(r"edm::eventsetup::EventSetupRecord::get<class edm::ESHandle<class .*>>(.*) const")
#epfuncre = re.compile(r"edm::eventsetup::EventSetupRecord::get<.*>\(.*\)")
epfuncre = re.compile(r"edm::eventsetup::EventSetupRecord::get<class edm::ESHandle<(class|struct) .*>>\(.*\) const")
skipfunc = re.compile(r"TGraph::IsA\(.*\)")
epfuncs = set()

Expand Down Expand Up @@ -55,21 +56,22 @@
cs = str("")
previous = str("")
for p in path:
if epfuncre.match(p):
break
stripped = re.sub(farg, "()", p)
stripped = p
#re.sub(farg, "()", p)
if previous != stripped:
cs += ' ' + stripped + ";"
previous = stripped
if cs not in callstacks:
callstacks.add(cs)
break

report = dict()
for key in sorted(module2package.keys()):
for value in sorted(module2package[key]):
for cs in sorted(callstacks):
if value in modules:
vre = re.compile(' %s::.*();' % value)
if vre.search(cs) and value in modules:
report.setdefault(key, {}).setdefault(value, []).append(cs)
for callstack in sorted(callstacks):
if vre.search(callstack) :
report.setdefault(key, {}).setdefault(value, []).append(callstack)

r = open('eventsetuprecord-get.yaml', 'w')
yaml.dump(report, r)
3 changes: 0 additions & 3 deletions Utilities/StaticAnalyzers/scripts/module_to_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3382,7 +3382,6 @@ RecoEgamma/EgammaPhotonProducers:
- ConversionTrackCandidateProducer
- GEDPhotonProducer
- PhotonProducer
- TrackProducer
- TrackProducerWithSCAssociation
- ConversionProducer
- ConversionTrackCandidateProducer
Expand All @@ -3394,7 +3393,6 @@ RecoEgamma/EgammaPhotonProducers:
- PhotonCoreProducer
- PhotonProducer
- ReducedEGProducer
- TrackProducerWithSCAssociation
RecoEgamma/EgammaTools:
- CalibratedElectronProducer
- CalibratedPatElectronProducer
Expand Down Expand Up @@ -3980,7 +3978,6 @@ RecoParticleFlow/PFTracking:
- PFV0Producer
- SimVertexSelector
RecoPixelVertexing/PixelLowPtUtilities:
- PixelTrackProducer
- PixelVertexProducerClusters
- SiPixelClusterShapeCacheProducer
- ClusterShapeTrackFilterProducer
Expand Down

0 comments on commit 6df3623

Please sign in to comment.