Exemplo n.º 1
0
basePath = 'samples'
sgnInputFile = 'sample.sgn.root'
bkgInputFile = 'sample.bkg.root'
outputFile = 'tuningData_citest1'
treePath = 'HLT/Egamma/Ntuple/Ntuple/HLT_e24_lhmedium_nod0_iloose'
crossValPath = 'data/crossValid_citest0.pic.gz'
etBins = [0, 100000]
etaBins = [0, 2.5]

from TuningTools.CrossValid import CrossValidArchieve
with CrossValidArchieve(crossValPath) as CVArchieve:
    crossVal = CVArchieve
    del CVArchieve

from TuningTools import createData
from TuningTools import Reference, RingerOperation
from RingerCore import expandFolders

createData(basePath + '/' + sgnInputFile,
           basePath + '/' + bkgInputFile,
           RingerOperation.EFCalo,
           referenceSgn=Reference.Off_Likelihood,
           referenceBkg=Reference.Truth,
           treePath=treePath,
           pattern_oFile=outputFile,
           l1EmClusCut=1,
           l2EtCut=1,
           efEtCut=1,
           etBins=etBins,
           etaBins=etaBins,
           crossVal=crossVal,
Exemplo n.º 2
0
                     nInitsPerJob=1,
                     nSortsPerJob=2,
                     compress=True)

from TuningTools.CrossValid import CrossValid, CrossValidArchieve
crossValid = CrossValid(
    nSorts=nSorts,
    nBoxes=5,
    nTrain=3,
    nValid=2,
    #nTest=args.nTest,
    #seed=args.seed,
    #level=args.output_level
)
place = CrossValidArchieve(
    'crossValid_citest0',
    crossValid=crossValid,
).save(True)

from TuningTools.PreProc import *
#ppCol = PreProcCollection( PreProcChain( MapStd() ) )
ppCol = PreProcChain(Norm1())
from TuningTools import fixPPCol
ppCol = fixPPCol(ppCol)
place = PreProcArchieve('ppFile_citest0', ppCol=ppCol).save()

from TuningTools import SubsetGeneratorArchieve, fixSubsetCol, SubsetGeneratorPatterns, Cluster, GMMCluster
from TuningTools import Norm1, PreProcChain, Projection

ppCross = [[[None for k in range(nSorts)] for j in range(nEta)]
           for i in range(nEt)]
import numpy as np
Exemplo n.º 3
0
from TuningTools.CreateTuningJobFiles import createTuningJobFiles
createTuningJobFiles(outputFolder='config.n5to20.s10.i100.100IPerSPerN',
                     neuronBounds=[5, 20],
                     sortBounds=10,
                     nInits=100,
                     nNeuronsPerJob=1,
                     nInitsPerJob=100,
                     nSortsPerJob=1,
                     compress=True)

from TuningTools.CrossValid import CrossValid, CrossValidArchieve
crossValid = CrossValid(
    nSorts=50,
    nBoxes=10,
    nTrain=6,
    nValid=4,
    #nTest=args.nTest,
    #seed=args.seed,
    #level=args.output_level
)
place = CrossValidArchieve(
    'crossValid',
    crossValid=crossValid,
).save(True)

from TuningTools.PreProc import *
#ppCol = PreProcCollection( PreProcChain( MapStd() ) )
ppCol = PreProcChain(Norm1())
place = PreProcArchieve('ppFile', ppCol=ppCol).save()
Exemplo n.º 4
0
#!/usr/bin/env python

from TuningTools.CreateData import TuningDataArchieve
filePath = '/afs/cern.ch/work/j/jodafons/public/Tuning2016/TuningConfig/mc14_13TeV.147406.129160.sgn.offLikelihood.bkg.truth.trig.e24_lhmedium_nod0_l1etcut20_l2etcut19_efetcut24_binned.pic.npz'
TDArchieve = TuningDataArchieve(filePath)
nEtBins = TDArchieve.nEtBins()
nEtaBins = TDArchieve.nEtaBins()

from TuningTools.PreProc import PreProcArchieve
with PreProcArchieve(
        '/afs/cern.ch/work/w/wsfreund/public/Online/Trigger_PCA_ICA_20_7_3_6/pre_proc_pca_T.pic'
) as ppCol:
    pass
from TuningTools.CrossValid import CrossValid, CrossValidArchieve
crossValidFile = '/afs/cern.ch/work/j/jodafons/public/Tuning2016/TuningConfig/crossVal_50sorts_20160324.pic.gz'
with CrossValidArchieve(crossValidFile) as CVArchieve:
    crossValid = CVArchieve
del CVArchieve

import numpy as np
#np.set_printoptions(threshold=np.nan)

from itertools import product
for etBinIdx, etaBinIdx in product(
        range(nEtBins if nEtBins is not None else 1),
        range(nEtaBins if nEtaBins is not None else 1)):
    with TuningDataArchieve(
            filePath,
            et_bin=etBinIdx if nEtBins is not None else None,
            eta_bin=etaBinIdx if nEtaBins is not None else None) as data:
        for sort in range(50):