DESY Hbb Analysis Framework
Public Member Functions | Protected Attributes | List of all members
analysis::mssmhbb::MssmHbbAnalyser Class Reference

#include <MssmHbbAnalyser.h>

Inheritance diagram for analysis::mssmhbb::MssmHbbAnalyser:
analysis::tools::Analyser analysis::tools::TriggerAnalyser analysis::tools::JetAnalyser analysis::tools::MuonAnalyser analysis::tools::BaseAnalyser analysis::tools::BaseAnalyser analysis::tools::BaseAnalyser

Public Member Functions

bool btagSelection ()
 
bool endSelection ()
 
virtual bool event (const int &i)
 Read event and perform basic selections and actions. More...
 
void fillMssmHbbHistograms ()
 
void fillMssmHbbTree ()
 
bool jetSelection ()
 
 MssmHbbAnalyser ()
 
 MssmHbbAnalyser (int argc, char **argv)
 
void mssmHbbTree ()
 
virtual bool muonJet (const bool &swap=false)
 
bool muonSelection ()
 
 ~MssmHbbAnalyser ()
 
- Public Member Functions inherited from analysis::tools::Analyser
 Analyser ()
 default constructor More...
 
 Analyser (int argc, char *argv[])
 main constructor More...
 
virtual bool muonJet (const int &)
 Assign muon to jet. More...
 
virtual bool preselection ()
 multiple actions: perform muon Id, jet Id and jet pileup Id selections More...
 
 ~Analyser ()
 desctructor More...
 
- Public Member Functions inherited from analysis::tools::TriggerAnalyser
virtual bool analysisWithTrigger ()
 
bool l1tJetsAnalysis () const
 
bool l1tMuonsAnalysis () const
 
virtual bool selectionHLT ()
 
virtual bool selectionL1 ()
 
virtual bool selectionTrigger ()
 
virtual bool selectionTriggerEmulated (const bool &, const bool &, const std::string &, const int &, const float &, const float &)
 
 TriggerAnalyser ()
 constructors More...
 
 TriggerAnalyser (int argc, char *argv[])
 
std::vector< std::shared_ptr< TriggerObject > > triggerObjectsCaloJets ()
 
std::vector< std::shared_ptr< TriggerObject > > triggerObjectsL1Jets ()
 
std::vector< std::shared_ptr< TriggerObject > > triggerObjectsL1Muons ()
 
std::vector< std::shared_ptr< TriggerObject > > triggerObjectsL3Muons ()
 
std::vector< std::shared_ptr< TriggerObject > > triggerObjectsPFJets ()
 
 ~TriggerAnalyser ()
 desctructor More...
 
- Public Member Functions inherited from analysis::tools::BaseAnalyser
void actionApplyPileupWeight (const int &var=0)
 apply pileup weight given a systematic variation More...
 
void analyserTree ()
 root tree More...
 
std::shared_ptr< Analysisanalysis ()
 returns pointer to Analysis object More...
 
 BaseAnalyser ()
 constructor More...
 
 BaseAnalyser (int argc, char *argv[])
 constructor More...
 
std::string basename (const std::string &)
 returns the basename of a path More...
 
std::map< std::string, std::shared_ptr< TGraphAsymmErrors > > btagEfficiencies () const
 
std::shared_ptr< Configconfig ()
 returns pointer to Config object More...
 
float crossSection () const
 returns cross section More...
 
int cutflow ()
 get cutflow index More...
 
void cutflow (const int &)
 set cutflow index More...
 
void cutflow (const std::string &label, const bool &ok=true)
 create and update cutflow entry in the cutflow histogram More...
 
void fillAnalyserTree ()
 fill root tree More...
 
void fillPileupHistogram ()
 fills pileup histogram More...
 
void generatorWeight ()
 generator weight More...
 
bool genJetsAnalysis () const
 returns whether analysis of gen jets can be done More...
 
bool genParticlesAnalysis () const
 returns whether analysis of gen particles can be done More...
 
