Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11379 from bsunanda/Run2-hcx27
bsunanda:Run2-hcx27 (Validation scripts for HCAL software)
- Loading branch information
Showing
6 changed files
with
311 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Please follow the steps as below: | ||
|
||
(1) cmsrel CMSSW_7_6_0_pre4 (for instance) | ||
|
||
(2) cd CMSSW_7_6_0_pre4/src | ||
|
||
(3) cmsenv | ||
|
||
(4) git cms-addpkg Validation/CaloTowers | ||
|
||
(5) scram b | ||
|
||
(6) mkdir scan | ||
|
||
(7) cd Validation/CaloTowers/CaloScan | ||
|
||
(8) ./make_configs.csh | ||
|
||
(9) ./submit_batch.csh | ||
|
||
NB: it uses batch submission (batch.csh) to lxbatch at CERN | ||
with input file | ||
/afs/cern.ch/cms/data/CMSSW/Validation/HcalHits/data/620/mc_pi50_eta05.root | ||
Each of 25 job uses 2K out of total 50K input. | ||
|
||
In 1-1.5 hour (in the submission directory, /Validation/CaloTowers/CaloScan | ||
in this case) the results of 25 batch jobs will be arriving. | ||
Once all 25 jobs finished and 25 *.root files appeared locally, | ||
|
||
(10) cmsRun merging_cfg.py | ||
(to produce final DQMxxx.root file) | ||
|
||
(11) clean up the directory | ||
rm -r pi50_*.py *.log LSFJOB_* pi50_*.root | ||
|
||
(12) move this DQMxxx.root to Validation/CaloTowers/test/macros | ||
renaming it into something like here: | ||
|
||
pi50scan760pre4_postLS1_fullGeom_ECALHCAL_CaloTowers.root | ||
|
||
NB: there is naming convention pi50scan<...>_ECALHCAL_CaloTowers.root | ||
where <...> can be any meaningful string (to appear in the legend of histos) | ||
|
||
(13) to compare two sets of histos, for instance if you have in | ||
Validation/CaloTowers/test/macros | ||
pi50scan760pre4_postLS1_ECALHCAL_CaloTowers.root and | ||
pi50scan760pre3_postLS1_ECALHCAL_CaloTowers.root | ||
|
||
(here "760pre4_postLS1" and "760pre3_postLS1" are mentioned <...> strings) - | ||
|
||
./RunPions.csh 760pre4_postLS1 760pre3_postLS1 | ||
|
||
|
||
(14) the result appear as the local directory | ||
760pre4_postLS1_vs_760pre3_postLS1_SinglePi | ||
|
||
which can be | ||
(i) viewed with web browser locally, e.g. | ||
firefox 760pre4_postLS1_vs_760pre3_postLS1_SinglePi/index.html | ||
|
||
(ii) uploaded to some web server and viewed from anywhere: | ||
|
||
https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HCAL/calo_scan_single_pi/760pre4_postLS1_vs_760pre3_postLS1_SinglePi/ | ||
|
||
(in this case, the results from the two releases are just identical) | ||
NB: hitso labels correspond to aforementioned <...> strings, here 760pre4_postLS1/760pre3_postLS1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/csh | ||
setenv num ${1} | ||
|
||
echo '===> num.' $num | ||
|
||
setenv name pi50 | ||
|
||
setenv MYWORKDIR $LS_SUBCWD | ||
|
||
setenv MYOUT ${MYWORKDIR} | ||
#---------------- | ||
cd ${MYWORKDIR} | ||
eval `scramv1 runtime -csh` | ||
cp ${MYWORKDIR}/${name}_${num}.py ${WORKDIR}/conf.py | ||
# | ||
cd ${WORKDIR} | ||
cp /afs/cern.ch/cms/data/CMSSW/Validation/HcalHits/data/620/mc_pi50_eta05.root mc.root | ||
echo ${WORKDIR} | ||
|
||
cmsRun conf.py > & ${name}_${num}.log | ||
#--------------------------------------------------------------- | ||
rfcp ${name}_${num}.log ${MYWORKDIR}/. | ||
rfcp output.root ${MYOUT}/${name}_${num}.root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/csh | ||
set template=template.py | ||
set head=pi50 | ||
|
||
#--- service variables | ||
set chunk = 2000 | ||
set j = 1 | ||
set one = 1 | ||
|
||
|
||
set i=1 | ||
while ( ${i} < 26) | ||
|
||
if( ${i} < 26 ) then | ||
echo "i :" ${i} | ||
@ j = ${i} - $one | ||
@ j = $j * $chunk + $one | ||
echo "j :" ${j} | ||
cat ${template} | sed s/XXXXX/${j}/ > ${head}_${i}.py | ||
endif | ||
|
||
@ i = ${i} + "1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import os | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("CONV") | ||
|
||
process.load("FWCore.MessageLogger.MessageLogger_cfi") | ||
process.MessageLogger.cerr.FwkReport.reportEvery = 1000 | ||
|
||
process.load("DQMServices.Core.DQMStore_cfi") | ||
process.load("DQMServices.Components.MEtoEDMConverter_cfi") | ||
|
||
#process.load("DQMServices.Core.DQM_cfg") | ||
#process.DQM.collectorHost = '' | ||
|
||
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32(-1) | ||
) | ||
|
||
process.source = cms.Source("PoolSource", | ||
fileNames = cms.untracked.vstring( | ||
'file:pi50_1.root', | ||
'file:pi50_2.root', | ||
'file:pi50_3.root', | ||
'file:pi50_4.root', | ||
'file:pi50_5.root', | ||
'file:pi50_6.root', | ||
'file:pi50_7.root', | ||
'file:pi50_8.root', | ||
'file:pi50_9.root', | ||
'file:pi50_10.root', | ||
'file:pi50_11.root', | ||
'file:pi50_12.root', | ||
'file:pi50_13.root', | ||
'file:pi50_14.root', | ||
'file:pi50_15.root', | ||
'file:pi50_16.root', | ||
'file:pi50_17.root', | ||
'file:pi50_18.root', | ||
'file:pi50_19.root', | ||
'file:pi50_20.root', | ||
'file:pi50_21.root', | ||
'file:pi50_22.root', | ||
'file:pi50_23.root', | ||
'file:pi50_24.root', | ||
'file:pi50_25.root' | ||
) | ||
) | ||
|
||
process.load('Configuration/StandardSequences/EDMtoMEAtRunEnd_cff') | ||
process.dqmSaver.referenceHandling = cms.untracked.string('all') | ||
|
||
cmssw_version = os.environ.get('CMSSW_VERSION','CMSSW_X_Y_Z') | ||
Workflow = '/HcalValidation/'+'Harvesting/'+str(cmssw_version) | ||
process.dqmSaver.workflow = Workflow | ||
|
||
process.hcaldigisClient = cms.EDAnalyzer("HcalDigisClient", | ||
outputFile = cms.untracked.string('HcalDigisHarvestingME.root'), | ||
DQMDirName = cms.string("/") # root directory | ||
) | ||
|
||
process.calotowersClient = cms.EDAnalyzer("CaloTowersClient", | ||
outputFile = cms.untracked.string('CaloTowersHarvestingME.root'), | ||
DQMDirName = cms.string("/") # root directory | ||
) | ||
process.hcalrechitsClient = cms.EDAnalyzer("HcalRecHitsClient", | ||
outputFile = cms.untracked.string('HcalRecHitsHarvestingME.root'), | ||
DQMDirName = cms.string("/") # root directory | ||
) | ||
|
||
process.p = cms.Path( | ||
process.EDMtoME * | ||
process.calotowersClient * | ||
process.hcalrechitsClient * | ||
process.hcaldigisClient * | ||
process.dqmSaver) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/csh | ||
set i=1 | ||
|
||
while ( ${i} < 26 ) | ||
bsub -u /dev/null -q 1nd batch.csh ${i} | ||
@ i = ${i} + "1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("TEST") | ||
|
||
### RANDOM setting (change last digit(s) to make runs different !) | ||
process.load("Configuration.StandardSequences.SimulationRandomNumberGeneratorSeeds_cff") | ||
|
||
process.load("Configuration.StandardSequences.Simulation_cff") | ||
process.load("Configuration.StandardSequences.Reconstruction_cff") | ||
process.load("SimGeneral.MixingModule.mixNoPU_cfi") | ||
process.load('Configuration/StandardSequences/DigiToRaw_cff') | ||
process.load('Configuration/StandardSequences/RawToDigi_cff') | ||
|
||
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") | ||
from Configuration.AlCa.autoCond import autoCond | ||
process.GlobalTag.globaltag = autoCond['run2_mc'] | ||
|
||
process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") | ||
process.load("Configuration.StandardSequences.GeometryDB_cff") | ||
process.load("Configuration.StandardSequences.MagneticField_cff") | ||
process.g4SimHits.UseMagneticField = False | ||
|
||
process.load("DQMServices.Core.DQMStore_cfi") | ||
process.load("DQMServices.Components.MEtoEDMConverter_cfi") | ||
|
||
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32(2000) | ||
) | ||
# Input source | ||
process.source = cms.Source("PoolSource", | ||
firstEvent = cms.untracked.uint32(XXXXX), | ||
fileNames = cms.untracked.vstring('file:mc.root') | ||
) | ||
|
||
process.FEVT = cms.OutputModule("PoolOutputModule", | ||
outputCommands = cms.untracked.vstring('drop *', 'keep *_MEtoEDMConverter_*_*'), | ||
splitLevel = cms.untracked.int32(0), | ||
fileName = cms.untracked.string("output.root") | ||
) | ||
|
||
process.VtxSmeared.SigmaX = 0.00001 | ||
process.VtxSmeared.SigmaY = 0.00001 | ||
process.VtxSmeared.SigmaZ = 0.00001 | ||
|
||
process.HcalSimHitsAnalyser = cms.EDAnalyzer("HcalSimHitsValidation", | ||
outputFile = cms.untracked.string('HcalSimHitsValidation.root') | ||
) | ||
|
||
process.hcalDigiAnalyzer = cms.EDAnalyzer("HcalDigisValidation", | ||
outputFile = cms.untracked.string('HcalDigisValidationRelVal.root'), | ||
digiLabel = cms.InputTag("hcalDigis"), | ||
zside = cms.untracked.string('*'), | ||
mode = cms.untracked.string('multi'), | ||
|
||
hcalselector = cms.untracked.string('all'), | ||
mc = cms.untracked.string('yes') # 'yes' for MC | ||
) | ||
|
||
process.hcalRecoAnalyzer = cms.EDAnalyzer("HcalRecHitsValidation", | ||
outputFile = cms.untracked.string('HcalRecHitValidationRelVal.root'), | ||
HBHERecHitCollectionLabel = cms.untracked.InputTag("hbhereco"), | ||
HFRecHitCollectionLabel = cms.untracked.InputTag("hfreco"), | ||
HORecHitCollectionLabel = cms.untracked.InputTag("horeco"), | ||
eventype = cms.untracked.string('single'), | ||
ecalselector = cms.untracked.string('yes'), | ||
hcalselector = cms.untracked.string('all'), | ||
mc = cms.untracked.string('yes') # default ! | ||
) | ||
|
||
process.hcalTowerAnalyzer = cms.EDAnalyzer("CaloTowersValidation", | ||
outputFile = cms.untracked.string('CaloTowersValidationRelVal.root'), | ||
CaloTowerCollectionLabel = cms.untracked.InputTag('towerMaker'), | ||
hcalselector = cms.untracked.string('all'), | ||
mc = cms.untracked.string('yes') # default! | ||
) | ||
|
||
#--- replace hbhereco with hbheprereco | ||
delattr(process,"hbhereco") | ||
process.hbhereco = process.hbheprereco.clone() | ||
process.hcalLocalRecoSequence = cms.Sequence(process.hbhereco+process.hfreco+process.horeco) | ||
|
||
|
||
#--- post-LS1 customization | ||
process.mix.digitizers.hcal.ho.photoelectronsToAnalog = cms.vdouble([4.0]*16) | ||
process.mix.digitizers.hcal.ho.siPMCode = cms.int32(1) | ||
process.mix.digitizers.hcal.ho.pixels = cms.int32(2500) | ||
process.mix.digitizers.hcal.ho.doSiPMSmearing = cms.bool(False) | ||
process.mix.digitizers.hcal.hf1.samplingFactor = cms.double(0.60) | ||
process.mix.digitizers.hcal.hf2.samplingFactor = cms.double(0.60) | ||
process.g4SimHits.HFShowerLibrary.FileName = 'SimG4CMS/Calo/data/HFShowerLibrary_npmt_noatt_eta4_16en_v3.root' | ||
|
||
|
||
#---------- PATH | ||
process.g4SimHits.Generator.HepMCProductLabel = 'generator' | ||
process.p = cms.Path( | ||
process.VtxSmeared * process.g4SimHits * process.mix * | ||
process.ecalDigiSequence * process.hcalDigiSequence * | ||
process.addPileupInfo * | ||
process.ecalPacker * | ||
process.esDigiToRaw * | ||
process.hcalRawData * | ||
process.rawDataCollector * | ||
process.ecalDigis * | ||
process.ecalPreshowerDigis * | ||
process.hcalDigis * | ||
process.calolocalreco * | ||
process.caloTowersRec * | ||
process.hcalnoise * | ||
process.HcalSimHitsAnalyser * | ||
process.hcalDigiAnalyzer * | ||
process.hcalTowerAnalyzer * | ||
process.hcalRecoAnalyzer * | ||
process.MEtoEDMConverter | ||
) | ||
|
||
process.outpath = cms.EndPath(process.FEVT) | ||
|