"scSeedCryIphi"
]

endcapVariables = [
    "scPreshowerEnergy/scRawEnergy"
]




commonVariablesEB = commonVariables + barrelVariables
commonVariablesEE = commonVariables + endcapVariables



batch = RegressionParametricJobLauncher()
batch.baseDir = "/home/llr/cms/sauvan/RegressionTraining/"
batch.baseName = "GBR_Clustering_70pre11_Photons"
batch.inputFiles = inputFiles
batch.outputDirectory = "/home/llr/cms/sauvan/DATA/sauvan/RegressionResults/StudyClustering/70pre11/Test/GBR_Clustering_Photons_MoreVariables_PtCut50_PtSlope50_Sig5/"
batch.commonOptions = ["MinEvents=200","Shrinkage=0.1","NTrees=1000","MinSignificance=5.0","RandomSeed=eventNumber+123456*scIndex","EventWeight=min(1,exp(-(genPt-50)/50))"]
batch.commonVariablesEB = commonVariablesEB
batch.commonVariablesEE = commonVariablesEE
batch.commonCutsEB      = ["scIsEB"]
batch.commonCutsEE      = ["!scIsEB"]
batch.commonCuts        = ["(eventNumber%2==0)&&(isMatched==1)"]
batch.commonCutsError   = ["(eventNumber%2!=0)&&(((eventNumber-1)/2)%4==3)&&(isMatched==1)"]
batch.doErrors = True
batch.doCombine = False

batch.target = "genEnergy/(scRawEnergy+scPreshowerEnergy)"
    "(scRawEnergy+scPreshowerEnergy)*BDTresponse/trkMomentum*sqrt(BDTerror/BDTresponse*BDTerror/BDTresponse+trkMomentumRelError*trkMomentumRelError)", ## error on E/p ( E/p *sqrt((dE/E)^2 + (dp/p)^2) )
    "eleEcalDriven",
    "eleTrackerDriven",
    "eleClass",
    "scIsEB",
]



commonVariablesEB = commonVariables + barrelVariables
commonVariablesEE = commonVariables
commonVariablesComb = combineVariables



batch = RegressionParametricJobLauncher()
batch.trainerType = "GBRLikelihoodTrain"
batch.baseDir = "/home/llr/cms/sauvan/Regression/RegressionTraining/"
batch.baseName = "GBRLikelihood_Clustering_746_bx50_Electrons"
batch.libs.append("{0}/lib/{1}/libHiggsAnalysisGBRLikelihood.so".format(cmsswBase, scram_arch))
batch.libs.append("{0}/lib/{1}/HiggsAnalysisGBRLikelihood_yr_rdict.pcm".format(cmsswBase, scram_arch))
batch.inputFiles = inputFiles
batch.outputDirectory = "/data_CMS/cms/sauvan/RegressionResults/StudyClustering/746/GBRLikelihood_Clustering_bx50_Electrons_MoreVariables_PtCut50_PtSlope50_Sig5/"
batch.histoConfig = "../../dummy_Histo.config"
batch.commonOptions = ["MinEvents=200","Shrinkage=0.1","NTrees=1000","MinSignificance=5.0","RandomSeed=eventNumber+123456*scIndex","EventWeight=min(1,exp(-(genPt-50)/50))"]
batch.commonVariablesEB = commonVariablesEB
batch.commonVariablesEE = commonVariablesEE
batch.commonVariablesComb = commonVariablesComb
batch.commonCutsEB      = ["scIsEB"]
batch.commonCutsEE      = ["!scIsEB"]
batch.commonCuts        = ["(eventNumber%2==0)&&(isMatched==1)"]
    "clusterDPhiToSeed[2]",
    "clusterDEtaToSeed[0]",
    "clusterDEtaToSeed[1]",
    "clusterDEtaToSeed[2]",
]

barrelVariables = [
    "scSeedCryEta", "scSeedCryPhi", "scSeedCryIeta", "scSeedCryIphi"
]

endcapVariables = ["scPreshowerEnergy/scRawEnergy"]

commonVariablesEB = commonVariables + barrelVariables
commonVariablesEE = commonVariables + endcapVariables

batch = RegressionParametricJobLauncher()
batch.baseDir = "/home/llr/cms/sauvan/RegressionTraining/"
batch.baseName = "GBR_Clustering_70pre11_Photons"
batch.inputFiles = inputFiles
batch.outputDirectory = "/home/llr/cms/sauvan/DATA/sauvan/RegressionResults/StudyClustering/70pre11/Test/GBR_Clustering_Photons_MoreVariables_PtCut50_PtSlope50_Sig5/"
batch.commonOptions = [
    "MinEvents=200", "Shrinkage=0.1", "NTrees=1000", "MinSignificance=5.0",
    "RandomSeed=eventNumber+123456*scIndex",
    "EventWeight=min(1,exp(-(genPt-50)/50))"
]
batch.commonVariablesEB = commonVariablesEB
batch.commonVariablesEE = commonVariablesEE
batch.commonCutsEB = ["scIsEB"]
batch.commonCutsEE = ["!scIsEB"]
batch.commonCuts = ["(eventNumber%2==0)&&(isMatched==1)"]
batch.commonCutsError = [
    "trkMomentum",
    "trkMomentumRelError",
    "BDTerror/BDTresponse/trkMomentumRelError",
    "(scRawEnergy+scPreshowerEnergy)*BDTresponse/trkMomentum",
    "(scRawEnergy+scPreshowerEnergy)*BDTresponse/trkMomentum*sqrt(BDTerror/BDTresponse*BDTerror/BDTresponse+trkMomentumRelError*trkMomentumRelError)",  ## error on E/p ( E/p *sqrt((dE/E)^2 + (dp/p)^2) )
    "eleEcalDriven",
    "eleTrackerDriven",
    "eleClass",
    "scIsEB",
]

commonVariablesEB = commonVariables + barrelVariables
commonVariablesEE = commonVariables
commonVariablesComb = combineVariables

batch = RegressionParametricJobLauncher()
batch.trainerType = "GBRLikelihoodTrain"
batch.baseDir = "/home/llr/cms/sauvan/Regression/RegressionTraining/"
batch.baseName = "GBRLikelihood_Clustering_746_bx50_Electrons_PROD"
batch.libs.append("{0}/lib/{1}/libHiggsAnalysisGBRLikelihood.so".format(
    cmsswBase, scram_arch))
batch.libs.append("{0}/lib/{1}/HiggsAnalysisGBRLikelihood_yr_rdict.pcm".format(
    cmsswBase, scram_arch))
batch.inputFiles = inputFiles
batch.outputDirectory = "/data_CMS/cms/sauvan/RegressionResults/StudyClustering/746/GBRLikelihood_Clustering_bx50_Electrons_MoreVariables_PtCut50_PtSlope50_Sig5_PROD/"
batch.histoConfig = "../../dummy_Histo.config"
batch.commonOptions = [
    "MinEvents=200", "Shrinkage=0.1", "NTrees=1000", "MinSignificance=5.0",
    "RandomSeed=eventNumber+123456*scIndex",
    "EventWeight=min(1,exp(-(genPt-50)/50))"
]