Skip to content

Commit

Permalink
Merge pull request cms-sw#67 from MT2Analysis/CMGTools-from-CMSSW_7_4_3
Browse files Browse the repository at this point in the history
Cmg tools from cmssw 7 4 3
  • Loading branch information
Boris Mangano committed Jul 1, 2015
2 parents 91830f9 + 4da78bf commit b88722f
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 56 deletions.
1 change: 0 additions & 1 deletion CMGTools/TTHAnalysis/BuildFile.xml
Expand Up @@ -5,7 +5,6 @@
<use name="EgammaAnalysis/ElectronTools"/>
<use name="SimDataFormats/GeneratorProducts"/>
<use name="RecoVertex/KalmanVertexFit"/>
<use name="MagneticField/ParametrizedEngine"/>
<use name="roottmva"/>
<use name="rootminuit2"/>
<use name="lhapdf"/>
Expand Down
4 changes: 2 additions & 2 deletions CMGTools/TTHAnalysis/cfg/crab/heppy_crab_config.py
Expand Up @@ -19,12 +19,12 @@
config.section_("Data")
config.Data.inputDBS = 'global'
config.Data.splitting = 'EventBased'
config.Data.outLFN = '/store/user/' + os.environ["USER"]
config.Data.outLFNDirBase = '/store/user/' + os.environ["USER"]
config.Data.publication = False

config.section_("Site")
#config.Site.whitelist = ["T2_CH_CSCS"]
config.Site.whitelist = ["T2_CH_CSCS", "T2_IT_Legnaro", "T2_UK_London_IC", "T2_UK_SGrid_Bristol", "T2_DE_DESY", "T2_ES_CIEMAT", "T2_IT_Rome", "T2_AT_Vienna","T2_DE_RWTH","T2_FR_GRIF_IRFU", "T2_HU_Budapest"] #, "T2_FR_IPHC", "T2_BE_IIHE", "T2_IT_Pisa", "T2_ES_IFCA", "T2_UK_London_Brunel"] , "T2_PK_NCP", "T2_US_Purdue", "T2_UA_KIPT", "T2_KR_KNU", "T2_RU_IHEP", "T2_RU_INR", "T2_RU_JINR", "T2_US_MIT", "T2_US_Wisconsin", "T2_US_UCSD", "T2_US_Vanderbilt", "T2_US_Caltech"]
config.Site.whitelist = ["T2_CH_CSCS"] #, "T2_IT_Legnaro", "T2_UK_London_IC", "T2_UK_SGrid_Bristol", "T2_DE_DESY", "T2_ES_CIEMAT", "T2_IT_Rome", "T2_AT_Vienna","T2_DE_RWTH","T2_FR_GRIF_IRFU", "T2_HU_Budapest", "T2_FR_IPHC", "T2_BE_IIHE", "T2_IT_Pisa", "T2_ES_IFCA", "T2_UK_London_Brunel", "T2_US_Purdue", "T2_UA_KIPT", "T2_US_MIT", "T2_US_Wisconsin", "T2_US_UCSD", "T2_US_Vanderbilt", "T2_US_Caltech"]
config.Site.storageSite = "T3_CH_PSI"
#config.Data.ignoreLocality = True

2 changes: 1 addition & 1 deletion CMGTools/TTHAnalysis/cfg/crab/heppy_crab_config_env.py
Expand Up @@ -33,7 +33,7 @@

# output will be .../$outLFN/$PRIMARY_DS/$PUBLISH_NAME/$TIMESTAMP/$COUNTER/$FILENAME
# https://twiki.cern.ch/twiki/bin/view/CMSPublic/Crab3DataHandling
config.Data.outLFN += '/babies/' + cmg_version
config.Data.outLFNDirBase += '/babies/' + cmg_version
config.Data.primaryDataset = production_label
config.Data.publishDataName = dataset
#final output: /store/user/$USER/babies/cmg_version/production_label/dataset/150313_114158/0000/foo.bar
Expand Down
17 changes: 5 additions & 12 deletions CMGTools/TTHAnalysis/cfg/crab/heppy_crab_script.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
import os
import PhysicsTools.HeppyCore.framework.config as cfg
#cfg.Analyzer.nosubdir=True

import ROOT
Expand All @@ -9,13 +8,6 @@
import re
#import PSet

