Skip to content

Commit

Permalink
Merge pull request cms-sw#16 from kdlong/WmassNanoProd_10_6_26
Browse files Browse the repository at this point in the history
Wmass nano prod 10 6 26
  • Loading branch information
kdlong authored Jun 17, 2022
2 parents 3b7bd65 + 7f66633 commit 645f845
Show file tree
Hide file tree
Showing 197 changed files with 9,975 additions and 3,395 deletions.
14 changes: 7 additions & 7 deletions CommonTools/MVAUtils/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<use name="CondFormats/EgammaObjects"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="CondFormats/DataRecord"/>
<use name="roottmva"/>
<use name="tinyxml2"/>

<use name="CommonTools/Utils"/>
<use name="CondFormats/EgammaObjects"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="CondFormats/DataRecord"/>
<use name="roottmva"/>
<use name="tinyxml2"/>
<export>
<lib name="1"/>
</export>
4 changes: 4 additions & 0 deletions CommonTools/MVAUtils/bin/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<use name="CommonTools/MVAUtils"/>

<bin name="convertXMLToGBRForestROOT" file="convertXMLToGBRForestROOT.cc">
</bin>
34 changes: 34 additions & 0 deletions CommonTools/MVAUtils/bin/convertXMLToGBRForestROOT.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include "CommonTools/MVAUtils/interface/GBRForestTools.h"

#include "TFile.h"

#include <boost/filesystem.hpp>
#include <iostream>

int main(int argc, char **argv) {
if (argc != 3) {
std::cout << "Please pass a (gzipped) BDT weight file and a name for the output ROOT file." << std::endl;
return 1;
}

char *inputFileName = argv[1];
char *outputFileName = argv[2];

if (!boost::filesystem::exists(inputFileName)) {
std::cout << "Input file " << inputFileName << " does not exists." << std::endl;
return 1;
}

if (boost::filesystem::exists(outputFileName)) {
std::cout << "Output file " << outputFileName << " already exists." << std::endl;
return 1;
}

auto gbrForest = createGBRForest(inputFileName);
std::cout << "Read GBRForest " << inputFileName << " successfully." << std::endl;

TFile{outputFileName, "RECREATE"}.WriteObject(gbrForest.get(), "gbrForest");
std::cout << "GBRForest written to " << outputFileName << " successfully." << std::endl;

return 0;
}
12 changes: 12 additions & 0 deletions CommonTools/MVAUtils/src/GBRForestTools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "TFile.h"

#include <cstdio>
#include <cstdlib>
#include <RVersion.h>
Expand Down Expand Up @@ -117,6 +119,16 @@ namespace {
}

