## Configuration
# sample = "data39x"
#sample = "z"
sample = "zg"
# sample = "qcd"


ROOT.gROOT.LoadMacro("resolutionErrors.C+")

#myFiles = mmgChains.efiles
#myPath  = mmgChains.epath

myFiles = mmgChains.cfiles
myPath  = mmgChains.cpath

chains = mmgChains.getChains( myFiles, myPath )

chain = chains[sample]

chain.SetAlias("pt1", "muGenPt[dau1]")
chain.SetAlias("pt2", "muGenPt[dau2]")
chain.SetAlias("eta1", "muGenEta[dau1]")
chain.SetAlias("eta2", "muGenEta[dau2]")
chain.SetAlias("phi1", "muGenPhi[dau1]")
chain.SetAlias("phi2", "muGenPhi[dau2]")
chain.SetAlias("mm", "mmgDimuon")
chain.SetAlias("mu1", "dau1[mmgDimuon]")
chain.SetAlias("mu2", "dau2[mmgDimuon]")
chain.SetAlias("g", "mmgPhoton")
chain.SetAlias("mnear", "mmgMuonNear")
chain.SetAlias("mfar", "mmgMuonFar")
print "Switching to batch mode ..."
sys.argv.append( '-b' )

import ROOT
import JPsi.MuMu.common.MuMuGammaChains as mmgChains


## Configuration
sample = "data39x"
# sample = "z"


ROOT.gROOT.LoadMacro("resolutionErrors.C+")

chains = mmgChains.getChains(mmgChains.dfiles,
                             mmgChains.dpath
                             )

chain = chains[sample]

chain.SetAlias("pt1", "muGenPt[dau1]")
chain.SetAlias("pt2", "muGenPt[dau2]")
chain.SetAlias("eta1", "muGenEta[dau1]")
chain.SetAlias("eta2", "muGenEta[dau2]")
chain.SetAlias("phi1", "muGenPhi[dau1]")
chain.SetAlias("phi2", "muGenPhi[dau2]")
chain.SetAlias("mm", "mmgDimuon")
chain.SetAlias("mu1", "dau1[mmgDimuon]")
chain.SetAlias("mu2", "dau2[mmgDimuon]")
chain.SetAlias("g", "mmgPhoton")
chain.SetAlias("mnear", "mmgMuonNear")