Skip to content

Commit

Permalink
Merge pull request #41913 from wddgit/implementRun2ScoutingDataFormat…
Browse files Browse the repository at this point in the history
…Test

Add unit test for Run 2 Scouting data formats
  • Loading branch information
cmsbuild authored Jun 13, 2023
2 parents e18c96d + b2282bb commit 50b427c
Show file tree
Hide file tree
Showing 11 changed files with 1,549 additions and 184 deletions.
4 changes: 2 additions & 2 deletions DataFormats/Scouting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Any changes to the Scouting data formats must be backwards compatible. In order
* a file written by the same release
* files written by (some) earlier releases

If the persistent format of any Scouting data format gets changed in the future, please adjust the `TestReadRun3Scouting` and `TestWriteRun3Scouting` 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-Scouting/](https://github.com/cms-data/DataFormats-Scouting/) repository, and update the `TestRun3ScoutingDataFormats` unit test to read the newly created file. The file name should contain the version numbers of the data format classes (from classes_def.xml) in alphabetical order and the release or pre-release with which it was written. If the latest file of Run 3 scouting before the update has not been used in data taking, the file can be deleted.
If the persistent format of any Scouting data format gets changed in the future, please adjust the `TestReadRun3Scouting` and `TestWriteRun3Scouting` 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-Scouting/](https://github.com/cms-data/DataFormats-Scouting/) repository, and update the `TestRun3ScoutingDataFormats` unit test to read the newly created file. The file name should contain the version numbers of the data format classes (from classes_def.xml) in alphabetical order (they are in this alphabetical order already in classes_def.xml) and the release or pre-release with which it was written. If the latest file of Run 3 scouting before the update has not been used in data taking, the file can be deleted.

There will probably be analogous tests added in the future for Run 2 and for runs after Run 3 which will need similar maintenance, although it is unlikely the Run 2 formats will change anymore.
There are analogous tests for Run 2. It is unlikely those formats will change anymore. There will probably be analogous tests added in the future for runs after Run 3 which will need similar maintenance.
126 changes: 63 additions & 63 deletions DataFormats/Scouting/src/classes_def.xml
Original file line number Diff line number Diff line change
@@ -1,45 +1,6 @@
<lcgdict>
<class name="ScoutingCaloJet" ClassVersion="3">
<version ClassVersion="2" checksum="2705685116"/>
<version ClassVersion="3" checksum="631496401"/>
</class>
<class name="ScoutingPFJet" ClassVersion="2">
<version ClassVersion="2" checksum="2507658732"/>
</class>
<class name="ScoutingParticle" ClassVersion="3">
<version ClassVersion="2" checksum="2803573918"/>
<version ClassVersion="3" checksum="3020184314"/>
</class>
<class name="ScoutingVertex" ClassVersion="3">
<version ClassVersion="2" checksum="2969738609"/>
<version ClassVersion="3" checksum="4008726838"/>
</class>
<class name="ScoutingElectron" ClassVersion="2">
<version ClassVersion="2" checksum="1190461538"/>
</class>
<class name="ScoutingMuon" ClassVersion="3">
<version ClassVersion="2" checksum="9151"/>
<version ClassVersion="3" checksum="3167554832"/>
</class>
<class name="ScoutingPhoton" ClassVersion="2">
<version ClassVersion="2" checksum="2797410539"/>
</class>
<class name="ScoutingTrack" ClassVersion="2">
<version ClassVersion="2" checksum="1342928770"/>
</class>
<class name="Run3ScoutingCaloJet" ClassVersion="3">
<version ClassVersion="3" checksum="1173827345"/>
</class>
<class name="Run3ScoutingPFJet" ClassVersion="3">
<version ClassVersion="3" checksum="3819751468"/>
</class>
<class name="Run3ScoutingParticle" ClassVersion="5">
<version ClassVersion="3" checksum="1672617274"/>
<version ClassVersion="4" checksum="1541586682"/>
<version ClassVersion="5" checksum="2425016900"/>
</class>
<class name="Run3ScoutingVertex" ClassVersion="3">
<version ClassVersion="3" checksum="316446070"/>
</class>
<class name="Run3ScoutingElectron" ClassVersion="6">
<version ClassVersion="3" checksum="1086011373"/>
Expand Down Expand Up @@ -74,10 +35,21 @@
trkcharge_.push_back(onfile.charge_);]]>
</ioread>

