if HistFitterArgs.cmd:
        log.info("Python commands executed: %s" % HistFitterArgs.cmd)
        exec(HistFitterArgs.cmd) ## python execute

    gROOT.SetBatch(not runInterpreter)

    """
    mandatory user-defined configuration file
    """
    execfile(HistFitterArgs.configFile[0]) #[0] since any extra arguments (sys.argv[-1], etc.) are caught here

    """
    standard execution from now on
    """
    configMgr.initialize()

    RooRandom.randomGenerator().SetSeed(configMgr.toySeed)

    ReduceCorrMatrix = configMgr.ReduceCorrMatrix

    """
    runs Trees->histos and/or histos->workspace according to specifications
    """
    if configMgr.readFromTree or configMgr.executeHistFactory:
        if doCodeProfiling:
            import cProfile
            cProfile.run('configMgr.executeAll()')
        else:
            configMgr.executeAll()
        elif opt == '-s':
            configMgr.toySeedSet = True
            configMgr.toySeed = int(arg)
        elif opt == '-a':
            configMgr.useAsimovSet = True
        elif opt == '-g':
            sigSamples = arg.split(',')    
        pass
    gROOT.SetBatch(not runInterpreter)
    

    #mandatory user-defined configuration
    execfile(configFile)

    #standard execution from now on. 
    configMgr.initialize()
        
    #runs Trees->histos and/or histos->workspace according to specifications
    if configMgr.readFromTree or configMgr.executeHistFactory:
        configMgr.executeAll()

    if runFit:
        for i in range(0,len(configMgr.topLvls)-1):
	#if len(configMgr.topLvls)>1:
            r=GenerateFitAndPlot(configMgr.topLvls[i])
            #for idx in range(len(configMgr.topLvls)):
            #    r=GenerateFitAndPlot(configMgr.topLvls[idx]) #1])
            pass
        #configMgr.cppMgr.fitAll()
        print "\nr0=GenerateFitAndPlot(configMgr.topLvls[0])"
        print "r1=GenerateFitAndPlot(configMgr.topLvls[1])"