From 298997a3ff361b7e320e5cfaf5c692aa24b0f804 Mon Sep 17 00:00:00 2001 From: "tfarooque@ifae.es" <tfarooque@at304.pic.es> Date: Mon, 7 Oct 2019 17:02:32 +0200 Subject: [PATCH] Cleaning compilation warnings --- Root/VLQ_Analysis_Data2015.cxx | 2 +- Root/VLQ_Options.cxx | 16 ++--------- Root/VLQ_OutputData.cxx | 6 ++-- Root/VLQ_TruthManager.cxx | 51 ++++++++++------------------------ Root/VLQ_WeightManager.cxx | 13 +++++---- VLQAnalysis/VLQ_Options.h | 4 +-- 6 files changed, 30 insertions(+), 62 deletions(-) diff --git a/Root/VLQ_Analysis_Data2015.cxx b/Root/VLQ_Analysis_Data2015.cxx index cbec1ba..3fa2da2 100644 --- a/Root/VLQ_Analysis_Data2015.cxx +++ b/Root/VLQ_Analysis_Data2015.cxx @@ -803,7 +803,7 @@ bool VLQ_Analysis_Data2015::Begin(){ std::string str_id = ""; str_id += std::to_string(iRCJet); if(iRCJet==-1) str_id = "s"; - const bool DrawSyst = (iRCJet == 0) && otherVariables; + //const bool DrawSyst = (iRCJet == 0) && otherVariables; if(DrawReco){ m_outMngrHist -> AddStandardTH1( "RCjet"+str_id+"_pt", 50, 0, 1000, ";RC jet"+str_id+" p_{T} [GeV]" , false, &(m_outData -> o_rcjets), iRCJet, "Pt"); diff --git a/Root/VLQ_Options.cxx b/Root/VLQ_Options.cxx index 9f07b9f..727c7e7 100644 --- a/Root/VLQ_Options.cxx +++ b/Root/VLQ_Options.cxx @@ -20,8 +20,6 @@ m_recomputeBtagSF(false), m_usePileUpWeight(true), m_dumpHistos(true), m_dumpTree(false), -m_dumpHBSMTree(false), -m_dumpHPluslmTree(false), m_dumpOverlapTree(false), m_splitVLQDecays(false), m_doTruthAnalysis(false), @@ -87,8 +85,8 @@ m_minMetCutOneLep(0.), m_maxMetCutOneLep(-1.), m_minMetCutZeroLep(200.), m_maxMetCutZeroLep(-1.), -m_doRecoVLQ("pair"), m_maxLeptopDR(1.), +m_doRecoVLQ("pair"), m_btagOP("77"), m_btagAlg("MV2c10"), m_TRFCDIPath("xAODBTaggingEfficiency/13TeV/2016-20_7-13TeV-MC15-CDI-2017-01-31_v1.root"), @@ -111,8 +109,6 @@ OptionsBase(q) m_usePileUpWeight = q.m_usePileUpWeight; m_dumpHistos = q.m_dumpHistos; m_dumpTree = q.m_dumpTree; - m_dumpHBSMTree = q.m_dumpHBSMTree; - m_dumpHPluslmTree = q.m_dumpHPluslmTree; m_dumpOverlapTree = q.m_dumpOverlapTree; m_splitVLQDecays = q.m_splitVLQDecays; m_doTruthAnalysis = q.m_doTruthAnalysis; @@ -178,8 +174,8 @@ OptionsBase(q) m_maxMetCutOneLep = q.m_maxMetCutOneLep; m_minMetCutZeroLep = q.m_minMetCutZeroLep; m_maxMetCutZeroLep = q.m_maxMetCutZeroLep; - m_doRecoVLQ = q.m_doRecoVLQ; m_maxLeptopDR = q.m_maxLeptopDR; + m_doRecoVLQ = q.m_doRecoVLQ; m_btagOP = q.m_btagOP; m_btagAlg = q.m_btagAlg; m_TRFCDIPath = q.m_TRFCDIPath; @@ -221,10 +217,6 @@ bool VLQ_Options::IdentifyOption ( const std::string &argument, const std::strin m_dumpHistos = AnalysisUtils::BoolValue(temp_val, temp_arg); } else if( temp_arg.find("--DUMPTREE") != std::string::npos ){ m_dumpTree = AnalysisUtils::BoolValue(temp_val, temp_arg); - } else if( temp_arg.find("--DUMPHBSMTREE") != std::string::npos ){ - m_dumpHBSMTree = AnalysisUtils::BoolValue(temp_val, temp_arg); - } else if( temp_arg.find("--DUMPHPLUSTREE") != std::string::npos ){ - m_dumpHPluslmTree = AnalysisUtils::BoolValue(temp_val, temp_arg); } else if( temp_arg.find("--DUMPOVERLAPTREE") != std::string::npos ){ m_dumpOverlapTree = AnalysisUtils::BoolValue(temp_val, temp_arg); } else if( temp_arg.find("--SPLITVLQDECAYS") != std::string::npos ){ @@ -452,8 +444,8 @@ void VLQ_Options::PrintOptions(){ std::cout << " m_maxMetCutOneLep = " << m_maxMetCutOneLep << std::endl; std::cout << " m_minMetCutZeroLep = " << m_minMetCutZeroLep << std::endl; std::cout << " m_maxMetCutZeroLep = " << m_maxMetCutZeroLep << std::endl; - std::cout << " m_doRecoVLQ = " << m_doRecoVLQ << std::endl; std::cout << " m_maxLeptopDR = " << m_maxLeptopDR << std::endl; + std::cout << " m_doRecoVLQ = " << m_doRecoVLQ << std::endl; std::cout << " m_btagOP = " << m_btagOP << std::endl; std::cout << " m_btagAlg = " << m_btagAlg << std::endl; std::cout << " m_btagCollection = " << m_btagCollection << std::endl; @@ -476,8 +468,6 @@ void VLQ_Options::PrintOptions(){ std::cout << " m_applyMetSignificanceCut = " << m_applyMetSignificanceCut << std::endl; std::cout << " m_dumpHistos = " << m_dumpHistos << std::endl; std::cout << " m_dumpTree = " << m_dumpTree << std::endl; - std::cout << " m_dumpHBSMTree = " << m_dumpHBSMTree << std::endl; - std::cout << " m_dumpHPluslmTree = " << m_dumpHPluslmTree << std::endl; std::cout << " m_dumpOverlapTree = " << m_dumpOverlapTree << std::endl; std::cout << " m_applyTtbbCorrection = " << m_applyTtbbCorrection << std::endl; std::cout << " m_multipleVariablesWithUncertainties = " << m_multipleVariablesWithUncertainties << std::endl; diff --git a/Root/VLQ_OutputData.cxx b/Root/VLQ_OutputData.cxx index 52a4e8a..6fa2b1e 100644 --- a/Root/VLQ_OutputData.cxx +++ b/Root/VLQ_OutputData.cxx @@ -43,7 +43,7 @@ o_el(0),o_mu(0),o_lep(0),o_selLep(0), //MET o_AO_met(0), //Leptonic top and leptonic W -o_leptop(0), o_leptop_n(0), o_lepW(0), o_nu(0), +o_leptop_n(0), o_leptop(0), o_lepW(0), o_nu(0), //Semi-boosted hadronic top o_bW_hadtop(0), //Top-tagging truth studies variables @@ -58,8 +58,8 @@ o_dRmin_ebjets(0), o_dRmin_mubjets(0), o_mTbmin(0), o_mTbmin_lowb_3b(0), o_mTbmi o_jets40_n(0), o_centrality(0), o_mbb_leading_bjets(0), o_mbb_softest_bjets(0), o_J_lepton_invariant_mass(0), o_J_leadingb_invariant_mass(0), o_J_J_invariant_mass(0), o_dRaverage_bjetbjet(0),o_dRaverage_jetjet(0), //Low mass Hplus Variable -o_mbb_maxdR(0), o_dPhibb_leading_bjets(0), o_dPhibb_mindR(0), o_dPhibb_maxdR(0), o_dEtabb_mindR(0), o_dEtabb_maxdR(0), o_dEtabb_leading_bjets(0), o_mjj_leading_jets(0), -o_mjj_maxdR(0), o_mjj_mindR(0), o_dPhijj_leading_jets(0), o_dPhijj_mindR(0), o_dPhijj_maxdR(0), o_dEtajj_leading_jets(0), o_dEtajj_mindR(0), o_dEtajj_maxdR(0), +o_mbb_maxdR(0), o_dPhibb_leading_bjets(0), o_dPhibb_mindR(0), o_dPhibb_maxdR(0), o_dEtabb_leading_bjets(0), o_dEtabb_mindR(0), o_dEtabb_maxdR(0), o_mjj_leading_jets(0), +o_mjj_mindR(0), o_mjj_maxdR(0), o_dPhijj_leading_jets(0), o_dPhijj_mindR(0), o_dPhijj_maxdR(0), o_dEtajj_leading_jets(0), o_dEtajj_mindR(0), o_dEtajj_maxdR(0), //Event variable for selection o_rejectEvent(0), //VLQ type diff --git a/Root/VLQ_TruthManager.cxx b/Root/VLQ_TruthManager.cxx index 79badca..297b879 100644 --- a/Root/VLQ_TruthManager.cxx +++ b/Root/VLQ_TruthManager.cxx @@ -449,29 +449,29 @@ int VLQ_TruthManager::MatchHiggsPartonsToFatJets(AOVector &Fatjets)const{ if(!m_outData -> o_truth_all_particles){ std::cerr << "<!> Error in VLQ_TruthManager::MatchHiggsPartonsToFatJets(): no m_outData -> o_truth_all_particles vector found" << std::endl; return -1; - } - + } + std::vector<AOVector> VecHiggsDecays; VecHiggsDecays.clear(); - + //Fill vector of top decays for(AnalysisObject *particle : *m_outData -> o_truth_all_particles){ // Start loop through particles - + if(particle->GetMoment("absPdgId") != 25) continue; // Ignore particle if it is not Higgs - + if(!(particle->GetMoment("H_btag"))) continue; // Ignore Higgs if it did not decay into b and bbar - + AOVector HiggsDecay; HiggsDecay.push_back(m_outData -> o_truth_all_particles->at(particle->GetMoment("H_decay1_idx"))); HiggsDecay.push_back(m_outData -> o_truth_all_particles->at(particle->GetMoment("H_decay2_idx"))); - + VecHiggsDecays.push_back(HiggsDecay); - + } // End loop through particles - + int fjet_n = Fatjets.size(); - + int btag_Higgs_matched = 0; for(int fj_idx = 0; fj_idx < fjet_n; fj_idx++){ // Start loop through fat jets @@ -479,24 +479,17 @@ int VLQ_TruthManager::MatchHiggsPartonsToFatJets(AOVector &Fatjets)const{ bool HiggsIn = false; float HiggsPt = -99; for(int H_idx = 0; H_idx < (int)VecHiggsDecays.size(); H_idx++){ // Start loop through VecHiggsDecays elements - bool HiggsContained = true; for(int H_dp_idx = 0; H_dp_idx < (int)VecHiggsDecays.at(H_idx).size(); H_dp_idx++){ // Start loop through Higgs decay products - + float dR_tmp = Fatjets.at(fj_idx)->DeltaR(*VecHiggsDecays.at(H_idx).at(H_dp_idx)); - + if(dR_tmp < 1.0){ classification_code |= 1 << ((H_idx*3)+H_dp_idx); } - else{ - HiggsContained = false; - } - - } // End loop through Higgs decay products - - } // End loop through VecHiggsDecays elements - + } // End loop through VecHiggsDecays elements + } std::vector < double > ContainedHiggsPt; - + // Match jet with Higgs with lowest delta R for(AnalysisObject *particle : *m_outData -> o_truth_all_particles){ @@ -1695,20 +1688,6 @@ int VLQ_TruthManager::FillParticlesPartonsVectors(){ int VLQ_TruthManager::MatchJetsToBQuarks(AOVector& jetcol, const double DRMATCH){ - // Remove duplicates - for( auto bit = (m_outData->o_truth_all_bpartons)->begin(); bit != (m_outData->o_truth_all_bpartons)->end(); ++bit ){ - auto bquark = *bit; - //std::cout<<" pt : "<<bquark->Pt()<<" eta : "<<bquark->Eta()<<" phi : "<<bquark->Phi() << std::endl; - /* - for( auto bit_prime = bit+1; bit_prime != (m_outData->o_truth_all_bpartons)->end(); ){ - if(*bit == *bit_prime){ bit_prime = (m_outData->o_truth_all_bpartons)->erase( bit_prime ); } - else{ ++bit_prime; } - } - */ - } - - - //std::cout << "nbpartons = " << (m_outData->o_truth_all_bpartons)->size() << "nbtruth = " << (m_outData->o_truth_all_b)->size() << std::endl; for( AnalysisObject* jet : jetcol ){ int nmatch_bpartons = 0; diff --git a/Root/VLQ_WeightManager.cxx b/Root/VLQ_WeightManager.cxx index 6a64b47..7917ac0 100644 --- a/Root/VLQ_WeightManager.cxx +++ b/Root/VLQ_WeightManager.cxx @@ -112,7 +112,7 @@ void VLQ_WeightManager::Init( std::map < int, Selection* >* selection_tree ){ // ttbar-related // if( m_vlq_outData -> o_is_ttbar ){ - + /* ////////////////////////////////////// // ttbar NNLO reweighting ////////////////////////////////////// @@ -133,10 +133,10 @@ void VLQ_WeightManager::Init( std::map < int, Selection* >* selection_tree ){ if( m_vlq_opt -> InputFile() . find(".407038.") != std::string::npos ) dsid = 410004; if( m_vlq_opt -> InputFile() . find(".407039.") != std::string::npos ) dsid = 410004; if( m_vlq_opt -> InputFile() . find(".407040.") != std::string::npos ) dsid = 410004; - //m_nnlo_rw = new NNLOReweighter( dsid, (std::string(getenv("ROOTCOREBIN"))+"/data/NNLOReweighter/") ); - //m_nnlo_rw -> Init(); + m_nnlo_rw = new NNLOReweighter( dsid, (std::string(getenv("ROOTCOREBIN"))+"/data/NNLOReweighter/") ); + m_nnlo_rw -> Init(); } - + */ ////////////////////////////////////// // tt+bb reweighting tool ////////////////////////////////////// @@ -597,9 +597,10 @@ bool VLQ_WeightManager::SetTtbarFractionWeight(){ //______________________________________________________________________________ // bool VLQ_WeightManager::SetNNLOWeight( const double topPt ){ + if( m_vlq_outData -> o_is_ttbar && m_vlq_opt->RecomputeTtbarNNLOCorrection()){ - const double result = 1.; //m_nnlo_rw->GetExtendedTopPtWeight( topPt * 1000.) ; - std::cout << "result = " << result << std::endl; + const double result = 1.; //m_nnlo_rw->GetExtendedTopPtWeight( topPt * 1000.) ; + //std::cout << "result = " << result << std::endl; SetNominalComponent("weight_ttbar_NNLO_1L", result) ; } diff --git a/VLQAnalysis/VLQ_Options.h b/VLQAnalysis/VLQ_Options.h index 68c8a1f..d5f846b 100644 --- a/VLQAnalysis/VLQ_Options.h +++ b/VLQAnalysis/VLQ_Options.h @@ -39,8 +39,6 @@ public: inline bool UsePileUpWeight() const { return m_usePileUpWeight; } inline bool DumpHistos() const { return m_dumpHistos; } inline bool DumpTree() const { return m_dumpTree; } - inline bool DumpHBSMTree() const { return m_dumpHBSMTree; } - inline bool DumpHPluslmTree() const { return m_dumpHPluslmTree; } inline bool DumpOverlapTree() const { return m_dumpOverlapTree; } inline bool SplitVLQDecays() const { return m_splitVLQDecays; } inline bool DoTruthAnalysis() const { return m_doTruthAnalysis; } @@ -135,7 +133,7 @@ protected: private: bool m_useLeptonsSF, m_useBtagSF, m_recomputeBtagSF, m_usePileUpWeight; - bool m_dumpHistos, m_dumpTree, m_dumpHBSMTree, m_dumpOverlapTree, m_dumpHPluslmTree; + bool m_dumpHistos, m_dumpTree, m_dumpOverlapTree; bool m_splitVLQDecays; bool m_doTruthAnalysis; bool m_doTRF, m_recomputeTRF; -- GitLab