Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add low-pT electrons to MINIAOD, update ID, improve end user experience (back port of 31220) #32372

Merged
merged 21 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
392fed9
support for GBRForest stored in ROOT files
bainbrid Nov 25, 2020
3eab02f
handle both old (e.g. 2019Aug07) and new (2020Sept15) BDT models, rek…
bainbrid Nov 25, 2020
e134d23
enable embedding of edm::Ptr<pat::PackedCandidate> in pat::Electron
bainbrid Nov 25, 2020
220f959
add 'ele2packed' and 'ele2lost' ValueMaps, embed IDs and Ptrs, select…
bainbrid Nov 25, 2020
4c9c394
add low-pT electrons to MINIAOD by default, modify collections in REC…
bainbrid Nov 25, 2020
eeb7230
revert to boost/filesystem
bainbrid Nov 26, 2020
ceb38e6
add missing lib
bainbrid Nov 26, 2020
6b29469
prevent copy of GBRForest after read
bainbrid Dec 2, 2020
e87d57d
switch to fixedGridRhoFastjetAll, tidy up
bainbrid Dec 2, 2020
3ebcce3
remove obsolete headers
bainbrid Dec 2, 2020
af519cf
bug fix concerning BaseParticlePropagator usage; removed lowptgsfeles…
bainbrid Dec 2, 2020
dcfdd01
scram build code-format
bainbrid Dec 2, 2020
074b7e3
add rekeyLowPtGsfElectronSeedValueMaps to RECO and FEVT
bainbrid Dec 3, 2020
ade0d0b
revert to original 'Autumn18' model for RECO, use 2020Sept15 for UL r…
bainbrid Dec 6, 2020
b5359cc
scram build code-format
bainbrid Dec 6, 2020
40916e6
slava: add gbrForestFile.Close(nodelete)
bainbrid Dec 8, 2020
ee6ceb3
slava: use run2_miniAOD_UL in lowPtGsfElectronID_cff
bainbrid Dec 8, 2020
c1513e2
slava: remove rekey module from RECO sequence
bainbrid Dec 8, 2020
d5297a2
slava: only add low pT electrons to MINIAOD for bParking and run2_min…
bainbrid Dec 8, 2020
692e790
Fixes a unit test failure in TauAnalysis/MCEmbeddingTools (back port …
bainbrid Dec 8, 2020
541fb89
schedule rekeyLowPtGsfElectronSeedValueMaps and lowPtGsfElectronID fo…
bainbrid Dec 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions CommonTools/MVAUtils/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<use name="CondFormats/EgammaObjects"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="CondFormats/DataRecord"/>
<use name="roottmva"/>
<use name="tinyxml2"/>

<use name="CommonTools/Utils"/>
<use name="CondFormats/EgammaObjects"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="CondFormats/DataRecord"/>
<use name="roottmva"/>
<use name="tinyxml2"/>
<export>
<lib name="1"/>
</export>
4 changes: 4 additions & 0 deletions CommonTools/MVAUtils/bin/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<use name="CommonTools/MVAUtils"/>

<bin name="convertXMLToGBRForestROOT" file="convertXMLToGBRForestROOT.cc">
</bin>
34 changes: 34 additions & 0 deletions CommonTools/MVAUtils/bin/convertXMLToGBRForestROOT.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include "CommonTools/MVAUtils/interface/GBRForestTools.h"

#include "TFile.h"

#include <boost/filesystem.hpp>
#include <iostream>

int main(int argc, char **argv) {
if (argc != 3) {
std::cout << "Please pass a (gzipped) BDT weight file and a name for the output ROOT file." << std::endl;
return 1;
}

char *inputFileName = argv[1];
char *outputFileName = argv[2];

if (!boost::filesystem::exists(inputFileName)) {
std::cout << "Input file " << inputFileName << " does not exists." << std::endl;
return 1;
}

if (boost::filesystem::exists(outputFileName)) {
std::cout << "Output file " << outputFileName << " already exists." << std::endl;
return 1;
}

auto gbrForest = createGBRForest(inputFileName);
std::cout << "Read GBRForest " << inputFileName << " successfully." << std::endl;

TFile{outputFileName, "RECREATE"}.WriteObject(gbrForest.get(), "gbrForest");
std::cout << "GBRForest written to " << outputFileName << " successfully." << std::endl;

return 0;
}
12 changes: 12 additions & 0 deletions CommonTools/MVAUtils/src/GBRForestTools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "TFile.h"

#include <cstdio>
#include <cstdlib>
#include <RVersion.h>
Expand Down Expand Up @@ -117,6 +119,16 @@ namespace {
}

std::unique_ptr<GBRForest> init(const std::string& weightsFileFullPath, std::vector<std::string>& varNames) {
//
// Load weights file, for ROOT file
//
if (reco::details::hasEnding(weightsFileFullPath, ".root")) {
TFile gbrForestFile(weightsFileFullPath.c_str());
std::unique_ptr<GBRForest> up(reinterpret_cast<GBRForest*>(gbrForestFile.Get("gbrForest")));
gbrForestFile.Close("nodelete");
return up;
}

//
// Load weights file, for gzipped or raw xml file
//
Expand Down
2 changes: 2 additions & 0 deletions DataFormats/PatCandidates/src/classes_def_objects.xml
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@
<class name="std::vector<edm::Ptr<pat::PackedCandidate> >" />
<class name="edm::Wrapper<edm::Ptr<pat::PackedCandidate> >" />
<class name="edm::Wrapper<std::vector<edm::Ptr<pat::PackedCandidate> > >" />
<class name="edm::ValueMap<edm::Ptr<pat::PackedCandidate> >" />
<class name="edm::Wrapper<edm::ValueMap<edm::Ptr<pat::PackedCandidate> > >" />

<class name="std::vector<edm::Ptr<pat::PackedGenParticle> >" />
<class name="edm::Wrapper<edm::Ptr<pat::PackedGenParticle> >" />
Expand Down
1 change: 1 addition & 0 deletions PhysicsTools/PatAlgos/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<use name="HLTrigger/HLTcore"/>
<use name="DataFormats/PatCandidates"/>
<use name="DataFormats/BTauReco"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/JetReco"/>
<use name="DataFormats/MuonReco"/>
<use name="DataFormats/TrackReco"/>
Expand Down
Loading