To add to your cmssw area
git clone git@github.com:PFCal-dev/HGCanalysis UserCode/HGCanalysis
To update in the remote
git push git@github.com:PFCal-dev/HGCanalysis
Use the generateEventsFromCfi.sh to steer the generation. It will call cmsDriver.py and customize the configuration file. The options can be inspected by calling:
generateEventsFromCfi.sh -h
A full production can be ran locally or submitted to the batch using the submitLocalHGCalProduction.py wrapper script. Two examples are given below:
For muons it's enough a single energy
#default geometry python scripts/submitLocalHGCalProduction.py -q 1nd -n 10 -s generateEventsFromCfi.sh -o "-o /store/cmst3/group/hgcal/CMSSW/Single13_${CMSSW_VERSION} -p 13 -n 100 -e 100"; #change geometry scenario python scripts/submitLocalHGCalProduction.py -q 1nd -n 100 -s generateEventsFromCfi.sh -o "-o /store/cmst3/group/hgcal/CMSSW/Single13_v4_${CMSSW_VERSION} -p 13 -n 100 -e 100 -g Extended2023HGCalV4Muon,Extended2023HGCalV4MuonReco";
For regression use flat gun
python scripts/submitLocalHGCalProduction.py -q 2nw -n 2500 -s generateEventsFromCfi.sh -o "-o /store/cmst3/group/hgcal/CMSSW/FlatPtYSingle22_${CMSSW_VERSION}/RECO_a -c UserCode/HGCanalysis/python/particlePtYGun_cfi.py -n 200 -p 22 -f"; python scripts/submitLocalHGCalProduction.py -q 1nw -n 2500 -s generateEventsFromCfi.sh -o "-o /store/cmst3/group/hgcal/CMSSW/FlatPtYSingle22_${CMSSW_VERSION}/RECO_b -c UserCode/HGCanalysis/python/particlePtYGun_cfi.py -n 200 -p 22 -f";
energies=(10 20 40 50 75 100 125 175 250 400 500)
pids=(22 211 11)
pu=(140 0 200)
for p in
pids=(111 15)
for p in
for p in
#test alternative physics lists for pions
phys=("QGSP_FTFP_BERT_EML" "FTFP_BERT_EML" "FTFP_BERT_XS_EML" "QBBC")
pids=(211)
energies=(30)
for pid in
#simulation step
beamspots=(HLLHC_Fix) # HLLHCCrabKissing)
for b in
#SIM integrity check
samples=(VBFHtoInv GluGluHtoGG) # MinBias)
for b in
#digi step
pu=(140)
samples=(VBFHtoInv GluGluHtoGG)
for s in cmsLs /store/cmst3/group/hgcal/CMSSW/${sigDir}/SIM | awk '{print $5}'
)
nFiles=${#inputFiles[@]};
echo "Submitting ${nFiles} jobs for events in ${sigDir}"
python scripts/submitLocalHGCalProduction.py -n ${nFiles} -q 2nw -s digitizeAndMix.sh -o "-o /store/cmst3/group/hgcal/CMSSW/${sigDir}/DIGI-PU${p} -c ${CMSSW_BASE}/src/UserCode/HGCanalysis/test/digitizeAndMix_cfg.py -m MinBias${CMSSW_VERSION}/${b}/SIM -p ${p} -i ${sigDir}/SIM";
done
done
done
#DIGI integrity check
for s in
done
done
done
#RECO step
recoBatchUnit=50
cfg=${CMSSW_BASE}/src/UserCode/HGCanalysis/test/recoStep_cfg.py
for s in cmsLs /store/cmst3/group/hgcal/CMSSW/${tag}/DIGI-PU${p} | awk '{print $5}'
)
for ifile in edmFileUtil -P ${file} | grep -ir bytes | awk '{print $6}'
nJobs=$((nEvts / recoBatchUnit))
echo "${file} has ${nEvts} events will be split into ${nJobs} jobs using ${cfg} with outout @
The ntuples are produced by plugins/HGCSimHitsAnalyzer.cc. Change the code according to your needs. To submit the production of the ntuples you can use the following script (it will printout the options)
cmsRun runHGCSimHitsAnalyzer_cfg.py
Submit several jobs to the batch and store the output in EOS
tags=("Single211_CMSSW_6_2_0_SLHC23_patch1" "Single22_CMSSW_6_2_0_SLHC23_patch1" "Single130-FixE_CMSSW_6_2_0_SLHC23_patch2")
#subdir="RECO-PU0"
subdir="pandoraRECO";
#subdir="mqRECO"
for tag in cmsLs /store/cmst3/group/hgcal/CMSSW/${tag}/${subdir} | awk '{print $5}'
);
nFiles=${#inputFiles[@]};
nJobs=$((nFiles/50));
for i in seq 0 ${nJobs}
; do
startFile=$((i*=50));
cmsRun test/runHGCSimHitsAnalyzer_cfg.py ${tag}/${subdir} ${startFile} 50 &
nrunning="ps -u psilva | grep -ir cmsRun | wc -l
"
while [ $nrunning -gt 5 ]; do
echo "$nrunning cmsRun processes launched, sleeping 30s"
sleep 30;
nrunning="ps -u psilva | grep -ir cmsRun | wc -l
"
done
done
done
a=(pandoraRECO-PU140 pandoraRECO-PU0)
b=(/store/cmst3/group/hgcal/CMSSW/RelValQCD_Pt_80_120_14TeV /store/cmst3/group/hgcal/CMSSW/RelValQCDForPF_14TeV)
for i in basename ${j}
_${i}.root" &
done
done
a=(ls *.root
)
for i in