std::unique_ptr<GBRForest> init(const std::string& weightsFileFullPath, std::vector<std::string>& varNames) {
//
// Load weights file, for ROOT file
//
if (reco::details::hasEnding(weightsFileFullPath, ".root")) {
TFile gbrForestFile(weightsFileFullPath.c_str());
std::unique_ptr<GBRForest> up(reinterpret_cast<GBRForest*>(gbrForestFile.Get("gbrForest")));
gbrForestFile.Close("nodelete");
return up;
}

//
// Load weights file, for gzipped or raw xml file
//
Expand Down
66 changes: 34 additions & 32 deletions Configuration/AlCa/python/autoCond.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@

### NEW KEYS ###
# GlobalTag for MC production with perfectly aligned and calibrated detector for Run1
'run1_design' : '106X_mcRun1_design_v3',
'run1_design' : '106X_mcRun1_design_v4',
# GlobalTag for MC production (pp collisions) with realistic alignment and calibrations for Run1
'run1_mc' : '106X_mcRun1_realistic_v3',
'run1_mc' : '106X_mcRun1_realistic_v4',
# GlobalTag for MC production (Heavy Ions collisions) with realistic alignment and calibrations for Run1
'run1_mc_hi' : '106X_mcRun1_HeavyIon_v3',
'run1_mc_hi' : '106X_mcRun1_HeavyIon_v4',
# GlobalTag for MC production (p-Pb collisions) with realistic alignment and calibrations for Run1
'run1_mc_pa' : '106X_mcRun1_pA_v3',
'run1_mc_pa' : '106X_mcRun1_pA_v4',
# GlobalTag for MC production with pessimistic alignment and calibrations for Run2
'run2_mc_50ns' : '106X_mcRun2_startup_v4',
'run2_mc_50ns' : '106X_mcRun2_startup_v5',
# GlobalTag for MC production (L1 Trigger Stage1) with starup-like alignment and calibrations for Run2, L1 trigger in Stage1 mode
'run2_mc_l1stage1' : '106X_mcRun2_asymptotic_l1stage1_v4',
'run2_mc_l1stage1' : '106X_mcRun2_asymptotic_l1stage1_v5',
# GlobalTag for MC production with perfectly aligned and calibrated detector for Run2
'run2_design' : '106X_mcRun2_design_v7',
'run2_design' : '106X_mcRun2_design_v8',
#GlobalTag for MC production with optimistic alignment and calibrations for 2016, prior to VFP change
'run2_mc_pre_vfp' : '106X_mcRun2_asymptotic_preVFP_v9',
'run2_mc_pre_vfp' : '106X_mcRun2_asymptotic_preVFP_v11',
#GlobalTag for MC production with optimistic alignment and calibrations for 2016, after VFP change
'run2_mc' : '106X_mcRun2_asymptotic_v15',
'run2_mc' : '106X_mcRun2_asymptotic_v17',
# GlobalTag for MC production (cosmics) with starup-like alignment and calibrations for Run2, Strip tracker in peak mode
'run2_mc_cosmics' : '106X_mcRun2cosmics_asymptotic_deco_v2',
'run2_mc_cosmics' : '106X_mcRun2cosmics_asymptotic_deco_v3',
# GlobalTag for MC production (Heavy Ions collisions) with optimistic alignment and calibrations for Run2
'run2_mc_hi' : '106X_mcRun2_HeavyIon_v4',
'run2_mc_hi' : '106X_mcRun2_HeavyIon_v5',
# GlobalTag for MC production (p-Pb collisions) with realistic alignment and calibrations for Run2
'run2_mc_pa' : '106X_mcRun2_pA_v5',
'run2_mc_pa' : '106X_mcRun2_pA_v6',
# GlobalTag for Run1 data reprocessing
'run1_data' : '106X_dataRun2_v32',
'run1_data' : '106X_dataRun2_v35',
# GlobalTag for Run2 data reprocessing
'run2_data' : '106X_dataRun2_v32',
'run2_data' : '106X_dataRun2_v35',
# GlobalTag for Run2 data relvals: allows customization to run with fixed L1 menu
'run2_data_relval' : '106X_dataRun2_relval_v30',
'run2_data_relval' : '106X_dataRun2_relval_v33',
# GlobalTag for Run2 data 2018B relvals only: HEM-15-16 fail
'run2_data_promptlike_HEfail' : '106X_dataRun2_PromptLike_HEfail_v13',
'run2_data_promptlike_HEfail' : '106X_dataRun2_PromptLike_HEfail_v14',
# GlobalTag for Run2 data 2016H relvals only: Prompt Conditions + fixed L1 menu (to be removed)
'run2_data_promptlike' : '106X_dataRun2_PromptLike_v14',
'run2_data_promptlike_hi' : '106X_dataRun2_PromptLike_HI_v14',
'run2_data_promptlike' : '106X_dataRun2_PromptLike_v15',
'run2_data_promptlike_hi' : '106X_dataRun2_PromptLike_HI_v15',
# GlobalTag for Run1 HLT: it points to the online GT
'run1_hlt' : '101X_dataRun2_HLT_frozen_v9',
# GlobalTag for Run2 HLT: it points to the online GT
Expand All @@ -46,33 +46,35 @@
# GlobalTag for Run2 HLT for HI (not 2018 HI): it points to the online GT
'run2_hlt_hi' : '101X_dataRun2_HLTHI_frozen_v9',
# GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2017 (and 0,0,~0-centred beamspot)
'phase1_2017_design' : '106X_mc2017_design_IdealBS_v5',
'phase1_2017_design' : '106X_mc2017_design_IdealBS_v6',
# GlobalTag for MC production with realistic conditions for Phase1 2017 detector
'phase1_2017_realistic' : '106X_mc2017_realistic_v8',
'phase1_2017_realistic' : '106X_mc2017_realistic_v9',
# GlobalTag for MC production with realistic conditions for Phase1 2017 detector, for PP reference run
'phase1_2017_realistic_ppref' : '106X_mc2017_realistic_forppRef5TeV_v3',
# GlobalTag for MC production (cosmics) with realistic alignment and calibrations for Phase1 2017 detector, Strip tracker in DECO mode
'phase1_2017_cosmics' : '106X_mc2017cosmics_realistic_deco_v3',
'phase1_2017_cosmics' : '106X_mc2017cosmics_realistic_deco_v4',
# GlobalTag for MC production (cosmics) with realistic alignment and calibrations for Phase1 2017 detector, Strip tracker in PEAK mode
'phase1_2017_cosmics_peak' : '106X_mc2017cosmics_realistic_peak_v3',
'phase1_2017_cosmics_peak' : '106X_mc2017cosmics_realistic_peak_v4',
# GlobalTag for MC production with perfectly aligned and calibrated detector for full Phase1 2018 (and 0,0,0-centred beamspot)
'phase1_2018_design' : '106X_upgrade2018_design_v6',
'phase1_2018_design' : '106X_upgrade2018_design_v8',
# GlobalTag for MC production with realistic conditions for full Phase1 2018 detector
'phase1_2018_realistic' : '106X_upgrade2018_realistic_v15',
'phase1_2018_realistic' : '106X_upgrade2018_realistic_v16',
# GlobalTag for MC production with realistic conditions for full Phase1 2018 detector for Heavy Ion
'phase1_2018_realistic_hi' : '106X_upgrade2018_realistic_HI_v6',
'phase1_2018_realistic_hi' : '106X_upgrade2018_realistic_HI_v7',
# GlobalTag for MC production with realistic conditions for full Phase1 2018 detector: HEM-15-16 fail
'phase1_2018_realistic_HEfail' : '106X_upgrade2018_realistic_HEfail_v15',
'phase1_2018_realistic_HEfail' : '106X_upgrade2018_realistic_HEfail_v16',
# GlobalTag for MC production (cosmics) with realistic conditions for full Phase1 2018 detector, Strip tracker in DECO mode
'phase1_2018_cosmics' : '106X_upgrade2018cosmics_realistic_deco_v12',
'phase1_2018_cosmics' : '106X_upgrade2018cosmics_realistic_deco_v13',
# GlobalTag for MC production (cosmics) with realistic conditions for full Phase1 2018 detector, Strip tracker in PEAK mode
'phase1_2018_cosmics_peak' : '106X_upgrade2018cosmics_realistic_peak_v12',
'phase1_2018_cosmics_peak' : '106X_upgrade2018cosmics_realistic_peak_v13',
# GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2021
'phase1_2021_design' : '106X_upgrade2021_design_v5', # GT containing design conditions for Phase1 2021
'phase1_2021_design' : '106X_upgrade2021_design_v6', # GT containing design conditions for Phase1 2021
# GlobalTag for MC production with realistic conditions for Phase1 2021
'phase1_2021_realistic' : '106X_upgrade2021_realistic_v11', # GT containing realistic conditions for Phase1 2021
'phase1_2021_realistic' : '106X_upgrade2021_realistic_v12', # GT containing realistic conditions for Phase1 2021
# GlobalTag for MC production (cosmics) with realistic conditions for Phase1 2021, Strip tracker in DECO mode
'phase1_2021_cosmics' : '106X_upgrade2021cosmics_realistic_deco_v4',
'phase1_2021_cosmics' : '106X_upgrade2021cosmics_realistic_deco_v5',
# GlobalTag for MC production with realistic conditions for Phase2 2023
'phase2_realistic' : '106X_upgrade2023_realistic_v5'
'phase2_realistic' : '106X_upgrade2023_realistic_v6'
}