ROOT.gSystem.Load("libCMGToolsTTHAnalysis")
ROOT.gSystem.Load("libFWCoreFWLite.so")
ROOT.gSystem.Load("libDataFormatsFWLite.so")
ROOT.gSystem.Load("libPhysicsToolsHeppy")
ROOT.gSystem.Load("libCMGToolsRootTools")
ROOT.AutoLibraryLoader.enable()

dataset = ""
total = 0 # total number of jobs for given dataset, not used at the moment
nevents = None # this means run all events
Expand All @@ -37,8 +29,8 @@
nevents = int(arg.split("=")[1])
print "selected to run over", nevents, "events"
elif arg.split("=")[0] == "useAAA":
useAAA = bool(arg.split("=")[1])
print "chosen to run via xrootd"
useAAA = not (arg.split("=")[1] == 'False') # 'True' by default
if useAAA: print "chosen to run via xrootd"

print "dataset:", dataset
print "job", job , " out of", total
Expand Down Expand Up @@ -68,7 +60,8 @@
print " - components:", config.components
if len(selectedComponents)>1:
print "More than one selected component:"
cfg.printComps(selectedComponents)
from PhysicsTools.HeppyCore.framework.config import printComps
printComps(selectedComponents)
else:
print "Selected component:"
print selectedComponents[0]
Expand Down Expand Up @@ -101,7 +94,7 @@

import ROOT
f=ROOT.TFile.Open('mt2.root')
entries=f.Get('tree').GetEntries()
entries=f.Get('mt2').GetEntries()
f.Close()

print entries, "events processed"
Expand Down
6 changes: 4 additions & 2 deletions CMGTools/TTHAnalysis/cfg/crab/heppy_crab_script.sh
Expand Up @@ -4,7 +4,6 @@ tar xzf python.tar.gz --directory $CMSSW_BASE
tar xzf cafpython.tar.gz --directory $CMSSW_BASE

# uncomment for debuging purposes

#ls -lR .
#echo "ARGS:"
#echo $@
Expand All @@ -17,9 +16,12 @@ tar xzf cafpython.tar.gz --directory $CMSSW_BASE
#echo $PYTHONPATH
#echo $PWD
#echo $HOME
#echo $ROOTSYS

