-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 #35953 from guitargeek/ElectronMVAEstimatorRun2_fw…
…lite Restructure VID Python/FWLite code and avoid generating dictionaries for `Reco*/*Identification` packages
- Loading branch information
Showing
29 changed files
with
156 additions
and
236 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
16 changes: 0 additions & 16 deletions
16
PhysicsTools/SelectorUtils/interface/MakePtrFromCollection.h
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
PhysicsTools/SelectorUtils/interface/MakePyVIDClassBuilder.h
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
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,4 @@ | ||
<bin file="testPhysicsToolsSelectorUtilsPythonTestsDriver.cpp"> | ||
<flags TEST_RUNNER_ARGS="/bin/bash PhysicsTools/SelectorUtils/test runPythonTests.sh"/> | ||
<use name="FWCore/Utilities"/> | ||
</bin> |
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,6 @@ | ||
#!/bin/sh | ||
|
||
# Pass in name and status | ||
function die { echo $1: status $2 ; exit $2; } | ||
|
||
python3 ${CMSSW_BASE}/src/PhysicsTools/SelectorUtils/test/test_vid_selectors.py |
3 changes: 3 additions & 0 deletions
3
PhysicsTools/SelectorUtils/test/testPhysicsToolsSelectorUtilsPythonTestsDriver.cpp
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,3 @@ | ||
#include "FWCore/Utilities/interface/TestHelper.h" | ||
|
||
RUNTEST() |
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,19 @@ | ||
import unittest | ||
|
||
class TestVIDSelectros(unittest.TestCase): | ||
|
||
def test_vid_selectors(self): | ||
# Test that all VID selectors for Python/FWLite can be instantiated | ||
|
||
from RecoMuon.MuonIdentification.VIDMuonSelector import VIDMuonSelector | ||
from RecoEgamma.ElectronIdentification.VIDElectronSelector import VIDElectronSelector | ||
from RecoEgamma.PhotonIdentification.VIDPhotonSelector import VIDPhotonSelector | ||
|
||
VIDMuonSelector() | ||
VIDElectronSelector() | ||
VIDPhotonSelector() | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
unittest.main(verbosity=2) |
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
16 changes: 16 additions & 0 deletions
16
RecoEgamma/EgammaTools/interface/AnyMVAEstimatorRun2Factory.h
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,16 @@ | ||
#ifndef RecoEgamma_EgammaTools_AnyMVAEstimatorRun2Factory_H | ||
#define RecoEgamma_EgammaTools_AnyMVAEstimatorRun2Factory_H | ||
|
||
#include "FWCore/PluginManager/interface/PluginFactory.h" | ||
#include "RecoEgamma/EgammaTools/interface/AnyMVAEstimatorRun2Base.h" | ||
|
||
// This plugin factory typedef is not defined in the main header file | ||
// "AnyMVAEstimatorRun2Base.h", because there are usecases of generating the | ||
// dictionaries for AnyMVAEstimatorRun2Base on the fly (see notes in | ||
// ElectronMVAEstimatorRun2.h for more details). This doesn't work if | ||
// PluginFactory.h is included in the header file because of conflicting C++ | ||
// modules. | ||
|
||
typedef edmplugin::PluginFactory<AnyMVAEstimatorRun2Base*(const edm::ParameterSet&)> AnyMVAEstimatorRun2Factory; | ||
|
||
#endif |
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
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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
#include "RecoEgamma/EgammaTools/interface/AnyMVAEstimatorRun2Base.h" | ||
#include "RecoEgamma/EgammaTools/interface/AnyMVAEstimatorRun2Factory.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
AnyMVAEstimatorRun2Base::AnyMVAEstimatorRun2Base(const edm::ParameterSet& conf) | ||
: tag_(conf.getParameter<std::string>("mvaTag")), | ||
nCategories_(conf.getParameter<int>("nCategories")), | ||
debug_(conf.getUntrackedParameter<bool>("debug", false)) {} | ||
|
||
EDM_REGISTER_PLUGINFACTORY(AnyMVAEstimatorRun2Factory, "AnyMVAEstimatorRun2Factory"); |
34 changes: 25 additions & 9 deletions
34
RecoEgamma/ElectronIdentification/interface/ElectronMVAEstimatorRun2.h
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
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
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
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
Oops, something went wrong.