Feature #11033
art module in Python
Start date:
12/01/2015
Due date:
12/01/2015
% Done:
0%
Estimated time:
Scope:
Internal
Experiment:
-
SSI Package:
Description
I would like to be able to write an EDAnalyzer in python. The initial work is available in artextensions on branch feature/pymod, in directory artextensions/PyMod. The interfaces are defined here. This work requires issue 11026. This is part of the usability issues at https://cdcvs.fnal.gov/redmine/projects/cet-is-private/wiki/IdeasForUsability. Only the NTuple product from issue 11026 needs to be supported; the initial work demonstrates this.
Here are the issues that need to be sorted out (or at least reviewed) to complete this work:
- need to make sure that the python path is set correctly so that the python module code is picked up properly when the art executable is run
- requires that no build step be necessary to run art and pick up newly edited python module code.
Here is a partial example module (from PyMod) of an art module written in Python.
class MyModule(art_services.Analyzer): def __init__(self, pset): super(MyModule,self).__init__(pset) self.name = pset['module_name'] self.label = pset['label'] self.registerHist(TH1F("Puker1","Duke1",15,0,1.3)) self.registerHist(TH1F("Puker2","Duke2",10,0,1.5)) self.registerHist(TH1F("Puker3","Duke3",15,0,1.3)) def analyze(self,event): print "in mymodule analyze", self.name prod = art_services.event_get(event,self.label) print prod all = art_services.extract_all(prod) print all.b b = all.a * all.b self.Puker1.Fill(all.a[0]) self.Puker2.Fill(all.a[1]) self.Puker3.Fill(all.c[2]) return 0 def endJob(self): print "in endJob of MyModule" return 0
Related issues
History
#1 Updated by Jim Kowalkowski over 5 years ago
- Follows Feature #11026: Tuple product support added
#2 Updated by Jim Kowalkowski over 5 years ago
- Precedes Feature #11035: art producer module in python added
#3 Updated by Kyle Knoepfel about 5 years ago
- Status changed from New to Accepted
#4 Updated by Kyle Knoepfel about 5 years ago
- Target version set to 2.01.00
#5 Updated by Kyle Knoepfel almost 5 years ago
- Target version changed from 2.01.00 to Vega
#6 Updated by Kyle Knoepfel almost 3 years ago
- Target version changed from Vega to Capella