# copy auxiliarity data to the right place (json, pu, lep eff, jet corr, ...)
cp lib/slc*/* $CMSSW_BASE/lib/slc*
cp -r lib/* $CMSSW_BASE/lib/
mkdir $CMSSW_BASE/src/CMGTools/
cp -r src/CMGTools/* $CMSSW_BASE/src/CMGTools/
for i in `find src/ -name data -type d`
do
echo $i
Expand Down
8 changes: 4 additions & 4 deletions CMGTools/TTHAnalysis/cfg/crab/launchall.py
Expand Up @@ -3,18 +3,18 @@
# datasets to run as defined from run_susyMT2.cfg
# number of jobs to run per dataset decided based on splitFactor and fineSplitFactor from cfg file
# in principle one only needs to modify the following two lines:
production_label = "testSplit"
cmg_version = 'MT2_CMGTools-from-CMSSW_7_2_3'
production_label = "prod74Xdata_noJSON"
cmg_version = 'MT2_CMGTools-from-CMSSW_7_4_3'

debug = False
useAAA = True
useAAA = False

handle = open("heppy_config.py", 'r')
cfo = imp.load_source("heppy_config", "heppy_config.py", handle)
conf = cfo.config
handle.close()

#os.system("scramv1 runtime -sh")
os.system("scramv1 runtime -sh")
os.system("source /cvmfs/cms.cern.ch/crab3/crab.sh")

os.environ["PROD_LABEL"] = production_label
Expand Down
58 changes: 35 additions & 23 deletions CMGTools/TTHAnalysis/cfg/run_susyMT2_cfg.py
Expand Up @@ -211,7 +211,8 @@

#-------- HOW TO RUN
# choose 2 for full production
test = 0
test = 3
isData = False
if test==0:
# ------------------------------------------------------------------------------------------- #
# --- all this lines taken from CMGTools.TTHAnalysis.samples.samples_13TeV_PHYS14
Expand Down Expand Up @@ -250,7 +251,7 @@
# Uncomment the two following lines to run on a specific event
#eventSelector.toSelect = [ 84142401 ]
#sequence = cfg.Sequence([eventSelector] + sequence)
from CMGTools.TTHAnalysis.samples.samples_13TeV_PHYS14 import *
#from CMGTools.TTHAnalysis.samples.samples_13TeV_PHYS14 import *
from CMGTools.TTHAnalysis.samples.samples_13TeV_74X import *
from CMGTools.TTHAnalysis.samples.samples_8TeVReReco_74X import *

Expand All @@ -259,59 +260,71 @@

comp=TTJets
#comp.files = ['/afs/cern.ch/user/d/dalfonso/public/TESTfilesPHY14/TTJets_miniAOD_fixPhoton_forSynch.root']
#comp.files = ['/afs/cern.ch/user/d/dalfonso/public/TESTspring/ttbar25nsmad_1ECE44F9-5F02-E511-9A65-02163E00EA1F.root']
comp.files = ['/afs/cern.ch/user/d/dalfonso/public/74samples/JetHT_GR_R_74_V12_19May_RelVal/1294BDDB-B7FE-E411-8028-002590596490.root']
comp.files = ['/afs/cern.ch/user/d/dalfonso/public/TESTspring/ttbar25nsmad_1ECE44F9-5F02-E511-9A65-02163E00EA1F.root']
# comp.files = ['/afs/cern.ch/user/d/dalfonso/public/74samples/JetHT_GR_R_74_V12_19May_RelVal/1294BDDB-B7FE-E411-8028-002590596490.root']

selectedComponents = [comp]
comp.splitFactor = 1
comp.triggers = triggers_HT900 + triggers_HTMET + triggers_photon155 + triggers_1mu_isolow + triggers_MT2_mumu + triggers_MT2_ee + triggers_MT2_mue # to apply trigger skimming

elif test==2:
from CMGTools.TTHAnalysis.samples.samples_13TeV_PHYS14 import *

#from CMGTools.TTHAnalysis.samples.samples_13TeV_PHYS14 import *
# full production
# selectedComponents = [
#TTJets, # TTJets
#TToLeptons_tch, TToLeptons_sch, TBarToLeptons_tch, TBarToLeptons_sch, TBar_tWch, T_tWch, #singleTop
#TTWJets, TTZJets, TTH, #TT+boson
#ZJetsToNuNu_HT100to200, ZJetsToNuNu_HT200to400, ZJetsToNuNu_HT400to600, ZJetsToNuNu_HT600toInf, # ZJetsToNuNu_HT
#WJetsToLNu_HT100to200, WJetsToLNu_HT200to400, WJetsToLNu_HT400to600, WJetsToLNu_HT600toInf, # WJetsToLNu_HT
#GJets_HT100to200_fixPhoton, GJets_HT200to400_fixPhoton, GJets_HT400to600_fixPhoton, GJets_HT600toInf_fixPhoton, # GJets_HT
#QCD_HT_100To250_fixPhoton, QCD_HT_250To500_fixPhoton, QCD_HT_500To1000_fixPhoton, QCD_HT_1000ToInf_fixPhoton, QCD_HT_250To500_ext1_fixPhoton, QCD_HT_500To1000_ext1_fixPhoton,QCD_HT_1000ToInf_ext1_fixPhoton, # QCD_HT
#QCD_Pt170to300_fixPhoton, QCD_Pt300to470_fixPhoton, QCD_Pt470to600_fixPhoton, QCD_Pt600to800_fixPhoton, QCD_Pt800to1000_fixPhoton, QCD_Pt1000to1400_fixPhoton, QCD_Pt1400to1800_fixPhoton, QCD_Pt1800to2400_fixPhoton, QCD_Pt2400to3200_fixPhoton, QCD_Pt3200_fixPhoton, # QCD_Pt
#QCD_Pt50to80, QCD_Pt80to120, QCD_Pt120to170, #For QCD Estimate
#SMS_T2tt_2J_mStop850_mLSP100, SMS_T2tt_2J_mStop650_mLSP325, SMS_T2tt_2J_mStop500_mLSP325, SMS_T2tt_2J_mStop425_mLSP325, SMS_T2qq_2J_mStop600_mLSP550, SMS_T2qq_2J_mStop1200_mLSP100, SMS_T2bb_2J_mStop900_mLSP100, SMS_T2bb_2J_mStop600_mLSP580, SMS_T1tttt_2J_mGl1500_mLSP100, SMS_T1tttt_2J_mGl1200_mLSP800, SMS_T1qqqq_2J_mGl1400_mLSP100, SMS_T1qqqq_2J_mGl1000_mLSP800, SMS_T1bbbb_2J_mGl1500_mLSP100, SMS_T1bbbb_2J_mGl1000_mLSP900, # SMS
#DYJetsToLL_M50_HT100to200, DYJetsToLL_M50_HT200to400, DYJetsToLL_M50_HT400to600, DYJetsToLL_M50_HT600toInf # DYJetsToLL_M50_HT
#]

from CMGTools.TTHAnalysis.samples.samples_13TeV_74X import *
selectedComponents = [
TTJets, # TTJets
TToLeptons_tch, TToLeptons_sch, TBarToLeptons_tch, TBarToLeptons_sch, TBar_tWch, T_tWch, #singleTop
TTWJets, TTZJets, TTH, #TT+boson
ZJetsToNuNu_HT100to200, ZJetsToNuNu_HT200to400, ZJetsToNuNu_HT400to600, ZJetsToNuNu_HT600toInf, # ZJetsToNuNu_HT
WJetsToLNu_HT100to200, WJetsToLNu_HT200to400, WJetsToLNu_HT400to600, WJetsToLNu_HT600toInf, # WJetsToLNu_HT
GJets_HT100to200_fixPhoton, GJets_HT200to400_fixPhoton, GJets_HT400to600_fixPhoton, GJets_HT600toInf_fixPhoton, # GJets_HT
QCD_HT_100To250_fixPhoton, QCD_HT_250To500_fixPhoton, QCD_HT_500To1000_fixPhoton, QCD_HT_1000ToInf_fixPhoton, QCD_HT_250To500_ext1_fixPhoton, QCD_HT_500To1000_ext1_fixPhoton,QCD_HT_1000ToInf_ext1_fixPhoton, # QCD_HT
QCD_Pt170to300_fixPhoton, QCD_Pt300to470_fixPhoton, QCD_Pt470to600_fixPhoton, QCD_Pt600to800_fixPhoton, QCD_Pt800to1000_fixPhoton, QCD_Pt1000to1400_fixPhoton, QCD_Pt1400to1800_fixPhoton, QCD_Pt1800to2400_fixPhoton, QCD_Pt2400to3200_fixPhoton, QCD_Pt3200_fixPhoton, # QCD_Pt
QCD_Pt50to80, QCD_Pt80to120, QCD_Pt120to170, #For QCD Estimate
SMS_T2tt_2J_mStop850_mLSP100, SMS_T2tt_2J_mStop650_mLSP325, SMS_T2tt_2J_mStop500_mLSP325, SMS_T2tt_2J_mStop425_mLSP325, SMS_T2qq_2J_mStop600_mLSP550, SMS_T2qq_2J_mStop1200_mLSP100, SMS_T2bb_2J_mStop900_mLSP100, SMS_T2bb_2J_mStop600_mLSP580, SMS_T1tttt_2J_mGl1500_mLSP100, SMS_T1tttt_2J_mGl1200_mLSP800, SMS_T1qqqq_2J_mGl1400_mLSP100, SMS_T1qqqq_2J_mGl1000_mLSP800, SMS_T1bbbb_2J_mGl1500_mLSP100, SMS_T1bbbb_2J_mGl1000_mLSP900, # SMS
DYJetsToLL_M50_HT100to200, DYJetsToLL_M50_HT200to400, DYJetsToLL_M50_HT400to600, DYJetsToLL_M50_HT600toInf # DYJetsToLL_M50_HT
TTJets, TTJets_LO, # TTJets
QCD_Pt80to120, QCD_Pt120to170, QCD_Pt300to470, QCD_Pt1000to1400, QCD_Pt1400to1800, QCD_Pt1800to2400, QCD_Pt2400to3200, QCD_Pt3200toInf, # QCD_Pt
#QCD_Pt2400to3200
]

# test all components (1 thread per component).
for comp in selectedComponents:
comp.splitFactor = 600
comp.splitFactor = 1200
#comp.fineSplitFactor = 2 # to run two jobs per file
comp.files = comp.files[:]
#comp.files = comp.files[:1]
#comp.files = comp.files[57:58] # to process only file [57]
comp.triggers = triggers_HT900 + triggers_HTMET + triggers_photon155 + triggers_1mu_isolow + triggers_MT2_mumu + triggers_MT2_ee + triggers_MT2_mue # to apply trigger skimming


elif test==3:
# run on data
isData = True
from CMGTools.TTHAnalysis.samples.samples_13TeV_74X import *
selectedComponents = [ jetHT_0T ]




# ------------------------------------------------------------------------------------------- #

doSpecialSettingsForMECCA = 1
doSpecialSettingsForMECCA = 0
if doSpecialSettingsForMECCA==1:
jetAna.doQG = False
photonAna.do_randomCone = False


isData = 0
if isData==1:
if isData:
jetAna.recalibrateJets = False
photonAna.do_mc_match = False
for comp in mcSamples:
comp.isMC = False
comp.isData = True
comp.files = ['/afs/cern.ch/user/d/dalfonso/public/74samples/JetHT_GR_R_74_V12_19May_RelVal/1294BDDB-B7FE-E411-8028-002590596490.root']
#comp.files = ['/afs/cern.ch/user/d/dalfonso/public/74samples/JetHT_GR_R_74_V12_19May_RelVal/1294BDDB-B7FE-E411-8028-002590596490.root']
# ------------------------------------------------------------------------------------------- #


Expand Down Expand Up @@ -342,4 +355,3 @@
events_class = event_class)
# events_class = Events)
#printComps(config.components, True)

69 changes: 69 additions & 0 deletions CMGTools/TTHAnalysis/python/samples/samples_13TeV_74X.py
Expand Up @@ -22,8 +22,72 @@

RelVals740 = [ TT_NoPU, TT_bx25, TT_bx50, TTLep_NoPU, ZEE_bx50, ZEE_bx25, ZMM_bx25, ZMM_bx50, ZTT_bx25, ZTT_bx50 ]

### 25 ns
### TTbar
TTJets = kreator.makeMCComponent("TTJets", "/TTJets_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root", 831.76, True)
TTJets_LO = kreator.makeMCComponent("TTJets_LO", "/TTJets_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/MINIAODSIM", "CMS", ".*root", 809.1)

### W+jets
WJetsToLNu_HT100to200 = kreator.makeMCComponent("WJetsToLNu_HT100to200", "/WJetsToLNu_HT-100To200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root",1292*1.23)
WJetsToLNu_HT200to400 = kreator.makeMCComponent("WJetsToLNu_HT200to400", "/WJetsToLNu_HT-200To400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root",385.9*1.23)
WJetsToLNu_HT400to600 = kreator.makeMCComponent("WJetsToLNu_HT400to600", "/WJetsToLNu_HT-400To600_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v3/MINIAODSIM", "CMS", ".*root",47.9*1.23)
WJetsToLNu_HT600toInf = kreator.makeMCComponent("WJetsToLNu_HT600toInf", "/WJetsToLNu_HT-600ToInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root",19.9*1.23)
WJetsToLNuHT = [
WJetsToLNu_HT100to200,
WJetsToLNu_HT200to400,
WJetsToLNu_HT400to600,
WJetsToLNu_HT600toInf,
]


### QCD
QCD_Pt80to120 = kreator.makeMCComponent("QCD_Pt80to120","/QCD_Pt_80to120_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root", 2762530)
QCD_Pt120to170 = kreator.makeMCComponent("QCD_Pt120to170","/QCD_Pt_120to170_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root", 471100)
QCD_Pt300to470 = kreator.makeMCComponent("QCD_Pt300to470","/QCD_Pt_300to470_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root", 7823)
QCD_Pt1000to1400 = kreator.makeMCComponent("QCD_Pt1000to1400","/QCD_Pt_1000to1400_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root", 9.4183)
QCD_Pt1400to1800 = kreator.makeMCComponent("QCD_Pt1400to1800","/QCD_Pt_1400to1800_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root", 0.84265)
QCD_Pt1800to2400 = kreator.makeMCComponent("QCD_Pt1800to2400","/QCD_Pt_1800to2400_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root", 0.114943)
QCD_Pt2400to3200 = kreator.makeMCComponent("QCD_Pt2400to3200","/QCD_Pt_2400to3200_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root", 0.00682981)
QCD_Pt3200toInf = kreator.makeMCComponent("QCD_Pt3200","/QCD_Pt_3200toInf_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/MINIAODSIM", "CMS", ".*root", 0.000165445)

QCDPt = [
QCD_Pt80to120,
QCD_Pt120to170,
QCD_Pt300to470,
QCD_Pt1000to1400,
QCD_Pt1400to1800,
QCD_Pt1800to2400,
QCD_Pt2400to3200,
QCD_Pt3200toInf
]

### Zero Tesla run

dataDir = "$CMSSW_BASE/src/CMGTools/TTHAnalysis/data" # use environmental variable, useful for instance to run on CRAB
json=dataDir+'/json/Cert_246908-248005_13TeV_PromptReco_Collisions15_ZeroTesla_JSON.txt'
#lumi: delivered= 4.430 (/nb) recorded= 4.013 (/nb)

jetHT_0T = cfg.DataComponent(
name = 'jetHT_0T',
files = kreator.getFilesFromEOS('jetHT_0T',
'firstData_JetHT_v2',
'/store/user/pandolf/MINIAOD/%s'),
intLumi = 4.0,
triggers = [],
json = None #json
)


### 50 ns

###

dataSamples = [jetHT_0T]

mcSamples = RelVals740

mcSamples_Asymptotic25ns = [TTJets, TTJets_LO] + WJetsToLNuHT + QCDPt

from CMGTools.TTHAnalysis.setup.Efficiencies import *
dataDir = "$CMSSW_BASE/src/CMGTools/TTHAnalysis/data"

Expand All @@ -36,6 +100,11 @@
comp.puFileData=dataDir+"/puProfile_Data12.root"
comp.efficiency = eff2012

for comp in dataSamples:
comp.splitFactor = 1000
comp.isMC = False
comp.isData = True

if __name__ == "__main__":
import sys
if "test" in sys.argv:
Expand Down
26 changes: 15 additions & 11 deletions PhysicsTools/HeppyCore/scripts/heppy_batch.py
Expand Up @@ -144,17 +144,20 @@ def batchScriptPSI( index, jobDir, remoteDir=''):
elif remoteDir.startswith("/pnfs/psi.ch"):
cpCmd="""echo 'sending root files to remote dir'
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/dcap/ # Fabio's workaround to fix gfal-tools
for f in Loop/treeProducerSusyFullHad/*.root
for f in Loop/mt2*.root
do
echo $f
ff=`basename $f | cut -d . -f 1`
echo $ff
gfal-mkdir {srm}
echo "gfal-copy file:///`pwd`/Loop/treeProducerSusyFullHad/$file.root {srm}/${{ff}}_{idx}.root"
gfal-copy file:///`pwd`/Loop/treeProducerSusyFullHad/$ff.root {srm}/${{ff}}_{idx}.root
ff=`basename $f | cut -d . -f 1`
#d=`echo $f | cut -d / -f 2`
gfal-mkdir {srm}
echo "gfal-copy file://`pwd`/Loop/$ff.root {srm}/${{ff}}_{idx}.root"
gfal-copy file://`pwd`/Loop/$ff.root {srm}/${{ff}}_{idx}.root
if [ $? -ne 0 ]; then
echo "ERROR: remote copy failed for file $ff"
else
echo "remote copy succeeded"
rm Loop/$ff.root
fi
done
rm Loop/treeProducerSusyFullHad/*.root
echo 'sending the logs back'
cp -r Loop/* $SUBMISIONDIR""".format(idx=index, srm='srm://t3se01.psi.ch'+remoteDir+jobDir[jobDir.rfind("/"):jobDir.find("_Chunk")])
else:
print "remote directory not supported yet: ", remoteDir
Expand Down Expand Up @@ -198,7 +201,8 @@ def batchScriptPSI( index, jobDir, remoteDir=''):
#source $VO_CMS_SW_DIR/cmsset_default.sh
source {vo}/cmsset_default.sh
export SCRAM_ARCH=slc6_amd64_gcc481
#export SCRAM_ARCH=slc6_amd64_gcc481
export SCRAM_ARCH=slc6_amd64_gcc491
#cd $CMSSW_BASE/src
cd {cmssw}/src
shopt -s expand_aliases
Expand All @@ -208,8 +212,8 @@ def batchScriptPSI( index, jobDir, remoteDir=''):
ls
cd `find . -type d | grep /`
echo 'running'
python $CMSSW_BASE/src/PhysicsTools/HeppyCore/python/framework/looper.py pycfg.py config.pck
#python $CMSSW_BASE/src/CMGTools/RootTools/python/fwlite/looper.py config.pck
python {cmssw}/src/CMGTools/RootTools/python/fwlite/looper.py pycfg.py config.pck
echo
{copy}
###########################################################################
Expand Down

0 comments on commit b88722f

Please sign in to comment.