-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 #31220
Changes from all commits
2d0c285
e58a64c
babc08c
2d64f38
356f410
57beace
522c552
444747b
e5e18d2
c5e2d04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "CommonTools/MVAUtils/interface/GBRForestTools.h" | ||
|
||
#include "TFile.h" | ||
|
||
#include <filesystem> | ||
#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 (!std::filesystem::exists(inputFileName)) { | ||
std::cout << "Input file " << inputFileName << " does not exists." << std::endl; | ||
return 1; | ||
} | ||
|
||
if (std::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; | ||
} |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -11,42 +11,49 @@ | |||||||
) | ||||||||
|
||||||||
patLowPtElectrons = patElectrons.clone( | ||||||||
# input collections | ||||||||
|
||||||||
# Input collection | ||||||||
electronSource = sourceElectrons, | ||||||||
genParticleMatch = cms.InputTag("lowPtElectronMatch"), | ||||||||
# overrides | ||||||||
addElectronID = cms.bool(False), | ||||||||
addGenMatch = cms.bool(True), | ||||||||
addMVAVariables = cms.bool(False), | ||||||||
addPFClusterIso = cms.bool(False), | ||||||||
electronIDSources = cms.PSet(), | ||||||||
computeMiniIso = cms.bool(False), | ||||||||
isoDeposits = cms.PSet(), | ||||||||
isolationValues = cms.PSet(), | ||||||||
isolationValuesNoPFId = cms.PSet(), | ||||||||
miniIsoParamsB = cms.vdouble(), | ||||||||
miniIsoParamsE = cms.vdouble(), | ||||||||
usePfCandidateMultiMap = cms.bool(False), | ||||||||
# embedding | ||||||||
embedBasicClusters = cms.bool(False), | ||||||||
embedGenMatch = cms.bool(False), | ||||||||
embedGsfElectronCore = cms.bool(False), | ||||||||
embedGsfTrack = cms.bool(False), | ||||||||
embedHighLevelSelection = cms.bool(False), | ||||||||
embedPFCandidate = cms.bool(False), | ||||||||
embedPflowBasicClusters = cms.bool(False), | ||||||||
embedPflowPreshowerClusters = cms.bool(False), | ||||||||
embedPflowSuperCluster = cms.bool(False), | ||||||||
embedPreshowerClusters = cms.bool(False), | ||||||||
embedRecHits = cms.bool(False), | ||||||||
embedSeedCluster = cms.bool(False), | ||||||||
embedSuperCluster = cms.bool(False), | ||||||||
embedTrack = cms.bool(True), | ||||||||
) | ||||||||
|
||||||||
# MC matching | ||||||||
genParticleMatch = "lowPtElectronMatch", | ||||||||
|
||||||||
# Electron ID | ||||||||
addElectronID = True, | ||||||||
electronIDSources = dict( | ||||||||
unbiased = cms.InputTag("rekeyLowPtGsfElectronSeedValueMaps:unbiased"), | ||||||||
ptbiased = cms.InputTag("rekeyLowPtGsfElectronSeedValueMaps:ptbiased"), | ||||||||
ID = cms.InputTag("lowPtGsfElectronID"), | ||||||||
), | ||||||||
|
||||||||
# Embedding of RECO/AOD items | ||||||||
|
||||||||
# Embedding of RECO/AOD items | ||||||||
embedTrack = True, | ||||||||
embedGsfElectronCore = True, | ||||||||
embedGsfTrack = True, | ||||||||
embedSuperCluster = True, | ||||||||
embedSeedCluster = True, | ||||||||
embedBasicClusters = True, | ||||||||
embedPreshowerClusters = False, | ||||||||
embedRecHits = False, | ||||||||
embedPflowSuperCluster = False, | ||||||||
embedPflowBasicClusters = False, | ||||||||
embedPflowPreshowerClusters = False, | ||||||||
embedPFCandidate = False, | ||||||||
|
||||||||
# Miscellaneous flags | ||||||||
addMVAVariables = False, | ||||||||
embedHighLevelSelection = False, | ||||||||
isoDeposits = cms.PSet(), | ||||||||
isolationValues = cms.PSet(), | ||||||||
isolationValuesNoPFId = cms.PSet(), | ||||||||
|
||||||||
) | ||||||||
|
||||||||
makePatLowPtElectronsTask = cms.Task( | ||||||||
lowPtElectronMatch, | ||||||||
patLowPtElectrons | ||||||||
patLowPtElectrons, | ||||||||
) | ||||||||
|
||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
this would enable re-running of lowPtGsfElectronID only for specific inputs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what you mean by this comment. I want to rerun both the ID and the rekey modules for run2_miniAOD_UL. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the new version seems OK, the comment was made before rekeying was in the config |
||||||||
makePatLowPtElectrons = cms.Sequence(makePatLowPtElectronsTask) | ||||||||
|
@@ -61,3 +68,12 @@ | |||||||
electronSource = "gedGsfElectrons", | ||||||||
genParticleMatch = "electronMatch" | ||||||||
) | ||||||||
|
||||||||
# Schedule rekeying of seed BDT ValueMaps by reco::GsfElectron for run2_miniAOD_UL | ||||||||
from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL | ||||||||
from RecoEgamma.EgammaElectronProducers.lowPtGsfElectronSeedValueMaps_cff import rekeyLowPtGsfElectronSeedValueMaps | ||||||||
from RecoEgamma.EgammaElectronProducers.lowPtGsfElectronID_cfi import lowPtGsfElectronID | ||||||||
_makePatLowPtElectronsTask = makePatLowPtElectronsTask.copy() | ||||||||
_makePatLowPtElectronsTask.add(rekeyLowPtGsfElectronSeedValueMaps) | ||||||||
_makePatLowPtElectronsTask.add(lowPtGsfElectronID) | ||||||||
run2_miniAOD_UL.toReplaceWith(makePatLowPtElectronsTask,_makePatLowPtElectronsTask) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these do not exist in the origin, is there really need to add empty sets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are set in the code, here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the point is to keep some consistency at the python layer.
So, if this is a clone from
patElectrons
, keep things defined consistently.I'd still prefer to only add/modify elements that are different from
patElectrons
, but if more things need to be added for cosmetic reasons, please add them in both files.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I do edmConfigDump, I see this for my
patLowPtElectron
:which means these PSets are being set outside of the cfi file (either in c++ or in other python files).
This is not my desired configuration, hence my explicit override (in python).
Acceptable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it is clear this way.
Thanks.