diff --git a/Calibration/PPSAlCaRecoProducer/python/ALCARECOPPSCalMaxTracks_Output_cff.py b/Calibration/PPSAlCaRecoProducer/python/ALCARECOPPSCalMaxTracks_Output_cff.py index 89d2fde63315e..41899d79dbcd0 100644 --- a/Calibration/PPSAlCaRecoProducer/python/ALCARECOPPSCalMaxTracks_Output_cff.py +++ b/Calibration/PPSAlCaRecoProducer/python/ALCARECOPPSCalMaxTracks_Output_cff.py @@ -29,7 +29,7 @@ 'keep recoForwardProtons_ctppsProtonsAlCaRecoProducer_*_*', # HLT info - 'keep *_hltGtStage2Digis_*_*', + 'keep *_gtStage2DigisAlCaRecoProducer_*_*', 'keep edmTriggerResults_*_*_*', 'keep triggerTriggerEvent_*_*_*' ) diff --git a/Calibration/PPSAlCaRecoProducer/python/ALCARECOPPSCalMaxTracks_cff.py b/Calibration/PPSAlCaRecoProducer/python/ALCARECOPPSCalMaxTracks_cff.py index 1349baa295f3b..588a62ea89e86 100644 --- a/Calibration/PPSAlCaRecoProducer/python/ALCARECOPPSCalMaxTracks_cff.py +++ b/Calibration/PPSAlCaRecoProducer/python/ALCARECOPPSCalMaxTracks_cff.py @@ -18,13 +18,13 @@ ctppsDiamondRawToDigiAlCaRecoProducer = _ctppsDiamondRawToDigi.clone(rawDataTag = 'hltPPSCalibrationRaw') totemTimingRawToDigiAlCaRecoProducer = _totemTimingRawToDigi.clone(rawDataTag = 'hltPPSCalibrationRaw') ctppsPixelDigisAlCaRecoProducer = _ctppsPixelDigis.clone(inputLabel = 'hltPPSCalibrationRaw') -hltGtStage2Digis = _gtStage2Digis.clone(InputLabel="hltFEDSelectorL1") +gtStage2DigisAlCaRecoProducer = _gtStage2Digis.clone(InputLabel="hltFEDSelectorL1") ctppsRawToDigiTaskAlCaRecoProducer = cms.Task( ctppsDiamondRawToDigiAlCaRecoProducer, totemTimingRawToDigiAlCaRecoProducer, ctppsPixelDigisAlCaRecoProducer, - hltGtStage2Digis + gtStage2DigisAlCaRecoProducer ) ALCARECOPPSCalMaxTracksRaw2Digi = cms.Sequence(ctppsRawToDigiTaskAlCaRecoProducer) @@ -105,4 +105,4 @@ # 6. master sequence object #------------------------------------------------------ -seqALCARECOPPSCalMaxTracksReco = cms.Sequence( ALCARECOPPSCalMaxTracksFilter + ALCARECOPPSCalMaxTracksRaw2Digi + recoPPSSequenceAlCaRecoProducer) \ No newline at end of file +seqALCARECOPPSCalMaxTracksReco = cms.Sequence( ALCARECOPPSCalMaxTracksFilter + ALCARECOPPSCalMaxTracksRaw2Digi + recoPPSSequenceAlCaRecoProducer) diff --git a/Calibration/PPSAlCaRecoProducer/test/test_express_AlCaRecoProducer.sh b/Calibration/PPSAlCaRecoProducer/test/test_express_AlCaRecoProducer.sh index e72383518f391..8f69a202df06d 100755 --- a/Calibration/PPSAlCaRecoProducer/test/test_express_AlCaRecoProducer.sh +++ b/Calibration/PPSAlCaRecoProducer/test/test_express_AlCaRecoProducer.sh @@ -1,30 +1,32 @@ #!/bin/bash function die { echo $1: status $2; exit $2; } -customise_commands="process.GlobalTag.toGet = cms.VPSet()\ -\nprocess.GlobalTag.toGet.append(cms.PSet(record = cms.string(\"AlCaRecoTriggerBitsRcd\"),tag = cms.string(\"AlCaRecoHLTpaths_PPS2022_express_v1\"), connect = cms.string(\"frontier://FrontierProd/CMS_CONDITIONS\")))\ -\nprocess.GlobalTag.toGet.append(cms.PSet(record = cms.string(\"PPSTimingCalibrationLUTRcd\"),tag = cms.string(\"PPSDiamondTimingCalibrationLUT_test\"), connect = cms.string(\"frontier://FrontierProd/CMS_CONDITIONS\")))\ -\nprocess.ALCARECOPPSCalMaxTracksFilter.TriggerResultsTag = cms.InputTag(\"TriggerResults\",\"\",\"HLTX\")\ -\nprocess.hltGtStage2Digis.InputLabel = cms.InputTag(\"hltFEDSelectorL1\",\"\",\"HLTX\")" +# customisation command needed for all tests cases +COMMON_CUSTOM="process.ALCARECOPPSCalMaxTracksFilter.TriggerResultsTag = cms.InputTag(\"TriggerResults\",\"\",\"HLTX\")" -INPUTFILE="/store/group/alca_global/pps_alcareco_producer_tests/outputALCAPPS_single.root" -COMMMAND=`xrdfs cms-xrd-global.cern.ch locate $INPUTFILE` -STATUS=$? -echo "xrdfs command status = "$STATUS -if [ $STATUS -eq 0 ]; then - echo "Using file ${INPUTFILE}. Running in ${SCRAM_TEST_PATH}." +# test on 2022 data +INPUTFILE_355207="file:/eos/cms/store/user/cmsbuild/store/data/Run2022B/AlCaPPS/RAW/v1/000/355/207/00000/c23440f4-49c0-44aa-b8f6-f40598fb4705.root" + +# new test on generated data, with same structure as data expected in 2024 +INPUTFILE_367104="/store/group/alca_global/pps_alcareco_producer_tests/outputALCAPPSExpress.root" + +# all input files and customisation commands to loop through +INPUTFILES=($INPUTFILE_355207 $INPUTFILE_367104) + +# test case loop +for TEST_RUN_NO in {0..1}; do + INPUTFILE=${INPUTFILES[$TEST_RUN_NO]} + echo "Using file: ${INPUTFILE} , Running in: ${SCRAM_TEST_PATH} ." (cmsDriver.py testExpressPPSAlCaRecoProducer -s ALCAPRODUCER:PPSCalMaxTracks,ENDJOB \ - --process ALCARECO \ - --scenario pp \ - --era run3_common \ - --conditions auto:run3_data_express \ - --data \ - --datatier ALCARECO \ - --eventcontent ALCARECO \ - --nThreads 8 \ - --number 100 --filein ${INPUTFILE} \ - --fileout file:outputALCAPPS_RECO_express.root \ - --customise_commands="$customise_commands") || die 'failed running test_express_AlCaRecoProducer' $? -else - die "SKIPPING test, file ${INPUTFILE} not found" 0 -fi + --process ALCARECO \ + --scenario pp \ + --era run3_common \ + --conditions auto:run3_data_express \ + --data \ + --datatier ALCARECO \ + --eventcontent ALCARECO \ + --nThreads 8 \ + --number 100 --filein ${INPUTFILE} \ + --fileout file:outputALCAPPS_RECO_express_test${TEST_RUN_NO}.root \ + --customise_commands="$COMMON_CUSTOM") || die 'failed running test_express_AlCaRecoProducer' $? +done diff --git a/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.py b/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.py index df89229ede911..c9eec37375c1d 100644 --- a/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.py +++ b/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.py @@ -1,13 +1,25 @@ import FWCore.ParameterSet.Config as cms -# load era modifier to run on 2018 data -from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 +# load era modifier to run on 2022 data +from Configuration.Eras.Modifier_ctpps_2022_cff import ctpps_2022 -process = cms.Process( 'TEST',ctpps_2018) +process = cms.Process( 'TEST',ctpps_2022) + +# command line options +import FWCore.ParameterSet.VarParsing as VarParsing +options = VarParsing.VarParsing('analysis') +options.register('runNo', + 1, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.int, + "Run number") +options.parseArguments() + +run_no = options.runNo # LHCInfo plotter process.load('Validation.CTPPS.ctppsLHCInfoPlotter_cfi') -process.ctppsLHCInfoPlotter.outputFile = "alcareco_lhc_info_express.root" +process.ctppsLHCInfoPlotter.outputFile = f"alcareco_lhc_info_express_{run_no}.root" # Load geometry from DB process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") @@ -21,7 +33,7 @@ rpId_56_N = cms.uint32(103), rpId_56_F = cms.uint32(123), - outputFile = cms.string("alcareco_tracks_express.root") + outputFile = cms.string(f"alcareco_tracks_express_{run_no}.root") ) # reconstruction plotter @@ -35,7 +47,7 @@ rpId_56_N = cms.uint32(103), rpId_56_F = cms.uint32(123), - outputFile = cms.string("alcareco_protons_express.root") + outputFile = cms.string(f"alcareco_protons_express_{run_no}.root") ) process.p = cms.Path( @@ -55,7 +67,7 @@ process.source = cms.Source( 'PoolSource', fileNames = cms.untracked.vstring( - 'file:outputALCAPPS_RECO_express.root', + options.inputFiles, ), inputCommands = cms.untracked.vstring( 'keep *' diff --git a/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.sh b/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.sh index a6a0bd232c279..04e48e3d650a4 100755 --- a/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.sh +++ b/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.sh @@ -1,4 +1,5 @@ #!/bin/bash function die { echo $1: status $2; exit $2; } -(cmsRun ${SCRAM_TEST_PATH}/test_express_PPSAlCaReco_output.py) || die 'failed running test_express_PPSAlCaReco_output.py' $? +cmsRun ${SCRAM_TEST_PATH}/test_express_PPSAlCaReco_output.py inputFiles=file:outputALCAPPS_RECO_express_test0.root runNo=355207 || die 'failed running test_express_PPSAlCaReco_output.py' $? +cmsRun ${SCRAM_TEST_PATH}/test_express_PPSAlCaReco_output.py inputFiles=file:outputALCAPPS_RECO_express_test1.root runNo=367104 || die 'failed running test_express_PPSAlCaReco_output.py' $? diff --git a/Calibration/PPSAlCaRecoProducer/test/test_prompt_AlCaRecoProducer.sh b/Calibration/PPSAlCaRecoProducer/test/test_prompt_AlCaRecoProducer.sh index d1aae9798f4c7..d2cb2fdc5895a 100755 --- a/Calibration/PPSAlCaRecoProducer/test/test_prompt_AlCaRecoProducer.sh +++ b/Calibration/PPSAlCaRecoProducer/test/test_prompt_AlCaRecoProducer.sh @@ -1,32 +1,32 @@ #!/bin/bash function die { echo $1: status $2; exit $2; } -customise_commands="process.GlobalTag.toGet = cms.VPSet()\ -\nprocess.GlobalTag.toGet.append(cms.PSet(record = cms.string(\"AlCaRecoTriggerBitsRcd\"),tag = cms.string(\"AlCaRecoHLTpaths_PPS2022_prompt_v1\"), connect = cms.string(\"frontier://FrontierProd/CMS_CONDITIONS\")))\ -\nprocess.GlobalTag.toGet.append(cms.PSet(record = cms.string(\"PPSTimingCalibrationLUTRcd\"),tag = cms.string(\"PPSDiamondTimingCalibrationLUT_test\"), connect = cms.string(\"frontier://FrontierProd/CMS_CONDITIONS\")))\ -\nprocess.ALCARECOPPSCalMaxTracksFilter.TriggerResultsTag = cms.InputTag(\"TriggerResults\",\"\",\"HLTX\")\ -\nprocess.hltGtStage2Digis.InputLabel = cms.InputTag(\"hltFEDSelectorL1\",\"\",\"HLTX\")" +# customisation command needed for all tests cases +COMMON_CUSTOM="process.ALCARECOPPSCalMaxTracksFilter.TriggerResultsTag = cms.InputTag(\"TriggerResults\",\"\",\"HLTX\")" -INPUTFILE="/store/group/alca_global/pps_alcareco_producer_tests/outputALCAPPS_single.root" -COMMMAND=`xrdfs cms-xrd-global.cern.ch locate $INPUTFILE` -STATUS=$? -echo "xrdfs command status = "$STATUS -if [ $STATUS -eq 0 ]; then - echo "Using file ${INPUTFILE}. Running in ${SCRAM_TEST_PATH}." - # note we currently use `auto:run3_data_express` GT - # the correct GT (auto:run3_data_prompt) doesn't have LHCInfo record for run 322022 which corresponds to our face ALCARAW file - (cmsDriver.py testPromptPPSAlCaRecoProducer -s ALCAPRODUCER:PPSCalMaxTracks,ENDJOB \ - --process ALCARECO \ - --scenario pp \ - --era run3_common \ - --conditions auto:run3_data_express \ - --data \ - --datatier ALCARECO \ - --eventcontent ALCARECO \ - --nThreads 8 \ - --number 100 --filein ${INPUTFILE} \ - --fileout file:outputALCAPPS_RECO_prompt.root \ - --customise_commands="$customise_commands") || die 'failed running test_prompt_AlCaRecoProducer' $? -else - die "SKIPPING test, file ${INPUTFILE} not found" 0 -fi +# test on 2022 data +INPUTFILE_355207="file:/eos/cms/store/user/cmsbuild/store/data/Run2022B/AlCaPPS/RAW/v1/000/355/207/00000/c23440f4-49c0-44aa-b8f6-f40598fb4705.root" + +# new test on generated data, with same structure as data expected in 2024 +INPUTFILE_367104="/store/group/alca_global/pps_alcareco_producer_tests/outputALCAPPSPrompt.root" + +# all input files and customisation commands to loop through +INPUTFILES=($INPUTFILE_355207 $INPUTFILE_367104) + +# test case loop +for TEST_RUN_NO in {0..1}; do + INPUTFILE=${INPUTFILES[$TEST_RUN_NO]} + echo "Using file: ${INPUTFILE} , Running in: ${SCRAM_TEST_PATH} ." + (cmsDriver.py testpromptPPSAlCaRecoProducer -s ALCAPRODUCER:PPSCalMaxTracks,ENDJOB \ + --process ALCARECO \ + --scenario pp \ + --era run3_common \ + --conditions auto:run3_data_prompt \ + --data \ + --datatier ALCARECO \ + --eventcontent ALCARECO \ + --nThreads 8 \ + --number 100 --filein ${INPUTFILE} \ + --fileout file:outputALCAPPS_RECO_prompt_test${TEST_RUN_NO}.root \ + --customise_commands="$COMMON_CUSTOM") || die 'failed running test_prompt_AlCaRecoProducer' $? +done diff --git a/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.py b/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.py index 939f2468dea88..887856fe16475 100644 --- a/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.py +++ b/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.py @@ -1,13 +1,25 @@ import FWCore.ParameterSet.Config as cms -# load era modifier to run on 2018 data -from Configuration.Eras.Modifier_run3_common_cff import run3_common +# load era modifier to run on 2022 data +from Configuration.Eras.Modifier_ctpps_2022_cff import ctpps_2022 -process = cms.Process( 'TEST',run3_common) +process = cms.Process( 'TEST',ctpps_2022) + +# command line options +import FWCore.ParameterSet.VarParsing as VarParsing +options = VarParsing.VarParsing('analysis') +options.register('runNo', + 1, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.int, + "Run number") +options.parseArguments() + +run_no = options.runNo # LHCInfo plotter process.load('Validation.CTPPS.ctppsLHCInfoPlotter_cfi') -process.ctppsLHCInfoPlotter.outputFile = "alcareco_lhc_info_prompt.root" +process.ctppsLHCInfoPlotter.outputFile = f"alcareco_lhc_info_prompt_{run_no}.root" # Load geometry from DB process.load("Geometry.VeryForwardGeometry.geometryRPFromDB_cfi") @@ -21,7 +33,7 @@ rpId_56_N = cms.uint32(103), rpId_56_F = cms.uint32(123), - outputFile = cms.string("alcareco_tracks_prompt.root") + outputFile = cms.string(f"alcareco_tracks_prompt_{run_no}.root") ) # reconstruction plotter @@ -35,7 +47,7 @@ rpId_56_N = cms.uint32(103), rpId_56_F = cms.uint32(123), - outputFile = cms.string("alcareco_protons_prompt.root") + outputFile = cms.string(f"alcareco_protons_prompt_{run_no}.root") ) process.p = cms.Path( @@ -51,12 +63,11 @@ # load GT process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run3_data_express') -# process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run3_data_prompt') # --> No LHCInfo, temporarily using the express GT +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run3_data_prompt') process.source = cms.Source( 'PoolSource', fileNames = cms.untracked.vstring( - 'file:outputALCAPPS_RECO_prompt.root', + options.inputFiles, ), inputCommands = cms.untracked.vstring( 'keep *' diff --git a/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.sh b/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.sh index f6de023687003..343ed48b48957 100755 --- a/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.sh +++ b/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.sh @@ -1,4 +1,5 @@ #!/bin/bash function die { echo $1: status $2; exit $2; } -(cmsRun ${SCRAM_TEST_PATH}/test_prompt_PPSAlCaReco_output.py) || die 'failed running test_prompt_PPSAlCaReco_output.py' $? +cmsRun ${SCRAM_TEST_PATH}/test_prompt_PPSAlCaReco_output.py inputFiles=file:outputALCAPPS_RECO_prompt_test0.root runNo=355207 || die 'failed running test_prompt_PPSAlCaReco_output.py' $? +cmsRun ${SCRAM_TEST_PATH}/test_prompt_PPSAlCaReco_output.py inputFiles=file:outputALCAPPS_RECO_prompt_test1.root runNo=367104 || die 'failed running test_prompt_PPSAlCaReco_output.py' $?