<class name="Run3ScoutingHitPatternPOD" ClassVersion="3">
<version ClassVersion="3" checksum="1448115564"/>
</class>
<class name="Run3ScoutingMuon" ClassVersion="4">
<version ClassVersion="3" checksum="3882497397"/>
<version ClassVersion="4" checksum="4206297195"/>
</class>
<class name="Run3ScoutingParticle" ClassVersion="5">
<version ClassVersion="3" checksum="1672617274"/>
<version ClassVersion="4" checksum="1541586682"/>
<version ClassVersion="5" checksum="2425016900"/>
</class>
<class name="Run3ScoutingPFJet" ClassVersion="3">
<version ClassVersion="3" checksum="3819751468"/>
</class>
<class name="Run3ScoutingPhoton" ClassVersion="5">
<version ClassVersion="3" checksum="1683146807"/>
<version ClassVersion="4" checksum="1725280278"/>
Expand All @@ -86,39 +58,67 @@
<class name="Run3ScoutingTrack" ClassVersion="3">
<version ClassVersion="3" checksum="3352318277"/>
</class>
<class name="Run3ScoutingHitPatternPOD" ClassVersion="3">
<version ClassVersion="3" checksum="1448115564"/>
<class name="Run3ScoutingVertex" ClassVersion="3">
<version ClassVersion="3" checksum="316446070"/>
</class>
<class name="ScoutingCaloJet" ClassVersion="3">
<version ClassVersion="2" checksum="2705685116"/>
<version ClassVersion="3" checksum="631496401"/>
</class>
<class name="ScoutingElectron" ClassVersion="2">
<version ClassVersion="2" checksum="1190461538"/>
</class>
<class name="ScoutingMuon" ClassVersion="3">
<version ClassVersion="2" checksum="9151"/>
<version ClassVersion="3" checksum="3167554832"/>
</class>
<class name="ScoutingParticle" ClassVersion="3">
<version ClassVersion="2" checksum="2803573918"/>
<version ClassVersion="3" checksum="3020184314"/>
</class>
<class name="ScoutingPFJet" ClassVersion="2">
<version ClassVersion="2" checksum="2507658732"/>
</class>
<class name="ScoutingPhoton" ClassVersion="2">
<version ClassVersion="2" checksum="2797410539"/>
</class>
<class name="ScoutingTrack" ClassVersion="2">
<version ClassVersion="2" checksum="1342928770"/>
</class>
<class name="ScoutingVertex" ClassVersion="3">
<version ClassVersion="2" checksum="2969738609"/>
<version ClassVersion="3" checksum="4008726838"/>
</class>
<class name="std::vector<ScoutingCaloJet>"/>
<class name="std::vector<ScoutingPFJet>"/>
<class name="std::vector<ScoutingParticle>"/>
<class name="std::vector<ScoutingVertex>"/>
<class name="std::vector<ScoutingElectron>"/>
<class name="std::vector<ScoutingMuon>"/>
<class name="std::vector<ScoutingPhoton>"/>
<class name="std::vector<ScoutingTrack>"/>
<class name="std::vector<Run3ScoutingCaloJet>"/>
<class name="std::vector<Run3ScoutingPFJet>"/>
<class name="std::vector<Run3ScoutingParticle>"/>
<class name="std::vector<Run3ScoutingVertex>"/>
<class name="std::vector<Run3ScoutingElectron>"/>
<class name="std::vector<Run3ScoutingMuon>"/>
<class name="std::vector<Run3ScoutingParticle>"/>
<class name="std::vector<Run3ScoutingPFJet>"/>
<class name="std::vector<Run3ScoutingPhoton>"/>
<class name="std::vector<Run3ScoutingTrack>"/>
<class name="edm::Wrapper<std::vector<ScoutingCaloJet> >"/>
<class name="edm::Wrapper<std::vector<ScoutingPFJet> >"/>
<class name="edm::Wrapper<std::vector<ScoutingParticle> >"/>
<class name="edm::Wrapper<std::vector<ScoutingVertex> >"/>
<class name="edm::Wrapper<std::vector<ScoutingElectron> >"/>
<class name="edm::Wrapper<std::vector<ScoutingMuon> >"/>
<class name="edm::Wrapper<std::vector<ScoutingPhoton> >"/>
<class name="edm::Wrapper<std::vector<ScoutingTrack> >"/>
<class name="std::vector<Run3ScoutingVertex>"/>
<class name="std::vector<ScoutingCaloJet>"/>
<class name="std::vector<ScoutingElectron>"/>
<class name="std::vector<ScoutingMuon>"/>
<class name="std::vector<ScoutingParticle>"/>
<class name="std::vector<ScoutingPFJet>"/>
<class name="std::vector<ScoutingPhoton>"/>
<class name="std::vector<ScoutingTrack>"/>
<class name="std::vector<ScoutingVertex>"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingCaloJet> >"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingPFJet> >"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingParticle> >"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingVertex> >"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingElectron> >"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingMuon> >"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingParticle> >"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingPFJet> >"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingPhoton> >"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingTrack> >"/>
<class name="edm::Wrapper<std::vector<Run3ScoutingVertex> >"/>
<class name="edm::Wrapper<std::vector<ScoutingCaloJet> >"/>
<class name="edm::Wrapper<std::vector<ScoutingElectron> >"/>
<class name="edm::Wrapper<std::vector<ScoutingMuon> >"/>
<class name="edm::Wrapper<std::vector<ScoutingParticle> >"/>
<class name="edm::Wrapper<std::vector<ScoutingPFJet> >"/>
<class name="edm::Wrapper<std::vector<ScoutingPhoton> >"/>
<class name="edm::Wrapper<std::vector<ScoutingTrack> >"/>
<class name="edm::Wrapper<std::vector<ScoutingVertex> >"/>
</lcgdict>
3 changes: 2 additions & 1 deletion DataFormats/Scouting/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<use name="DataFormats/Scouting"/>

<library name="testRun3ScoutingDataFormats" file="TestReadRun3Scouting.cc,TestWriteRun3Scouting.cc">
<library name="testScoutingDataFormats" file="TestReadRun2Scouting.cc,TestWriteRun2Scouting.cc,TestReadRun3Scouting.cc,TestWriteRun3Scouting.cc">
<flags EDM_PLUGIN="1"/>
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
</library>

<test name="TestRun2ScoutingDataFormats" command="TestRun2ScoutingFormats.sh"/>
<test name="TestRun3ScoutingDataFormats" command="TestRun3ScoutingFormats.sh"/>

<test name="testDataFormatsScoutingRun2" command="testDataFormatsScoutingRun2.sh"/>
Expand Down
Loading

0 comments on commit 50b427c

Please sign in to comment.