User Tools

Site Tools


ganga:ganga

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
ganga:ganga [2012/08/12 11:14] – [Submitting a ROOT-job] decianmganga:ganga [2016/01/19 17:14] – [Bookkeeping information within Ganga] egraveri
Line 466: Line 466:
 dirac-proxy-init -g lhcb_user dirac-proxy-init -g lhcb_user
 </code> </code>
 +
 +===== Bookkeeping information within Ganga =====
 +A simple method that can be added to the ~/.ganga.py to access information directly from the BK can be seen below:
 +
 +<code python>
 +def getBKInfo ( evttype )  :
 +    from subprocess import Popen, PIPE
 +
 +    serr = open ( '/dev/null' )
 +    pipe = Popen ( [ 'get_bookkeeping_info'  , str(evttype) ] ,
 +                   env    = os.environ ,
 +                   stdout = PIPE       ,
 +                   stderr = serr       )
 +            
 +    stdout = pipe.stdout
 +    ts = {} 
 +    result = {} 
 +        
 +    for line in stdout :
 +    
 +        try :
 +            value = eval ( line )
 +        except :
 +            continue
 +            
 +        if not isinstance ( value    , tuple ) : continue
 +        if not isinstance ( value[0] , str   ) : continue
 +        if not isinstance ( value[1] , str   ) : continue
 +        if not isinstance ( value[2] , str   ) : continue
 +
 +        if result.has_key ( value[0] ) : continue
 +        result [ value[0] ] = value[1:]
 +
 +    return result
 +</code>
 +
 +In this case two additional files 'get_bookkeeping_info' and 'dirac-bookkeeping-get-prodinfo-eventtype.py' are required to be saved locally in your ~/bin/ directory. 
 +
 +More info can be found here: [[https://groups.cern.ch/group/lhcb-bender/Lists/Archive/DispForm.aspx?ID=551]]
  
 ===== Help ===== ===== Help =====
Line 479: Line 518:
 ===== Links ===== ===== Links =====
 Information for using ganga in LHCb (and where I stole most of the information from): [[http://ganga.web.cern.ch/ganga/user/html/LHCb/]] Information for using ganga in LHCb (and where I stole most of the information from): [[http://ganga.web.cern.ch/ganga/user/html/LHCb/]]
- 
ganga/ganga.txt · Last modified: 2017/01/12 12:31 by bernet