Skip to content

Commit

Permalink
Merge pull request cms-sw#120 from mariadalfonso/TopBotV14
Browse files Browse the repository at this point in the history
FullHad: first version
  • Loading branch information
amarini authored Mar 14, 2017
2 parents c5b51d3 + 965cd4f commit e621b7d
Show file tree
Hide file tree
Showing 14 changed files with 915 additions and 4 deletions.
5 changes: 5 additions & 0 deletions dat/branches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ jetUnc
jetBdiscr
jetSelBits
jetQGL
## QG
jetQglCMult
jetQglNMult
jetQglMult
jetQglPtD
jetQglAxis1
jetQglAxis2
jetQglPtDrLog

### FatJet
fatjetAK8CHSP4

### Leptons
lepP4
lepIso
Expand Down
47 changes: 47 additions & 0 deletions dat/configTopBot_FullHad.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
##configure Looper
##### This file store the configuratino to run all the analysis
##### if you want to make a config file that overwrite some changes just create a new one with the line
##### Loader=LoadNero
##### include=dat/config.txt
##### Files=....,....,...

include=dat/config.2017.moriond.dat

Files=
include=dat/catalog/2017.moriond/tt.dat
## signal
include=dat/catalog/2017.moriond/topbottom.dat


include=dat/topBot_FullHad.2017.dat
pileup=aux/pileup.2017.BCDEFGH.root

#____________________ SPECIAL SETTINGS _____________________________

#__________________________________________________________________
#____________________ COMMON SETTINGS _____________________________
#

# Smearer

Smear=NONE

################################# ANALYSIS CONFIGURATION ############################

Correct=NONE
#Correct=MetPhiCorrector
Final=no
#Final=yes
# final remember: no tree, no data, w/ syst

#________________________________________________________________
#____________________ CONFIGURATION _____________________________
#
########## ANALYSIS ################
Analysis=JsonAnalysis,MetFiltersAnalysis,ChargedHiggsTopBottomFullHad

Output=ChHiggs_FullHad.root




21 changes: 21 additions & 0 deletions dat/topBot_FullHad.2017.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#############
### TopBottom FullHad ###
#############

config=ChargedHiggsTopBottom|AddLabel('ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8')
###addConfig=ChargedHiggsTopBottom|AddLabel('HplusToTB_M-2000')
###addConfig=ChargedHiggsTopBottom|AddLabel('HplusToTB_M-1000')
addConfig=ChargedHiggsTopBottom|AddLabel('ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8')
###addConfig=ChargedHiggsTopBottom|AddLabel('HplusToTB_M-750')
addConfig=ChargedHiggsTopBottom|AddLabel('ChargedHiggs_HplusTB_HplusToTB_M-500_13TeV_amcatnlo_pythia8')
###addConfig=ChargedHiggsTopBottom|AddLabel('HplusToTB_M-450')
addConfig=ChargedHiggsTopBottom|AddLabel('ChargedHiggs_HplusTB_HplusToTB_M-400_13TeV_amcatnlo_pythia8')
addConfig=ChargedHiggsTopBottom|AddLabel('ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8')
addConfig=ChargedHiggsTopBottom|AddLabel('ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8')
addConfig=ChargedHiggsTopBottom|AddLabel('ChargedHiggs_HplusTB_HplusToTB_M-250_13TeV_amcatnlo_pythia8')
addConfig=ChargedHiggsTopBottom|AddLabel('ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8')
addConfig=ChargedHiggsTopBottom|AddLabel('ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8')
addConfig=ChargedHiggsTopBottom|AddLabel('ChargedHiggs_HplusTB_HplusToTB_M-180_13TeV_amcatnlo_pythia8')

addConfig=ChargedHiggsTopBottom|AddLabel('TT_TuneCUETP8M2T4')

94 changes: 94 additions & 0 deletions interface/AnalysisChargedHiggsTBfullHad.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#ifndef CHARGEDHIGGSTOPBOTTOMFULLHAD_H
#define CHARGEDHIGGSTOPBOTTOMFULLHAD_H
#include "interface/AnalysisBase.hpp"
#include "interface/CutSelector.hpp"


#include "interface/Output.hpp" // DataStore
#include "TMVA/Reader.h"
#include "TMVA/Tools.h"

class ChargedHiggsTopBottomFullHad: virtual public AnalysisBase
{
public:

ChargedHiggsTopBottomFullHad() : AnalysisBase () {}
virtual ~ChargedHiggsTopBottomFullHad () {}

void Init() override;

void SetLeptonCuts(Lepton *l) override ;
void SetJetCuts(Jet*j) override;
void SetTauCuts(Tau*t) override;

void BookCutFlow(string l, string category);
void BookHisto(string l, string category, string phasespace);
void BookFlavor(string l, string category, string phasespace, string flavor, string SR);
void Preselection();

// function with various plots
void jetPlot(Event*e, string label, string category, string systname, string jetname);
void leptonPlot(Event*e, string label, string category, string systname, string phasespace);
void eventShapePlot(Event*e, string label, string category, string systname, string phasespace);
void classifyHF(Event*e, string label, string category, string systname, string jetname, string SR);
void leptonicHiggs(Event*e, string label, string systname, TLorentzVector b1, TLorentzVector b2, TLorentzVector p4W, string combination);

void computeVar(Event*e);

void printSynch(Event*e);

int analyze(Event*,string systname) override;
const string name() const override {return "ChargedHiggsTopBottomFullHad";}

// Tree
bool writeTree = false;
void setTree(Event*e, string label, string category);

// Variables for MVA

template<class T>
void SetVariable( string name, T value){ varValues_.Set(name, value); }
void AddVariable( string name, char type, int r);
void AddSpectator( string name, char type, int r);

vector<string> weights;


private:

CutSelector cut;

enum CutFlow{ Total=0,
NoLep,
NoTau,
MaxCut
};

double evt_HT=-1;
double evt_minDRbb=-1;
double evt_minDRbb_invMass=-1;
double evt_DEtaMaxBB=-1;

double evt_C=0;


/////
/////

DataStore varValues_;

//
//TMVA::Reader *reader_ ;
vector<TMVA::Reader*> readers_;


};

