Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sani committed Apr 8, 2013
1 parent ecea0ce commit a28d35f
Show file tree
Hide file tree
Showing 63 changed files with 226,774 additions and 0 deletions.
18,071 changes: 18,071 additions & 0 deletions data/Electrons_BDTG_NonTrigV0_Cat1.weights.xml

Large diffs are not rendered by default.

18,071 changes: 18,071 additions & 0 deletions data/Electrons_BDTG_NonTrigV0_Cat2.weights.xml

Large diffs are not rendered by default.

18,072 changes: 18,072 additions & 0 deletions data/Electrons_BDTG_NonTrigV0_Cat3.weights.xml

Large diffs are not rendered by default.

18,071 changes: 18,071 additions & 0 deletions data/Electrons_BDTG_NonTrigV0_Cat4.weights.xml

Large diffs are not rendered by default.

18,071 changes: 18,071 additions & 0 deletions data/Electrons_BDTG_NonTrigV0_Cat5.weights.xml

Large diffs are not rendered by default.

18,072 changes: 18,072 additions & 0 deletions data/Electrons_BDTG_NonTrigV0_Cat6.weights.xml

Large diffs are not rendered by default.

18,073 changes: 18,073 additions & 0 deletions data/Electrons_BDTG_TrigV0_Cat1.weights.xml

Large diffs are not rendered by default.

18,073 changes: 18,073 additions & 0 deletions data/Electrons_BDTG_TrigV0_Cat2.weights.xml

Large diffs are not rendered by default.

18,074 changes: 18,074 additions & 0 deletions data/Electrons_BDTG_TrigV0_Cat3.weights.xml

Large diffs are not rendered by default.

18,073 changes: 18,073 additions & 0 deletions data/Electrons_BDTG_TrigV0_Cat4.weights.xml

Large diffs are not rendered by default.

18,073 changes: 18,073 additions & 0 deletions data/Electrons_BDTG_TrigV0_Cat5.weights.xml

Large diffs are not rendered by default.

18,074 changes: 18,074 additions & 0 deletions data/Electrons_BDTG_TrigV0_Cat6.weights.xml

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions data/download.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
http://cern.ch/sani/Electrons_BDTG_NonTrigV0_Cat1.weights.xml
http://cern.ch/sani/Electrons_BDTG_NonTrigV0_Cat2.weights.xml
http://cern.ch/sani/Electrons_BDTG_NonTrigV0_Cat3.weights.xml
http://cern.ch/sani/Electrons_BDTG_NonTrigV0_Cat4.weights.xml
http://cern.ch/sani/Electrons_BDTG_NonTrigV0_Cat5.weights.xml
http://cern.ch/sani/Electrons_BDTG_NonTrigV0_Cat6.weights.xml
http://cern.ch/sani/Electrons_BDTG_TrigV0_Cat1.weights.xml
http://cern.ch/sani/Electrons_BDTG_TrigV0_Cat2.weights.xml
http://cern.ch/sani/Electrons_BDTG_TrigV0_Cat3.weights.xml
http://cern.ch/sani/Electrons_BDTG_TrigV0_Cat4.weights.xml
http://cern.ch/sani/Electrons_BDTG_TrigV0_Cat5.weights.xml
http://cern.ch/sani/Electrons_BDTG_TrigV0_Cat6.weights.xml
http://cern.ch/sani/eleEnergyRegWeights_V1.root
http://cern.ch/sani/eleEnergyRegWeights_V2.root
Binary file added data/eleEnergyRegWeights_V1.root
Binary file not shown.
Binary file added data/eleEnergyRegWeights_V2.root
Binary file not shown.
152 changes: 152 additions & 0 deletions interface/EGammaCutBasedEleId.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@

//
// to use this code outside of CMSSW
// set this definition
//

//#define STANDALONEID
#ifndef STANDALONEID
#include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
#include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
#include "DataFormats/EgammaCandidates/interface/Conversion.h"
#include "DataFormats/Common/interface/ValueMap.h"
#include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#endif

#include <vector>