std::shared_ptr< TH1F > histogram (const std::string &)
 returns a given 1D histogram More...
 
std::map< std::string, std::shared_ptr< TH1F > > histograms ()
 returns all 1D histograms More...
 
virtual void histograms (const std::string &, const int &)
 create n histograms of a given type More...
 
int nEvents ()
 number of events to be processed More...
 
std::shared_ptr< TFile > output ()
 returns pointer to output root file More...
 
void pileupHistogram ()
 creates pileup histogram More...
 
float pileupWeight (const float &truepu, const int &var) const
 returns pileup weight given the true pileup and uncertainty variation in values of sigma More...
 
std::shared_ptr< PileupWeightpileupWeights () const
 returns pointer to pileup weights (MC-only) More...
 
void scale (const float &)
 sets a scale More...
 
int seed ()
 returns a seed for random number generator More...
 
int seed (const std::string &)
 reads a file containing a seed and returns the seed or -1 if fails More...
 
void seed (const int &)
 sets a seed for random number generators More...
 
bool triggerEmulated (const std::string &)
 return status of an emulated l1 trigger More...
 
virtual bool triggerEmulation (const std::string &, const int &, const float &, const float &, const std::string &)
 emulate l1 trigger More...
 
std::map< std::string, bool > triggersEmulated ()
 return status of all emulated l1 triggers More...
 
float trueInteractions () const
 returns true number of interactions More...
 
float weight ()
 returns event weight More...
 
void weight (const float &)
 sets event weight More...
 
virtual ~BaseAnalyser ()
 desctructor More...
 
- Public Member Functions inherited from analysis::tools::JetAnalyser
virtual void actionApplyBjetRegression ()
 
virtual void actionApplyBjetRegression (const int &)
 
virtual float actionApplyBtagSF (const int &, const bool &global_weight=true)
 
virtual void actionApplyJER ()
 
virtual bool analysisWithJets ()
 
float btag (const Jet &jet, const std::string &algo)
 Returns the btag value of the jet for a given btag algorithm. More...
 
virtual ScaleFactors btagSF (const int &, const std::string &)
 
virtual void fillJetHistograms (const std::string &label="x")
 Fill the pre-defined histograms created by the jetHistograms() method. More...
 
virtual void fillJetHistograms (const int &r=-1, const std::string &label="x", const float &sf=1., const bool &workflow=false)
 For experts only (fills pre-defined histograms for a specific jet, applying weights) More...
 
virtual float getBtagSF (const int &)
 
 JetAnalyser ()
 constructors More...
 
 JetAnalyser (int argc, char *argv[])
 
virtual bool jetCorrections ()
 multiple actions: apply JER and b-tag regression corrections More...
 
virtual void jetHistograms (const int &n, const std::string &label="x")
 Creates pre-defined histograms in directory 'label' for analysis with 'n' jets. More...
 
virtual void jetHistograms (const std::string &label="x")
 Creates pre-defined histograms in directory 'label' for analysis with config->nJetsMin() More...
 
std::vector< std::shared_ptr< Jet > > jets ()
 vector of pointers of all jets from the "Jets" collection More...
 
void jets (const std::string &col)
 Creates the "Jets" collection. More...
 
virtual void jetSwap (const int &, const int &)
 
virtual bool onlineBJetMatching (const int &)
 
virtual bool onlineJetMatching (const int &)
 
std::vector< std::shared_ptr< Jet > > selectedJets ()
 vector of pointers of the selectedJets More...
 
virtual bool selectionBJet (const int &)
 
virtual bool selectionBJetProbB (const int &)
 
virtual bool selectionBJetProbBB (const int &)
 
virtual bool selectionBJetProbC (const int &)
 
virtual bool selectionBJetProbG (const int &)
 
virtual bool selectionBJetProbLepB (const int &)
 
virtual bool selectionBJetProbLight (const int &)
 
