Skip to content

Commit

Permalink
Merge pull request #84 from robervalwalsh/develop
Browse files Browse the repository at this point in the history
improvements
  • Loading branch information
robervalwalsh authored Nov 1, 2019
2 parents 9d688d6 + 0af7fbf commit 0e3b269
Show file tree
Hide file tree
Showing 4 changed files with 234 additions and 161 deletions.
50 changes: 34 additions & 16 deletions interface/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ namespace analysis {
std::string jerPtRes() const;
std::string jerSF() const;
std::string l1tJetsCollection() const;

std::string btagAlgorithm() const;
std::string btagScaleFactors() const;
std::vector<std::string> jetsBtagWP() const;
std::vector<float> jetsBtagProbB() const;
std::vector<float> jetsBtagProbBB() const;
Expand All @@ -123,8 +126,22 @@ namespace analysis {
bool doDijet() const;
bool doDijetFlavour() const;
int nBJetsMin() const;

std::vector<float> jetsQGmin() const;
std::vector<float> jetsQGmax() const;



// jet-jet
float jetsDetaMax() const;
float jetsDetaMin() const;
float jetsDphiMax() const;
float jetsDphiMin() const;
float jetsDrMax() const;
float jetsDrMin() const;
float jetsPtImbalanceMax() const;
float jetsPtImbalanceMin() const;

// muons
std::string muonsCollection() const;
int nMuonsMin() const;
Expand Down Expand Up @@ -195,7 +212,6 @@ namespace analysis {


// btag SF csv file
std::string btagsf_;
std::vector<float> jetsbtagmin_;

// additional cuts of unidentified objects or for extra selections
Expand All @@ -205,12 +221,6 @@ namespace analysis {
std::vector<float> ptmax_;
std::vector<float> etamax_;

float jetsdrmin_;
float jetsdrmax_;
float jetsdetamax_;
float jetsdetamin_;
float jetsdphimin_;
float jetsdphimax_;


float drmin_;
Expand All @@ -220,15 +230,6 @@ namespace analysis {
float dphimin_;
float dphimax_;

float ptimbalmax_;
float ptimbalmin_;

std::vector<float> qgmin_;
std::vector<float> qgmax_;

std::string btagalgo_;


std::string hltPath_;
std::string l1Seed_;

Expand Down Expand Up @@ -293,12 +294,29 @@ namespace analysis {
std::string jetsid_;
std::string jetspuid_;

std::vector<float> qgmin_;
std::vector<float> qgmax_;

float jetsdetamax_;
float jetsdetamin_;
float jetsdphimin_;
float jetsdphimax_;
float jetsdrmin_;
float jetsdrmax_;
float jetsptimbalmax_;
float jetsptimbalmin_;

// JER resolution and scale factors from txt file
std::string jerptres_;
std::string jersf_;
//
std::string l1tjetsCol_;
//
//
std::string btagalgo_;
std::string btagsf_;


std::vector<std::string> jetsbtagwp_;
std::string nonbtagwp_;
int nonbtagjet_;
Expand Down
41 changes: 29 additions & 12 deletions interface/JetAnalyser.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,41 @@ namespace analysis {
private:

public:
/// vector of pointers of the selectedJets
std::vector< std::shared_ptr<Jet> > selectedJets();
/// vector of pointers of all jets from the "Jets" collection
std::vector< std::shared_ptr<Jet> > jets();
float btag(const Jet & , const std::string & );

/// Returns the btag value of the jet for a given btag algorithm
float btag(const Jet & jet, const std::string & algo);

// Sets
void jets(const std::string &);
/// Creates the "Jets" collection
void jets(const std::string & col);

// Actions
virtual bool analysisWithJets();
virtual bool selectionJet(const int &);
virtual bool selectionJetDeta(const int &, const int &, const float &);
virtual bool selectionJetDeta(const int &, const int &);
virtual bool selectionJetDphi(const int &, const int &, const float &);
virtual bool selectionJetDphi(const int &, const int &);
virtual bool selectionJetDr(const int &, const int &, const float &);
virtual bool selectionJetDr(const int &, const int &);
virtual bool selectionJetPtImbalance(const int &, const int &, const float &);
virtual bool selectionJetPtImbalance(const int &, const int &);
/// Given the ranking 'r' of a jet, it returns whether the jet passes the pt_min and |eta_max|, optionally pt_max, where the values of the thresholds pt_min and |eta_max|, pt_max are passed by configuration file
virtual bool selectionJet(const int & r);
/// Given the ranking 'r' of a jet, it returns whether the jet passes the pt_min and |eta_max|, optionally pt_max, where the values of the thresholds pt_min and |eta_max|, pt_max (opt) are passed as arguments
virtual bool selectionJet(const int & r, const float & pt_min, const float &eta_max, const float &pt_max=-1. );
/// Given the rankings r1 and r2 of two jets, it returns whether the jets passes the delta_eta selection; the threshold delta is passed by the configuration file
virtual bool selectionJetDeta(const int & r1, const int &r2);
/// Given the rankings r1 and r2 of two jets, it returns whether the jets passes the delta_eta selection; the threshold delta is passed as an argument (if delta <= 0, |delta| = delta_min; else |delta| = delta_max )
virtual bool selectionJetDeta(const int & r1, const int & r2, const float & delta);
/// Given the rankings r1 and r2 of two jets, it returns whether the jets passes the delta_phi selection; the threshold delta is passed by the configuration file
virtual bool selectionJetDphi(const int & r1, const int & r2);
/// Given the rankings r1 and r2 of two jets, it returns whether the jets passes the delta_phi selection; the threshold delta is passed as an argument (if delta <= 0, |delta| = delta_min; else |delta| = delta_max )
virtual bool selectionJetDphi(const int & r1, const int & r2, const float & delta);
/// Given the rankings r1 and r2 of two jets, it returns whether the jets passes the delta_R selection; the threshold delta is passed by the configuration file
virtual bool selectionJetDr(const int & r1, const int & r2);
/// Given the rankings r1 and r2 of two jets, it returns whether the jets passes the delta_R selection; the threshold delta is passed as an argument (if delta <= 0, |delta| = delta_min; else |delta| = delta_max )
virtual bool selectionJetDr(const int & r1, const int & r2, const float & delta);
/// Given the rankings r1 and r2 of two jets, it returns whether the jets passes the pt imbalance selection; the threshold delta is passed by the configuration file
virtual bool selectionJetPtImbalance(const int & r1, const int & r2);
/// Given the rankings r1 and r2 of two jets, it returns whether the jets passes the pt imbalance selection; the threshold delta is passed as an argument (if delta <= 0, |delta| = delta_min; else |delta| = delta_max )
virtual bool selectionJetPtImbalance(const int & r1, const int & r2, const float & delta);


virtual bool selectionJetId();
virtual bool selectionJetPileupId();
virtual bool selectionNJets();
Expand Down
19 changes: 17 additions & 2 deletions src/Config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ Config::Config(int argc, char ** argv) : opt_cmd_("Options"), opt_cfg_("Configur
("ptMin", po::value<std::vector<float> >(&ptmin_)->multitoken(),"Mimium pt of an object")
("ptMax", po::value<std::vector<float> >(&ptmax_)->multitoken(),"Maximum pt of an object")
("etaMax", po::value<std::vector<float> >(&etamax_)->multitoken(),"Maximum |eta| of an object")
("ptImbalanceMin",po::value <float> (&ptimbalmin_)->default_value(-1),"Minimum relative imbalance between two candidates")
("ptImbalanceMax",po::value <float> (&ptimbalmax_)->default_value(-1),"Maximum relative imbalance between two candidates");
("ptImbalanceMin",po::value <float> (&jetsptimbalmin_)->default_value(-1),"Minimum relative imbalance between two candidates")
("ptImbalanceMax",po::value <float> (&jetsptimbalmax_)->default_value(-1),"Maximum relative imbalance between two candidates");


opt_cfg_.add_options()
Expand Down Expand Up @@ -357,6 +357,8 @@ std::string Config::jetsPuId() const { return jetspuid_; }
std::string Config::jerPtRes() const { return jerptres_; }
std::string Config::jerSF() const { return jersf_; }
std::string Config::l1tJetsCollection() const { return l1tjetsCol_; }
std::string Config::btagAlgorithm() const { return btagalgo_; }
std::string Config::btagScaleFactors() const { return btagsf_; }
std::vector<std::string> Config::jetsBtagWP() const { return jetsbtagwp_; }
std::vector<float> Config::jetsBtagProbB() const { return jetsbtagprobb_; }
std::vector<float> Config::jetsBtagProbBB() const { return jetsbtagprobbb_; }
Expand All @@ -371,6 +373,19 @@ bool Config::useJetsExtendedFlavour() const { return usejetsextflv
bool Config::doDijet() const { return dodijet_ ; }
int Config::nBJetsMin() const { return nbjetsmin_; }

std::vector<float> Config::jetsQGmin() const { return qgmin_; }
std::vector<float> Config::jetsQGmax() const { return qgmax_; }

// jet-jet
float Config::jetsDetaMax() const { return jetsdetamax_; }
float Config::jetsDetaMin() const { return jetsdetamin_; }
float Config::jetsDphiMax() const { return jetsdphimax_; }
float Config::jetsDphiMin() const { return jetsdphimin_; }
float Config::jetsDrMax() const { return jetsdrmax_; }
float Config::jetsDrMin() const { return jetsdrmin_; }
float Config::jetsPtImbalanceMax() const { return jetsptimbalmax_; }
float Config::jetsPtImbalanceMin() const { return jetsptimbalmin_; }

// muons
std::string Config::muonsCollection() const { return muonsCol_; }
int Config::nMuonsMin() const { return nmuonsmin_; }
Expand Down
Loading

0 comments on commit 0e3b269

Please sign in to comment.