namespace EgammaCutBasedEleId {

//
// typedefs
//

typedef std::vector< edm::Handle< edm::ValueMap<reco::IsoDeposit> > > IsoDepositMaps;
typedef std::vector< edm::Handle< edm::ValueMap<double> > > IsoDepositVals;

//
// defined ID working points
//

enum WorkingPoint {
VETO,
LOOSE,
MEDIUM,
TIGHT
};

enum TriggerWorkingPoint {
TRIGGERTIGHT,
TRIGGERWP70
};

//
// cuts used within working points
//

enum CutType {
DETAIN = (1<<0),
DPHIIN = (1<<1),
SIGMAIETAIETA = (1<<2),
HOE = (1<<3),
OOEMOOP = (1<<4),
D0VTX = (1<<5),
DZVTX = (1<<6),
ISO = (1<<7),
VTXFIT = (1<<8),
MHITS = (1<<9)
};

//
// all possible cuts pass
//

static const unsigned int PassAll = DETAIN | DPHIIN | SIGMAIETAIETA | HOE | OOEMOOP | D0VTX | DZVTX | ISO | VTXFIT | MHITS;

//
// CMSSW interface
//

#ifndef STANDALONEID

bool PassWP(const WorkingPoint workingPoint,
const reco::GsfElectronRef &ele,
const edm::Handle<reco::ConversionCollection> &conversions,
const reco::BeamSpot &beamspot,
const edm::Handle<reco::VertexCollection> &vtxs,
const double &iso_ch,
const double &iso_em,
const double &iso_nh,
const double &rho);


bool PassWP(const WorkingPoint workingPoint,
const reco::GsfElectron &ele,
const edm::Handle<reco::ConversionCollection> &conversions,
const reco::BeamSpot &beamspot,
const edm::Handle<reco::VertexCollection> &vtxs,
const double &iso_ch,
const double &iso_em,
const double &iso_nh,
const double &rho);


bool PassTriggerCuts(const TriggerWorkingPoint triggerWorkingPoint, const reco::GsfElectronRef &ele);

bool PassTriggerCuts(const TriggerWorkingPoint triggerWorkingPoint, const reco::GsfElectron &ele);

bool PassEoverPCuts(const reco::GsfElectronRef &ele);

bool PassEoverPCuts(const reco::GsfElectron &ele);

unsigned int TestWP(const WorkingPoint workingPoint,
const reco::GsfElectronRef &ele,
const edm::Handle<reco::ConversionCollection> &conversions,
const reco::BeamSpot &beamspot,
const edm::Handle<reco::VertexCollection> &vtxs,
const double &iso_ch,
const double &iso_em,
const double &iso_nh,
const double &rho);

unsigned int TestWP(const WorkingPoint workingPoint,
const reco::GsfElectron &ele,
const edm::Handle<reco::ConversionCollection> &conversions,
const reco::BeamSpot &beamspot,
const edm::Handle<reco::VertexCollection> &vtxs,
const double &iso_ch,
const double &iso_em,
const double &iso_nh,
const double &rho);

#endif

//
// implementation of working points
// used by CMSSW interface, does not
// itself depend on CMSSW code
//

bool PassWP(WorkingPoint workingPoint, const bool isEB, const float pt, const float eta,
const float dEtaIn, const float dPhiIn, const float sigmaIEtaIEta, const float hoe,
const float ooemoop, const float d0vtx, const float dzvtx, const float iso_ch, const float iso_em, const float iso_nh,
const bool vtxFitConversion, const unsigned int mHits, const double rho);

bool PassTriggerCuts(const TriggerWorkingPoint triggerWorkingPoint, const bool isEB, const float pt,
const float dEtaIn, const float dPhiIn, const float sigmaIEtaIEta, const float hoe,
const float trackIso, const float ecalIso, const float hcalIso);

bool PassEoverPCuts(const float eta, const float eopin, const float fbrem);

unsigned int TestWP(WorkingPoint workingPoint, const bool isEB, const float pt, const float eta,
const float dEtaIn, const float dPhiIn, const float sigmaIEtaIEta, const float hoe,
const float ooemoop, const float d0vtx, const float dzvtx, const float iso_ch, const float iso_em, const float iso_nh,
const bool vtxFitConversion, const unsigned int mHits, const double rho);

// print the bit mask
void PrintDebug(unsigned int mask);

}

Loading

0 comments on commit a28d35f

Please sign in to comment.