#endif
// Local Variables:
// mode:c++
// indent-tabs-mode:nil
// tab-width:4
// c-basic-offset:4
// End:
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
5 changes: 5 additions & 0 deletions interface/Event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ using namespace std;
// -----
#include "interface/Object.hpp"
#include "interface/Jet.hpp"
#include "interface/FatJet.hpp"
#include "interface/Lepton.hpp"
#include "interface/Tau.hpp"
#include "interface/Met.hpp"
Expand Down Expand Up @@ -37,6 +38,7 @@ class Event{
protected:
vector<Lepton*> leps_;
vector<Jet*> jets_;
vector<FatJet*> fat_;
vector<Tau*> taus_;
vector<Photon*> phos_;
vector<GenParticle*> genparticles_; // gen particles
Expand Down Expand Up @@ -71,6 +73,7 @@ class Event{

// Bare version -- don't use these functions, unless for debug or sync
inline Jet * GetBareJet(unsigned iJet) const { if (jets_.size() <= iJet) return (Jet*) NULL; return jets_[iJet]; }
inline FatJet * GetBareFatJet(unsigned iJet) const { if (fat_.size() <= iJet) return (FatJet*) NULL; return fat_[iJet]; }
inline Tau * GetBareTau(unsigned iTau) const { if (taus_.size() <= iTau) return (Tau*) NULL; return taus_[iTau]; }
inline Lepton * GetBareLepton(unsigned iLepton) const { if (leps_.size() <= iLepton) return (Lepton*) NULL; return leps_[iLepton]; }
inline Photon * GetBarePhoton(unsigned iPhoton) const { if (phos_.size() <= iPhoton) return (Photon*) NULL; return phos_[iPhoton]; }
Expand All @@ -90,6 +93,7 @@ class Event{
Jet * GetBjet( int iJet );
Jet * GetBjetInvIso( int iJet );
Jet * GetLjet( int iJet );
FatJet * GetFatJet( int iJet );
Tau * GetTau( int iTau );
Tau * GetTauInvIso( int iTau );
Lepton * GetLepton( int iLep );
Expand Down Expand Up @@ -119,6 +123,7 @@ class Event{
inline int Bjets()const {int n=0; for(auto j : jets_) if(j->IsBJet()) n++; return n;}
inline int Ljets()const {int n=0; for(auto j : jets_) if(not j->IsBJet()) n++; return n;}
inline int BjetsInvIso()const {int n=0; for(auto j : jets_) if(j->IsBJetInvIso()) n++; return n;}
inline int NFatJets()const {int n=0; for(auto j : fat_) if(j->IsJet()) n++; return n;}
inline int Ntaus(){int n=0; for(auto t : taus_) if(t->IsTau()) n++; return n;}
inline int Nleps(){int n=0; for(auto t : leps_) if(t->IsLep()) n++; return n;}
inline int NGenPar(){return genparticles_.size();}
Expand Down
72 changes: 72 additions & 0 deletions interface/FatJet.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#ifndef FATJET_H
#define FATJET_H

#include "interface/Object.hpp"
#include "interface/Smearable.hpp"
#include <algorithm>
#include <string>
#include <map>

//#include <iostream>
//using namespace std;

// ---
class FatJet : virtual public Object, virtual public SmearableBase
{
// This class take care of the jet definition in the analysis
//
float ptcut_; // ** pt cut on the accepted jets
float etacut_ ; // ** eta cut on the accepted jets
float tau1cut_ ; // To Set
float tau2cut_ ; // To Set
float tau3cut_ ; // To Set

float corrprunedMasscut_ ;
float prunedMasscut_ ;
float softdropMasscut_ ;
float nSubjetscut_ ;
float hbbcut_;

// FIXME: add puppi

TLorentzVector pp4;

public:

void SetPtCut(float x){ptcut_= x;}
void SetEtaCut(float x){etacut_ = x;}

void SetTau1Cut(float x){tau1cut_ = x;}
void SetTau2Cut(float x){tau2cut_ = x;}
void SetTau3Cut(float x){tau3cut_ = x;}

void SetCorrPrunedMassCut(float x){corrprunedMasscut_ = x;}
void SetPrunedMassCut(float x){prunedMasscut_ = x;}
void SetSDMassCut(float x){softdropMasscut_ = x;}
void SetSubjetsCut(float x){nSubjetscut_ = x;}

void SetDoubleBBCut(float x){hbbcut_ = x;}


FatJet() ;


float bdiscr; //

//Gen-level info

// ---

inline int IsJet() const { return 1;}


};

#endif
// Local Variables:
// mode:c++
// indent-tabs-mode:nil
// tab-width:4
// c-basic-offset:4
// End:
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
1 change: 1 addition & 0 deletions interface/LinkDef.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#pragma link C++ class Object+ ;
#pragma link C++ class Jet+ ;
#pragma link C++ class FatJet+ ;
#pragma link C++ class GenParticle+ ;
#pragma link C++ class Lepton+ ;
#pragma link C++ class Met+ ;
Expand Down
1 change: 1 addition & 0 deletions interface/Loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class LoadNero : public Loader{
void Clear() override { for (auto c : bare_) c->clear() ;}

void FillJets();
void FillFatJets();
void FillLeptons();
void FillPhotons();
void FillTaus();
Expand Down
Loading

0 comments on commit e621b7d

Please sign in to comment.