Esempio n. 1
0
def configure( gaudi = None  ) :
    """ Configuration of the job """
    
    if not gaudi :
        from GaudiPython.Bindings import AppMgr
        gaudi = AppMgr()

    gaudi.JobOptionsType       = 'NONE'
    gaudi.EvtSel               = 'NONE'
    gaudi.HistogramPersistency = 'ROOT'

    gaudi.config()

    gaudi.DLLs = [ 'GaudiAlg', 'RootHistCnv', ]

    alg = HistoEx('HistoEx')
    gaudi.setAlgorithms( [alg] )
    alg.HistoPrint = True

    hsvc = gaudi.service('HistogramPersistencySvc')
    hsvc.OutputFile = "histo1.root"

    # This does not harm and tests bug #50389
    getMyalgBack = gaudi.algorithm ( 'HistoEx' )

    return SUCCESS
Esempio n. 2
0
def configure( gaudi = None  ) :
    """ Configuration of the job """

    if not gaudi :
        from GaudiPython.Bindings import AppMgr
        gaudi = AppMgr()

    gaudi.JobOptionsType       = 'NONE'
    gaudi.EvtSel               = 'NONE'
    gaudi.HistogramPersistency = 'ROOT'

    gaudi.ExtSvc += ["NTupleSvc" ]

    ntSvc = gaudi.service('NTupleSvc')
    ntSvc.Output = [ "MYLUN DATAFILE='TupleEx.root' OPT='NEW' TYP='ROOT'" ]

    gaudi.config()

    gaudi.DLLs = [ 'GaudiAlg', 'RootHistCnv', ]

    alg = TupleEx(
        ## configure the property
        NTupleLUN = 'MYLUN'
        )
    
    gaudi.setAlgorithms( [alg] )

    return SUCCESS
Esempio n. 3
0
        def _color_pre_start_action_():

            logger.debug('Add colorization to MessageSvc')
            from GaudiPython.Bindings import AppMgr
            _g = AppMgr()
            if not _g: return
            _s = _g.service('MessageSvc')
            if not _s: return
            _s.useColors = True
            _s.errorColorCode = ['yellow', 'red']
            _s.warningColorCode = ['red']
            _s.fatalColorCode = ['blue', 'red']
            ##_s.alwaysColorCode  = [ 'blue'            ]
            ##_s.infoColorCode    = [ 'green'           ]
            del _g, _s
Esempio n. 4
0
    if not opts.do_not_rewind:
        mainSeq.Enable = False
        evtSel.rewind()
        mainSeq.Enable = True

    # steer the monitor sequence depending on the iteration
    appMgr.algorithm('AlignMonitorSeq').Enable = (i == 0)
    appMgr.algorithm('Moni').Enable = (i == 0)
    if opts.numiter > 1:
        appMgr.algorithm('AlignPostMonitorSeq').Enable = (i == opts.numiter -
                                                          1)

    # event loop
    appMgr.run(opts.numevents)

    # fire incident for update
    from GaudiPython import gbl
    from Configurables import Escher
    incSvc = appMgr.service('IncidentSvc', 'IIncidentSvc')
    updateConstants = gbl.Incident('Alignment', 'UpdateConstants')
    if Escher().getProp("Incident") == "GlobalMPedeFit":
        updateConstants = gbl.Incident('Alignment', 'GlobalMPedeFit')
        printUniformity = gbl.Incident('Alignment', 'PrintUniformTD')
        updateTrackSelector = gbl.Incident('Alignment', 'ResetUniformity')
        incSvc.fireIncident(printUniformity)
        incSvc.fireIncident(updateTrackSelector)
    incSvc.fireIncident(updateConstants)

#exit the appmgr for finalize
appMgr.exit()
Esempio n. 5
0
              outputs={
                  "DigitLocation": "Raw/HC/Digits",
                  "L0DigitLocation": "Raw/HC/L0Digits"
              },
              inputs={"RawEventLocations": ['/Event/DAQ/RawEvent']},
              properties={
                  "DigitLocation": "Raw/HC/Digits",
                  "L0DigitLocation": "Raw/HC/L0Digits"
              },
              conf=DecoderDB)
conf = dec.setup()

