Skip to content

Commit

Permalink
Moving the LepEff to compiled class
Browse files Browse the repository at this point in the history
Follow by PR 110: cms-nanoAOD#110
  • Loading branch information
Zhenbin Wu committed Mar 16, 2019
1 parent c5bce0d commit 1d6eea4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,34 +1,4 @@
#ifndef PhysicsTools_NanoAODTools_LeptonEfficiencyCorrector_h
#define PhysicsTools_NanoAODTools_LeptonEfficiencyCorrector_h

#include <iostream>
#include <string>
#include <vector>
#include <TH2.h>
#include <TFile.h>

#include "WeightCalculatorFromHistogram.cc"

class LeptonEfficiencyCorrector {
public:

LeptonEfficiencyCorrector() {effmaps_.clear();}
LeptonEfficiencyCorrector(std::vector<std::string> files, std::vector<std::string> histos);
~LeptonEfficiencyCorrector() {}

void setLeptons(int nLep, int *lepPdgId, float *lepPt, float *lepEta);

float getSF(int pdgid, float pt, float eta);
float getSFErr(int pdgid, float pt, float eta);
const std::vector<float> & run();

private:
std::vector<TH2F*> effmaps_;
std::vector<float> ret_;
int nLep_;
float *Lep_eta_, *Lep_pt_;
int *Lep_pdgId_;
};
#include "PhysicsTools/NanoAODTools/interface/LeptonEfficiencyCorrector.h"

LeptonEfficiencyCorrector:: LeptonEfficiencyCorrector(std::vector<std::string> files, std::vector<std::string> histos) {
effmaps_.clear();
Expand Down Expand Up @@ -90,4 +60,3 @@ const std::vector<float> & LeptonEfficiencyCorrector::run() {
return ret_;
}

#endif
2 changes: 2 additions & 0 deletions src/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
#include "PhysicsTools/NanoAODTools/interface/PyJetParametersWrapper.h"
#include "PhysicsTools/NanoAODTools/interface/WeightCalculatorFromHistogram.h"
#include "PhysicsTools/NanoAODTools/interface/ReduceMantissa.h"
#include "PhysicsTools/NanoAODTools/interface/LeptonEfficiencyCorrector.h"

PyJetResolutionWrapper jetRes;
PyJetResolutionScaleFactorWrapper jetResScaleFactor;
PyJetParametersWrapper jetParams;
WeightCalculatorFromHistogram wcalc;
ReduceMantissaToNbitsRounding red(12);
LeptonEfficiencyCorrector lepSF;
1 change: 1 addition & 0 deletions src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
<class name="PyJetParametersWrapper"/>
<class name="WeightCalculatorFromHistogram"/>
<class name="ReduceMantissaToNbitsRounding"/>
<class name="LeptonEfficiencyCorrector"/>
</selection>
</lcgdict>

0 comments on commit 1d6eea4

Please sign in to comment.