4 #include "boost/program_options.hpp" 5 #include "boost/algorithm/string.hpp" 34 if (
config_->btagScaleFactors() !=
"" )
50 if (
config_->useJetsExtendedFlavour() )
79 std::string triggerObjectsL1Jets;
80 if (
config_->triggerObjectsL1Jets() !=
"" )
82 triggerObjectsL1Jets =
config_->triggerObjectsL1Jets();
83 if (
config_->triggerEmulateL1Jets() !=
"" &&
config_->triggerEmulateL1JetsNMin() > 0 )
85 int nmin =
config_->triggerEmulateL1JetsNMin();
86 float ptmin =
config_->triggerEmulateL1JetsPtMin();
87 float etamax =
config_->triggerEmulateL1JetsEtaMax();
88 std::string newL1Jets =
config_->triggerEmulateL1Jets();
90 triggerObjectsL1Jets = newL1Jets;
95 std::string triggerObjectsCaloJets;
96 if (
config_->triggerObjectsCaloJets() !=
"" )
98 triggerObjectsCaloJets =
config_->triggerObjectsCaloJets();
99 if (
config_->triggerEmulateCaloJets() !=
"" &&
config_->triggerEmulateCaloJetsNMin() > 0 )
101 int nmin =
config_->triggerEmulateCaloJetsNMin();
102 float ptmin =
config_->triggerEmulateCaloJetsPtMin();
103 float etamax =
config_->triggerEmulateCaloJetsEtaMax();
104 std::string newCaloJets =
config_->triggerEmulateCaloJets();
106 triggerObjectsCaloJets = newCaloJets;
111 std::string triggerObjectsPFJets;
112 if (
config_->triggerObjectsPFJets() !=
"" )
114 triggerObjectsPFJets =
config_->triggerObjectsPFJets();
115 if (
config_->triggerEmulatePFJets() !=
"" &&
config_->triggerEmulatePFJetsNMin() > 0 )
117 int nmin =
config_->triggerEmulatePFJetsNMin();
118 float ptmin =
config_->triggerEmulatePFJetsPtMin();
119 float etamax =
config_->triggerEmulatePFJetsEtaMax();
120 std::string newPFJets =
config_->triggerEmulatePFJets();
122 triggerObjectsPFJets = newPFJets;
129 cutflow(Form(
"Using Jet collection: %s",(
config_->jetsCollection()).c_str()));
132 if (
config_->triggerObjectsL1Jets() !=
"" )
134 if (
config_->triggerObjectsCaloJets() !=
"" )
136 if (
config_->triggerObjectsPFJets() !=
"" )
146 jets->associatePartons(particles,0.4,1.,
config_->pythia8());
152 jets->addGenJets(genjets);
155 for (
int j = 0 ; j < jets->size() ; ++j )
jets_.push_back(std::make_shared<Jet>(jets->at(j)));
175 this->
output()->mkdir(label.c_str());
176 this->
output()->cd(label.c_str());
180 h1_[Form(
"jet_hist_weight_%s",label.c_str())] = std::make_shared<TH1F>(Form(
"jet_hist_weight_%s",label.c_str()) , Form(
"jet_hist_weight_%s",label.c_str()) ,1 , 0. , 1. );
185 float size1 = 0.0001;
186 int nbins1 =
int((max1-min1)/size1);
190 int nbins2 =
int((max2-min2)/size2);
193 float size3 = 0.0001;
194 int nbins3 =
int((max3-min3)/size3);
195 int nbins_btag = nbins1+nbins2+nbins3;
197 std::vector<float> bins_btag;
200 for (
int i = 0; i<nbins1; ++i) { bins_btag.push_back(min1 + size1*i); ++counter; }
201 for (
int i = 0; i<nbins2; ++i) { bins_btag.push_back(min2 + size2*i); ++counter; }
202 for (
int i = 0; i<nbins3+1; ++i) { bins_btag.push_back(min3 + size3*i); ++counter; }
206 nbins_btag =
int(1./size);
208 for (
int i = 0; i<nbins_btag+1; ++i) { bins_btag.push_back(size*i); ++counter; }
211 for (
int j = 0; j < n; ++j )
214 h1_[Form(
"pt_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"pt_jet%d" , j+1) , Form(
"pt_jet%d_%s" , j+1,label.c_str()) ,1500 , 0 , 1500 );
215 h1_[Form(
"eta_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"eta_jet%d" , j+1) , Form(
"eta_jet%d_%s" , j+1,label.c_str()) , 600 , -3, 3 );
216 h1_[Form(
"phi_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"phi_jet%d" , j+1) , Form(
"phi_jet%d_%s" , j+1,label.c_str()) , 360 , -180, 180 );
217 h1_[Form(
"btag_jet%d_%s", j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_jet%d", j+1) , Form(
"btag_jet%d_%s", j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
218 h1_[Form(
"btaglog_jet%d_%s", j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btaglog_jet%d", j+1) , Form(
"btaglog_jet%d_%s", j+1,label.c_str()) , 200 , 1.e-6, 10 );
219 h1_[Form(
"qglikelihood_jet%d_%s", j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"qglikelihood_jet%d", j+1) , Form(
"qglikelihood_jet%d_%s", j+1,label.c_str()) , 200 , 0, 1 );
220 h1_[Form(
"nconstituents_jet%d_%s", j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"nconstituents_jet%d", j+1) , Form(
"nconstituents_jet%d_%s", j+1,label.c_str()) , 200 , 0, 200 );
222 if (
config_-> histogramJetsRegionSplit() )
224 h1_[Form(
"pt_jet%d_me_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"pt_jet%d_me" , j+1) , Form(
"pt_jet%d_me_%s" , j+1,label.c_str()) ,1500 , 0 , 1500 );
225 h1_[Form(
"pt_jet%d_pe_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"pt_jet%d_pe" , j+1) , Form(
"pt_jet%d_pe_%s" , j+1,label.c_str()) ,1500 , 0 , 1500 );
226 h1_[Form(
"pt_jet%d_mb_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"pt_jet%d_mb" , j+1) , Form(
"pt_jet%d_mb_%s" , j+1,label.c_str()) ,1500 , 0 , 1500 );
227 h1_[Form(
"pt_jet%d_pb_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"pt_jet%d_pb" , j+1) , Form(
"pt_jet%d_pb_%s" , j+1,label.c_str()) ,1500 , 0 , 1500 );
228 h1_[Form(
"pt_jet%d_mbe_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"pt_jet%d_mbe" , j+1) , Form(
"pt_jet%d_mbe_%s" , j+1,label.c_str()) ,1500 , 0 , 1500 );
229 h1_[Form(
"pt_jet%d_pbe_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"pt_jet%d_pbe" , j+1) , Form(
"pt_jet%d_pbe_%s" , j+1,label.c_str()) ,1500 , 0 , 1500 );
232 h1_[Form(
"pt_jet%d_%s" , j+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d p_{T} [GeV]",j+1));
233 h1_[Form(
"eta_jet%d_%s" , j+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d #eta",j+1));
234 h1_[Form(
"phi_jet%d_%s" , j+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d #phi",j+1));
235 h1_[Form(
"btag_jet%d_%s", j+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d btag discriminator",j+1));
236 h1_[Form(
"btaglog_jet%d_%s", j+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d -ln(1-btag discriminator)",j+1));
237 h1_[Form(
"qglikelihood_jet%d_%s", j+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d q-g likelihood",j+1));
238 h1_[Form(
"nconstituents_jet%d_%s", j+1,label.c_str())]-> GetXaxis() -> SetTitle(Form(
"Jet %d n constituents",j+1));
240 if (
config_->btagAlgorithm() ==
"deepcsv")
242 h1_[Form(
"btag_light_jet%d_%s", j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_light_jet%d", j+1) , Form(
"btag_light_jet%d_%s", j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
243 h1_[Form(
"btag_c_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_c_jet%d" , j+1) , Form(
"btag_c_jet%d_%s" , j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
244 h1_[Form(
"btag_b_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_b_jet%d" , j+1) , Form(
"btag_b_jet%d_%s" , j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
245 h1_[Form(
"btag_bb_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_bb_jet%d" , j+1) , Form(
"btag_bb_jet%d_%s" , j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
246 h1_[Form(
"btag_cc_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_cc_jet%d" , j+1) , Form(
"btag_cc_jet%d_%s" , j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
248 if (
config_->btagAlgorithm() ==
"deepflavour" ||
config_->btagAlgorithm() ==
"deepjet" )
250 h1_[Form(
"btag_light_jet%d_%s", j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_light_jet%d", j+1) , Form(
"btag_light_jet%d_%s", j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
251 h1_[Form(
"btag_g_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_g_jet%d" , j+1) , Form(
"btag_g_jet%d_%s" , j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
252 h1_[Form(
"btag_c_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_c_jet%d" , j+1) , Form(
"btag_c_jet%d_%s" , j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
253 h1_[Form(
"btag_b_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_b_jet%d" , j+1) , Form(
"btag_b_jet%d_%s" , j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
254 h1_[Form(
"btag_bb_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_bb_jet%d" , j+1) , Form(
"btag_bb_jet%d_%s" , j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
255 h1_[Form(
"btag_lepb_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH1F>(Form(
"btag_lepb_jet%d" , j+1) , Form(
"btag_lepb_jet%d_%s" , j+1,label.c_str()) , nbins_btag, &bins_btag[0] );
259 h2_[Form(
"pt_eta_jet%d_%s" , j+1,label.c_str())] = std::make_shared<TH2F>(Form(
"pt_eta_jet%d" , j+1) , Form(
"pt_eta_jet%d_%s" , j+1,label.c_str()) ,1500 , 0 , 1500, 600, -3, 3 );
260 h2_[Form(
"pt_eta_jet%d_%s" , j+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d p_{T} [GeV]",j+1));
261 h2_[Form(
"pt_eta_jet%d_%s" , j+1,label.c_str())] -> GetYaxis() -> SetTitle(Form(
"Jet %d #eta",j+1));
268 h1_[Form(
"pt_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"pt_jet%d_%s" , j+1, flv.c_str()) , Form(
"pt_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) ,1500 , 0 , 1500 );
269 h1_[Form(
"eta_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"eta_jet%d_%s" , j+1, flv.c_str()) , Form(
"eta_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , 600 , -3, 3 );
270 h1_[Form(
"phi_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"phi_jet%d_%s" , j+1, flv.c_str()) , Form(
"phi_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , 360 , -180, 180 );
271 h1_[Form(
"btag_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_jet%d_%s" , j+1, flv.c_str()) , Form(
"btag_jet%d_%s_%s", j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
272 h1_[Form(
"qglikelihood_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"qglikelihood_jet%d_%s" , j+1, flv.c_str()) , Form(
"qglikelihood_jet%d_%s_%s", j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
273 h1_[Form(
"nconstituents_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"nconstituents_jet%d_%s" , j+1, flv.c_str()) , Form(
"nconstituents_jet%d_%s_%s", j+1,label.c_str(),flv.c_str()) , 200 , 0, 200 );
275 h1_[Form(
"pt_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d (%s) p_{T} [GeV]" , j+1, flv.c_str()));
276 h1_[Form(
"eta_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d (%s) #eta" , j+1, flv.c_str()));
277 h1_[Form(
"phi_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d (%s) #phi" , j+1, flv.c_str()));
278 h1_[Form(
"btag_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d (%s) btag discriminator" , j+1, flv.c_str()));
279 h1_[Form(
"qglikelihood_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d (%s) q-g likelihood" , j+1, flv.c_str()));
280 h1_[Form(
"nconstituents_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d (%s) n constituents" , j+1, flv.c_str()));
282 if (
config_->btagAlgorithm() ==
"deepcsv")
284 h1_[Form(
"btag_light_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_light_jet%d_%s", j+1,flv.c_str()) , Form(
"btag_light_jet%d_%s_%s", j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
285 h1_[Form(
"btag_c_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_c_jet%d_%s" , j+1,flv.c_str()) , Form(
"btag_c_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
286 h1_[Form(
"btag_b_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_b_jet%d_%s" , j+1,flv.c_str()) , Form(
"btag_b_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
287 h1_[Form(
"btag_bb_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_bb_jet%d_%s" , j+1,flv.c_str()) , Form(
"btag_bb_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
288 h1_[Form(
"btag_cc_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_cc_jet%d_%s" , j+1,flv.c_str()) , Form(
"btag_cc_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
290 if (
config_->btagAlgorithm() ==
"deepflavour" ||
config_->btagAlgorithm() ==
"deepjet" )
292 h1_[Form(
"btag_light_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_light_jet%d_%s", j+1,flv.c_str()) , Form(
"btag_light_jet%d_%s_%s", j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
293 h1_[Form(
"btag_g_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_g_jet%d_%s" , j+1,flv.c_str()) , Form(
"btag_g_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
294 h1_[Form(
"btag_c_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_c_jet%d_%s" , j+1,flv.c_str()) , Form(
"btag_c_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
295 h1_[Form(
"btag_b_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_b_jet%d_%s" , j+1,flv.c_str()) , Form(
"btag_b_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
296 h1_[Form(
"btag_bb_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_bb_jet%d_%s" , j+1,flv.c_str()) , Form(
"btag_bb_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
297 h1_[Form(
"btag_lepb_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH1F>(Form(
"btag_lepb_jet%d_%s" , j+1,flv.c_str()) , Form(
"btag_lepb_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) , nbins_btag, &bins_btag[0] );
300 h2_[Form(
"pt_eta_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] = std::make_shared<TH2F>(Form(
"pt_eta_jet%d_%s" , j+1,flv.c_str()) , Form(
"pt_eta_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str()) ,1500 , 0 , 1500, 600, -3, 3 );
301 h2_[Form(
"pt_eta_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d (%s) p_{T} [GeV]" , j+1,flv.c_str()));
302 h2_[Form(
"pt_eta_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> GetYaxis() -> SetTitle(Form(
"Jet %d (%s) #eta" ,j+1,flv.c_str()));
308 for (
int k = j+1; k < n && j < n; ++k )
310 h1_[Form(
"dptrel_jet%d%d_%s" , j+1,k+1,label.c_str())] = std::make_shared<TH1F>(Form(
"dptrel_jet%d%d" , j+1,k+1) , Form(
"dptrel_jet%d%d_%s" , j+1,k+1,label.c_str()) ,1000 , 0,1 );
311 h1_[Form(
"dpt_jet%d%d_%s" , j+1,k+1,label.c_str())] = std::make_shared<TH1F>(Form(
"dpt_jet%d%d" , j+1,k+1) , Form(
"dpt_jet%d%d_%s" , j+1,k+1,label.c_str()) ,1000 , 0,1000 );
312 h1_[Form(
"dr_jet%d%d_%s" , j+1,k+1,label.c_str())] = std::make_shared<TH1F>(Form(
"dr_jet%d%d" , j+1,k+1) , Form(
"dr_jet%d%d_%s" , j+1,k+1,label.c_str()) , 100 , 0, 5 );
313 h1_[Form(
"deta_jet%d%d_%s" , j+1,k+1,label.c_str())] = std::make_shared<TH1F>(Form(
"deta_jet%d%d", j+1,k+1) , Form(
"deta_jet%d%d_%s" , j+1,k+1,label.c_str()) , 100 , 0,10 );
314 h1_[Form(
"dphi_jet%d%d_%s" , j+1,k+1,label.c_str())] = std::make_shared<TH1F>(Form(
"dphi_jet%d%d", j+1,k+1) , Form(
"dphi_jet%d%d_%s" , j+1,k+1,label.c_str()) , 315 , 0, 3.15 );
315 h1_[Form(
"pt_jet%d%d_%s" , j+1,k+1,label.c_str())] = std::make_shared<TH1F>(Form(
"pt_jet%d%d" , j+1,k+1) , Form(
"pt_jet%d%d_%s" , j+1,k+1,label.c_str()) , 300 , 0,3000 );
316 h1_[Form(
"eta_jet%d%d_%s" , j+1,k+1,label.c_str())] = std::make_shared<TH1F>(Form(
"eta_jet%d%d" , j+1,k+1) , Form(
"eta_jet%d%d_%s" , j+1,k+1,label.c_str()) , 200 , -10,10 );
317 h1_[Form(
"phi_jet%d%d_%s" , j+1,k+1,label.c_str())] = std::make_shared<TH1F>(Form(
"phi_jet%d%d" , j+1,k+1) , Form(
"phi_jet%d%d_%s" , j+1,k+1,label.c_str()) , 360 , -180,180 );
318 h1_[Form(
"m_jet%d%d_%s" , j+1,k+1,label.c_str())] = std::make_shared<TH1F>(Form(
"m_jet%d%d" , j+1,k+1) , Form(
"m_jet%d%d_%s" , j+1,k+1,label.c_str()) ,3000 , 0,3000 );
320 h1_[Form(
"dptrel_jet%d%d_%s" , j+1,k+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"#DeltaP_{T}(Jet %d, Jet %d)/Jet %d p_{T}",j+1,k+1,j+1));
321 h1_[Form(
"dpt_jet%d%d_%s" , j+1,k+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"#Delta p_{T}(Jet %d, Jet %d) [GeV]",j+1,k+1));
322 h1_[Form(
"dr_jet%d%d_%s" , j+1,k+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"#DeltaR(Jet %d, Jet %d)",j+1,k+1));
323 h1_[Form(
"deta_jet%d%d_%s" , j+1,k+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"#Delta#eta(Jet %d, Jet %d)",j+1,k+1));
324 h1_[Form(
"dphi_jet%d%d_%s" , j+1,k+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"#Delta#phi(Jet %d, Jet %d)",j+1,k+1));
325 h1_[Form(
"pt_jet%d%d_%s" , j+1,k+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d + Jet %d p_{T} [GeV]",j+1,k+1));
326 h1_[Form(
"eta_jet%d%d_%s" , j+1,k+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d + Jet %d #eta",j+1,k+1));
327 h1_[Form(
"phi_jet%d%d_%s" , j+1,k+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d + Jet %d #phi",j+1,k+1));
328 h1_[Form(
"m_jet%d%d_%s" , j+1,k+1,label.c_str())] -> GetXaxis() -> SetTitle(Form(
"M_{%d%d} [GeV]",j+1,k+1));
334 for (
auto & flv2 : flavours_ )
336 h1_[Form(
"dptrel_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] = std::make_shared<TH1F>(Form(
"dptrel_jet%d%d_%s_%s" , j+1,k+1,flv1.c_str(),flv2.c_str()) , Form(
"dptrel_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str()) , 100 , 0,1 );
337 h1_[Form(
"dpt_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] = std::make_shared<TH1F>(Form(
"dpt_jet%d%d_%s_%s" , j+1,k+1,flv1.c_str(),flv2.c_str()) , Form(
"dpt_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str()) , 100 , 0,1000 );
338 h1_[Form(
"dr_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] = std::make_shared<TH1F>(Form(
"dr_jet%d%d_%s_%s" , j+1,k+1,flv1.c_str(),flv2.c_str()) , Form(
"dr_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str()) , 100 , 0, 5 );
339 h1_[Form(
"deta_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] = std::make_shared<TH1F>(Form(
"deta_jet%d%d_%s_%s" , j+1,k+1,flv1.c_str(),flv2.c_str()) , Form(
"deta_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str()) , 100 , 0,10 );
340 h1_[Form(
"dphi_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] = std::make_shared<TH1F>(Form(
"dphi_jet%d%d_%s_%s" , j+1,k+1,flv1.c_str(),flv2.c_str()) , Form(
"dphi_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str()) , 315 , 0, 3.15 );
341 h1_[Form(
"pt_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] = std::make_shared<TH1F>(Form(
"pt_jet%d%d_%s_%s" , j+1,k+1,flv1.c_str(),flv2.c_str()) , Form(
"pt_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str()) , 300 , 0,300 );
342 h1_[Form(
"eta_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] = std::make_shared<TH1F>(Form(
"eta_jet%d%d_%s_%s" , j+1,k+1,flv1.c_str(),flv2.c_str()) , Form(
"eta_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str()) , 200 , -10,10 );
343 h1_[Form(
"phi_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] = std::make_shared<TH1F>(Form(
"phi_jet%d%d_%s_%s" , j+1,k+1,flv1.c_str(),flv2.c_str()) , Form(
"phi_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str()) , 360 , -180,180 );
344 h1_[Form(
"m_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] = std::make_shared<TH1F>(Form(
"m_jet%d%d_%s_%s" , j+1,k+1,flv1.c_str(),flv2.c_str()) , Form(
"m_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str()) ,3000 , 0,300 );
346 h1_[Form(
"dptrel_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> GetXaxis() -> SetTitle(Form(
"#DeltaP_{T}(Jet %d (%s), Jet %d (%s))/Jet %d p_{T}",j+1,flv1.c_str(),k+1,flv2.c_str(),j+1));
347 h1_[Form(
"dpt_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> GetXaxis() -> SetTitle(Form(
"#Delta p_{T}(Jet %d (%s), Jet %d (%s)) [GeV]",j+1,flv1.c_str(),k+1,flv2.c_str()));
348 h1_[Form(
"dr_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> GetXaxis() -> SetTitle(Form(
"#DeltaR(Jet %d (%s), Jet %d (%s))",j+1,flv1.c_str(),k+1,flv2.c_str()));
349 h1_[Form(
"deta_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> GetXaxis() -> SetTitle(Form(
"#Delta#eta(Jet %d (%s), Jet %d (%s))",j+1,flv1.c_str(),k+1,flv2.c_str()));
350 h1_[Form(
"dphi_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> GetXaxis() -> SetTitle(Form(
"#Delta#phi(Jet %d (%s), Jet %d (%s))",j+1,flv1.c_str(),k+1,flv2.c_str()));
351 h1_[Form(
"pt_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d (%s) + Jet %d (%s) p_{T} [GeV]",j+1,flv1.c_str(),k+1,flv2.c_str()));
352 h1_[Form(
"eta_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d (%s) + Jet %d (%s) #eta",j+1,flv1.c_str(),k+1,flv2.c_str()));
353 h1_[Form(
"phi_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> GetXaxis() -> SetTitle(Form(
"Jet %d (%s) + Jet %d (%s) #phi",j+1,flv1.c_str(),k+1,flv2.c_str()));
354 h1_[Form(
"m_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> GetXaxis() -> SetTitle(Form(
"M_{%d%d} (%s)(%s) [GeV]",j+1,k+1,flv1.c_str(),flv2.c_str()));
369 if (
config_->btagAlgorithm() ==
"csvivf" ||
config_->btagAlgorithm() ==
"csv" ) { btag = jet.
btag(
"btag_csvivf"); }
370 else if (
config_->btagAlgorithm() ==
"deepcsv" ) { btag = jet.
btag(
"btag_deepb") + jet.
btag(
"btag_deepbb"); }
371 else if (
config_->btagAlgorithm() ==
"deepbvsall" ) { btag = jet.
btag(
"btag_deepbvsall"); }
372 else if (
config_->btagAlgorithm() ==
"deepflavour" ||
config_->btagAlgorithm() ==
"deepjet" ) { btag = jet.
btag(
"btag_dfb") + jet.
btag(
"btag_dfbb") + jet.
btag(
"btag_dflepb"); }
373 else { btag = -9999; }
380 if ( r >
config_->nJetsMin() )
return true;
383 float pt_min =
config_->jetsPtMin()[j];
385 float eta_max =
config_->jetsEtaMax()[j];
389 bool isgood =
this ->
selectionJet(r,pt_min,eta_max,pt_max);
396 if ( r >
config_->nJetsMin() )
return true;
401 std::string label = Form(
"Jet %d: pt > %5.1f GeV and |eta| < %3.1f",r,pt_min, eta_max );
402 if ( pt_max > pt_min )
403 label = Form(
"Jet %d: pt > %5.1f GeV and pt < %5.1f GeV and |eta| < %3.1f",r,pt_min, pt_max, eta_max );
408 if (
selectedJets_[j] -> pt() < pt_min && !(pt_min < 0) ) isgood =
false;
409 if ( fabs(
selectedJets_[j] -> eta()) > eta_max && !(eta_max < 0) ) isgood =
false;
410 if (
config_->jetsPtMax().size() > 0 )
412 if (
selectedJets_[j] -> pt() > pt_max && !(pt_max < pt_min ) ) isgood =
false;
423 if ( r1 >
config_->nJetsMin() || r2 >
config_->nJetsMin() || delta == 0 )
return true;
427 std::string label = Form(
"Deta(jet %d, jet %d) < %4.2f",r1,r2,fabs(delta));
429 label = Form(
"Deta(jet %d, jet %d) > %4.2f",r1,r2,fabs(delta));
448 if (
config_->jetsDetaMax() < 0 )
457 if (
config_->jetsDetaMin() < 0 )
471 if ( r1 >
config_->nJetsMin() || r2 >
config_->nJetsMin() || delta == 0 )
return true;
475 std::string label = Form(
"Dphi(jet %d, jet %d) < %4.2f",r1,r2,fabs(delta));
477 label = Form(
"Dphi(jet %d, jet %d) > %4.2f",r1,r2,fabs(delta));
495 if (
config_->jetsDphiMax() < 0 )
504 if (
config_->jetsDphiMin() < 0 )
519 if ( r1 >
config_->nJetsMin() || r2 >
config_->nJetsMin() || delta == 0 )
return true;
523 std::string label = Form(
"DR(jet %d, jet %d) < %4.2f",r1,r2,fabs(delta));
525 label = Form(
"DR(jet %d, jet %d) > %4.2f",r1,r2,fabs(delta));
567 if ( r1 >
config_->nJetsMin() || r2 >
config_->nJetsMin() || delta == 0 )
return true;
570 std::string label = Form(
"DpT(jet %d, jet %d)/jet %d pT < %4.2f",r1,r2,r1,fabs(delta));
572 label = Form(
"DpT(jet %d, jet %d)/jet %d pT > %4.2f",r1,r2,r1,fabs(delta));
591 if (
config_->jetsPtImbalanceMax() < 0 )
600 if (
config_->jetsPtImbalanceMin() < 0 )
629 std::string label = Form(
"JetId: %s",
config_->jetsId().c_str());
634 if ( ! (*jet)->id(
config_->jetsId() ) )
651 std::string label = Form(
"JetPileupId: %s",
config_->jetsPuId().c_str());
656 if ( ! (*jet)->pileupJetIdFullId(
config_->jetsPuId()) )
672 if (
config_->nJetsMin() < 0 )
return true;
677 if (
config_->nJetsMax() <= 0 )
679 label = Form(
"NJets >= %d",
config_->nJetsMin());
682 else if (
config_->nJets() >= 0 )
684 label = Form(
"NJets = %d",
config_->nJets());
689 if (
config_->nJetsMin() == 0 )
691 label = Form(
"NJets <= %d",
config_->nJetsMax());
696 label = Form(
"%d <= NJets <= %d",
config_->nJetsMin(),
config_->nJetsMax());
718 std::string label = Form(
"Jet %d: %s btag > %6.4f (%s)",r,
config_->btagAlgorithm().c_str(),
config_->btagWP(
config_->jetsBtagWP()[j]),
config_->jetsBtagWP()[j].c_str());
733 std::string label = Form(
"Jet %d: %s btag < %6.4f (%s) [reverse btag]",r,
config_->btagAlgorithm().c_str(),
config_->btagWP(
config_->revBtagWP()),
config_->revBtagWP().c_str());
748 if (
config_->triggerObjectsL1Jets() ==
"" &&
config_->triggerObjectsCaloJets() ==
"" &&
config_->triggerObjectsPFJets() ==
"")
return true;
749 if (
config_->nJetsMin() < 0 )
return true;
752 std::string label = Form(
"Jet %d: online jet match (deltaR: L1 < %4.3f, Calo < %4.3f, PF < %4.3f)",r,
config_-> triggerMatchL1JetsDrMax(),
config_-> triggerMatchCaloJetsDrMax(),
config_-> triggerMatchPFJetsDrMax());
756 std::string triggerObjectsL1Jets =
config_->triggerObjectsL1Jets();
757 if (
config_->triggerEmulateL1Jets() !=
"" &&
config_->triggerEmulateL1JetsNMin() > 0 )
758 triggerObjectsL1Jets =
config_->triggerEmulateL1Jets();
759 std::string triggerObjectsCaloJets =
config_->triggerObjectsCaloJets();
760 if (
config_->triggerEmulateCaloJets() !=
"" &&
config_->triggerEmulateCaloJetsNMin() > 0 )
761 triggerObjectsCaloJets =
config_->triggerEmulateCaloJets();
762 std::string triggerObjectsPFJets =
config_->triggerObjectsPFJets();
763 if (
config_->triggerEmulatePFJets() !=
"" &&
config_->triggerEmulatePFJetsNMin() > 0 )
764 triggerObjectsPFJets =
config_->triggerEmulatePFJets();
768 isgood = ( jet->matched(triggerObjectsL1Jets ) );
769 isgood = ( isgood && jet->matched(triggerObjectsCaloJets ) );
770 isgood = ( isgood && jet->matched(triggerObjectsPFJets ) );
780 if (
config_->triggerObjectsBJets() ==
"" )
return true;
783 std::string label = Form(
"Jet %d: online b jet match (deltaR < %4.3f)",r,
config_-> triggerMatchCaloBJetsDrMax());
788 isgood = ( jet->matched(
config_->triggerObjectsBJets()) );
799 this->
output()->cd(label.c_str());
805 h1_[Form(
"jet_hist_weight_%s",label.c_str())] -> Fill(0.,
weight_);
807 for (
int j = 0; j < n; ++j )
814 for (
int k = j+1; k < n && j < n; ++k )
820 h1_[Form(
"dr_jet%d%d_%s",j+1,k+1,label.c_str())] -> Fill(c_ij.
deltaR(),
weight_);
823 h1_[Form(
"pt_jet%d%d_%s",j+1,k+1,label.c_str())] -> Fill(c_ij.
pt(),
weight_);
824 h1_[Form(
"eta_jet%d%d_%s",j+1,k+1,label.c_str())] -> Fill(c_ij.
eta(),
weight_);
825 h1_[Form(
"phi_jet%d%d_%s",j+1,k+1,label.c_str())] -> Fill(c_ij.
phi()*180./acos(-1.),
weight_);
828 h1_[Form(
"m_jet%d%d_%s",j+1,k+1,label.c_str())] -> Fill(c_ij.
m(),
weight_);
832 h1_[Form(
"m_jet%d%d_%s",j+1,k+1,label.c_str())] -> Fill(0.,
weight_);
836 std::string flv1 =
"udsg";
837 std::string flv2 =
"udsg";
838 if ( !
config_ -> useJetsExtendedFlavour() )
852 h1_[Form(
"dr_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> Fill(c_ij.
deltaR(),
weight_);
853 h1_[Form(
"deta_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> Fill(c_ij.
deltaEta(),
weight_);
854 h1_[Form(
"dphi_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> Fill(fabs(
selectedJets_[j]->deltaPhi(*
selectedJets_[k])));
855 h1_[Form(
"pt_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> Fill(c_ij.
pt(),
weight_);
856 h1_[Form(
"eta_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> Fill(c_ij.
eta(),
weight_);
857 h1_[Form(
"phi_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> Fill(c_ij.
phi()*180./acos(-1.),
weight_);
858 h1_[Form(
"m_jet%d%d_%s_%s_%s" , j+1,k+1,label.c_str(),flv1.c_str(),flv2.c_str())] -> Fill(c_ij.
m(),
weight_);
866 cutflow(Form(
"*** Filling jets histograms - %s",label.c_str()));
872 if ( r < 1 || r >
n_hjets_ )
return;
878 if ( std::string(
h1_[
"cutflow"] -> GetXaxis()-> GetBinLabel(
cutflow_+1)) ==
"" )
879 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"*** Filling jet # %d histograms - %s",r, label.c_str()));
880 this->
output()->cd(label.c_str());
889 if (
config_-> histogramJetsRegionSplit() )
893 if ( eta < 0.0 && eta > -1.0 )
h1_[Form(
"pt_jet%d_mb_%s" , j+1,label.c_str())] -> Fill(
selectedJets_[j]->pt(),
weight_*sf);
894 if ( eta > 0.0 && eta < 1.0 )
h1_[Form(
"pt_jet%d_pb_%s" , j+1,label.c_str())] -> Fill(
selectedJets_[j]->pt(),
weight_*sf);
895 if ( eta < -1.0 && eta > -1.4 )
h1_[Form(
"pt_jet%d_mbe_%s" , j+1,label.c_str())] -> Fill(
selectedJets_[j]->pt(),
weight_*sf);
896 if ( eta > 1.0 && eta < 1.4 )
h1_[Form(
"pt_jet%d_pbe_%s" , j+1,label.c_str())] -> Fill(
selectedJets_[j]->pt(),
weight_*sf);
903 float mybtaglog = 1.e-7;
904 if ( mybtag > 0 ) mybtaglog = -log(1.-mybtag);
905 h1_[Form(
"btag_jet%d_%s",j+1,label.c_str())] -> Fill(mybtag,
weight_*sf);
906 h1_[Form(
"btaglog_jet%d_%s",j+1,label.c_str())] -> Fill(mybtaglog,
weight_*sf);
910 if (
config_->btagAlgorithm() ==
"deepcsv")
918 if (
config_->btagAlgorithm() ==
"deepflavour" ||
config_->btagAlgorithm() ==
"deepjet" )
933 std::string flv =
"udsg";
934 if ( !
config_ -> useJetsExtendedFlavour() )
946 h1_[Form(
"phi_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->phi()*180./acos(-1.),
weight_*sf);
948 h1_[Form(
"qglikelihood_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->qgLikelihood(),
weight_*sf);
949 h1_[Form(
"nconstituents_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->constituents(),
weight_*sf);
950 if (
config_->btagAlgorithm() ==
"deepcsv")
952 h1_[Form(
"btag_light_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_deeplight"),
weight_*sf);
953 h1_[Form(
"btag_c_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_deepc"),
weight_*sf);
954 h1_[Form(
"btag_b_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_deepb"),
weight_*sf);
955 h1_[Form(
"btag_bb_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_deepbb"),
weight_*sf);
956 h1_[Form(
"btag_cc_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_deepcc"),
weight_*sf);
958 if (
config_->btagAlgorithm() ==
"deepflavour" ||
config_->btagAlgorithm() ==
"deepjet")
960 h1_[Form(
"btag_light_jet%d_%s_%s", j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_dflight"),
weight_*sf);
961 h1_[Form(
"btag_g_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_dfg") ,
weight_*sf);
962 h1_[Form(
"btag_c_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_dfc") ,
weight_*sf);
963 h1_[Form(
"btag_b_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_dfb") ,
weight_*sf);
964 h1_[Form(
"btag_bb_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_dfbb") ,
weight_*sf);
965 h1_[Form(
"btag_lepb_jet%d_%s_%s" , j+1,label.c_str(),flv.c_str())] -> Fill(
selectedJets_[j]->
btag(
"btag_dflepb") ,
weight_*sf);
996 std::string label =
"WARNING: NO JER smearing (*** missing JER Info and/or GenJet collection ***)";
1002 label = Form(
"JER smearing (%s,%s)",bnpt.c_str(),bnsf.c_str());
1014 if ( !
config_->signalRegion() && r ==
config_->revBtagJet() )
return sf;
1017 std::string label = Form(
"Jet %d: btag SF applied (%s %s WP)",r,
config_->btagAlgorithm().c_str(),
config_->jetsBtagWP()[j].c_str());
1019 if (
config_->jetsBtagWP()[j] ==
"xxx" )
1020 label = Form(
"Jet %d: btag SF = 1 applied (%s %s WP)",r,
config_->btagAlgorithm().c_str(),
config_->jetsBtagWP()[j].c_str());
1022 if ( global_weight ||
config_->jetsBtagWP()[j] !=
"xxx" ) sf = this->
btagSF(r,
config_->jetsBtagWP()[j]).nominal;
1037 if ( !
config_->signalRegion() && r ==
config_->revBtagJet() )
return sf;
1039 if (
config_->jetsBtagWP()[j] !=
"xxx" ) sf = this->
btagSF(r,
config_->jetsBtagWP()[j]).nominal;
1046 if ( !
config_->bRegression() )
return;
1049 j -> applyBjetRegression();
1051 cutflow(
"b jet energy regression");
1056 if ( !
config_->bRegression() )
return;
1061 cutflow(Form(
"Jet %d: b jet energy regression",r));
1068 float min =
config_->massMin();
1069 float max =
config_->massMax();
1070 if ( min < 0. && max < 0. )
return true;
1073 if ( std::string(
h1_[
"cutflow"] -> GetXaxis()-> GetBinLabel(
cutflow_+1)) ==
"" )
1075 std::string label = Form(
"M(Jet %d + Jet %d)",r1,r2);
1078 if ( max > 0. && max > min ) label = Form(
"%5.1f GeV < %s < %5.1f GeV",min,label.c_str(),max);
1079 else label = Form(
"%s > %5.1f GeV",label.c_str(),min);
1083 label = Form(
"%s < %5.1f GeV",label.c_str(),max);
1086 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,label.c_str());
1092 float mass = c_j1j2.
m();
1094 if ( min > 0. && mass < min )
return false;
1095 if ( max > 0. && mass > max )
return false;
1106 if ( r1 == r2 )
return;
1128 std::string label = Form(
"Jet %d Q-G likelihood < %4.2f",r,fabs(cut));
1133 label = Form(
"Jet %d Q-G likelihood > %4.2f",r,fabs(cut));
1174 if (
config_->jetsBtagProbB().size() == 0 )
return true;
1176 float wp =
config_->jetsBtagProbB()[j];
1177 std::string algo =
config_->btagAlgorithm();
1178 if ( fabs(wp) > 1 )
return true;
1181 if ( std::string(
h1_[
"cutflow"] -> GetXaxis()-> GetBinLabel(
cutflow_+1)) ==
"" )
1184 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob b < %6.4f",r,algo.c_str(),fabs(wp)));
1186 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob b > %6.4f",r,algo.c_str(),fabs(wp)));
1190 if ( r >
config_->nBJetsMin() )
1192 std::cout <<
"* warning * - JetAnalyser::selectionBJetProbB(): given jet rank > nbjetsmin. Returning false! " << std::endl;
1197 if ( algo ==
"deepcsv" )
1202 if ( algo ==
"deepflavour" || algo ==
"deepjet" )
1218 if (
config_->jetsBtagProbBB().size() == 0 )
return true;
1220 float wp =
config_->jetsBtagProbBB()[j];
1221 std::string algo =
config_->btagAlgorithm();
1222 if ( fabs(wp) > 1 )
return true;
1225 if ( std::string(
h1_[
"cutflow"] -> GetXaxis()-> GetBinLabel(
cutflow_+1)) ==
"" )
1228 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob bb < %6.4f",r,algo.c_str(),fabs(wp)));
1230 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob bb > %6.4f",r,algo.c_str(),fabs(wp)));
1234 if ( r >
config_->nBJetsMin() )
1236 std::cout <<
"* warning * - JetAnalyser::selectionBJetProbBB(): given jet rank > nbjetsmin. Returning false! " << std::endl;
1241 if ( algo ==
"deepcsv" )
1246 if ( algo ==
"deepflavour" || algo ==
"deepjet" )
1259 if (
config_->jetsBtagProbLepB().size() == 0 )
return true;
1261 float wp =
config_->jetsBtagProbLepB()[j];
1262 std::string algo =
config_->btagAlgorithm();
1263 if ( fabs(wp) > 1 || algo ==
"deepcsv" )
return true;
1266 if ( std::string(
h1_[
"cutflow"] -> GetXaxis()-> GetBinLabel(
cutflow_+1)) ==
"" )
1269 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob lepb < %6.4f",r,algo.c_str(),fabs(wp)));
1271 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob lepb > %6.4f",r,algo.c_str(),fabs(wp)));
1275 if ( r >
config_->nBJetsMin() )
1277 std::cout <<
"* warning * - JetAnalyser::selectionBJetProbLepB(): given jet rank > nbjetsmin. Returning false! " << std::endl;
1282 if ( algo ==
"deepflavour" || algo ==
"deepjet" )
1297 if (
config_->jetsBtagProbC().size() == 0 )
return true;
1299 float wp =
config_->jetsBtagProbC()[j];
1300 std::string algo =
config_->btagAlgorithm();
1301 if ( fabs(wp) > 1 )
return true;
1304 if ( std::string(
h1_[
"cutflow"] -> GetXaxis()-> GetBinLabel(
cutflow_+1)) ==
"" )
1307 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob c < %6.4f",r,algo.c_str(),fabs(wp)));
1309 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob c > %6.4f",r,algo.c_str(),fabs(wp)));
1313 if ( r >
config_->nBJetsMin() )
1315 std::cout <<
"* warning * - JetAnalyser::selectionBJetProbC(): given jet rank > nbjetsmin. Returning false! " << std::endl;
1320 if ( algo ==
"deepcsv" )
1325 if ( algo ==
"deepflavour" || algo ==
"deepjet" )
1338 if (
config_->jetsBtagProbG().size() == 0 )
return true;
1340 float wp =
config_->jetsBtagProbG()[j];
1341 std::string algo =
config_->btagAlgorithm();
1342 if ( fabs(wp) > 1 || algo ==
"deepcsv" )
return true;
1345 if ( std::string(
h1_[
"cutflow"] -> GetXaxis()-> GetBinLabel(
cutflow_+1)) ==
"" )
1348 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob g < %6.4f",r,algo.c_str(),fabs(wp)));
1350 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob g > %6.4f",r,algo.c_str(),fabs(wp)));
1354 if ( r >
config_->nBJetsMin() )
1356 std::cout <<
"* warning * - JetAnalyser::selectionBJetProbG(): given jet rank > nbjetsmin. Returning false! " << std::endl;
1361 if ( algo ==
"deepflavour" || algo ==
"deepjet" )
1374 if (
config_->jetsBtagProbLight().size() == 0 )
return true;
1376 float wp =
config_->jetsBtagProbLight()[j];
1377 std::string algo =
config_->btagAlgorithm();
1378 if ( fabs(wp) > 1 )
return true;
1381 if ( std::string(
h1_[
"cutflow"] -> GetXaxis()-> GetBinLabel(
cutflow_+1)) ==
"" )
1384 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob light < %6.4f",r,algo.c_str(),fabs(wp)));
1386 h1_[
"cutflow"] -> GetXaxis()-> SetBinLabel(
cutflow_+1,Form(
"Jet %d: %s btag prob light > %6.4f",r,algo.c_str(),fabs(wp)));
1390 if ( r >
config_->nBJetsMin() )
1392 std::cout <<
"* warning * - JetAnalyser::selectionBJetProbLight(): given jet rank > nbjetsmin. Returning false! " << std::endl;
1397 if ( algo ==
"deepcsv" )
1399 if ( wp > 0 &&
selectedJets_[j]->
btag(
"btag_deeplight") > fabs(wp) )
return false;
1400 if ( wp < 0 &&
selectedJets_[j]->
btag(
"btag_deeplight") < fabs(wp) )
return false;
1402 if ( algo ==
"deepflavour" || algo ==
"deepjet" )
1404 if ( wp > 0 &&
selectedJets_[j]->
btag(
"btag_dflight") > fabs(wp) )
return false;
1405 if ( wp < 0 &&
selectedJets_[j]->
btag(
"btag_dflight") < fabs(wp) )
return false;