virtual bool selectionDiJetMass (const int &, const int &)
 
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 are passed by configuration file. More...
 
virtual bool selectionJet (const int &r, const float &pt_min, const float &eta_max, const float &pt_max=-1.)
 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. More...
 
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 by the configuration file. More...
 
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_eta selection; the threshold delta is passed as an argument (if delta <= 0, |delta| = delta_min; else |delta| = delta_max ) More...
 
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 by the configuration file. More...
 
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_phi selection; the threshold delta is passed as an argument (if delta <= 0, |delta| = delta_min; else |delta| = delta_max ) More...
 
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 by the configuration file. More...
 
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 delta_R selection; the threshold delta is passed as an argument (if delta <= 0, |delta| = delta_min; else |delta| = delta_max ) More...
 
virtual bool selectionJetId ()
 
virtual bool selectionJetPileupId ()
 
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 by the configuration file. More...
 
virtual bool selectionJetPtImbalance (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 as an argument (if delta <= 0, |delta| = delta_min; else |delta| = delta_max ) More...
 
virtual bool selectionJetQGlikelihood (const int &, const float &)
 
virtual bool selectionJetQGlikelihood (const int &)
 
virtual bool selectionNJets ()
 
virtual bool selectionNonBJet (const int &)
 
 ~JetAnalyser ()
 desctructor More...
 
- Public Member Functions inherited from analysis::tools::MuonAnalyser
virtual bool analysisWithMuons ()
 
float btag (const Muon &, const std::string &)
 
virtual void fillMuonHistograms ()
 
 MuonAnalyser ()
 constructors More...
 
 MuonAnalyser (int argc, char *argv[])
 
virtual void muonHistograms (const std::string &, const int &n=1)
 
std::vector< std::shared_ptr< Muon > > muons ()
 
virtual bool onlineL1MuonMatching (const int &)
 
virtual bool onlineL3MuonMatching (const int &)
 
std::vector< std::shared_ptr< Muon > > onlineMatchedMuons ()
 
virtual bool onlineMuonMatching ()
 
std::vector< std::shared_ptr< Muon > > selectedMuons ()
 
virtual bool selectionMuon (const int &)
 
virtual bool selectionMuonDr (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 by the configuration file. More...
 
virtual bool selectionMuonDr (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 as an argument (if delta <= 0, |delta| = delta_min; else |delta| = delta_max ) More...
 
virtual bool selectionMuonId ()
 
virtual bool selectionMuons ()
 
virtual bool selectionNMuons ()
 
 ~MuonAnalyser ()
 desctructor More...
 

Protected Attributes

bool do_tree_
 
double mbb_
 
double mbbw_
 
std::shared_ptr< TTree > mssmhbb_tree_
 
- Protected Attributes inherited from analysis::tools::TriggerAnalyser
bool l1tjetsanalysis_
 
bool l1tmuonsanalysis_
 
bool triggeranalysis_
 
- Protected Attributes inherited from analysis::tools::BaseAnalyser
std::shared_ptr< TTree > analyser_tree_
 output tree More...
 
std::shared_ptr< Analysisanalysis_
 Analysis objects. More...
 
std::map< std::string, std::shared_ptr< TGraphAsymmErrors > > btageff_
 
std::shared_ptr< Configconfig_
 Config objects. More...
 
int cutflow_
 Cutflow index. More...
 
bool genjetsanalysis_
 
bool genpartsanalysis_
 
std::map< std::string, std::shared_ptr< TH1F > > h1_
 1D histograms mapping More...
 
std::map< std::string, std::shared_ptr< TH2F > > h2_
 2D histograms mapping More...
 
std::shared_ptr< TFile > hout_
 output root file More...
 
bool isData_
 flag for DATA sample More...
 
bool isMC_
 flag for MC sample More...
 
bool istruepu_
 true pileup More...
 
std::string puw_label_
 pileup weight label More...
 
std::shared_ptr< PileupWeightpuweights_
 pileup weight More...
 
float scale_
 overall scaling More...
 
int seed_
 seed value More...
 
std::map< std::string, bool > trg_emul_
 emulated triggers More...
 
float weight_
 event weight More...
 
float xsection_
 cross section More...
 
- Protected Attributes inherited from analysis::tools::JetAnalyser
bool applyjer_
 
std::map< std::string, std::shared_ptr< BTagCalibrationReader > > bsf_reader_
 
std::vector< std::string > flavours_
 
std::shared_ptr< JetResolutionInfojerinfo_
 
std::vector< std::shared_ptr< Jet > > jets_
 
bool jetsanalysis_
 
int n_hjets_
 
std::vector< std::shared_ptr< Jet > > selectedJets_
 
- Protected Attributes inherited from analysis::tools::MuonAnalyser
std::map< std::string, std::shared_ptr< BTagCalibrationReader > > bsf_reader_
 
std::vector< std::shared_ptr< Muon > > muons_
 
bool muonsanalysis_
 
std::vector< std::shared_ptr< Muon > > onlineMatchedMuons_
 
std::vector< std::shared_ptr< Muon > > selectedMuons_
 

Detailed Description

Definition at line 38 of file MssmHbbAnalyser.h.

Constructor & Destructor Documentation

MssmHbbAnalyser::MssmHbbAnalyser ( )

Definition at line 33 of file MssmHbbAnalyser.cc.

34 {
35 }
MssmHbbAnalyser::MssmHbbAnalyser ( int  argc,
char **  argv 
)

Definition at line 37 of file MssmHbbAnalyser.cc.

References analysis::tools::BaseAnalyser::config_, do_tree_, analysis::tools::BaseAnalyser::h1_, analysis::tools::JetAnalyser::jetHistograms(), mbb_, and mssmHbbTree().

37  : BaseAnalyser(argc,argv), Analyser(argc,argv)
38 {
39 // histograms("cutflow");
40 // histograms("jet",config_->nJetsMin());
41  do_tree_ = config_->doTree();
42  if ( do_tree_ ) this -> mssmHbbTree();
43  mbb_ = -1.;
44  this->jetHistograms(config_->nJetsMin(),"final_selection");
45  h1_["mssmhbb_mbb"] = std::make_shared<TH1F>("mbb","MSSM Hbb mbb", 30000,0,3000);
46 }
Analyser()
default constructor
Definition: Analyser.cc:19
std::shared_ptr< Config > config_
Config objects.
Definition: BaseAnalyser.h:63
virtual void jetHistograms(const int &n, const std::string &label="x")
Creates pre-defined histograms in directory &#39;label&#39; for analysis with &#39;n&#39; jets.
Definition: JetAnalyser.cc:172
std::map< std::string, std::shared_ptr< TH1F > > h1_
1D histograms mapping
Definition: BaseAnalyser.h:80
MssmHbbAnalyser::~MssmHbbAnalyser ( )

Definition at line 48 of file MssmHbbAnalyser.cc.

References do_tree_, and mssmhbb_tree_.

49 {
50  // do anything here that needs to be done at desctruction time
51  // (e.g. close files, deallocate resources etc.)
52 
53  if ( do_tree_ ) mssmhbb_tree_ -> Write();
54 }
std::shared_ptr< TTree > mssmhbb_tree_

Member Function Documentation

bool MssmHbbAnalyser::btagSelection ( )

Definition at line 89 of file MssmHbbAnalyser.cc.

References analysis::tools::JetAnalyser::actionApplyBtagSF(), analysis::tools::BaseAnalyser::config_, analysis::tools::JetAnalyser::onlineBJetMatching(), and analysis::tools::JetAnalyser::selectionBJet().

Referenced by main().

90 {
91  for ( int i = 1; i <= config_->nBJetsMin(); ++i )
92  {
93  if ( ! this->selectionBJet(i) ) return false;
94  this->actionApplyBtagSF(i);
95  if ( i<= 2 && ! this->onlineBJetMatching(i) ) return false;
96  }
97 
98  return true;
99 
100 }
std::shared_ptr< Config > config_
Config objects.
Definition: BaseAnalyser.h:63
virtual bool onlineBJetMatching(const int &)
Definition: JetAnalyser.cc:778
virtual bool selectionBJet(const int &)
Definition: JetAnalyser.cc:708
virtual float actionApplyBtagSF(const int &, const bool &global_weight=true)
bool MssmHbbAnalyser::endSelection ( )

Definition at line 109 of file MssmHbbAnalyser.cc.

References analysis::tools::JetAnalyser::fillJetHistograms(), fillMssmHbbHistograms(), and fillMssmHbbTree().

Referenced by main().

110 {
111  this->fillJetHistograms("final_selection");
112  this->fillMssmHbbHistograms();
113  this->fillMssmHbbTree();
114  return true;
115 
116 }
virtual void fillJetHistograms(const std::string &label="x")
Fill the pre-defined histograms created by the jetHistograms() method.
Definition: JetAnalyser.cc:795
bool MssmHbbAnalyser::event ( const int &  i)
virtual

Read event and perform basic selections and actions.

Reimplemented from analysis::tools::Analyser.

Definition at line 61 of file MssmHbbAnalyser.cc.

Referenced by main().

62 {
63  // parent function checks only json and run range validity
64  if ( ! Analyser::event(i) ) return false;
65 
66 // PILEUP RE-WEIGHT
67 // this->actionApplyPileupWeight();
68 
69  return true;
70 }
void MssmHbbAnalyser::fillMssmHbbHistograms ( )

Definition at line 178 of file MssmHbbAnalyser.cc.

References analysis::tools::BaseAnalyser::config_, analysis::tools::BaseAnalyser::cutflow_, analysis::tools::BaseAnalyser::h1_, analysis::tools::Candidate::m(), analysis::tools::JetAnalyser::selectedJets_, and analysis::tools::BaseAnalyser::weight_.

Referenced by endSelection().

179 {
180  ++ cutflow_;
181  if ( std::string(h1_["cutflow"] -> GetXaxis()-> GetBinLabel(cutflow_+1)) == "" )
182  h1_["cutflow"] -> GetXaxis()-> SetBinLabel(cutflow_+1,"Fill MssmHbb Histograms");
183 
185  float mbb = 0.;
186  if ( config_->isMC() || !config_->signalRegion() ) mbb = c_12.m();
187 
188  h1_["mssmhbb_mbb"] -> Fill(mbb,weight_);
189  h1_["cutflow"] -> Fill(cutflow_,weight_);
190 
191 }
std::shared_ptr< Config > config_
Config objects.
Definition: BaseAnalyser.h:63
float weight_
event weight
Definition: BaseAnalyser.h:72
std::vector< std::shared_ptr< Jet > > selectedJets_
Definition: JetAnalyser.h:47
std::map< std::string, std::shared_ptr< TH1F > > h1_
1D histograms mapping
Definition: BaseAnalyser.h:80
int cutflow_
Cutflow index.
Definition: BaseAnalyser.h:66
void MssmHbbAnalyser::fillMssmHbbTree ( )

Definition at line 152 of file MssmHbbAnalyser.cc.

References analysis::tools::BaseAnalyser::config_, analysis::tools::BaseAnalyser::cutflow_, do_tree_, analysis::tools::BaseAnalyser::h1_, analysis::tools::Candidate::m(), mbb_, mbbw_, mssmhbb_tree_, analysis::tools::JetAnalyser::selectedJets_, and analysis::tools::BaseAnalyser::weight_.

Referenced by endSelection().

153 {
154  if ( ! do_tree_ ) return;
155  ++ cutflow_;
156  if ( std::string(h1_["cutflow"] -> GetXaxis()-> GetBinLabel(cutflow_+1)) == "" )
157  h1_["cutflow"] -> GetXaxis()-> SetBinLabel(cutflow_+1,"Fill MssmHbb tree");
158 
160  if ( config_->isMC() || !config_->signalRegion() ) mbb_ = c_12.m();
161 
162  mbbw_ = weight_;
163 
164  mssmhbb_tree_ -> Fill();
165  h1_["cutflow"] -> Fill(cutflow_,weight_);
166 
167 }
std::shared_ptr< Config > config_
Config objects.
Definition: BaseAnalyser.h:63
float weight_
event weight
Definition: BaseAnalyser.h:72
std::vector< std::shared_ptr< Jet > > selectedJets_
Definition: JetAnalyser.h:47
std::map< std::string, std::shared_ptr< TH1F > > h1_
1D histograms mapping
Definition: BaseAnalyser.h:80
int cutflow_
Cutflow index.
Definition: BaseAnalyser.h:66
std::shared_ptr< TTree > mssmhbb_tree_
bool MssmHbbAnalyser::jetSelection ( )

Definition at line 71 of file MssmHbbAnalyser.cc.

References analysis::tools::BaseAnalyser::config_, analysis::tools::JetAnalyser::onlineJetMatching(), analysis::tools::JetAnalyser::selectionJet(), analysis::tools::JetAnalyser::selectionJetDeta(), analysis::tools::JetAnalyser::selectionJetDr(), and analysis::tools::JetAnalyser::selectionNJets().

Referenced by main().

72 {
73  if ( ! this->selectionNJets() ) return false;
74  for ( int i = 1; i <= config_->nJetsMin(); ++i )
75  {
76  // kinematics selection
77  if ( ! this->selectionJet(i) ) return false;
78  if ( i <= 2 && (! this->onlineJetMatching(i)) ) return false;
79  // delta R selection
80  for ( int j = i+1; j <= config_->nJetsMin(); ++j )
81  if ( ! this->selectionJetDr(i,j) ) return false;
82  }
83  // delta eta jet selection
84  if ( ! this->selectionJetDeta(1,2) ) return false;
85 
86  return true;
87 
88 }
virtual bool selectionJet(const int &r)
Given the ranking &#39;r&#39; 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.
Definition: JetAnalyser.cc:378
virtual bool onlineJetMatching(const int &)
Definition: JetAnalyser.cc:746
std::shared_ptr< Config > config_
Config objects.
Definition: BaseAnalyser.h:63
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;...
Definition: JetAnalyser.cc:445
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; t...
Definition: JetAnalyser.cc:541
void MssmHbbAnalyser::mssmHbbTree ( )

Definition at line 169 of file MssmHbbAnalyser.cc.

References mbb_, mbbw_, mssmhbb_tree_, and analysis::tools::BaseAnalyser::output().

Referenced by MssmHbbAnalyser().

170 {
171 // do_tree_ = true;
172  this->output()->cd();
173  mssmhbb_tree_ = std::make_shared<TTree>("mssmhbb","TTree with mbb and weight for FitModel");
174  mssmhbb_tree_ -> Branch("mbb",&mbb_,"mbb/D");
175  mssmhbb_tree_ -> Branch("weight",&mbbw_,"weight/D");
176 }
std::shared_ptr< TFile > output()
returns pointer to output root file
std::shared_ptr< TTree > mssmhbb_tree_
bool MssmHbbAnalyser::muonJet ( const bool &  swap = false)
virtual

Definition at line 118 of file MssmHbbAnalyser.cc.

References analysis::tools::BaseAnalyser::cutflow_, analysis::tools::BaseAnalyser::h1_, analysis::tools::JetAnalyser::jetsanalysis_, analysis::tools::JetAnalyser::jetSwap(), analysis::tools::MuonAnalyser::muonsanalysis_, analysis::tools::JetAnalyser::selectedJets_, analysis::tools::MuonAnalyser::selectedMuons_, and analysis::tools::BaseAnalyser::weight_.

Referenced by main().

119 {
120  // jet 1 is the muon jet, swap with jet 2 in case jet1 does not have a muon
121  // Muon jet association, a muon can be in either of the two leading jets.
122  // If argument is false(default, the jet label follows the jet ranking, regardless of where the muon is
123  // If argument is true, the jet label 1 refers to the muon-jet: *** the order of the workflow may matter!!! ***
124  if ( ! muonsanalysis_ || ! jetsanalysis_ ) return true; // will skip this selection
125 
126  int r1 = 1;
127  int r2 = 2;
128  int j1 = r1-1;
129  int j2 = r2-1;
130  ++ cutflow_;
131  if ( std::string(h1_["cutflow"] -> GetXaxis()-> GetBinLabel(cutflow_+1)) == "" )
132  {
133  if ( swap ) h1_["cutflow"] -> GetXaxis()-> SetBinLabel(cutflow_+1,"MSSMHbb Semileptonic: Jet-muon association -> Muon-Jet index 1");
134  else h1_["cutflow"] -> GetXaxis()-> SetBinLabel(cutflow_+1,"MSSMHbb Semileptonic: Jet-muon association");
135  }
136 
137  if ( selectedJets_.size() < 2 || selectedMuons_.size() < 1 ) return false;
138 
139  auto jet1 = selectedJets_[j1];
140  jet1 -> addMuon(selectedMuons_);
141  auto jet2 = selectedJets_[j2];
142  jet2 -> addMuon(selectedMuons_);
143 
144  if ( ! (jet1 -> muon() || jet2 -> muon()) ) return false;
145  if ( ! jet1 -> muon() && swap ) this->jetSwap(r1,r2);
146 
147  h1_["cutflow"] -> Fill(cutflow_,weight_);
148  return true;
149 
150 }
virtual void jetSwap(const int &, const int &)
float weight_
event weight
Definition: BaseAnalyser.h:72
std::vector< std::shared_ptr< Muon > > selectedMuons_
Definition: MuonAnalyser.h:47
std::vector< std::shared_ptr< Jet > > selectedJets_
Definition: JetAnalyser.h:47
std::map< std::string, std::shared_ptr< TH1F > > h1_
1D histograms mapping
Definition: BaseAnalyser.h:80
int cutflow_
Cutflow index.
Definition: BaseAnalyser.h:66
bool MssmHbbAnalyser::muonSelection ( )

Definition at line 101 of file MssmHbbAnalyser.cc.

References analysis::tools::MuonAnalyser::onlineMuonMatching(), analysis::tools::MuonAnalyser::selectionMuons(), and analysis::tools::MuonAnalyser::selectionNMuons().

Referenced by main().

102 {
103  if ( ! this->selectionNMuons() ) return false;
104  if ( ! this->selectionMuons() ) return false;
105  if ( ! this->onlineMuonMatching() ) return false;
106  return true;
107 
108 }

Member Data Documentation

bool analysis::mssmhbb::MssmHbbAnalyser::do_tree_
protected

Definition at line 56 of file MssmHbbAnalyser.h.

Referenced by fillMssmHbbTree(), MssmHbbAnalyser(), and ~MssmHbbAnalyser().

double analysis::mssmhbb::MssmHbbAnalyser::mbb_
protected

Definition at line 58 of file MssmHbbAnalyser.h.

Referenced by fillMssmHbbTree(), MssmHbbAnalyser(), and mssmHbbTree().

double analysis::mssmhbb::MssmHbbAnalyser::mbbw_
protected

Definition at line 59 of file MssmHbbAnalyser.h.

Referenced by fillMssmHbbTree(), and mssmHbbTree().

std::shared_ptr<TTree> analysis::mssmhbb::MssmHbbAnalyser::mssmhbb_tree_
protected

Definition at line 57 of file MssmHbbAnalyser.h.

Referenced by fillMssmHbbTree(), mssmHbbTree(), and ~MssmHbbAnalyser().


The documentation for this class was generated from the following files: