Project

General

Profile

Feature #11033

art module in Python

Added by Jim Kowalkowski almost 4 years ago. Updated over 1 year ago.

Status:
Accepted
Priority:
Normal
Assignee:
-
Category:
Infrastructure
Target version:
Start date:
12/01/2015
Due date:
12/01/2015
% Done:

0%

Estimated time:
Scope:
Internal
Experiment:
-
SSI Package:
Duration: 1

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:

  1. 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
  2. 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

Follows art - Feature #11026: Tuple product supportAccepted11/30/2015

Precedes art - Feature #11035: art producer module in pythonAccepted12/02/201512/02/2015

History

#1 Updated by Jim Kowalkowski almost 4 years ago

#2 Updated by Jim Kowalkowski almost 4 years ago

#3 Updated by Kyle Knoepfel almost 4 years ago

  • Status changed from New to Accepted

#4 Updated by Kyle Knoepfel almost 4 years ago

  • Target version set to 2.01.00

#5 Updated by Kyle Knoepfel over 3 years ago

  • Target version changed from 2.01.00 to Vega

#6 Updated by Kyle Knoepfel over 1 year ago

  • Target version changed from Vega to Capella


Also available in: Atom PDF