aliases = {
Expand Down
3 changes: 3 additions & 0 deletions Configuration/Eras/python/Modifier_run2_nanoAOD_106Xv2_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FWCore.ParameterSet.Config as cms

run2_nanoAOD_106Xv2 = cms.Modifier()
3 changes: 3 additions & 0 deletions Configuration/Eras/python/Modifier_run2_nanoAOD_devel_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FWCore.ParameterSet.Config as cms

run2_nanoAOD_devel = cms.Modifier()

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import FWCore.ParameterSet.Config as cms

# Settings from $HERWIGPATH/LHE.in

herwig7LHECommonSettingsBlock = cms.PSet(
hw_lhe_common_settings = cms.vstring(
'read snippets/PPCollider.in',
'cd /Herwig/Generators',
'cd /Herwig/EventHandlers',
'library LesHouches.so',
'create ThePEG::LesHouchesEventHandler LesHouchesHandler',
'set LesHouchesHandler:PartonExtractor /Herwig/Partons/PPExtractor',
'set LesHouchesHandler:CascadeHandler /Herwig/Shower/ShowerHandler',
'set LesHouchesHandler:DecayHandler /Herwig/Decays/DecayHandler',
'set LesHouchesHandler:HadronizationHandler /Herwig/Hadronization/ClusterHadHandler',

# set the weight option (e.g. for MC@NLO)
'set LesHouchesHandler:WeightOption VarNegWeight',
'set LesHouchesHandler:Weighted On',

'set /Herwig/Generators/EventGenerator:EventHandler /Herwig/EventHandlers/LesHouchesHandler',
'create ThePEG::Cuts /Herwig/Cuts/NoCuts',
'create ThePEG::LHAPDF /Herwig/Partons/LHAPDF ThePEGLHAPDF.so',
Expand All @@ -30,6 +32,10 @@
'set LesHouchesReader:MomentumTreatment RescaleEnergy',
'set LesHouchesReader:PDFA /Herwig/Partons/LHAPDF',
'set LesHouchesReader:PDFB /Herwig/Partons/LHAPDF',
'insert LesHouchesHandler:LesHouchesReaders 0 LesHouchesReader'
'insert LesHouchesHandler:LesHouchesReaders 0 LesHouchesReader',
'set /Herwig/Shower/ShowerHandler:MaxPtIsMuF Yes',
'set /Herwig/Shower/ShowerHandler:RestrictPhasespace Yes',
'set /Herwig/Shower/PartnerFinder:PartnerMethod Random',
'set /Herwig/Shower/PartnerFinder:ScaleChoice Partner'
)
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import FWCore.ParameterSet.Config as cms

# Settings from $HERWIGPATH/LHE-MCatNLO.in, should be used together with the Herwig7LHECommonSettings

herwig7LHEMG5aMCatNLOSettingsBlock = cms.PSet(
hw_lhe_MG5aMCatNLO_settings = cms.vstring(
'set /Herwig/Shower/KinematicsReconstructor:InitialInitialBoostOption LongTransBoost',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import FWCore.ParameterSet.Config as cms

# Settings from $HERWIGPATH/LHE-POWHEG.in, should be used together with the Herwig7LHECommonSettings

herwig7LHEPowhegSettingsBlock = cms.PSet(
hw_lhe_Powheg_settings = cms.vstring(
hw_lhe_powheg_settings = cms.vstring(
'set /Herwig/Shower/ShowerHandler:MaxPtIsMuF Yes',
'set /Herwig/Shower/ShowerHandler:RestrictPhasespace Yes',
'set /Herwig/Shower/PartnerFinder:PartnerMethod Random',
'set /Herwig/Shower/PartnerFinder:ScaleChoice Partner',
'set /Herwig/Shower/GtoQQbarSplitFn:AngularOrdered Yes',
'set /Herwig/Shower/GammatoQQbarSplitFn:AngularOrdered Yes',
'set /Herwig/Particles/t:NominalMass 172.5'
)
)
Loading

0 comments on commit 645f845

Please sign in to comment.