From a7c90686cd5892128939f56d99cabc978e745652 Mon Sep 17 00:00:00 2001 From: mmusich Date: Mon, 26 Feb 2024 11:41:09 +0100 Subject: [PATCH 1/7] minimal fixes to make Zmumumerge run in unit tests --- Alignment/OfflineValidation/bin/Zmumumerge.cc | 76 ++++++++++++++----- .../OfflineValidation/src/FitWithRooFit.cc | 16 +++- 2 files changed, 69 insertions(+), 23 deletions(-) diff --git a/Alignment/OfflineValidation/bin/Zmumumerge.cc b/Alignment/OfflineValidation/bin/Zmumumerge.cc index 03eb44f9ca9a5..a56dbb39483ca 100644 --- a/Alignment/OfflineValidation/bin/Zmumumerge.cc +++ b/Alignment/OfflineValidation/bin/Zmumumerge.cc @@ -75,13 +75,25 @@ class FitOut { }; FitOut ZMassBinFit_OldTool(TH1D* th1d_input, TString s_name = "zmumu_fitting", TString output_path = "./") { - double xMin(75), xMax(105), xMean(91); - double sigma = 2; - double sigmaMin = 0.1; - double sigmaMax = 10; + // silence messages + RooMsgService::instance().setGlobalKillBelow(RooFit::FATAL); + + double xMean = 91.1876; + double xMin = th1d_input->GetXaxis()->GetXmin(); + double xMax = th1d_input->GetXaxis()->GetXmax(); + + double sigma(2.); + double sigmaMin(0.1); + double sigmaMax(10.); + + double sigma2(0.1); + double sigma2Min(0.); + double sigma2Max(10.); + + std::unique_ptr fitter = std::make_unique(); + + bool useChi2(false); - FitWithRooFit* fitter = new FitWithRooFit(); - double sigma2(0.1), sigma2Min(0.), sigma2Max(10.), useChi2(false); fitter->useChi2_ = useChi2; fitter->initMean(xMean, xMin, xMax); fitter->initSigma(sigma, sigmaMin, sigmaMax); @@ -89,8 +101,6 @@ FitOut ZMassBinFit_OldTool(TH1D* th1d_input, TString s_name = "zmumu_fitting", T fitter->initAlpha(1.5, 0.05, 10.); fitter->initN(1, 0.01, 100.); fitter->initFGCB(0.4, 0., 1.); - - fitter->initMean(91.1876, xMin, xMax); fitter->initGamma(2.4952, 0., 10.); fitter->gamma()->setConstant(kTRUE); fitter->initMean2(0., -20., 20.); @@ -109,6 +119,7 @@ FitOut ZMassBinFit_OldTool(TH1D* th1d_input, TString s_name = "zmumu_fitting", T fitter->initA4(0., -10., 10.); fitter->initA5(0., -10., 10.); fitter->initA6(0., -10., 10.); + TCanvas* c1 = new TCanvas(); c1->Clear(); c1->SetLeftMargin(0.15); @@ -121,9 +132,10 @@ FitOut ZMassBinFit_OldTool(TH1D* th1d_input, TString s_name = "zmumu_fitting", T FitOut fitRes( fitter->mean()->getValV(), fitter->mean()->getError(), fitter->sigma()->getValV(), fitter->sigma()->getError()); + return fitRes; } -void Draw_th1d(TH1D* th1d_input, TString variable_name) { +void Draw_th1d(TH1D* th1d_input, TString variable_name, TString output_path) { TCanvas* c = new TCanvas(); c->cd(); gStyle->SetOptStat(0); @@ -137,12 +149,13 @@ void Draw_th1d(TH1D* th1d_input, TString variable_name) { th1d_input->GetYaxis()->SetTitle("Mass mean (GeV)"); th1d_input->Draw(); tlxg->DrawLatexNDC(0.2, 0.8, Form("%s", GT.Data())); - c->Print(Form("%s/fitResultPlot/mass_VS_%s.pdf", GT.Data(), variable_name.Data())); + c->Print(Form("%s/fitResultPlot/mass_VS_%s.pdf", output_path.Data(), variable_name.Data())); } const static int variables_number = 8; const TString tstring_variables_name[variables_number] = { "CosThetaCS", "DeltaEta", "EtaMinus", "EtaPlus", "PhiCS", "PhiMinus", "PhiPlus", "Pt"}; + void Fitting_GetMassmeanVSvariables(TString inputfile_name, TString output_path) { TH2D* th2d_mass_variables[variables_number]; TFile* inputfile = TFile::Open(inputfile_name.Data()); @@ -154,7 +167,7 @@ void Fitting_GetMassmeanVSvariables(TString inputfile_name, TString output_path) gSystem->Exec(Form("mkdir -p %s", output_path.Data())); gSystem->Exec(Form("mkdir -p %s/fitResultPlot", output_path.Data())); - TFile* outpufile = TFile::Open(Form("%s/fitting_output.root", output_path.Data()), "recreate"); + TFile* outputfile = TFile::Open(Form("%s/fitting_output.root", output_path.Data()), "RECREATE"); TH1D* th1d_variables_meanmass[variables_number]; TH1D* th1d_variables_entries[variables_number]; const int variables_rebin[variables_number] = {1, 1, 1, 1, 1, 1, 1, 1}; @@ -169,8 +182,8 @@ void Fitting_GetMassmeanVSvariables(TString inputfile_name, TString output_path) if (i == 7 and j > 25) { continue; } - cout << "th1d_variables_meanmass[i]->GetNbinsX()=" << th1d_variables_meanmass[i]->GetNbinsX() << endl; - cout << "th2d_mass_variables[i]->GetNbinsY()=" << th2d_mass_variables[i]->GetNbinsY() << endl; + //cout << __LINE__ << " th1d_variables_meanmass[i]->GetNbinsX()=" << th1d_variables_meanmass[i]->GetNbinsX() << endl; + //cout << __LINE__ << " th2d_mass_variables[i]->GetNbinsY()=" << th2d_mass_variables[i]->GetNbinsY() << endl; th1d_variables_meanmass[i]->SetBinContent(j, 0); th1d_variables_meanmass[i]->SetBinError(j, 0); @@ -181,25 +194,39 @@ void Fitting_GetMassmeanVSvariables(TString inputfile_name, TString output_path) TString s_name = Form("%s_%d", tstring_variables_name[i].Data(), j); FitOut fitR = ZMassBinFit_OldTool(th1d_i, s_name, output_path); + th1d_variables_meanmass[i]->SetBinContent(j, fitR.mean); th1d_variables_meanmass[i]->SetBinError(j, fitR.mean_err); } + th1d_variables_meanmass[i]->GetXaxis()->SetRangeUser(xaxis_range[i][0], xaxis_range[i][1]); - Draw_th1d(th1d_variables_meanmass[i], tstring_variables_name[i]); - outpufile->cd(); + Draw_th1d(th1d_variables_meanmass[i], tstring_variables_name[i], output_path); + outputfile->cd(); th1d_variables_meanmass[i]->Write(th1d_name); TString th1d_name_entries = Form("th1d_entries_%s", tstring_variables_name[i].Data()); th1d_variables_entries[i] = th2d_mass_variables[i]->ProjectionY(th1d_name_entries, 0, -1, "d"); th1d_variables_entries[i]->GetXaxis()->SetTitle(tstring_variables_name[i].Data()); th1d_variables_entries[i]->GetYaxis()->SetTitle("Entry"); - outpufile->cd(); + outputfile->cd(); th1d_variables_entries[i]->Write(th1d_name_entries); } - outpufile->Write(); - outpufile->Close(); - delete outpufile; + if (outputfile->IsOpen()) { + // Get the path (current working directory) in which the file is going to be written + const char* path = outputfile->GetPath(); + + if (path) { + std::cout << "File is going to be written in the directory: " << path << " for input file: " << inputfile_name + << std::endl; + } else { + std::cerr << "Error: Unable to determine the path." << std::endl; + } + + //outputfile->Write(); + outputfile->Close(); + delete outputfile; + } } const static int max_file_number = 10; @@ -261,7 +288,16 @@ int Zmumumerge(int argc, char* argv[]) { pt::read_json(options.config, main_tree); pt::ptree alignments = main_tree.get_child("alignments"); pt::ptree validation = main_tree.get_child("validation"); + for (const auto& childTree : alignments) { + // do not consider the nodes with a "file" to merge + if (childTree.second.find("file") == childTree.second.not_found()) { + std::cerr << "Ignoring alignment: " << childTree.second.get("title") << ".\nNo file to merged found!" + << std::endl; + continue; + } else { + std::cout << "Storing alignment: " << childTree.second.get("title") << std::endl; + } vec_single_file_path.push_back(childTree.second.get("file")); vec_single_file_name.push_back(childTree.second.get("file") + "/Zmumu.root"); vec_color.push_back(childTree.second.get("color")); @@ -271,6 +307,7 @@ int Zmumumerge(int argc, char* argv[]) { //Fitting_GetMassmeanVSvariables(childTree.second.get("file") + "/Zmumu.root", childTree.second.get("file")); } + TString merge_output = main_tree.get("output"); //============================================= vector vec_single_fittingoutput; @@ -300,6 +337,7 @@ int Zmumumerge(int argc, char* argv[]) { th1d_name_entries, merge_output + Form("/entries_%s_GTs.pdf", tstring_variables_name[idx_variable].Data())); } + //============================================= return EXIT_SUCCESS; } diff --git a/Alignment/OfflineValidation/src/FitWithRooFit.cc b/Alignment/OfflineValidation/src/FitWithRooFit.cc index 6bb2a154a7073..33e218e701353 100644 --- a/Alignment/OfflineValidation/src/FitWithRooFit.cc +++ b/Alignment/OfflineValidation/src/FitWithRooFit.cc @@ -20,7 +20,7 @@ void FitWithRooFit::fit( reinitializeParameters(); std::unique_ptr dh = importTH1(histo, xMin, xMax); - RooRealVar x(*static_cast(dh->get()->find("x"))); + RooRealVar x(*static_cast(dh->get()->find("InvMass"))); // Make plot of binned dataset showing Poisson error bars (RooFit default) RooPlot* frame = x.frame(RooFit::Title("di-muon mass M(#mu^{+}#mu^{-}) [GeV]")); @@ -36,7 +36,8 @@ void FitWithRooFit::fit( // ----------------------- // Fit with likelihood if (!useChi2_) { - model->fitTo(*dh, RooFit::SumW2Error(sumW2Error)); + // use RooFit::PrintLevel(-1) to reduce output to screen + model->fitTo(*dh, RooFit::SumW2Error(sumW2Error), RooFit::PrintLevel(-1)); } // Fit with chi^2 else { @@ -46,8 +47,12 @@ void FitWithRooFit::fit( m.hesse(); // RooFitResult* r_chi2_wgt = m.save(); } + model->plotOn(frame, RooFit::LineColor(kRed)); - model->plotOn(frame, RooFit::Components(backgroundType), RooFit::LineStyle(kDashed)); + + // this causes segfaults when the fit causes a Warning in : Error when calculating Hessian + //model->plotOn(frame, RooFit::Components(backgroundType), RooFit::LineStyle(kDashed)); + model->paramOn(frame, RooFit::Label("fit result"), RooFit::Layout(0.65, 0.90, 0.90), @@ -64,10 +69,13 @@ void FitWithRooFit::fit( // If histogram has custom error (i.e. its contents is does not originate from a Poisson process // but e.g. is a sum of weighted events) you can data with symmetric 'sum-of-weights' error instead // (same error bars as shown by ROOT) + RooPlot* frame2 = x.frame(RooFit::Title("di-muon mass M(#mu^{+}#mu^{-}) [GeV]")); dh->plotOn(frame2, RooFit::DataError(RooAbsData::SumW2)); model->plotOn(frame2, RooFit::LineColor(kRed)); - model->plotOn(frame2, RooFit::Components(backgroundType), RooFit::LineStyle(kDashed)); + + // this causes segfaults when the fit causes a Warning in : Error when calculating Hessian + //model->plotOn(frame2, RooFit::Components(backgroundType), RooFit::LineStyle(kDashed)); model->paramOn(frame2, RooFit::Label("fit result"), RooFit::Layout(0.65, 0.90, 0.90), From 3c70baf175928a9a148516f5b75ae6deaccb8c7a Mon Sep 17 00:00:00 2001 From: mmusich Date: Wed, 14 Feb 2024 22:38:09 +0100 Subject: [PATCH 2/7] add unit tests for Zmumu validation --- .../python/TkAlAllInOneTool/Zmumu_cfg.py | 32 ++++++++++++------- .../TkAlAllInOneTool/defaultInputFiles_cff.py | 2 ++ .../OfflineValidation/test/BuildFile.xml | 3 ++ .../test/testingScripts/test_unitZmumu.sh | 21 ++++++++++++ .../OfflineValidation/test/unit_test.yaml | 25 +++++++++++++++ 5 files changed, 71 insertions(+), 12 deletions(-) create mode 100755 Alignment/OfflineValidation/test/testingScripts/test_unitZmumu.sh diff --git a/Alignment/OfflineValidation/python/TkAlAllInOneTool/Zmumu_cfg.py b/Alignment/OfflineValidation/python/TkAlAllInOneTool/Zmumu_cfg.py index e69951e1a799b..387a07e817350 100644 --- a/Alignment/OfflineValidation/python/TkAlAllInOneTool/Zmumu_cfg.py +++ b/Alignment/OfflineValidation/python/TkAlAllInOneTool/Zmumu_cfg.py @@ -7,6 +7,7 @@ import FWCore.PythonUtilities.LumiList as LumiList from FWCore.ParameterSet.VarParsing import VarParsing from Alignment.OfflineValidation.TkAlAllInOneTool.utils import _byteify +from Alignment.OfflineValidation.TkAlAllInOneTool.defaultInputFiles_cff import filesDefaultMC_DoubleMuonAlCa_string ################################################################### # Define process @@ -26,20 +27,27 @@ ################################################################### # Read in AllInOne config in JSON format ################################################################### -with open(options.config, "r") as configFile: - if version_info.major == 2: - config = _byteify(json.load(configFile, object_hook=_byteify),ignore_dicts=True) - else: - config = json.load(configFile) +if options.config == "": + config = {"validation": {}, + "alignment": {}} +else: + with open(options.config, "r") as configFile: + if version_info.major == 2: + config = _byteify(json.load(configFile, object_hook=_byteify),ignore_dicts=True) + else: + config = json.load(configFile) ################################################################### # Read filenames from given TXT file ################################################################### readFiles = [] -with open(config["validation"]["dataset"], "r") as datafiles: - for fileName in datafiles.readlines(): - readFiles.append(fileName.replace("\n", "")) +if "dataset" in config["validation"]: + with open(config["validation"]["dataset"], "r") as datafiles: + for fileName in datafiles.readlines(): + readFiles.append(fileName.replace("\n", "")) +else: + readFiles = filesDefaultMC_DoubleMuonAlCa_string ################################################################### # Get good lumi section @@ -98,9 +106,9 @@ process.load("RecoTracker.TrackProducer.TrackRefitters_cff") import RecoTracker.TrackProducer.TrackRefitters_cff process.TrackRefitter = process.TrackRefitterP5.clone( - src = 'ALCARECOTkAlZMuMu', + src = config["validation"].get("trackcollection", "ALCARECOTkAlZMuMu"), TrajectoryInEvent = True, - TTRHBuilder = "WithAngleAndTemplate", + TTRHBuilder = config["validation"].get("tthrbuilder", "WithAngleAndTemplate"), NavigationSchool = "", ) @@ -109,7 +117,7 @@ ################################################################### process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, config["alignment"].get("globaltag", "auto:run2_data")) +process.GlobalTag = GlobalTag(process.GlobalTag, config["alignment"].get("globaltag", "auto:phase1_2024_realistic")) ################################################################### # Load conditions if wished @@ -182,7 +190,7 @@ if valiMode == "StandAlone": # Output file process.TFileService = cms.Service("TFileService", - fileName = cms.string("{}/Zmumu.root".format(config["output"])), + fileName = cms.string("{}/Zmumu.root".format(config.get("output", os.getcwd()))), closeFileFast = cms.untracked.bool(True), ) diff --git a/Alignment/OfflineValidation/python/TkAlAllInOneTool/defaultInputFiles_cff.py b/Alignment/OfflineValidation/python/TkAlAllInOneTool/defaultInputFiles_cff.py index 69a5e48f18e19..77c2975d2f1ba 100644 --- a/Alignment/OfflineValidation/python/TkAlAllInOneTool/defaultInputFiles_cff.py +++ b/Alignment/OfflineValidation/python/TkAlAllInOneTool/defaultInputFiles_cff.py @@ -10,6 +10,8 @@ filesDefaultMC_DoubleMuon_string = '/store/relval/CMSSW_12_5_0_pre5/RelValZMM_14/GEN-SIM-RECO/125X_mcRun3_2022_realistic_v3-v1/10000/068634c7-e8e2-4e46-a68e-97ebefed4868.root' +filesDefaultMC_DoubleMuonAlCa_string = '/store/relval/CMSSW_14_0_0_pre3/RelValZMM_14/ALCARECO/TkAlZMuMu-140X_mcRun3_2024_realistic_v1_STD_2024_noPU-v1/2580000/b91cfb5d-090c-4410-8c9e-ce165f4a4ef4.root' + filesDefaultMC_TTBarPU = cms.untracked.vstring( '/store/relval/CMSSW_12_5_0_pre5/RelValTTbar_14TeV/GEN-SIM-RECO/PU_125X_mcRun3_2022_realistic_v3-v1/10000/0136c33f-3ff9-4602-8578-906ae6e0160b.root' ) diff --git a/Alignment/OfflineValidation/test/BuildFile.xml b/Alignment/OfflineValidation/test/BuildFile.xml index d6cc4c190ef4d..b015dcf141fcb 100644 --- a/Alignment/OfflineValidation/test/BuildFile.xml +++ b/Alignment/OfflineValidation/test/BuildFile.xml @@ -6,6 +6,9 @@ + + + diff --git a/Alignment/OfflineValidation/test/testingScripts/test_unitZmumu.sh b/Alignment/OfflineValidation/test/testingScripts/test_unitZmumu.sh new file mode 100755 index 0000000000000..3faa0bcc36bf6 --- /dev/null +++ b/Alignment/OfflineValidation/test/testingScripts/test_unitZmumu.sh @@ -0,0 +1,21 @@ +#! /bin/bash + +function die { echo $1: status $2 ; exit $2; } + +echo "TESTING Alignment/Zmumu single configuration with json..." +pushd test_yaml/Zmumu/single/testSingleZMM/unitTestZmumuMCreal/1/ +./cmsRun validation_cfg.py config=validation.json || die "Failure running Zmumu first single configuration with json" $? +popd + +echo "TESTING Alignment/Zmumu single configuration with json..." +pushd test_yaml/Zmumu/single/testSingleZMM/unitTestZmumuMCdesign/1/ +./cmsRun validation_cfg.py config=validation.json || die "Failure running Zmumu second single configuration with json" $? + +echo "TESTING Alignment/Zmumu single configuration standalone..." +./cmsRun validation_cfg.py || die "Failure running Zmumu single configuration standalone" $? +popd + +echo "TESTING Zmumu merge step" +pushd test_yaml/Zmumu/merge/testSingleZMM/1/ +./Zmumumerge --verbose validation.json || die "Failure running Zmumu merge step" $? +popd diff --git a/Alignment/OfflineValidation/test/unit_test.yaml b/Alignment/OfflineValidation/test/unit_test.yaml index 6274962d8076c..d26e57966e1f9 100644 --- a/Alignment/OfflineValidation/test/unit_test.yaml +++ b/Alignment/OfflineValidation/test/unit_test.yaml @@ -44,6 +44,16 @@ alignments: globaltag: auto:phase1_2022_realistic style: 2101 title: unit test + unitTestZmumuMCreal: + color: 1 + globaltag: auto:phase1_2024_realistic + style: 20 + title: realistic + unitTestZmumuMCdesign: + color: 2 + globaltag: auto:phase1_2024_design + style: 21 + title: design PromptNewTemplate: name: PromptNewTemplate color: 1 @@ -182,6 +192,21 @@ validations: - unitTestDiMuonVMC trackcollection: generalTracks maxevents: 10 + + Zmumu: + merge: + testSingleZMM: + singles: + - testSingleZMM + single: + testSingleZMM: + IOV: + - 1 + alignments: + - unitTestZmumuMCreal + - unitTestZmumuMCdesign + trackcollection: ALCARECOTkAlZMuMu + maxevents: 100 MTS: merge: testSingleMTS: From fac0fa4a0f87c879b364bb9932e5f865ebac3845 Mon Sep 17 00:00:00 2001 From: mmusich Date: Thu, 15 Feb 2024 17:16:56 +0100 Subject: [PATCH 3/7] fix DiMuonV_cfg.py so that it can be used with ALCARECO data-tier --- .../OfflineValidation/python/TkAlAllInOneTool/DiMuonV_cfg.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Alignment/OfflineValidation/python/TkAlAllInOneTool/DiMuonV_cfg.py b/Alignment/OfflineValidation/python/TkAlAllInOneTool/DiMuonV_cfg.py index e51c5fa46794d..60538859f858f 100644 --- a/Alignment/OfflineValidation/python/TkAlAllInOneTool/DiMuonV_cfg.py +++ b/Alignment/OfflineValidation/python/TkAlAllInOneTool/DiMuonV_cfg.py @@ -1,6 +1,7 @@ from __future__ import print_function from fnmatch import fnmatch import FWCore.ParameterSet.Config as cms +import FWCore.PythonUtilities.LumiList as LumiList import FWCore.Utilities.FileUtils as FileUtils from FWCore.ParameterSet.VarParsing import VarParsing from Alignment.OfflineValidation.TkAlAllInOneTool.defaultInputFiles_cff import filesDefaultMC_DoubleMuon_string @@ -209,9 +210,13 @@ ## depending if RECO or ALCARECO is used ## the useReco flag above must be set accordingly if (config["validation"].get("useReco",True)): + print("I AM USING RECO DATA-TIER") process.DiMuonVertexValidation.muons = 'muons' process.DiMuonVertexValidation.tracks = 'refittedVtxTracks' else: + print("I AM USING ALCARECO DATA-TIER") + if(hasattr(process.DiMuonVertexValidation,'muons')): + delattr(process.DiMuonVertexValidation,'muons') process.DiMuonVertexValidation.muonTracks = cms.InputTag('refittedMuons') #################################################################### From ebbf30e7b4e4520023137ee0ce948feed346a54c Mon Sep 17 00:00:00 2001 From: mmusich Date: Thu, 15 Feb 2024 18:44:38 +0100 Subject: [PATCH 4/7] fixes to the DiMuonVertexValidation to work when files are on eos --- Alignment/OfflineValidation/bin/DiMuonVmerge.cc | 10 +++++++--- Alignment/OfflineValidation/macros/loopAndPlot.C | 10 +++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Alignment/OfflineValidation/bin/DiMuonVmerge.cc b/Alignment/OfflineValidation/bin/DiMuonVmerge.cc index a12042f1cc759..7f9d4575f1363 100644 --- a/Alignment/OfflineValidation/bin/DiMuonVmerge.cc +++ b/Alignment/OfflineValidation/bin/DiMuonVmerge.cc @@ -46,10 +46,14 @@ int merge(int argc, char* argv[]) { // std::cout << " Attribute: " << attr.first << " = " << attr.second.data() << std::endl; // } - std::cout << childTree.second.get("file") << std::endl; + std::string file = childTree.second.get("file"); + std::cout << file << std::endl; std::cout << childTree.second.get("title") << std::endl; - std::string toAdd = childTree.second.get("file") + - "/DiMuonVertexValidation.root=" + childTree.second.get("title") + ","; + + // Check if the file contains "/eos/cms/" and add the prefix accordingly + std::string prefixToAdd = file.find("/eos/cms/") != std::string::npos ? "root://eoscms.cern.ch/" : ""; + std::string toAdd = + prefixToAdd + file + "/DiMuonVertexValidation.root=" + childTree.second.get("title") + ","; filesAndLabels += toAdd; } diff --git a/Alignment/OfflineValidation/macros/loopAndPlot.C b/Alignment/OfflineValidation/macros/loopAndPlot.C index 093582435b54d..c4cdd2b0e40f4 100644 --- a/Alignment/OfflineValidation/macros/loopAndPlot.C +++ b/Alignment/OfflineValidation/macros/loopAndPlot.C @@ -68,7 +68,15 @@ void recurseOverKeys(TDirectory *target1, const std::vector &labels, bo /************************************************/ { // Figure out where we are - TString path((char *)strstr(target1->GetPath(), ":")); + TString fullPath = target1->GetPath(); + + // Check if the prefix "root://eoscms.cern.ch/" is present and remove it + TString prefixToRemove = "root://eoscms.cern.ch/"; + if (fullPath.BeginsWith(prefixToRemove)) { + fullPath.Remove(0, prefixToRemove.Length()); + } + + TString path((char *)strstr(fullPath.Data(), ":")); path.Remove(0, 2); sourceFiles[0]->cd(path); From 8736b1e7a5517bb5d8ce7e70ca45937c668f1718 Mon Sep 17 00:00:00 2001 From: mmusich Date: Mon, 26 Feb 2024 18:41:02 +0100 Subject: [PATCH 5/7] Graphical improvements to Zmumumerge Co-authored-by: bcamaian --- Alignment/OfflineValidation/bin/Zmumumerge.cc | 121 ++++++++++++++++-- Alignment/OfflineValidation/macros/CMS_lumi.h | 10 +- 2 files changed, 117 insertions(+), 14 deletions(-) diff --git a/Alignment/OfflineValidation/bin/Zmumumerge.cc b/Alignment/OfflineValidation/bin/Zmumumerge.cc index a56dbb39483ca..deaf1e4ac95c7 100644 --- a/Alignment/OfflineValidation/bin/Zmumumerge.cc +++ b/Alignment/OfflineValidation/bin/Zmumumerge.cc @@ -39,6 +39,7 @@ #include #include "Alignment/OfflineValidation/interface/FitWithRooFit.h" +#include "Alignment/OfflineValidation/macros/CMS_lumi.h" using namespace RooFit; using namespace std; @@ -155,6 +156,14 @@ void Draw_th1d(TH1D* th1d_input, TString variable_name, TString output_path) { const static int variables_number = 8; const TString tstring_variables_name[variables_number] = { "CosThetaCS", "DeltaEta", "EtaMinus", "EtaPlus", "PhiCS", "PhiMinus", "PhiPlus", "Pt"}; +const TString tstring_variables_name_label[variables_number] = {"cos #theta_{CS}", + "#Delta #eta", + "#eta_{#mu^{-}}", + "#eta_{#mu^{+}}", + "#phi_{CS}", + "#phi_{#mu^{-}}", + "#phi_{#mu^{+}}", + "p_{T}"}; void Fitting_GetMassmeanVSvariables(TString inputfile_name, TString output_path) { TH2D* th2d_mass_variables[variables_number]; @@ -182,8 +191,10 @@ void Fitting_GetMassmeanVSvariables(TString inputfile_name, TString output_path) if (i == 7 and j > 25) { continue; } - //cout << __LINE__ << " th1d_variables_meanmass[i]->GetNbinsX()=" << th1d_variables_meanmass[i]->GetNbinsX() << endl; - //cout << __LINE__ << " th2d_mass_variables[i]->GetNbinsY()=" << th2d_mass_variables[i]->GetNbinsY() << endl; + std::cout << __PRETTY_FUNCTION__ + << " th1d_variables_meanmass[i]->GetNbinsX()=" << th1d_variables_meanmass[i]->GetNbinsX() << endl; + std::cout << __PRETTY_FUNCTION__ << " th2d_mass_variables[i]->GetNbinsY()=" << th2d_mass_variables[i]->GetNbinsY() + << endl; th1d_variables_meanmass[i]->SetBinContent(j, 0); th1d_variables_meanmass[i]->SetBinError(j, 0); @@ -222,8 +233,6 @@ void Fitting_GetMassmeanVSvariables(TString inputfile_name, TString output_path) } else { std::cerr << "Error: Unable to determine the path." << std::endl; } - - //outputfile->Write(); outputfile->Close(); delete outputfile; } @@ -234,10 +243,13 @@ void Draw_TH1D_forMultiRootFiles(const vector& file_names, const vector& label_names, const vector& colors, const vector& styles, + const TString& Rlabel, const TString& th1d_name, + const TString& xlabel, + const TString& ylabel, const TString& output_name) { if (file_names.empty() || label_names.empty()) { - cout << "Provided an empty list of file and label names" << std::endl; + std::cout << "Provided an empty list of file and label names" << std::endl; return; } @@ -252,24 +264,96 @@ void Draw_TH1D_forMultiRootFiles(const vector& file_names, th1d_input[filename.index()]->SetTitle(""); } - TCanvas* c = new TCanvas(); - TLegend* lg = new TLegend(0.2, 0.7, 0.5, 0.95); - c->cd(); + int W = 800; + int H = 800; + // references for T, B, L, R + float T = 0.08 * H; + float B = 0.12 * H; + float L = 0.12 * W; + float R = 0.04 * W; + + // Form the canvas name by appending th1d_name + TString canvasName; + canvasName.Form("canv_%s", th1d_name.Data()); + + // Create a new canvas with the formed name + TCanvas* canv = new TCanvas(canvasName, canvasName, W, H); + canv->SetFillColor(0); + canv->SetBorderMode(0); + canv->SetFrameFillStyle(0); + canv->SetFrameBorderMode(0); + canv->SetLeftMargin(L / W + 0.05); + canv->SetRightMargin(R / W); + canv->SetTopMargin(T / H); + canv->SetBottomMargin(B / H); + canv->SetTickx(0); + canv->SetTicky(0); + canv->SetGrid(); + canv->cd(); + gStyle->SetOptStat(0); + TLegend* lg = new TLegend(0.3, 0.7, 0.7, 0.9); + lg->SetFillStyle(0); + lg->SetLineColor(0); + lg->SetEntrySeparation(0.05); + + double ymin; + double ymax; + + for (auto const& labelname : label_names | boost::adaptors::indexed(0)) { + double temp_ymin = th1d_input[labelname.index()]->GetMinimum(); + double temp_ymax = th1d_input[labelname.index()]->GetMaximum(); + if (labelname.index() == 0) { + ymin = temp_ymin; + ymax = temp_ymax; + } + if (temp_ymin <= ymin) { + ymin = temp_ymin; + } + if (temp_ymax >= ymax) { + ymax = temp_ymax; + } + } + for (auto const& labelname : label_names | boost::adaptors::indexed(0)) { th1d_input[labelname.index()]->SetMarkerColor(colors[labelname.index()]); th1d_input[labelname.index()]->SetLineColor(colors[labelname.index()]); th1d_input[labelname.index()]->SetMarkerStyle(styles[labelname.index()]); - th1d_input[labelname.index()]->Draw("same"); + th1d_input[labelname.index()]->GetXaxis()->SetTitle(xlabel); + th1d_input[labelname.index()]->GetYaxis()->SetTitle(ylabel); + th1d_input[labelname.index()]->GetYaxis()->SetTitleOffset(2.0); lg->AddEntry(th1d_input[labelname.index()], labelname.value()); + + TString label_meanmass_plot = "Mean M_{#mu#mu} (GeV)"; + if (ylabel.EqualTo(label_meanmass_plot)) { + double ycenter = (ymax + ymin) / 2.0; + double yrange = (ymax - ymin) * 2; + double Ymin = ycenter - yrange; + double Ymax = ycenter + yrange * 1.10; + th1d_input[labelname.index()]->SetAxisRange(Ymin, Ymax, "Y"); + th1d_input[labelname.index()]->Draw("PEX0same"); + } else { + double Ymin = ymin - ymin * 0.07; + double Ymax = ymax + ymax * 0.35; + th1d_input[labelname.index()]->SetAxisRange(Ymin, Ymax, "Y"); + th1d_input[labelname.index()]->Draw("HIST E1 same"); + } } + + CMS_lumi(canv, 0, 3, Rlabel); + lg->Draw("same"); - c->SaveAs(output_name); + + canv->Update(); + canv->RedrawAxis(); + canv->GetFrame()->Draw(); + canv->SaveAs(output_name); + if (output_name.Contains(".pdf")) { TString output_name_png(output_name); // output_name is const, copy to modify output_name_png.Replace(output_name_png.Index(".pdf"), 4, ".png"); - c->SaveAs(output_name_png); + canv->SaveAs(output_name_png); } } @@ -280,6 +364,7 @@ int Zmumumerge(int argc, char* argv[]) { vector vec_title; vector vec_color; vector vec_style; + vector vec_right_title; Options options; options.helper(argc, argv); @@ -302,6 +387,11 @@ int Zmumumerge(int argc, char* argv[]) { vec_single_file_name.push_back(childTree.second.get("file") + "/Zmumu.root"); vec_color.push_back(childTree.second.get("color")); vec_style.push_back(childTree.second.get("style")); + if (childTree.second.find("customrighttitle") == childTree.second.not_found()) { + vec_right_title.push_back(""); + } else { + vec_right_title.push_back(childTree.second.get("customrighttitle")); + } vec_global_tag.push_back(childTree.second.get("globaltag")); vec_title.push_back(childTree.second.get("title")); @@ -321,20 +411,29 @@ int Zmumumerge(int argc, char* argv[]) { cout << "files_number=" << files_number << endl; for (int idx_variable = 0; idx_variable < variables_number; idx_variable++) { TString th1d_name = Form("th1d_meanmass_%s", tstring_variables_name[idx_variable].Data()); + Draw_TH1D_forMultiRootFiles( vec_single_fittingoutput, vec_title, vec_color, vec_style, + vec_right_title[0], th1d_name, + tstring_variables_name_label[idx_variable].Data(), + "Mean M_{#mu#mu} (GeV)", merge_output + Form("/meanmass_%s_GTs.pdf", tstring_variables_name[idx_variable].Data())); + TString th1d_name_entries = Form("th1d_entries_%s", tstring_variables_name[idx_variable].Data()); + Draw_TH1D_forMultiRootFiles( vec_single_fittingoutput, vec_title, vec_color, vec_style, + vec_right_title[0], th1d_name_entries, + tstring_variables_name_label[idx_variable].Data(), + "Events", merge_output + Form("/entries_%s_GTs.pdf", tstring_variables_name[idx_variable].Data())); } diff --git a/Alignment/OfflineValidation/macros/CMS_lumi.h b/Alignment/OfflineValidation/macros/CMS_lumi.h index 547fe9563eb8e..38902f97379b3 100644 --- a/Alignment/OfflineValidation/macros/CMS_lumi.h +++ b/Alignment/OfflineValidation/macros/CMS_lumi.h @@ -41,9 +41,9 @@ TString lumi_sqrtS = ""; bool writeExraLumi = false; bool drawLogo = false; -void CMS_lumi(TPad* pad, int iPeriod = 3, int iPosX = 10); +void CMS_lumi(TPad* pad, int iPeriod = 3, int iPosX = 10, TString RLabel = ""); -inline void CMS_lumi(TPad* pad, int iPeriod, int iPosX) { +inline void CMS_lumi(TPad* pad, int iPeriod, int iPosX, TString RLabel) { bool outOfFrame = false; if (iPosX / 10 == 0) { outOfFrame = true; @@ -139,7 +139,11 @@ inline void CMS_lumi(TPad* pad, int iPeriod, int iPosX) { latex.SetTextFont(42); latex.SetTextAlign(31); latex.SetTextSize(lumiTextSize * t); - latex.DrawLatex(1 - r, 1 - t + lumiTextOffset * t, lumiText); + if (RLabel != "") { + latex.DrawLatex(1 - r, 1 - t + lumiTextOffset * t, RLabel); + } else { + latex.DrawLatex(1 - r, 1 - t + lumiTextOffset * t, lumiText); + } if (outOfFrame) { latex.SetTextFont(cmsTextFont); From d9f8ba0c3ec31091ca2aabea952c73eafcbc99eb Mon Sep 17 00:00:00 2001 From: mmusich Date: Tue, 27 Feb 2024 14:56:57 +0100 Subject: [PATCH 6/7] modify loopAndPlot.C to show inverse cosphi plots Co-authored-by: phnattla --- .../OfflineValidation/macros/loopAndPlot.C | 221 ++++++++++++++++-- 1 file changed, 204 insertions(+), 17 deletions(-) diff --git a/Alignment/OfflineValidation/macros/loopAndPlot.C b/Alignment/OfflineValidation/macros/loopAndPlot.C index c4cdd2b0e40f4..9052ae3a41097 100644 --- a/Alignment/OfflineValidation/macros/loopAndPlot.C +++ b/Alignment/OfflineValidation/macros/loopAndPlot.C @@ -17,6 +17,9 @@ // standard includes #include +// style +#include "Alignment/OfflineValidation/macros/CMS_lumi.h" + // 2 file case TFile *sourceFile1, *sourceFile2; @@ -32,12 +35,19 @@ void MakeNiceProfile(TProfile *prof); //void MakeNicePlotStyle(TH1 *hist); void plot2Histograms(TH1 *h1, TH1 *h2, const TString &label1, const TString &label2); void plot2Profiles(TProfile *h1, TProfile *h2, const TString &label1, const TString &label2); -void recurseOverKeys(TDirectory *target1, const std::vector &labels, bool isNorm); +void recurseOverKeys(TDirectory *target1, const std::vector &labels, bool isNorm, const TString &Rlabel); void recurseOverKeys(TDirectory *target1, const TString &label1, const TString &label2); -void plotHistograms(std::vector histos, const std::vector &labels, bool isNormalized = false); +void plotHistograms(std::vector histos, + const std::vector &labels, + bool isNormalized = false, + const TString &Rlabel = ""); +void plotHistogramsInv(std::vector histos, + std::vector invHistos, + const std::vector &labels, + const TString &Rlabel = ""); /************************************************/ -void loopAndPlot(TString namesandlabels, bool doNormalize = false) +void loopAndPlot(TString namesandlabels, const TString &Rlabel = "", bool doNormalize = false) /************************************************/ { std::vector labels; @@ -53,10 +63,11 @@ void loopAndPlot(TString namesandlabels, bool doNormalize = false) } else { std::cout << "Please give file name and legend entry in the following form:\n" << " filename1=legendentry1,filename2=legendentry2\n"; + return; } } - recurseOverKeys(sourceFiles[0], labels, doNormalize); + recurseOverKeys(sourceFiles[0], labels, doNormalize, Rlabel); for (const auto &file : sourceFiles) { file->Close(); @@ -64,7 +75,7 @@ void loopAndPlot(TString namesandlabels, bool doNormalize = false) } /************************************************/ -void recurseOverKeys(TDirectory *target1, const std::vector &labels, bool isNorm) +void recurseOverKeys(TDirectory *target1, const std::vector &labels, bool isNorm, const TString &Rlabel) /************************************************/ { // Figure out where we are @@ -95,7 +106,6 @@ void recurseOverKeys(TDirectory *target1, const std::vector &labels, bo if (obj->IsA()->InheritsFrom("TH1")) { if (obj->IsA()->InheritsFrom("TH2")) continue; - // ************************** // Plot & Save this Histogram std::vector histos; @@ -112,11 +122,28 @@ void recurseOverKeys(TDirectory *target1, const std::vector &labels, bo } histos.push_back(htemp); } - - //outputFilename=histName; - //plot2Histograms(htemp1, htemp2, outputFolder+path+"/"+outputFilename+"."+imageType); - plotHistograms(histos, labels, isNorm); - + // If it is a CosPhi histogram, plot it together with the inverted histogram + if (histName == "CosPhi" or histName == "CosPhi3D") { + TString histName2; + if (histName == "CosPhi") { + histName2 = "CosPhiInv"; + } else if (histName == "CosPhi3D") { + histName2 = "CosPhiInv3D"; + } + std::vector invHistos; + for (const auto &file : sourceFiles) { + TH1 *htemp2; + if (path != "") { + file->GetObject(path + "/" + histName2, htemp2); + } else { + file->GetObject(histName2, htemp2); + } + invHistos.push_back(htemp2); + } + plotHistogramsInv(histos, invHistos, labels, Rlabel); + } + // do now all the normal plotting + plotHistograms(histos, labels, isNorm, Rlabel); } else if (obj->IsA()->InheritsFrom("TDirectory")) { // it's a subdirectory @@ -130,22 +157,47 @@ void recurseOverKeys(TDirectory *target1, const std::vector &labels, bo if ((TString(obj->GetName())).Contains("Residuals")) continue; - recurseOverKeys((TDirectory *)obj, labels, isNorm); + recurseOverKeys((TDirectory *)obj, labels, isNorm, Rlabel); } // end of IF a TDriectory } } /************************************************/ -void plotHistograms(std::vector histos, const std::vector &labels, bool isNormalized) { - /************************************************/ - +void plotHistograms(std::vector histos, + const std::vector &labels, + bool isNormalized, + const TString &Rlabel) +/************************************************/ +{ TGaxis::SetMaxDigits(3); - auto c1 = new TCanvas(Form("c1_%s", histos[0]->GetName()), "A ratio example", 1000, 800); - c1->SetTicks(0, 1); + int W = 800; + int H = 800; + // references for T, B, L, R + float T = 0.08 * H; + float B = 0.12 * H; + float L = 0.12 * W; + float R = 0.04 * W; + + auto c1 = new TCanvas(Form("c1_%s", histos[0]->GetName()), "A ratio example", W, H); + c1->SetFillColor(0); + c1->SetBorderMode(0); + c1->SetFrameFillStyle(0); + c1->SetFrameBorderMode(0); + c1->SetLeftMargin(L / W + 0.05); + c1->SetRightMargin(R / W); + c1->SetTopMargin(T / H); + c1->SetBottomMargin(B / H); + c1->SetTickx(0); + c1->SetTicky(0); + c1->SetGrid(); + c1->cd(); + gStyle->SetOptStat(0); + c1->SetTicks(0, 1); + TObjArray *array = new TObjArray(histos.size()); int index = 0; for (const auto &histo : histos) { @@ -236,10 +288,145 @@ void plotHistograms(std::vector histos, const std::vector &label //rp->GetLowerPad()->cd(); //c1->Update(); + CMS_lumi(c1, 0, 3, Rlabel); c1->SaveAs(TString(histos[0]->GetName()) + ".png"); delete c1; } +/************************************************/ +void plotHistogramsInv(std::vector histos, + std::vector invHistos, + const std::vector &labels, + const TString &Rlabel) +/************************************************/ +{ + TGaxis::SetMaxDigits(4); + + int W = 800; + int H = 800; + // references for T, B, L, R + float T = 0.08 * H; + float B = 0.12 * H; + float L = 0.12 * W; + float R = 0.04 * W; + + auto c1 = new TCanvas(Form("c1_%s", histos[0]->GetName()), "A ratio example", W, H); + c1->SetFillColor(0); + c1->SetBorderMode(0); + c1->SetFrameFillStyle(0); + c1->SetFrameBorderMode(0); + c1->SetLeftMargin(L / W + 0.05); + c1->SetRightMargin(R / W); + c1->SetTopMargin(T / H); + c1->SetBottomMargin(B / H); + c1->SetTickx(0); + c1->SetTicky(0); + c1->SetGrid(); + c1->cd(); + + gStyle->SetOptStat(0); + + c1->SetTicks(0, 1); + + TObjArray *array = new TObjArray(histos.size()); + //~ int index = 0; + for (unsigned int i = 0; i < histos.size(); i++) { + const Double_t bin1 = histos[i]->GetBinContent(1); + const Double_t invBin1 = invHistos[i]->GetBinContent(invHistos[i]->GetNbinsX()); + if (bin1 != invBin1) { + std::cout << "Something went wrong, inverted histograms are not mirrored" << std::endl; + } + MakeNicePlotStyle(histos[i]); + MakeNicePlotStyle(invHistos[i]); + + histos[i]->SetLineColor(def_colors[i]); + histos[i]->SetMarkerColor(def_colors[i]); + histos[i]->SetMarkerStyle(20); + + invHistos[i]->SetLineColor(def_colors[i]); + invHistos[i]->SetMarkerStyle(kOpenCross); + invHistos[i]->SetMarkerSize(1.2); + invHistos[i]->SetMarkerColor(def_colors[i]); + invHistos[i]->GetXaxis()->SetTitle(histos[0]->GetXaxis()->GetTitle()); + array->Add(histos[i]); + } + + std::pair extrema = getExtrema(array); + delete array; + float min = (extrema.first > 0) ? (extrema.first) * 0.7 : (extrema.first) * 1.3; + histos[0]->GetYaxis()->SetRangeUser(min, extrema.second * 1.3); + + TRatioPlot *rp{nullptr}; + + for (unsigned int i = 0; i < histos.size(); i++) { + invHistos[i]->SetLineWidth(2); + if (i == 0) { + rp = new TRatioPlot(invHistos[0], histos[0]); + rp->SetLeftMargin(0.15); + rp->SetRightMargin(0.05); + rp->SetSeparationMargin(0.01); + rp->SetLowBottomMargin(0.35); + rp->Draw("hist"); + } else { + rp->GetUpperPad()->cd(); + invHistos[i]->Draw("same hist"); + histos[i]->Draw("same p0"); + } + } + + if (!rp) { + std::cerr << "TRatioPlot could not be initialized, exiting!" << std::endl; + return; + } + + rp->GetUpperPad()->cd(); + + // Draw the legend + TLegend *infoBox = new TLegend(0.4, 0.75, 0.65, 0.90, ""); + infoBox->SetShadowColor(0); // 0 = transparent + infoBox->SetFillColor(kWhite); + infoBox->SetTextSize(0.035); + + for (unsigned int i = 0; i < histos.size(); i++) { + infoBox->AddEntry(histos[i], labels[i], "P"); + } + infoBox->Draw("same"); + + MakeNicePlotStyle(rp->GetLowerRefGraph()); + rp->GetLowerRefGraph()->GetYaxis()->SetTitle("ratio"); + rp->GetLowerRefGraph()->SetMinimum(0.3); + rp->GetLowerRefGraph()->SetMaximum(1.7); + rp->GetLowerRefGraph()->SetLineColor(def_colors[0]); + rp->GetLowerRefGraph()->SetMarkerColor(def_colors[0]); + + for (unsigned int i = 1; i < histos.size(); i++) { + TLine *line = new TLine(gPad->GetUxmin(), 1, gPad->GetUxmax(), 1); + auto c2 = new TCanvas(Form("c2_%s_%i", histos[i]->GetName(), i), "A ratio example 2", 800, 800); + c2->cd(); + auto rp2 = new TRatioPlot(invHistos[i], histos[i]); + rp2->Draw(); + TGraph *g = rp2->GetLowerRefGraph(); + // if(g) + MakeNicePlotStyle(g); + g->SetLineColor(def_colors[i]); + g->SetMarkerColor(def_colors[i]); + //~ g->GetXaxis()->SetTitle(histos[0]->GetXaxis()->GetTitle()); + + c1->cd(); + rp->GetLowerPad()->cd(); + line->Draw("same"); + if (g) + g->Draw("same P"); + c1->Update(); + delete c2; + } + + CMS_lumi(c1, 0, 3, Rlabel); + c1->SaveAs(TString(histos[0]->GetName()) + "_mirrored.png"); + c1->SaveAs(TString(histos[0]->GetName()) + "_mirrored.pdf"); + delete c1; +} + /************************************************/ void recurseOverKeys(TDirectory *target1, const TString &label1, const TString &label2) /************************************************/ From 1301189b8a1a146a2402807baeb30150414acfb8 Mon Sep 17 00:00:00 2001 From: mmusich Date: Tue, 27 Feb 2024 21:03:56 +0100 Subject: [PATCH 7/7] miscellaneous fixes to DiMuonVertexValidation source and configuration --- Alignment/OfflineValidation/plugins/DiMuonVertexValidation.cc | 2 +- .../OfflineValidation/test/DiMuonVertexValidation_cfg.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Alignment/OfflineValidation/plugins/DiMuonVertexValidation.cc b/Alignment/OfflineValidation/plugins/DiMuonVertexValidation.cc index 5af46dc1759ee..a34d39847384d 100644 --- a/Alignment/OfflineValidation/plugins/DiMuonVertexValidation.cc +++ b/Alignment/OfflineValidation/plugins/DiMuonVertexValidation.cc @@ -471,7 +471,7 @@ void DiMuonVertexValidation::beginJob() { // take the range from the 2D histograms const auto& svDistSigRng = extractRangeValues(VtxDistSigConfiguration_); - hSVDistSig_ = fs->make("VtxDistSig", ";PV-#mu^{+}#mu^{-} vertex xy distance signficance;N(#mu#mu pairs)", 100, svDistSigRng.first, svDistRng.second); + hSVDistSig_ = fs->make("VtxDistSig", ";PV-#mu^{+}#mu^{-} vertex xy distance signficance;N(#mu#mu pairs)", 100, svDistSigRng.first, svDistSigRng.second); // take the range from the 2D histograms const auto& svDist3DRng = extractRangeValues(VtxDist3DConfiguration_); diff --git a/Alignment/OfflineValidation/test/DiMuonVertexValidation_cfg.py b/Alignment/OfflineValidation/test/DiMuonVertexValidation_cfg.py index 186800262e0bd..7dc9c0d280fcf 100644 --- a/Alignment/OfflineValidation/test/DiMuonVertexValidation_cfg.py +++ b/Alignment/OfflineValidation/test/DiMuonVertexValidation_cfg.py @@ -27,13 +27,13 @@ def best_match(rcd): VarParsing.VarParsing.varType.int, "number of events to process (\"-1\" for all)") options.register ('era', - '2017', # default value + '2022', # default value VarParsing.VarParsing.multiplicity.singleton, # singleton or list VarParsing.VarParsing.varType.string, # string, int, or float "CMS running era") options.register ('GlobalTag', - '113X_mc2017_realistic_v4', # default value + 'auto:phase1_2022_realistic', # default value VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "seed number")