Skip to content

Commit 5a21f34

Browse files
committed
Add tests with split 0 input files to raw data unit tests
1 parent a86063d commit 5a21f34

File tree

16 files changed

+229
-50
lines changed

16 files changed

+229
-50
lines changed

DataFormats/Common/test/TestTriggerResultsFormat.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,25 @@ file=testTriggerResults.root
1010

1111
cmsRun ${LOCAL_TEST_DIR}/test_readTriggerResults_cfg.py "$file" || die "Failure using test_readTriggerResults_cfg.py $file" $?
1212

13-
oldFiles="testTriggerResults_CMSSW_13_0_0.root testTriggerResults_CMSSW_13_1_0_pre3.root"
13+
# The old files read below were generated as follows.
14+
#
15+
# Check out the release indicated in the filename. Then cherry pick
16+
# the commit that adds the original version of the file
17+
# DataFormats/Common/test/TestWriteTriggerResults.cc.
18+
# Except for BuildFile.xml, this only adds new test files.
19+
# There may be minor conflicts or issues in test/BuildFile.xml
20+
# that need to be resolved.
21+
#
22+
# Run cmsRun with DataFormats/Common/test/create_triggerresults_test_file_cfg.py
23+
# as the configuration and rename the file that creates.
24+
25+
# Note that TriggerResults is declared in the classes_def.xml file with
26+
# a requirement that the product is always written with split level 0.
27+
# Most other raw data products are written with the default split level
28+
# for the output file. That is why all the test input files in this
29+
# shell script were written with split level 0.
30+
31+
oldFiles="testTriggerResults_CMSSW_13_0_0_split_0.root testTriggerResults_CMSSW_13_1_0_pre3_split_0.root"
1432
for file in $oldFiles; do
1533
inputfile=$(edmFileInPath DataFormats/Common/data/$file) || die "Failure edmFileInPath DataFormats/Common/data/$file" $?
1634
cmsRun ${LOCAL_TEST_DIR}/test_readTriggerResults_cfg.py "$inputfile" || die "Failed to read old file $file" $?

DataFormats/DetId/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ The type `std::vector<DetId>` is part of the RAW data, and any changes must be b
77
* a file written by the same release
88
* files written by (some) earlier releases
99

10-
If the persistent format of class `std::vector<DetId>` gets changed in the future, please adjust the `TestReadVectorDetId` and `TestWriteVectorDetId` modules accordingly. It is important that every member container has some content in this test. Please also add a new file to the [https://github.com/cms-data/DataFormats-DetId/](https://github.com/cms-data/DataFormats-DetId/) repository, and update the `TestVectorDetId` unit test to read the newly created file. The file name should contain the release or pre-release with which it was written.
10+
If the persistent format of class `std::vector<DetId>` gets changed in the future, please adjust the `TestReadVectorDetId` and `TestWriteVectorDetId` modules accordingly. It is important that every member container has some content in this test. Please also add new files to the [https://github.com/cms-data/DataFormats-DetId/](https://github.com/cms-data/DataFormats-DetId/) repository, and update the `TestVectorDetId` unit test to read the newly created files. There should be one file written with split level 0 and one with split level 99. The file name should contain the release or pre-release with which it was written and the split level.

DataFormats/DetId/test/TestVectorDetId.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,25 @@ file=testVectorDetId.root
1010

1111
cmsRun ${LOCAL_TEST_DIR}/test_readVectorDetId_cfg.py "$file" || die "Failure using test_readVectorDetId_cfg.py $file" $?
1212

13-
oldFiles="testVectorDetId_CMSSW_13_2_4.root"
13+
# The old files read below were generated as follows.
14+
#
15+
# Check out the 13_2_4 release and cherry pick the commit that
16+
# adds the original version of the file
17+
# DataFormats/DetId/test/TestWriteVectorDetId.cc.
18+
# Except for BuildFile.xml this only adds new test files.
19+
# There may be minor conflicts or issues in test/BuildFile.xml
20+
# that need to be resolved.
21+
#
22+
# Run cmsRun with DataFormats/DetId/test/create_VectorDetId_test_file_cfg.py
23+
# as the configuration and rename the file that creates.
24+
#
25+
# By default, split level 99 is used (maximum possible splitting).
26+
# If the suffix "_split_0" is near the end of the filename, the
27+
# following was added to the configuration of the output module:
28+
# "splitLevel = cms.untracked.int32(0)"
29+
#
30+
31+
oldFiles="testVectorDetId_CMSSW_13_2_4_split_99.root testVectorDetId_CMSSW_13_2_4_split_0.root"
1432
for file in $oldFiles; do
1533
inputfile=$(edmFileInPath DataFormats/DetId/data/$file) || die "Failure edmFileInPath DataFormats/DetId/data/$file" $?
1634
cmsRun ${LOCAL_TEST_DIR}/test_readVectorDetId_cfg.py "$inputfile" || die "Failed to read old file $file" $?

DataFormats/FEDRawData/test/TestFEDRawDataCollectionFormat.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,25 @@ file=testFEDRawDataCollection.root
1010

1111
cmsRun ${LOCAL_TEST_DIR}/test_readFEDRawDataCollection_cfg.py "$file" || die "Failure using test_readFEDRawDataCollection_cfg.py $file" $?
1212

13-
oldFiles="testFEDRawDataCollection_CMSSW_13_0_0.root testFEDRawDataCollection_CMSSW_13_1_0_pre3.root"
13+
# The old files read below were generated as follows.
14+
#
15+
# Check out the release indicated in the filename. Then cherry pick
16+
# the commit that adds the original version of the file
17+
# DataFormats/FEDRawData/test/TestWriteFEDRawDataCollection.cc.
18+
# Except for BuildFile.xml, this only adds new test files.
19+
# There may be minor conflicts or issues in test/BuildFile.xml
20+
# that need to be resolved.
21+
#
22+
# Run cmsRun with DataFormats/FEDRawData/test/create_FEDRawDataCollection_test_file_cfg.py
23+
# as the configuration and rename the file that creates.
24+
25+
# Note that FEDRawDataCollection is declared in the classes_def.xml file with
26+
# a requirement that the product is always written with split level 0.
27+
# Most other raw data products are written with the default split level
28+
# for the output file. That is why all the test input files in this
29+
# shell script were written with split level 0.
30+
31+
oldFiles="testFEDRawDataCollection_CMSSW_13_0_0_split_0.root testFEDRawDataCollection_CMSSW_13_1_0_pre3_split_0.root"
1432
for file in $oldFiles; do
1533
inputfile=$(edmFileInPath DataFormats/FEDRawData/data/$file) || die "Failure edmFileInPath DataFormats/FEDRawData/data/$file" $?
1634
cmsRun ${LOCAL_TEST_DIR}/test_readFEDRawDataCollection_cfg.py "$inputfile" || die "Failed to read old file $file" $?

DataFormats/HLTReco/test/TestTriggerEventFormat.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,25 @@ file=testTriggerEvent.root
1010

1111
cmsRun ${LOCAL_TEST_DIR}/test_readTriggerEvent_cfg.py "$file" || die "Failure using test_readTriggerEvent_cfg.py $file" $?
1212

13-
oldFiles="testTriggerEvent_CMSSW_13_0_0.root testTriggerEvent_CMSSW_13_1_0_pre3.root"
13+
# The old files read below were generated as follows.
14+
#
15+
# Check out the release indicated in the filename. Then cherry pick
16+
# the commit that adds the original version of the file
17+
# DataFormats/HLTReco/test/TestWriteTriggerEvent.cc.
18+
# Except for BuildFile.xml, this only adds new test files.
19+
# There may be minor conflicts or issues in test/BuildFile.xml
20+
# that need to be resolved.
21+
#
22+
# Run cmsRun with DataFormats/HLTReco/test/create_TriggerEvent_test_file_cfg.py
23+
# as the configuration and rename the file that creates.
24+
25+
# Note that TriggerEvent is declared in the classes_def.xml file with
26+
# a requirement that the product is always written with split level 0.
27+
# Most other raw data products are written with the default split level
28+
# for the output file. That is why all the test input files in this
29+
# shell script were written with split level 0.
30+
31+
oldFiles="testTriggerEvent_CMSSW_13_0_0_split_0.root testTriggerEvent_CMSSW_13_1_0_pre3_split_0.root"
1432
for file in $oldFiles; do
1533
inputfile=$(edmFileInPath DataFormats/HLTReco/data/$file) || die "Failure edmFileInPath DataFormats/HLTReco/data/$file" $?
1634
cmsRun ${LOCAL_TEST_DIR}/test_readTriggerEvent_cfg.py "$inputfile" || die "Failed to read old file $file" $?

DataFormats/L1Scouting/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ Any changes to the L1 scouting data formats must be backwards compatible.
66
In order to ensure the L1 Scouting formats can be read by future CMSSW releases,
77
there is a `TestWriteL1ScoutingDataFormats` unit test, which makes use of the `TestReadL1Scouting` analyzer and the `TestWriteL1Scouting` producer.
88
The unit test checks that objects can be written and read properly.
9+
If any of the data formats is changed, then 2 new input files
10+
for the test should be created, one for split level 0 and one for
11+
split level 99.

DataFormats/L1Scouting/test/TestL1ScoutingFormat.sh

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,37 @@ file=testL1Scouting.root
1010

1111
cmsRun ${LOCAL_TEST_DIR}/read_L1Scouting_cfg.py --inputFile "$file" || die "Failure using read_L1Scouting_cfg.py $file" $?
1212

13+
# The old files read below were generated as follows.
14+
#
15+
# Check out the release in the filename and use it without modification to make
16+
# files with split level 99 (maximum possible splitting for each product)
17+
#
18+
# Then execute:
19+
#
20+
# cmsRun DataFormats/L1Scouting/test/create_L1Scouting_test_file_cfg.py
21+
#
22+
# Rename the output file.
23+
#
24+
# The versions of the classes are encoded in the filenames in
25+
# alphabetical order. This order is also the order the classes
26+
# appear in classes_def.xml.
27+
#
28+
# For the split level 0 files, do the exact same thing except
29+
# add the following to the output module configuration.
30+
# "splitLevel = cms.untracked.int32(0)"
31+
1332
# test file for muon, jet, e/gamma and energy sums data formats
14-
oldFile="testL1Scouting_v3_v3_v3_v3_v3_13_3_0_pre5.root"
15-
inputfile=$(edmFileInPath DataFormats/L1Scouting/data/$oldFile) || die "Failure edmFileInPath DataFormats/L1Scouting/data/$oldFile" $?
16-
cmsRun ${LOCAL_TEST_DIR}/read_L1Scouting_cfg.py --inputFile "$inputfile" --bmtfStubVersion 0 || die "Failed to read old file $oldFile" $?
33+
oldFiles="testL1Scouting_v3_v3_v3_v3_v3_14_0_0_split_99.root testL1Scouting_v3_v3_v3_v3_v3_14_0_0_split_0.root"
34+
for file in $oldFiles; do
35+
inputfile=$(edmFileInPath DataFormats/L1Scouting/data/$file) || die "Failure edmFileInPath DataFormats/L1Scouting/data/$file" $?
36+
cmsRun ${LOCAL_TEST_DIR}/read_L1Scouting_cfg.py --inputFile "$inputfile" --bmtfStubVersion 0 || die "Failed to read old file $file" $?
37+
done
1738

1839
# added BMTF input stubs data format
19-
oldFile="testL1Scouting_v3_v3_v3_v3_v3_v3_14_1_0_pre4.root"
20-
inputfile=$(edmFileInPath DataFormats/L1Scouting/data/$oldFile) || die "Failure edmFileInPath DataFormats/L1Scouting/data/$oldFile" $?
21-
cmsRun ${LOCAL_TEST_DIR}/read_L1Scouting_cfg.py --inputFile "$inputfile" --bmtfStubVersion 3 || die "Failed to read old file $oldFile" $?
40+
oldFiles="testL1Scouting_v3_v3_v3_v3_v3_v3_14_1_0_pre5_split_99.root testL1Scouting_v3_v3_v3_v3_v3_v3_14_1_0_pre5_split_0.root"
41+
for file in $oldFiles; do
42+
inputfile=$(edmFileInPath DataFormats/L1Scouting/data/$file) || die "Failure edmFileInPath DataFormats/L1Scouting/data/$file" $?
43+
cmsRun ${LOCAL_TEST_DIR}/read_L1Scouting_cfg.py --inputFile "$inputfile" --bmtfStubVersion 3 || die "Failed to read old file $file" $?
44+
done
2245

2346
exit 0

DataFormats/L1ScoutingRawData/test/TestSDSRawDataCollectionFormat.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,22 @@ file=testSDSRawDataCollection.root
1010

1111
cmsRun ${LOCAL_TEST_DIR}/read_SDSRawDataCollection_cfg.py "$file" || die "Failure using read_SDSRawDataCollection_cfg.py $file" $?
1212

13-
oldFile="testSDSRawDataCollection_v3_CMSSW_13_3_0_pre5.root"
13+
# The old files read below were generated as follows.
14+
#
15+
# Check out the release in the filename and use it without modification.
16+
# Then execute:
17+
#
18+
# cmsRun DataFormats/L1ScoutingRawData/test/create_SDSRawDataCollection_test_file_cfg.py
19+
#
20+
# Rename the output file. The versions of the class is encoded in the filename.
21+
#
22+
# Note that SDSRawDataCollection is declared in the classes_def.xml file with
23+
# a requirement that the product is always written with split level 0.
24+
# Most other raw data products are written with the default split level
25+
# for the output file. That is why all the test input files in this
26+
# shell script were written with split level 0.
27+
28+
oldFile="testSDSRawDataCollection_v3_CMSSW_14_0_0_split_0.root"
1429
inputfile=$(edmFileInPath DataFormats/L1ScoutingRawData/data/$oldFile) || die "Failure edmFileInPath DataFormats/L1ScoutingRawData/data/$oldFile" $?
1530
cmsRun ${LOCAL_TEST_DIR}/read_SDSRawDataCollection_cfg.py "$inputfile" || die "Failed to read old file $oldFile" $?
1631

DataFormats/L1TGlobal/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ The class `GlobalObjectMapRecord` is part of the RAW data, and any changes must
77
* a file written by the same release
88
* files written by (some) earlier releases
99

10-
If the persistent format of class `GlobalObjectMapRecord` gets changed in the future, please adjust the `TestReadGlobalObjectMapRecord` and `TestWriteGlobalObjectMapRecord` modules accordingly. It is important that every member container has some content in this test. Please also add a new file to the [https://github.com/cms-data/DataFormats-L1TGlobal/](https://github.com/cms-data/DataFormats-L1TGlobal/) repository, and update the `TestGlobalObjectMapRecord` unit test to read the newly created file. The file name should contain the release or pre-release with which it was written.
10+
If the persistent format of class `GlobalObjectMapRecord` gets changed in the future, please adjust the `TestReadGlobalObjectMapRecord` and `TestWriteGlobalObjectMapRecord` modules accordingly. It is important that every member container has some content in this test. Please also add new files to the [https://github.com/cms-data/DataFormats-L1TGlobal/](https://github.com/cms-data/DataFormats-L1TGlobal/) repository, and update the `TestGlobalObjectMapRecord` unit test to read the newly created files. There should be one file written with split level 0 and one with split level 99. The file name should contain the release or pre-release with which it was written and the split level.

DataFormats/L1TGlobal/test/TestGlobalObjectMapRecordFormat.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,22 @@ file=testGlobalObjectMapRecord.root
1010

1111
cmsRun ${LOCAL_TEST_DIR}/test_readGlobalObjectMapRecord_cfg.py "$file" || die "Failure using test_readGlobalObjectMapRecord_cfg.py $file" $?
1212

13-
oldFiles="testGlobalObjectMapRecord_CMSSW_13_0_0.root testGlobalObjectMapRecord_CMSSW_13_1_0_pre3.root"
13+
# The old files read below were generated as follows.
14+
#
15+
# Check out the release in the filename and cherry pick the commit that
16+
# adds the original version of the file:
17+
# DataFormats/L1TGlobal/test/TestWriteGlobalObjectMapRecord.cc
18+
#
19+
# Run cmsRun with DataFormats/L1TGlobal/test/create_GlobalObjectMapRecord_test_file_cfg.py
20+
# as the configuration and rename the file that creates.
21+
#
22+
# By default, split level 99 is used (maximum possible splitting).
23+
# If the suffix "_split_0" is near the end of the filename, the
24+
# following was added to the configuration of the output module:
25+
# "splitLevel = cms.untracked.int32(0)"
26+
27+
oldFiles="testGlobalObjectMapRecord_CMSSW_13_0_0_split_99.root testGlobalObjectMapRecord_CMSSW_13_0_0_split_0.root"
28+
oldFiles+=" testGlobalObjectMapRecord_CMSSW_13_1_0_pre3_split_99.root testGlobalObjectMapRecord_CMSSW_13_1_0_pre3_split_0.root"
1429
for file in $oldFiles; do
1530
inputfile=$(edmFileInPath DataFormats/L1TGlobal/data/$file) || die "Failure edmFileInPath DataFormats/L1TGlobal/data/$file" $?
1631
cmsRun ${LOCAL_TEST_DIR}/test_readGlobalObjectMapRecord_cfg.py "$inputfile" || die "Failed to read old file $file" $?

0 commit comments

Comments
 (0)