-
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
VID Feature Requests for 75X #9659
Merged
Merged
Changes from all commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
267fa00
first version of VID validation tool
lgray 6a4d5e0
give per-cut hash information then hash all of that into the total
lgray 857b45e
boiler plate for expression evaluator cuts
lgray 5ac77f3
working on ExpressionEvaluator cuts
lgray 99e5879
implement expression evaluator cut in VID
lgray bd151ea
turn off debug output of ExpressionEvaluator and fix naming bug in Ve…
lgray cac812d
add value() accessor to VID cuts
lgray 366d841
add VIDCutFlowResult result digest and bitmap manipulator
lgray c49a2ca
add name to each CutFlowResult
lgray 8acce90
correct logic in cut flow decision
lgray cc7e6cb
make python wrapper for vid::CutFlowResult
lgray c14d0ab
add cutFlowResult to VersionedIdProducer
lgray 5f64981
add value to muon pog cuts, change muon pog cuts to switch
lgray d30a34c
change to FWLiteEnabler and updates to python classes
lgray ce3d570
use std::map in vid::CutFlowResult
lgray d0b2665
stash some further developments for cut digest
lgray 303b351
Update effAreaPhotons_cone03_pfPhotons.txt
skyriacoCMS 1e0146b
Electron MVA implementation (work in progress, doesn't build in this …
ikrav 347e59f
A few updates to MVA code, now it builds
ikrav fa8b736
A few changes to the MVA class
ikrav d119899
MVA weights for non-triggering PHYS14 electron MVA
ikrav 3e9d92a
Further updates of this MVA implementation
ikrav d2d099e
Improvement to the MVA estimator classes
ikrav 000e91e
Added MVA cut, producer, and one full configuration to VID
ikrav 910f348
Followed a few tips from Lindsey: fixed a memory leak, and the cause …
ikrav cb6f2a1
Partial modifications of the new MVA classes toward the factory/plugi…
ikrav 7c6438a
Next steps in MVA implementation for electron ID. This version does n…
ikrav 46d54da
Fixed compiler errors
ikrav 7fa3779
Changed MVA name field to match class name. Added consistent configur…
ikrav c8f1293
More changes to MVA implementation
ikrav b5d75c4
More changes to MVA implementation
ikrav 625b452
Added value() function to conform the new way of cut implementation.
ikrav d23b02b
Moving to templated MVA producer. This commit does not compile
ikrav 8e5fd72
Another step in the right direction
ikrav 95e9c7c
Another step
ikrav c40b220
A few more fixes, and now the templated MVA compiles
ikrav c0c8711
Adjusted cut values for MVA cuts for WP80 and WP90 to give roughly th…
ikrav 803d692
Working on the issue if CTF track reference, this is not final.
ikrav 2ceaf25
The fix for the CTF track reference issue
ikrav 07389a6
First steps toward photon MVA esimator and producer implementation.
ikrav c68ec02
More development of the VID MVA. This version compiles
ikrav a1e37f5
A fix
ikrav c076fd6
Minor adjustments
ikrav ef08eb9
Added the new MVA for photons, V0 trained on Spring15
ikrav 56d1fd7
baseline of ObjectModifier plugin system, towards VID-by-value
lgray 1b12edd
add guts to ObjectModifier
lgray 3808870
use regular edm::Event and add edm::EventSetup, ObjectModifiers will …
lgray e4cd06e
modified object producers for MiniAOD -> MiniAOD reprocessing or poss…
lgray cb136cd
configuring for HEEP V6.0
Sam-Harper 8fed351
move MicroEventContent to its own file
lgray bcd4dde
add reMiniAOD config and add empty modification list to all places wh…
lgray 9d74367
more descriptive file name
lgray 58b007a
add appropriate import statements to event content
lgray 27f0537
enable MINIAODfromMINIAOD in cmsDriver.py
lgray a66e5b3
add skeleton of EG shower shape modifier
lgray fc4b57d
working example of object editors for EGM
lgray 0bab17b
VID by value working, still testing
lgray b0c2be0
validate no vmap to vmap
lgray 13ed787
update all valuemap based cuts to check for valuemap or ask for embed…
lgray 04f8fca
documentation, bugfix, and address code review for vid::CutFlowResult
lgray 5bed138
move ModifyObjectValueBase to CommonTools/CandAlgos
lgray 7eb8895
Float_t -> float for electron mva
lgray 9afd93b
fix logic in checking for products in photon mva producers
lgray baa9535
Point PatAlgos/plugins BuildFile at the right place...
lgray eb4b3a2
add pat::UserData hooks to VersionedIdProducer
lgray 4851448
fix bug in MVA cut
lgray e30b2fc
add masking information to python wrapper
lgray 343f4a9
set pog approved IDs
lgray 74ebe1d
update MiniAOD to latest IDs
lgray ed92daa
add self-checking to python classes
lgray cf40f4c
fix naming of modified object producers + add in hooks object mods in…
lgray 7651ef6
fix up issues with getting products in modifiers
lgray af17071
move object mods to be directly in miniaod
lgray 5c6b902
fix indexing
lgray 7e1ddb8
remove local copies of data files
lgray bbd6535
fix patch area identification
VinInn 6f6d932
fix a bug in using valuemaps in miniaodfromminiaod
lgray 156b815
point pyfwlite script at relval
lgray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<use name="SimGeneral/HepPDTRecord"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="DataFormats/PatCandidates"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
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,61 @@ | ||
#ifndef __CommonTools_CandAlgos_ModifyObjectValueBase_h__ | ||
#define __CommonTools_CandAlgos_ModifyObjectValueBase_h__ | ||
|
||
#include "DataFormats/PatCandidates/interface/Electron.h" | ||
#include "DataFormats/PatCandidates/interface/Photon.h" | ||
#include "DataFormats/PatCandidates/interface/Muon.h" | ||
#include "DataFormats/PatCandidates/interface/Tau.h" | ||
#include "DataFormats/PatCandidates/interface/Jet.h" | ||
|
||
#include "FWCore/Utilities/interface/Exception.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/Framework/interface/ConsumesCollector.h" | ||
|
||
#include <string> | ||
|
||
class ModifyObjectValueBase { | ||
public: | ||
ModifyObjectValueBase(const edm::ParameterSet& conf) : | ||
name_( conf.getParameter<std::string>("modifierName") ) {} | ||
|
||
virtual ~ModifyObjectValueBase() {} | ||
|
||
virtual void setEvent(const edm::Event&) {} | ||
virtual void setEventContent(const edm::EventSetup&) {} | ||
virtual void setConsumes(edm::ConsumesCollector&) {} | ||
|
||
virtual void modifyObject(pat::Electron&) const { | ||
throw cms::Exception("InvalidConfiguration") | ||
<< name_ << " is not configured to handle electrons!"; | ||
} | ||
virtual void modifyObject(pat::Photon&) const { | ||
throw cms::Exception("InvalidConfiguration") | ||
<< name_ << " is not configured to handle photons!"; | ||
} | ||
virtual void modifyObject(pat::Muon&) const { | ||
throw cms::Exception("InvalidConfiguration") | ||
<< name_ << " is not configured to handle muons!"; | ||
} | ||
virtual void modifyObject(pat::Tau&) const { | ||
throw cms::Exception("InvalidConfiguration") | ||
<< name_ << " is not configured to handle taus!"; | ||
} | ||
virtual void modifyObject(pat::Jet&) const { | ||
throw cms::Exception("InvalidConfiguration") | ||
<< name_ << " is not configured to handle jets!"; | ||
} | ||
|
||
const std::string& name() const { return name_; } | ||
|
||
private: | ||
const std::string name_; | ||
}; | ||
|
||
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__) | ||
#include "FWCore/PluginManager/interface/PluginFactory.h" | ||
typedef edmplugin::PluginFactory< ModifyObjectValueBase* (const edm::ParameterSet&) > ModifyObjectValueFactory; | ||
#endif | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "CommonTools/CandAlgos/interface/ModifyObjectValueBase.h" | ||
|
||
EDM_REGISTER_PLUGINFACTORY(ModifyObjectValueFactory,"ModifyObjectValueFactory"); | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
EventInterpretation = { | ||
'top' : 'CommonTools.ParticleFlow.EITopPAG_cff' | ||
'top' : 'CommonTools.ParticleFlow.EITopPAG_cff', | ||
'MiniAODfromMiniAOD' : 'PhysicsTools.PatAlgos.slimming.MiniAODfromMiniAOD_cff' | ||
} |
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,112 @@ | ||
#ifndef __DataFormats_PatCandidates_VIDResult_H__ | ||
#define __DataFormats_PatCandidates_VIDResult_H__ | ||
|
||
#include <map> | ||
#include <vector> | ||
#include <string> | ||
|
||
/********* | ||
* | ||
* Class: vid::CutFlowResult | ||
* Author: L. Gray (FNAL) | ||
* | ||
* A synthesis of the output of a VID selector into an easily | ||
* manipulated class, such that cuts can be masked and sidebands | ||
* created without major intervention on the part of the person | ||
* doing analysis. | ||
* | ||
* The class is self-describing and the original cut-names, the | ||
* values cut upon, the result of each cut used, and final cutflow | ||
* decision can be accessed with this class. Using this information | ||
* the cut flow can be masked interactively by the user, allowing | ||
* for a large degree of flexibility at the analysis level. | ||
* | ||
*********/ | ||
|
||
namespace vid { | ||
class CutFlowResult { | ||
template<class T> friend class VersionedSelector; | ||
public: | ||
|
||
CutFlowResult() : bitmap_(0) {} | ||
CutFlowResult(const std::string& name, | ||
const std::string& hash, | ||
const std::map<std::string,unsigned>& n2idx, | ||
const std::vector<double>& values, | ||
unsigned bitmap, | ||
unsigned mask = 0); | ||
|
||
// get the original name of this cutflow | ||
const std::string& cutFlowName() const { return name_; } | ||
// get the md5 hash for this cutflow | ||
const std::string& cutFlowHash() const { return hash_; } | ||
// did this cutflow (in its current state!) pass? | ||
bool cutFlowPassed() const { | ||
const unsigned all_pass = (1 << indices_.size()) - 1; | ||
return (all_pass&bitmap_) == all_pass; | ||
} | ||
// how many cuts in this cutflow? | ||
size_t cutFlowSize() const { return indices_.size(); } | ||
|
||
// get the name of a cut in the cutflow | ||
// indexed by order it was executed | ||
const std::string& getNameAtIndex(const unsigned idx) const; | ||
|
||
// get the individual cut result (pass/fail) either by name or by index | ||
bool getCutResultByIndex(const unsigned idx) const; | ||
bool getCutResultByName(const std::string& name) const; | ||
|
||
// return true if the cut as index/name is masked out | ||
bool isCutMasked(const unsigned idx) const; | ||
bool isCutMasked(const std::string& name) const; | ||
|
||
// get the value of variable that was cut on, either by name or by index | ||
double getValueCutUpon(const unsigned idx) const; | ||
double getValueCutUpon(const std::string& name) const; | ||
|
||
// create a new copy of this cutflow masking out the listed cuts | ||
// can be done either by name or by index | ||
CutFlowResult getCutFlowResultMasking(const unsigned idx) const; | ||
CutFlowResult getCutFlowResultMasking(const std::string& name) const; | ||
|
||
CutFlowResult getCutFlowResultMasking(const std::vector<unsigned>& idxs) const; | ||
CutFlowResult getCutFlowResultMasking(const std::vector<std::string>& names) const; | ||
|
||
private: | ||
std::string name_, hash_; | ||
unsigned bitmap_, mask_; | ||
std::vector<double> values_; | ||
std::vector<std::string> names_; | ||
std::vector<unsigned> indices_; | ||
|
||
CutFlowResult(const std::string& name, | ||
const std::string& hash, | ||
const std::vector<std::string>& names, | ||
const std::vector<unsigned>& indices, | ||
const std::vector<double>& values, | ||
unsigned bitmap, | ||
unsigned mask) : | ||
name_(name), | ||
hash_(hash), | ||
bitmap_(bitmap), | ||
mask_(mask), | ||
values_(values), | ||
names_(names), | ||
indices_(indices) {} | ||
|
||
|
||
bool getMaskBit(const unsigned idx) const { | ||
return (bool)(0x1&(mask_>>idx)); | ||
} | ||
|
||
bool getCutBit(const unsigned idx) const { | ||
return (bool)(0x1&(bitmap_>>idx)); | ||
} | ||
|
||
bool getCutValue(const unsigned idx) const { | ||
return values_[idx]; | ||
} | ||
}; | ||
} | ||
|
||
#endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I suggested this as a hack.
Full implementation should deal with this as a separate step or a separate option in the configBuilder.
(plan to have it in 76X)
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.
For now, for people to use it, is this fine?
This will need to go into 74X as well, so we should decide what we want quickly.
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.
it's OK for me in a short term, as long as this stays for some private recipes.
If MiniAODfromMiniAOD turns into an official workflow (with central production implied), then the steps better be defined appropriately.