import pandas as pd
import numpy as np
import os
import sys

sys.path.insert(0, os.path.dirname(__file__))
from ListCommon import *

sumFile = open( sys.argv[1], 'w' )
detFile = open( sys.argv[2], 'w' )

physicals = ['machine', 'SizeZone']
ops = ['movement', 'polarity', 'accessor']
fx = ['fx']
bkgnd = ['NumNodes']            # never drilled/marginalized, always conditioned
ignore = [ 'InterleaveFrac',    # unused ever and always zero
           'Width',             # unused here and always one
           'Length' ]           # unused here and always =NumNodes

# assure every explanation is classified
assert( set( explanations )
        - set( ignore )
        ==
        set(physicals) | set(ops) | set(fx) | set(bkgnd) )

printHistos(
    tgtMovement = 'all',
    tgtPolarity = 'all',
    tgtAccessor = 'all',
    drillOn=physicals,
    sumFile = sumFile,
    detFile = detFile )

printHistos(
    tgtMovement = 'all',
    tgtPolarity = 'all',
    tgtAccessor = 'all',
    drillOn=ops,
    sumFile = sumFile,
    detFile = detFile )

printHistos(
    tgtMovement = 'all',
    tgtPolarity = 'all',
    tgtAccessor = 'all',
    drillOn=fx,
    sumFile = sumFile,
    detFile = detFile )
