Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crab fixed #29

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions FrameworkJobReport.xml
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested without this file, and the submission can not be successful.

Copy link
Owner

@ram1123 ram1123 Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, strange. This job report is created when we run it locally, by switching the job report boolean.

This report helps us to set the crab job parameters like the number of jobs and how many events are in each job.

How does the crab job depend on this file?

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<FrameworkJobReport>
<ReadBranches>
</ReadBranches>
<PerformanceReport>
<PerformanceSummary Metric="StorageStatistics">
<Metric Name="Parameter-untracked-bool-enabled" Value="true"/>
<Metric Name="Parameter-untracked-bool-stats" Value="true"/>
<Metric Name="Parameter-untracked-string-cacheHint" Value="application-only"/>
<Metric Name="Parameter-untracked-string-readHint" Value="auto-detect"/>
<Metric Name="ROOT-tfile-read-totalMegabytes" Value="0"/>
<Metric Name="ROOT-tfile-write-totalMegabytes" Value="0"/>
</PerformanceSummary>
</PerformanceReport>

<GeneratorInfo>
</GeneratorInfo>
</FrameworkJobReport>
13 changes: 13 additions & 0 deletions PSet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#this fake PSET is needed for local test and for crab to figure the output filename
#you do not need to edit it unless you want to do a local test using a different input file than
#the one marked below
import FWCore.ParameterSet.Config as cms
process = cms.Process('NANO')
process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(),
# lumisToProcess=cms.untracked.VLuminosityBlockRange("254231:1-254231:24")
)
process.source.fileNames = [ 'root://cms-xrd-global.cern.ch//store/mc/RunIISummer16NanoAOD/TTJets_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/NANOAODSIM/PUMoriond17_05Feb2018_94X_mcRun2_asymptotic_v2-v1/40000/2CE738F9-C212-E811-BD0E-EC0D9A8222CE.root' ##you can change only this line
]
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(111))
process.output = cms.OutputModule("PoolOutputModule", fileName = cms.untracked.string('tree.root'))
process.out = cms.EndPath(process.output)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ nanoAOD skiming code for vv semi-leptonic VBS studies
5. batch job submission.
1. Crab-job submission
```bash
cd crab/
cd PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim
voms-proxy-init -voms cms --valid 200:00
source /cvmfs/cms.cern.ch/crab3/crab.sh
crab submit -c crab_cfg.py
crab submit --config=crab_cfg.py
```

2. Step: 5 (b): Condor-job submission
Expand Down
2 changes: 1 addition & 1 deletion Utils
Submodule Utils updated from f30c7e to 637dc2
2 changes: 1 addition & 1 deletion check_das_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"v6_2016_campaign" : ["RunIISummer16NanoAODv6-*","Run2016*-Nano25Oct2019*-v*"],
"v6_2017_campaign" : ["RunIIFall17NanoAODv6-*","Run2017*-Nano25Oct2019*-v*"],
"v6_2018_campaign" : ["RunIIAutumn18NanoAODv6-*102X_upgrade2018_realistic_v20-v*","Run2018*-Nano25Oct2019*-v*"],
"v7_2018_campaign" : ["RunIIAutumn18NanoAODv7-*102X_upgrade2018_realistic_v20-v*","Run2018*-02Apr2020-v1"],
"v7_2018_campaign" : ["RunIIAutumn18NanoAODv7-*102X_upgrade2018_realistic_v*-v*","Run2018*-02Apr2020-v1"],
"v7_2017_campaign" : ["RunIIFall17NanoAODv7-*","Run2017*-02Apr2020-v1"],
"v7_2016_campaign" : ["RunIISummer16NanoAODv7-*","Run2016*-02Apr2020-v1"],
}
Expand Down
31 changes: 31 additions & 0 deletions crab_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from WMCore.Configuration import Configuration
from CRABClient.UserUtilities import config
config = Configuration()

config.section_("General")
config.General.requestName = 'nanoAOD_testing_2'
config.General.workArea = '/afs/cern.ch/user/y/yujil/crabtest/CMSSW_10_6_30/src/PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim/crab_projects_sendPythonFolderFalse'
#config.General.transferLogs=True
config.General.transferOutputs = True
config.section_("JobType")
config.JobType.pluginName = 'Analysis'
config.JobType.psetName = 'PSet.py'
config.JobType.scriptExe = 'crab_script.sh'
config.JobType.inputFiles = ['post_proc.py','../../../../scripts/haddnano.py','keep_and_drop.txt','FrameworkJobReport.xml'] #hadd nano will not be needed once nano tools are in cmssw
#config.JobType.sendPythonFolder = True
config.JobType.allowUndistributedCMSSW = True
config.section_("Data")
config.Data.inputDataset = '/WplusTo2JWminusTo2LJJ_EWK_LO_aQGC_MJJ100PTJ10_TuneCP5_13TeV-madgraph-pythia8/RunIIAutumn18NanoAODv5-Nano1June2019_102X_upgrade2018_realistic_v19-v1/NANOAODSIM'
#config.Data.inputDBS = 'phys03'
config.Data.inputDBS = 'global'
config.Data.splitting = 'FileBased'
#config.Data.splitting = 'EventAwareLumiBased'
config.Data.unitsPerJob = 1

config.Data.outLFNDirBase = '/store/user/yujil/newNTuple_UL'
#config.Data.outLFNDirBase = '/store/user/%s/NanoPostTemp' % (getUsernameFromSiteDB())
config.Data.publication = False
config.Data.ignoreLocality = False
config.Data.outputDatasetTag = 'NanoTestPost'
config.section_("Site")
config.Site.storageSite = "T2_CN_Beijing"
32 changes: 32 additions & 0 deletions crab_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#this is not mean to be run locally
#
echo Check if TTY
if [ "`tty`" != "not a tty" ]; then
echo "YOU SHOULD NOT RUN THIS IN INTERACTIVE, IT DELETES YOUR LOCAL FILES"
else

echo "ENV..................................."
env
echo "VOMS"
voms-proxy-info -all
echo "CMSSW BASE, python path, pwd"
echo $CMSSW_BASE
echo $PYTHON_PATH
echo $PWD
rm -rf $CMSSW_BASE/lib/
rm -rf $CMSSW_BASE/src/
rm -rf $CMSSW_BASE/module/
rm -rf $CMSSW_BASE/python/
mv lib $CMSSW_BASE/lib
mv src $CMSSW_BASE/src
mv module $CMSSW_BASE/module
mv python $CMSSW_BASE/python

echo Found Proxy in: $X509_USER_PROXY
cd $CMSSW_BASE/src/PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim
cp /srv/FrameworkJobReport.xml .
cmsenv
python post_proc.py $1
cp tree*root /srv
#python crab_script.py $1
fi
Loading