Skip to content

Commit

Permalink
Sync with 10_4_X
Browse files Browse the repository at this point in the history
  • Loading branch information
guitargeek committed Dec 5, 2018
1 parent 3cef419 commit 89fe032
Show file tree
Hide file tree
Showing 87 changed files with 1,444 additions and 2,882 deletions.
4 changes: 1 addition & 3 deletions RecoEgamma/EgammaTools/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
<use name="RecoLocalCalo/HGCalRecAlgos"/>
<use name="clhep"/>
<use name="root"/>
<use name="PhysicsTools/MVAComputer"/>
<use name="PhysicsTools/MVATrainer"/>
<use name="roottmva"/>
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/EgammaObjects"/>
<use name="RecoEcal/EgammaCoreTools"/>
<use name="CondCore/DBOutputService"/>
<use name="DataFormats/ParticleFlowReco"/>
<use name="CommonTools/Utils"/>
<use name="roottmva"/>
<export>
<lib name="1"/>
</export>
50 changes: 36 additions & 14 deletions RecoEgamma/EgammaTools/interface/AnyMVAEstimatorRun2Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,68 @@ class AnyMVAEstimatorRun2Base {

public:
// Constructor, destructor
AnyMVAEstimatorRun2Base(const edm::ParameterSet& conf) : conf_(conf) {}
AnyMVAEstimatorRun2Base(const edm::ParameterSet& conf)
: tag_ (conf.getParameter<std::string>("mvaTag"))
, nCategories_ (conf.getParameter<int>("nCategories"))
, debug_ (conf.getUntrackedParameter<bool>("debug", false))
{}

AnyMVAEstimatorRun2Base(const::std::string& mvaName,
const::std::string& mvaTag,
int nCategories,
bool debug)
: name_ (mvaName)
, tag_ (mvaTag)
, nCategories_ (nCategories)
, debug_ (debug)
{}
virtual ~AnyMVAEstimatorRun2Base(){};

// Functions that must be provided in derived classes
// These function should work on electrons or photons
// of the reco or pat type

virtual float mvaValue( const edm::Ptr<reco::Candidate>& particle, const edm::EventBase&) const = 0;
virtual float mvaValue( const reco::Candidate* candidate, std::vector<float> const& auxVariables, int &iCategory) const = 0;
float mvaValue( const reco::Candidate* candidate, std::vector<float> const& auxVariables) const {
int iCategory;
return mvaValue(candidate, auxVariables, iCategory);
};

// A specific implementation of MVA is expected to have one or more categories
// defined with respect to eta, pt, etc.
// This function determines the category for a given particle.
virtual int findCategory( const edm::Ptr<reco::Candidate>& particle) const = 0;
virtual int getNCategories() const = 0;
// The name is a unique name associated with a particular MVA implementation,
// it is found as a const data member in a derived class.
virtual const std::string& getName() const = 0;
// This function determines the category for a given candidate.
virtual int findCategory( const reco::Candidate* candidate) const = 0;
int getNCategories() const { return nCategories_; }
const std::string& getName() const { return name_; }
// An extra variable string set during construction that can be used
// to distinguish different instances of the estimator configured with
// different weight files. The tag can be used to construct names of ValueMaps, etc.
virtual const std::string& getTag() const = 0;
const std::string& getTag() const { return tag_; }

bool isDebug() const { return debug_; }
//
// Extra event content - if needed.
//
// Some MVA implementation may require direct access to event content.
// Implement these methods only if needed in the derived classes (use "override"
// for certainty).

// This method needs to be used only once after this MVA estimator is constructed
virtual void setConsumes(edm::ConsumesCollector &&cc) const {};

private:

//
// Data members
//
// Configuration
const edm::ParameterSet conf_;
const std::string name_;

// MVA tag. This is an additional string variable to distinguish
// instances of the estimator of this class configured with different
// weight files.
const std::string tag_;

// The number of categories and number of variables per category
const int nCategories_;

const bool debug_;
};

// define the factory for this base class
Expand Down
26 changes: 13 additions & 13 deletions RecoEgamma/EgammaTools/interface/ConversionTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,30 @@ class ConversionTools


static bool hasMatchedConversion(const reco::GsfElectron &ele,
const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);
const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);

static bool hasMatchedConversion(const reco::TrackRef &trk,
const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);
const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);

static bool hasMatchedConversion(const reco::SuperCluster &sc,
const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, float dRMax = 0.1, float dEtaMax = 999., float dPhiMax = 999., float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);
const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, float dRMax = 0.1, float dEtaMax = 999., float dPhiMax = 999., float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);


static reco::ConversionRef matchedConversion(const reco::GsfElectron &ele,
const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);
static reco::Conversion const* matchedConversion(const reco::GsfElectron &ele,
const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);

static reco::ConversionRef matchedConversion(const reco::TrackRef &trk,
const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);
static reco::Conversion const* matchedConversion(const reco::TrackRef &trk,
const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);

static reco::ConversionRef matchedConversion(const reco::SuperCluster &sc,
const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, float dRMax = 0.1, float dEtaMax = 999., float dPhiMax = 999., float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);
static reco::Conversion const* matchedConversion(const reco::SuperCluster &sc,
const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, float dRMax = 0.1, float dEtaMax = 999., float dPhiMax = 999., float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);

static bool hasMatchedPromptElectron(const reco::SuperClusterRef &sc, const edm::Handle<reco::GsfElectronCollection> &eleCol,
const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);
static bool hasMatchedPromptElectron(const reco::SuperClusterRef &sc, const reco::GsfElectronCollection &eleCol,
const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);


static reco::GsfElectronRef matchedPromptElectron(const reco::SuperClusterRef &sc, const edm::Handle<reco::GsfElectronCollection> &eleCol,
const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);
static reco::GsfElectron const* matchedPromptElectron(const reco::SuperClusterRef &sc, const reco::GsfElectronCollection &eleCol,
const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);

};
#endif
1 change: 0 additions & 1 deletion RecoEgamma/EgammaTools/interface/EffectiveAreas.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class EffectiveAreas {
public:
// Constructor, destructor
EffectiveAreas(const std::string& filename);
~EffectiveAreas();

// Accessors
const float getEffectiveArea(float eta) const;
Expand Down
39 changes: 0 additions & 39 deletions RecoEgamma/EgammaTools/interface/GBRForestTools.h

This file was deleted.

30 changes: 0 additions & 30 deletions RecoEgamma/EgammaTools/interface/MVAObjectCache.h

This file was deleted.

0 comments on commit 89fe032

Please sign in to comment.