from GaudiPython.Bindings import AppMgr
appMgr = AppMgr()
appMgr.HistogramPersistency = "ROOT"
hpSvc = appMgr.service('HistogramPersistencySvc')
hpSvc.OutputFile = options.OutputDirectory + '/' + options.runNumber + '/' + options.analysisType + '_' + options.runNumber + '.root'

ntSvc = appMgr.ntupleSvc()
ntSvc.Output = [
    "FILE1 DATAFILE='" + options.OutputDirectory + '/' + options.runNumber +
    '/' + options.analysisType + '_' + options.runNumber +
    "Tuple.root'  TYP='ROOT'  OPT='NEW'"
]

eventTimeDecoder = appMgr.toolsvc().create("OdinTimeDecoder",
                                           interface="IEventTimeDecoder")

appMgr.addAlgorithm('LbAppInit')

from Configurables import HCRawBankDecoder
Esempio n. 6
0
        DDDBConf().DbRoot = dddbroot
    else:
        assert dddbroot.endswith('.db'), 'Unsupported format of DDDB'
        CondDB().addLayer(dbFile=dddbroot, dbName="DDDB")
else:
    print 'Using default DDDB'

from Configurables import MessageSvc

MessageSvc().Format = '% F%40W%S%7W%R%T %0W%M'

appMgr = AppMgr(outputlevel=4)
appMgr.ExtSvc += ['TransportSvc']
det = appMgr.detSvc()

transSvc = appMgr.service('TransportSvc', 'ITransportSvc')

# define intersections
std = GaudiPython.gbl.std
Interval = std.pair('double', 'double')
Intersection = std.pair(Interval, 'const Material*')
Intersections = std.vector(Intersection)
intersepts = Intersections()
tickMin = 0.
tickMax = 1.


def getRadiationAndInteractionLength(intersepts):
    fracAbsLength_rad = 0.
    fracAbsLength_int = 0.
Esempio n. 7
0
atexit.register ( gaudi.exit )


gaudi.EvtSel               = 'NONE' ## no external event input
#gaudi.HistogramPersistency = 'HBOOK' ## define the persistency type for N-tuples
gaudi.HistogramPersistency = 'ROOT' ## define the persistency type for N-tuples


## configure & initialize 
gaudi.config()
gaudi.initialize()

## get some random numbers
Rndm        = cpp.Rndm
IRndmGenSvc = cpp.IRndmGenSvc
rndmSvc     = gaudi.service('RndmGenSvc',IRndmGenSvc) 
if not rndmSvc : gaudi.createSvc('RndmGenSvc') 
rndmSvc     = gaudi.service('RndmGenSvc',IRndmGenSvc)

gauss       = Rndm.Numbers ( cpp.SmartIF("IRndmGenSvc")(rndmSvc) , Rndm.Gauss ( 0.0 , 1.0 ) )
    
## get the first N-tuple
tup1 = TupleUtils.nTuple( "path"             , ## the path 
                          "It is a title for my n-tuple" , ## the title 
                          LUN = 'MYLUN1'                 ) ## logical unit  
## fill it:
for i in xrange(0,5000) :
    tup1.column ( 'i'  , i           )  ## int 
    tup1.column ( 'g1' , gauss()     )  ## double 
    tup1.column ( 'g2' , gauss()     )  ## double
    b = 0 < gauss() 
Esempio n. 8
0
    aida2root 
    )

print __doc__ 

## get the application manager   (create if needed) 
gaudi = AppMgr()

## no external input
gaudi.EvtSel = 'NONE'

## define the histogram persistency 
gaudi.HistogramPersistency = "ROOT"

## define the name of the output file with histograms:
hsvc = gaudi.service('HistogramPersistencySvc')
hsvc.OutputFile = "HistoUtilsEx.root"

## configure & initialize 
gaudi.config()
gaudi.initialize()

## get some random numbers
Rndm        = cpp.Rndm
IRndmGenSvc = cpp.IRndmGenSvc
rndmSvc     = gaudi.service('RndmGenSvc',IRndmGenSvc) 
if not rndmSvc : gaudi.createSvc('RndmGenSvc') 
rndmSvc     = gaudi.service('RndmGenSvc',IRndmGenSvc)
gauss       = Rndm.Numbers ( cpp.SmartIF("IRndmGenSvc")(rndmSvc) , Rndm.Gauss ( 0.0 , 1.0 ) )