From e224e1e537ff51217e918a729639d2bc6120bbe4 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 12 Dec 2023 17:54:11 +0100 Subject: [PATCH] make DirectSimulation use old LHCInfo in Run3 --- .../CTPPSBeamParametersFromLHCInfoESSource.cc | 31 +++++++++---- ...PPSInterpolatedOpticalFunctionsESSource.cc | 2 +- ...psBeamParametersFromLHCInfoESSource_cfi.py | 8 ++++ ...nterpolatedOpticalFunctionsESSource_cff.py | 3 -- ...nterpolatedOpticalFunctionsESSource_cfi.py | 8 ++++ .../python/ctppsOpticalFunctions_cff.py | 2 +- .../ctppsOpticalFunctions_non_DB_cff.py | 2 +- .../test/test_express_PPSAlCaReco_output.py | 2 +- .../test/test_prompt_PPSAlCaReco_output.py | 2 +- .../interface/CTPPSBeamParametersRcd.h | 7 ++- CondTools/RunInfo/interface/LHCInfoCombined.h | 2 +- CondTools/RunInfo/src/LHCInfoCombined.cc | 2 +- .../python/Modifier_ctpps_directSim_cff.py | 3 ++ .../python/Era_Run3_CTPPS_directSim_cff.py | 6 +++ .../test/2023_lhcinfo_test_recoCTPPS_cfg.py | 2 +- .../plugins/CTPPSProtonProducer.cc | 2 +- .../python/ctppsProtons_cff.py | 13 +----- .../python/ctppsProtons_cfi.py | 12 +++++ .../python/PPSTransportESSources_cfi.py | 2 +- .../plugins/CTPPSHepMCDistributionPlotter.cc | 40 ++++++++++++---- .../CTPPS/plugins/CTPPSLHCInfoPlotter.cc | 2 +- ...onReconstructionEfficiencyEstimatorData.cc | 30 ++++++++---- ...otonReconstructionEfficiencyEstimatorMC.cc | 46 ++++++++++++++++--- ...ProtonReconstructionSimulationValidator.cc | 43 +++++++++++++---- .../ctppsHepMCDistributionPlotter_cfi.py | 8 ++++ .../CTPPS/python/ctppsLHCInfoPlotter_cff.py | 3 -- .../CTPPS/python/ctppsLHCInfoPlotter_cfi.py | 8 ++++ ...constructionEfficiencyEstimatorData_cfi.py | 8 ++++ ...ReconstructionEfficiencyEstimatorMC_cfi.py | 8 ++++ ...onReconstructionSimulationValidator_cfi.py | 8 ++++ Validation/CTPPS/test/simu/run_multiple | 12 +++-- Validation/CTPPS/test/simu/template_cfg.py | 15 ++---- 32 files changed, 254 insertions(+), 88 deletions(-) create mode 100644 CalibPPS/ESProducers/python/ctppsBeamParametersFromLHCInfoESSource_cfi.py delete mode 100644 CalibPPS/ESProducers/python/ctppsInterpolatedOpticalFunctionsESSource_cff.py create mode 100644 CalibPPS/ESProducers/python/ctppsInterpolatedOpticalFunctionsESSource_cfi.py create mode 100644 Configuration/Eras/python/Modifier_ctpps_directSim_cff.py create mode 100644 Configuration/ProcessModifiers/python/Era_Run3_CTPPS_directSim_cff.py create mode 100644 RecoPPS/ProtonReconstruction/python/ctppsProtons_cfi.py create mode 100644 Validation/CTPPS/python/ctppsHepMCDistributionPlotter_cfi.py delete mode 100644 Validation/CTPPS/python/ctppsLHCInfoPlotter_cff.py create mode 100644 Validation/CTPPS/python/ctppsLHCInfoPlotter_cfi.py create mode 100644 Validation/CTPPS/python/ctppsProtonReconstructionEfficiencyEstimatorData_cfi.py create mode 100644 Validation/CTPPS/python/ctppsProtonReconstructionEfficiencyEstimatorMC_cfi.py create mode 100644 Validation/CTPPS/python/ctppsProtonReconstructionSimulationValidator_cfi.py diff --git a/CalibPPS/ESProducers/plugins/CTPPSBeamParametersFromLHCInfoESSource.cc b/CalibPPS/ESProducers/plugins/CTPPSBeamParametersFromLHCInfoESSource.cc index 27b33c4eeada6..1b921e643c666 100644 --- a/CalibPPS/ESProducers/plugins/CTPPSBeamParametersFromLHCInfoESSource.cc +++ b/CalibPPS/ESProducers/plugins/CTPPSBeamParametersFromLHCInfoESSource.cc @@ -13,7 +13,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "CondFormats/DataRecord/interface/LHCInfoRcd.h" +#include "CondTools/RunInfo/interface/LHCInfoCombined.h" #include "CondFormats/DataRecord/interface/CTPPSBeamParametersRcd.h" #include "CondFormats/RunInfo/interface/LHCInfo.h" @@ -31,7 +31,10 @@ class CTPPSBeamParametersFromLHCInfoESSource : public edm::ESProducer { static void fillDescriptions(edm::ConfigurationDescriptions&); private: - const edm::ESGetToken lhcInfoToken_; + edm::ESGetToken lhcInfoToken_; + edm::ESGetToken lhcInfoPerLSToken_; + edm::ESGetToken lhcInfoPerFillToken_; + const bool useNewLHCInfo_; CTPPSBeamParameters defaultParameters_; }; @@ -39,8 +42,12 @@ class CTPPSBeamParametersFromLHCInfoESSource : public edm::ESProducer { //---------------------------------------------------------------------------------------------------- CTPPSBeamParametersFromLHCInfoESSource::CTPPSBeamParametersFromLHCInfoESSource(const edm::ParameterSet& iConfig) - : lhcInfoToken_( - setWhatProduced(this).consumes(edm::ESInputTag("", iConfig.getParameter("lhcInfoLabel")))) { + : useNewLHCInfo_(iConfig.getParameter("useNewLHCInfo")) { + auto cc = setWhatProduced(this); + lhcInfoToken_ = cc.consumes(edm::ESInputTag("", iConfig.getParameter("lhcInfoLabel"))); + lhcInfoPerLSToken_ = cc.consumes(edm::ESInputTag("", iConfig.getParameter("lhcInfoPerLSLabel"))); + lhcInfoPerFillToken_ = cc.consumes(edm::ESInputTag("", iConfig.getParameter("lhcInfoPerFillLabel"))); + defaultParameters_.setBeamDivergenceX45(iConfig.getParameter("beamDivX45")); defaultParameters_.setBeamDivergenceY45(iConfig.getParameter("beamDivX56")); defaultParameters_.setBeamDivergenceX56(iConfig.getParameter("beamDivY45")); @@ -62,13 +69,16 @@ CTPPSBeamParametersFromLHCInfoESSource::CTPPSBeamParametersFromLHCInfoESSource(c std::unique_ptr CTPPSBeamParametersFromLHCInfoESSource::produce( const CTPPSBeamParametersRcd& iRecord) { - LHCInfo const& lhcInfo = iRecord.get(lhcInfoToken_); + auto lhcInfoCombined = + LHCInfoCombined::createLHCInfoCombined>( + iRecord, lhcInfoPerLSToken_, lhcInfoPerFillToken_, lhcInfoToken_, useNewLHCInfo_); auto bp = std::make_unique(defaultParameters_); - const auto beamMom = lhcInfo.energy(); - const auto betaStar = lhcInfo.betaStar() * 1E2; // conversion m --> cm - const auto xangle = lhcInfo.crossingAngle() * 1E-6; // conversion mu rad --> rad + const auto beamMom = lhcInfoCombined.energy; + const auto betaStar = lhcInfoCombined.betaStarX * 1E2; // conversion m --> cm + const auto xangle = lhcInfoCombined.crossingAngle() * 1E-6; // conversion mu rad --> rad bp->setBeamMom45(beamMom); bp->setBeamMom56(beamMom); @@ -92,6 +102,9 @@ void CTPPSBeamParametersFromLHCInfoESSource::fillDescriptions(edm::Configuration edm::ParameterSetDescription desc; desc.add("lhcInfoLabel", ""); + desc.add("lhcInfoPerLSLabel", ""); + desc.add("lhcInfoPerFillLabel", ""); + desc.add("useNewLHCInfo", false); // beam divergence (rad) desc.add("beamDivX45", 0.1); @@ -112,7 +125,7 @@ void CTPPSBeamParametersFromLHCInfoESSource::fillDescriptions(edm::Configuration desc.add("vtxStddevY", 2.e-2); desc.add("vtxStddevZ", 2.e-2); - descriptions.add("ctppsBeamParametersFromLHCInfoESSource", desc); + descriptions.add("ctppsBeamParametersFromLHCInfoESSourceDefault", desc); } //---------------------------------------------------------------------------------------------------- diff --git a/CalibPPS/ESProducers/plugins/CTPPSInterpolatedOpticalFunctionsESSource.cc b/CalibPPS/ESProducers/plugins/CTPPSInterpolatedOpticalFunctionsESSource.cc index e4d0f26bb3c5d..fb25ff49ebee1 100644 --- a/CalibPPS/ESProducers/plugins/CTPPSInterpolatedOpticalFunctionsESSource.cc +++ b/CalibPPS/ESProducers/plugins/CTPPSInterpolatedOpticalFunctionsESSource.cc @@ -62,7 +62,7 @@ void CTPPSInterpolatedOpticalFunctionsESSource::fillDescriptions(edm::Configurat desc.add("opticsLabel", "")->setComment("label of the optics records"); desc.add("useNewLHCInfo", false)->setComment("flag whether to use new LHCInfoPer* records or old LHCInfo"); - descriptions.add("ctppsInterpolatedOpticalFunctionsESSource", desc); + descriptions.add("ctppsInterpolatedOpticalFunctionsESSourceDefault", desc); } //---------------------------------------------------------------------------------------------------- diff --git a/CalibPPS/ESProducers/python/ctppsBeamParametersFromLHCInfoESSource_cfi.py b/CalibPPS/ESProducers/python/ctppsBeamParametersFromLHCInfoESSource_cfi.py new file mode 100644 index 0000000000000..b03973c02cc2a --- /dev/null +++ b/CalibPPS/ESProducers/python/ctppsBeamParametersFromLHCInfoESSource_cfi.py @@ -0,0 +1,8 @@ +from CalibPPS.ESProducers.ctppsBeamParametersFromLHCInfoESSourceDefault_cfi import ctppsBeamParametersFromLHCInfoESSourceDefault as _ctppsBeamParametersFromLHCInfoESSourceDefault +ctppsBeamParametersFromLHCInfoESSource = _ctppsBeamParametersFromLHCInfoESSourceDefault.clone() + +from Configuration.Eras.Modifier_run3_common_cff import run3_common +run3_common.toModify(ctppsBeamParametersFromLHCInfoESSource, useNewLHCInfo = True) + +from Configuration.Eras.Modifier_ctpps_directSim_cff import ctpps_directSim +ctpps_directSim.toModify(ctppsBeamParametersFromLHCInfoESSource, useNewLHCInfo = False) diff --git a/CalibPPS/ESProducers/python/ctppsInterpolatedOpticalFunctionsESSource_cff.py b/CalibPPS/ESProducers/python/ctppsInterpolatedOpticalFunctionsESSource_cff.py deleted file mode 100644 index e6cc78ccdd3f9..0000000000000 --- a/CalibPPS/ESProducers/python/ctppsInterpolatedOpticalFunctionsESSource_cff.py +++ /dev/null @@ -1,3 +0,0 @@ -from CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cfi import * -from Configuration.Eras.Modifier_run3_common_cff import run3_common -run3_common.toModify(ctppsInterpolatedOpticalFunctionsESSource, useNewLHCInfo = True) \ No newline at end of file diff --git a/CalibPPS/ESProducers/python/ctppsInterpolatedOpticalFunctionsESSource_cfi.py b/CalibPPS/ESProducers/python/ctppsInterpolatedOpticalFunctionsESSource_cfi.py new file mode 100644 index 0000000000000..25426226c1be7 --- /dev/null +++ b/CalibPPS/ESProducers/python/ctppsInterpolatedOpticalFunctionsESSource_cfi.py @@ -0,0 +1,8 @@ +from CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSourceDefault_cfi import ctppsInterpolatedOpticalFunctionsESSourceDefault as _ctppsInterpolatedOpticalFunctionsESSourceDefault +ctppsInterpolatedOpticalFunctionsESSource = _ctppsInterpolatedOpticalFunctionsESSourceDefault.clone() + +from Configuration.Eras.Modifier_run3_common_cff import run3_common +run3_common.toModify(ctppsInterpolatedOpticalFunctionsESSource, useNewLHCInfo = True) + +from Configuration.Eras.Modifier_ctpps_directSim_cff import ctpps_directSim +ctpps_directSim.toModify(ctppsInterpolatedOpticalFunctionsESSource, useNewLHCInfo = False) diff --git a/CalibPPS/ESProducers/python/ctppsOpticalFunctions_cff.py b/CalibPPS/ESProducers/python/ctppsOpticalFunctions_cff.py index 00017a8690f84..7a123f6792d0d 100644 --- a/CalibPPS/ESProducers/python/ctppsOpticalFunctions_cff.py +++ b/CalibPPS/ESProducers/python/ctppsOpticalFunctions_cff.py @@ -25,4 +25,4 @@ #ctppsOpticalFunctionsESSource.configuration.append(config_2016_preTS2) # optics interpolation between crossing angles -from CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cff import * +from CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cfi import * diff --git a/CalibPPS/ESProducers/python/ctppsOpticalFunctions_non_DB_cff.py b/CalibPPS/ESProducers/python/ctppsOpticalFunctions_non_DB_cff.py index 72f1a07f4bbdd..946d7b3b68e1a 100644 --- a/CalibPPS/ESProducers/python/ctppsOpticalFunctions_non_DB_cff.py +++ b/CalibPPS/ESProducers/python/ctppsOpticalFunctions_non_DB_cff.py @@ -136,4 +136,4 @@ ctppsOpticalFunctionsESSource.configuration.append(optics_2022) # optics interpolation between crossing angles -from CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cff import * +from CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cfi import * diff --git a/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.py b/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.py index 5b4aedc191531..df89229ede911 100644 --- a/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.py +++ b/Calibration/PPSAlCaRecoProducer/test/test_express_PPSAlCaReco_output.py @@ -6,7 +6,7 @@ process = cms.Process( 'TEST',ctpps_2018) # LHCInfo plotter -process.load('Validation.CTPPS.ctppsLHCInfoPlotter_cff') +process.load('Validation.CTPPS.ctppsLHCInfoPlotter_cfi') process.ctppsLHCInfoPlotter.outputFile = "alcareco_lhc_info_express.root" # Load geometry from DB diff --git a/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.py b/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.py index 2b6a2db3240a6..27cb8bb23aeb1 100644 --- a/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.py +++ b/Calibration/PPSAlCaRecoProducer/test/test_prompt_PPSAlCaReco_output.py @@ -6,7 +6,7 @@ process = cms.Process( 'TEST',ctpps_2018) # LHCInfo plotter -process.load('Validation.CTPPS.ctppsLHCInfoPlotter_cff') +process.load('Validation.CTPPS.ctppsLHCInfoPlotter_cfi') process.ctppsLHCInfoPlotter.outputFile = "alcareco_lhc_info_prompt.root" # Load geometry from DB diff --git a/CondFormats/DataRecord/interface/CTPPSBeamParametersRcd.h b/CondFormats/DataRecord/interface/CTPPSBeamParametersRcd.h index a77796620c968..cd3b52a223e4d 100644 --- a/CondFormats/DataRecord/interface/CTPPSBeamParametersRcd.h +++ b/CondFormats/DataRecord/interface/CTPPSBeamParametersRcd.h @@ -8,10 +8,13 @@ #include "FWCore/Framework/interface/DependentRecordImplementation.h" #include "CondFormats/DataRecord/interface/LHCInfoRcd.h" +#include "CondFormats/DataRecord/interface/LHCInfoPerFillRcd.h" +#include "CondFormats/DataRecord/interface/LHCInfoPerLSRcd.h" #include "FWCore/Utilities/interface/mplVector.h" -class CTPPSBeamParametersRcd - : public edm::eventsetup::DependentRecordImplementation> {}; +class CTPPSBeamParametersRcd : public edm::eventsetup::DependentRecordImplementation< + CTPPSBeamParametersRcd, + edm::mpl::Vector> {}; #endif diff --git a/CondTools/RunInfo/interface/LHCInfoCombined.h b/CondTools/RunInfo/interface/LHCInfoCombined.h index 2f6aab4289642..aef3dbe4cfb01 100644 --- a/CondTools/RunInfo/interface/LHCInfoCombined.h +++ b/CondTools/RunInfo/interface/LHCInfoCombined.h @@ -43,7 +43,7 @@ class LHCInfoCombined { void setFromPerLS(const LHCInfoPerLS& infoPerLS); void setFromPerFill(const LHCInfoPerFill& infoPerFill); - float crossingAngle(); + float crossingAngle() const; static constexpr float crossingAngleInvalid = -1.; bool isCrossingAngleInvalid(); diff --git a/CondTools/RunInfo/src/LHCInfoCombined.cc b/CondTools/RunInfo/src/LHCInfoCombined.cc index f489adfbbe3d6..c2376f970b606 100644 --- a/CondTools/RunInfo/src/LHCInfoCombined.cc +++ b/CondTools/RunInfo/src/LHCInfoCombined.cc @@ -43,7 +43,7 @@ void LHCInfoCombined::setFromPerFill(const LHCInfoPerFill& infoPerFill) { fillNumber = infoPerFill.fillNumber(); } -float LHCInfoCombined::crossingAngle() { +float LHCInfoCombined::crossingAngle() const { if (crossingAngleX == 0. && crossingAngleY == 0.) { return crossingAngleInvalid; } diff --git a/Configuration/Eras/python/Modifier_ctpps_directSim_cff.py b/Configuration/Eras/python/Modifier_ctpps_directSim_cff.py new file mode 100644 index 0000000000000..6d010cdcb308e --- /dev/null +++ b/Configuration/Eras/python/Modifier_ctpps_directSim_cff.py @@ -0,0 +1,3 @@ +import FWCore.ParameterSet.Config as cms + +ctpps_directSim = cms.Modifier() diff --git a/Configuration/ProcessModifiers/python/Era_Run3_CTPPS_directSim_cff.py b/Configuration/ProcessModifiers/python/Era_Run3_CTPPS_directSim_cff.py new file mode 100644 index 0000000000000..67c085ea3cc9b --- /dev/null +++ b/Configuration/ProcessModifiers/python/Era_Run3_CTPPS_directSim_cff.py @@ -0,0 +1,6 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_cff import Run3 +from Configuration.Eras.Modifier_ctpps_directSim_cff import ctpps_directSim + +Run3_CTPPS_directSim = cms.ModifierChain(Run3,ctpps_directSim) diff --git a/RecoPPS/Local/test/2023_lhcinfo_test_recoCTPPS_cfg.py b/RecoPPS/Local/test/2023_lhcinfo_test_recoCTPPS_cfg.py index 790d9e66b512d..831d91d0ecb4d 100644 --- a/RecoPPS/Local/test/2023_lhcinfo_test_recoCTPPS_cfg.py +++ b/RecoPPS/Local/test/2023_lhcinfo_test_recoCTPPS_cfg.py @@ -31,7 +31,7 @@ from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag.globaltag = "130X_dataRun3_Prompt_forLHCInfo_Candidate_2023_08_08_10_52_01" +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run3_data') # local RP reconstruction chain with standard settings process.load("RecoPPS.Configuration.recoCTPPS_cff") diff --git a/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc b/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc index 73809feb4aae5..43c3a0a5b2663 100644 --- a/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc +++ b/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc @@ -189,7 +189,7 @@ void CTPPSProtonProducer::fillDescriptions(edm::ConfigurationDescriptions &descr desc.add("multiRPAlgorithm", "chi2") ->setComment("algorithm for multi-RP reco, options include chi2, newton, anal-iter"); - descriptions.add("ctppsProtons", desc); + descriptions.add("ctppsProtonsDefault", desc); } //---------------------------------------------------------------------------------------------------- diff --git a/RecoPPS/ProtonReconstruction/python/ctppsProtons_cff.py b/RecoPPS/ProtonReconstruction/python/ctppsProtons_cff.py index 2a564e400b589..25f6dba850683 100644 --- a/RecoPPS/ProtonReconstruction/python/ctppsProtons_cff.py +++ b/RecoPPS/ProtonReconstruction/python/ctppsProtons_cff.py @@ -1,17 +1,6 @@ import FWCore.ParameterSet.Config as cms -# import default alignment settings -from CalibPPS.ESProducers.ctppsAlignment_cff import * +from RecoPPS.ProtonReconstruction.ctppsProtons_cfi import * # import default optics settings from CalibPPS.ESProducers.ctppsOpticalFunctions_cff import * - -# import and adjust proton-reconstructions settings -from RecoPPS.ProtonReconstruction.ctppsProtons_cfi import * - - -ctppsProtons.pixelDiscardBXShiftedTracks = True -ctppsProtons.default_time = -999. - -from Configuration.Eras.Modifier_run3_common_cff import run3_common -run3_common.toModify(ctppsProtons, useNewLHCInfo = True) \ No newline at end of file diff --git a/RecoPPS/ProtonReconstruction/python/ctppsProtons_cfi.py b/RecoPPS/ProtonReconstruction/python/ctppsProtons_cfi.py new file mode 100644 index 0000000000000..9421ed546ddd2 --- /dev/null +++ b/RecoPPS/ProtonReconstruction/python/ctppsProtons_cfi.py @@ -0,0 +1,12 @@ +# import and adjust proton-reconstructions settings +from RecoPPS.ProtonReconstruction.ctppsProtonsDefault_cfi import ctppsProtonsDefault as _ctppsProtonsDefault +ctppsProtons = _ctppsProtonsDefault.clone( + pixelDiscardBXShiftedTracks = True, + default_time = -999. +) + +from Configuration.Eras.Modifier_run3_common_cff import run3_common +run3_common.toModify(ctppsProtons, useNewLHCInfo = True) + +from Configuration.Eras.Modifier_ctpps_directSim_cff import ctpps_directSim +ctpps_directSim.toModify(ctppsProtons, useNewLHCInfo = False) diff --git a/SimTransport/PPSProtonTransport/python/PPSTransportESSources_cfi.py b/SimTransport/PPSProtonTransport/python/PPSTransportESSources_cfi.py index 409420fac930c..7e6afe9b0b041 100644 --- a/SimTransport/PPSProtonTransport/python/PPSTransportESSources_cfi.py +++ b/SimTransport/PPSProtonTransport/python/PPSTransportESSources_cfi.py @@ -3,7 +3,7 @@ # beam optics from CondCore.CondDB.CondDB_cfi import * from CalibPPS.ESProducers.ctppsBeamParametersFromLHCInfoESSource_cfi import * -from CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cff import * +from CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cfi import * ctppsInterpolatedOpticalFunctionsESSource.lhcInfoLabel = "" """ diff --git a/Validation/CTPPS/plugins/CTPPSHepMCDistributionPlotter.cc b/Validation/CTPPS/plugins/CTPPSHepMCDistributionPlotter.cc index 358c31f8f54e6..b93032e19164d 100644 --- a/Validation/CTPPS/plugins/CTPPSHepMCDistributionPlotter.cc +++ b/Validation/CTPPS/plugins/CTPPSHepMCDistributionPlotter.cc @@ -15,8 +15,7 @@ #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" -#include "CondFormats/RunInfo/interface/LHCInfo.h" -#include "CondFormats/DataRecord/interface/LHCInfoRcd.h" +#include "CondTools/RunInfo/interface/LHCInfoCombined.h" #include "TFile.h" #include "TH1D.h" @@ -29,13 +28,20 @@ class CTPPSHepMCDistributionPlotter : public edm::one::EDAnalyzer<> { public: explicit CTPPSHepMCDistributionPlotter(const edm::ParameterSet &); + static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); + private: void analyze(const edm::Event &, const edm::EventSetup &) override; void endJob() override; - edm::EDGetTokenT tokenHepMC_; - edm::ESGetToken lhcInfoESToken_; - std::string outputFile_; + const edm::EDGetTokenT tokenHepMC_; + + const edm::ESGetToken lhcInfoToken_; + const edm::ESGetToken lhcInfoPerLSToken_; + const edm::ESGetToken lhcInfoPerFillToken_; + const bool useNewLHCInfo_; + + const std::string outputFile_; std::unique_ptr h_vtx_x_, h_vtx_y_, h_vtx_z_, h_vtx_t_; std::unique_ptr h_xi_, h_th_x_, h_th_y_; @@ -51,7 +57,12 @@ using namespace HepMC; CTPPSHepMCDistributionPlotter::CTPPSHepMCDistributionPlotter(const edm::ParameterSet &iConfig) : tokenHepMC_(consumes(iConfig.getParameter("tagHepMC"))), - lhcInfoESToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoLabel")))), + + lhcInfoToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoLabel")))), + lhcInfoPerLSToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoPerLSLabel")))), + lhcInfoPerFillToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoPerFillLabel")))), + useNewLHCInfo_(iConfig.getParameter("useNewLHCInfo")), + outputFile_(iConfig.getParameter("outputFile")), h_vtx_x_(new TH1D("h_vtx_x", ";vtx_x (mm)", 100, 0., 0.)), @@ -65,9 +76,22 @@ CTPPSHepMCDistributionPlotter::CTPPSHepMCDistributionPlotter(const edm::Paramete //---------------------------------------------------------------------------------------------------- +void CTPPSHepMCDistributionPlotter::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { + edm::ParameterSetDescription desc; + + desc.add("lhcInfoLabel", "")->setComment("label of the LHCInfo record"); + desc.add("lhcInfoPerLSLabel", "")->setComment("label of the LHCInfoPerLS record"); + desc.add("lhcInfoPerFillLabel", "")->setComment("label of the LHCInfoPerFill record"); + desc.add("useNewLHCInfo", false)->setComment("flag whether to use new LHCInfoPer* records or old LHCInfo"); + + desc.add("outputFile", "")->setComment("output file"); + + descriptions.add("ctppsHepMCDistributionPlotterDefault", desc); +} + void CTPPSHepMCDistributionPlotter::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { // get conditions - const auto &lhcInfo = iSetup.getData(lhcInfoESToken_); + LHCInfoCombined lhcInfoCombined(iSetup, lhcInfoPerLSToken_, lhcInfoPerFillToken_, lhcInfoToken_, useNewLHCInfo_); // get input edm::Handle hHepMC; @@ -98,7 +122,7 @@ void CTPPSHepMCDistributionPlotter::analyze(const edm::Event &iEvent, const edm: continue; const auto &mom = part->momentum(); - const double p_nom = lhcInfo.energy(); + const double p_nom = lhcInfoCombined.energy; if (mom.rho() / p_nom < 0.7) continue; diff --git a/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc b/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc index 8d80b0246ad0a..b90706c094726 100644 --- a/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc +++ b/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc @@ -86,7 +86,7 @@ void CTPPSLHCInfoPlotter::fillDescriptions(edm::ConfigurationDescriptions &descr desc.add("outputFile", "")->setComment("output file"); - descriptions.add("ctppsLHCInfoPlotter", desc); + descriptions.add("ctppsLHCInfoPlotterDefault", desc); } //---------------------------------------------------------------------------------------------------- diff --git a/Validation/CTPPS/plugins/CTPPSProtonReconstructionEfficiencyEstimatorData.cc b/Validation/CTPPS/plugins/CTPPSProtonReconstructionEfficiencyEstimatorData.cc index cdef4aacf5f2a..ee88320d42151 100644 --- a/Validation/CTPPS/plugins/CTPPSProtonReconstructionEfficiencyEstimatorData.cc +++ b/Validation/CTPPS/plugins/CTPPSProtonReconstructionEfficiencyEstimatorData.cc @@ -12,8 +12,7 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ESWatcher.h" -#include "CondFormats/RunInfo/interface/LHCInfo.h" -#include "CondFormats/DataRecord/interface/LHCInfoRcd.h" +#include "CondTools/RunInfo/interface/LHCInfoCombined.h" #include "CondFormats/DataRecord/interface/CTPPSInterpolatedOpticsRcd.h" #include "CondFormats/PPSObjects/interface/LHCInterpolatedOpticalFunctionsSetCollection.h" #include "CondFormats/DataRecord/interface/PPSAssociationCutsRcd.h" @@ -53,7 +52,10 @@ class CTPPSProtonReconstructionEfficiencyEstimatorData : public edm::one::EDAnal edm::EDGetTokenT tokenTracks_; edm::EDGetTokenT tokenRecoProtonsMultiRP_; - edm::ESGetToken lhcInfoESToken_; + const edm::ESGetToken lhcInfoToken_; + const edm::ESGetToken lhcInfoPerLSToken_; + const edm::ESGetToken lhcInfoPerFillToken_; + const bool useNewLHCInfo_; edm::ESGetToken opticsESToken_; edm::ESGetToken ppsAssociationCutsToken_; @@ -243,7 +245,11 @@ CTPPSProtonReconstructionEfficiencyEstimatorData::CTPPSProtonReconstructionEffic tokenRecoProtonsMultiRP_( consumes(iConfig.getParameter("tagRecoProtonsMultiRP"))), - lhcInfoESToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoLabel")))), + lhcInfoToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoLabel")))), + lhcInfoPerLSToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoPerLSLabel")))), + lhcInfoPerFillToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoPerFillLabel")))), + useNewLHCInfo_(iConfig.getParameter("useNewLHCInfo")), + opticsESToken_(esConsumes(ESInputTag("", iConfig.getParameter("opticsLabel")))), ppsAssociationCutsToken_( esConsumes(ESInputTag("", iConfig.getParameter("ppsAssociationCutsLabel")))), @@ -283,7 +289,10 @@ void CTPPSProtonReconstructionEfficiencyEstimatorData::fillDescriptions(edm::Con desc.add("tagTracks", edm::InputTag())->setComment("input tag for local lite tracks"); desc.add("tagRecoProtonsMultiRP", edm::InputTag())->setComment("input tag for multi-RP reco protons"); - desc.add("lhcInfoLabel", "")->setComment("label of LHCInfo data"); + desc.add("lhcInfoLabel", "")->setComment("label of the LHCInfo record"); + desc.add("lhcInfoPerLSLabel", "")->setComment("label of the LHCInfoPerLS record"); + desc.add("lhcInfoPerFillLabel", "")->setComment("label of the LHCInfoPerFill record"); + desc.add("useNewLHCInfo", false)->setComment("flag whether to use new LHCInfoPer* records or old LHCInfo"); desc.add("opticsLabel", "")->setComment("label of optics data"); desc.add("ppsAssociationCutsLabel", "")->setComment("label of PPSAssociationCuts data"); @@ -311,7 +320,7 @@ void CTPPSProtonReconstructionEfficiencyEstimatorData::fillDescriptions(edm::Con desc.addUntracked("verbosity", 0)->setComment("verbosity level"); - descriptions.add("ctppsProtonReconstructionEfficiencyEstimatorData", desc); + descriptions.add("ctppsProtonReconstructionEfficiencyEstimatorDataDefault", desc); } //---------------------------------------------------------------------------------------------------- @@ -321,7 +330,8 @@ void CTPPSProtonReconstructionEfficiencyEstimatorData::analyze(const edm::Event std::ostringstream os; // get conditions - const auto &lhcInfo = iSetup.getData(lhcInfoESToken_); + const LHCInfoCombined lhcInfoCombined( + iSetup, lhcInfoPerLSToken_, lhcInfoPerFillToken_, lhcInfoToken_, useNewLHCInfo_); const auto &opticalFunctions = iSetup.getData(opticsESToken_); const auto &ppsAssociationCuts = iSetup.getData(ppsAssociationCutsToken_); @@ -660,8 +670,10 @@ void CTPPSProtonReconstructionEfficiencyEstimatorData::analyze(const edm::Event evp.idx_N = i; evp.idx_F = j; - evp.x_cut = ass_cut.isSatisfied(ass_cut.qX, tr_i.x(), tr_i.y(), lhcInfo.crossingAngle(), tr_i.x() - tr_j.x()); - evp.y_cut = ass_cut.isSatisfied(ass_cut.qY, tr_i.x(), tr_i.y(), lhcInfo.crossingAngle(), tr_i.y() - tr_j.y()); + evp.x_cut = + ass_cut.isSatisfied(ass_cut.qX, tr_i.x(), tr_i.y(), lhcInfoCombined.crossingAngle(), tr_i.x() - tr_j.x()); + evp.y_cut = + ass_cut.isSatisfied(ass_cut.qY, tr_i.x(), tr_i.y(), lhcInfoCombined.crossingAngle(), tr_i.y() - tr_j.y()); evp.match = evp.x_cut && evp.y_cut; diff --git a/Validation/CTPPS/plugins/CTPPSProtonReconstructionEfficiencyEstimatorMC.cc b/Validation/CTPPS/plugins/CTPPSProtonReconstructionEfficiencyEstimatorMC.cc index e415b13ac01bf..07772a66c42df 100644 --- a/Validation/CTPPS/plugins/CTPPSProtonReconstructionEfficiencyEstimatorMC.cc +++ b/Validation/CTPPS/plugins/CTPPSProtonReconstructionEfficiencyEstimatorMC.cc @@ -12,8 +12,7 @@ #include "DataFormats/CTPPSDetId/interface/CTPPSDetId.h" -#include "CondFormats/RunInfo/interface/LHCInfo.h" -#include "CondFormats/DataRecord/interface/LHCInfoRcd.h" +#include "CondTools/RunInfo/interface/LHCInfoCombined.h" #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" @@ -40,6 +39,8 @@ class CTPPSProtonReconstructionEfficiencyEstimatorMC : public edm::one::EDAnalyz public: explicit CTPPSProtonReconstructionEfficiencyEstimatorMC(const edm::ParameterSet &); + static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); + private: void analyze(const edm::Event &, const edm::EventSetup &) override; void endJob() override; @@ -53,7 +54,10 @@ class CTPPSProtonReconstructionEfficiencyEstimatorMC : public edm::one::EDAnalyz edm::EDGetTokenT tokenRecoProtonsMultiRP_; - edm::ESGetToken lhcInfoESToken_; + const edm::ESGetToken lhcInfoToken_; + const edm::ESGetToken lhcInfoPerLSToken_; + const edm::ESGetToken lhcInfoPerFillToken_; + const bool useNewLHCInfo_; unsigned int rpId_45_N_, rpId_45_F_; unsigned int rpId_56_N_, rpId_56_F_; @@ -103,7 +107,11 @@ CTPPSProtonReconstructionEfficiencyEstimatorMC::CTPPSProtonReconstructionEfficie tracksToken_(consumes(iConfig.getParameter("tagTracks"))), tokenRecoProtonsMultiRP_( consumes(iConfig.getParameter("tagRecoProtonsMultiRP"))), - lhcInfoESToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoLabel")))), + + lhcInfoToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoLabel")))), + lhcInfoPerLSToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoPerLSLabel")))), + lhcInfoPerFillToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoPerFillLabel")))), + useNewLHCInfo_(iConfig.getParameter("useNewLHCInfo")), rpId_45_N_(iConfig.getParameter("rpId_45_N")), rpId_45_F_(iConfig.getParameter("rpId_45_F")), @@ -128,11 +136,37 @@ CTPPSProtonReconstructionEfficiencyEstimatorMC::CTPPSProtonReconstructionEfficie //---------------------------------------------------------------------------------------------------- +void CTPPSProtonReconstructionEfficiencyEstimatorMC::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { + edm::ParameterSetDescription desc; + + desc.add("tagTracks", edm::InputTag())->setComment("input tag for local lite tracks"); + desc.add("tagRecoProtonsMultiRP", edm::InputTag())->setComment("input tag for multi-RP reco protons"); + + desc.add("lhcInfoLabel", "")->setComment("label of the LHCInfo record"); + desc.add("lhcInfoPerLSLabel", "")->setComment("label of the LHCInfoPerLS record"); + desc.add("lhcInfoPerFillLabel", "")->setComment("label of the LHCInfoPerFill record"); + desc.add("useNewLHCInfo", false)->setComment("flag whether to use new LHCInfoPer* records or old LHCInfo"); + + desc.add("rpId_45_N", 0)->setComment("decimal RP id for 45 near"); + desc.add("rpId_45_F", 0)->setComment("decimal RP id for 45 far"); + desc.add("rpId_56_N", 0)->setComment("decimal RP id for 56 near"); + desc.add("rpId_56_F", 0)->setComment("decimal RP id for 56 far"); + + desc.add("outputFile", "output.root")->setComment("output file name"); + + desc.addUntracked("verbosity", 0)->setComment("verbosity level"); + + descriptions.add("ctppsProtonReconstructionEfficiencyEstimatorMCDefault", desc); +} + +//---------------------------------------------------------------------------------------------------- + void CTPPSProtonReconstructionEfficiencyEstimatorMC::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { std::ostringstream os; // get conditions - const auto &lhcInfo = iSetup.getData(lhcInfoESToken_); + const LHCInfoCombined lhcInfoCombined( + iSetup, lhcInfoPerLSToken_, lhcInfoPerFillToken_, lhcInfoToken_, useNewLHCInfo_); // get input edm::Handle hHepMCAfterSmearing; @@ -184,7 +218,7 @@ void CTPPSProtonReconstructionEfficiencyEstimatorMC::analyze(const edm::Event &i info.arm = (mom.z() > 0.) ? 0 : 1; - const double p_nom = lhcInfo.energy(); + const double p_nom = lhcInfoCombined.energy; info.xi = (p_nom - mom.rho()) / p_nom; particleInfo[part->barcode()] = std::move(info); diff --git a/Validation/CTPPS/plugins/CTPPSProtonReconstructionSimulationValidator.cc b/Validation/CTPPS/plugins/CTPPSProtonReconstructionSimulationValidator.cc index 686d0e2ade00c..647cc426083eb 100644 --- a/Validation/CTPPS/plugins/CTPPSProtonReconstructionSimulationValidator.cc +++ b/Validation/CTPPS/plugins/CTPPSProtonReconstructionSimulationValidator.cc @@ -12,8 +12,7 @@ #include "DataFormats/CTPPSDetId/interface/CTPPSDetId.h" -#include "CondFormats/RunInfo/interface/LHCInfo.h" -#include "CondFormats/DataRecord/interface/LHCInfoRcd.h" +#include "CondTools/RunInfo/interface/LHCInfoCombined.h" #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" @@ -38,6 +37,8 @@ class CTPPSProtonReconstructionSimulationValidator : public edm::one::EDAnalyzer public: explicit CTPPSProtonReconstructionSimulationValidator(const edm::ParameterSet &); + static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); + private: void analyze(const edm::Event &, const edm::EventSetup &) override; void endJob() override; @@ -47,7 +48,7 @@ class CTPPSProtonReconstructionSimulationValidator : public edm::one::EDAnalyzer const reco::ForwardProton &rec_pr, const HepMC::FourVector &vtx, const HepMC::FourVector &mom, - const LHCInfo &lhcInfo); + const double energy); edm::EDGetTokenT tokenHepMCBeforeSmearing_; edm::EDGetTokenT tokenHepMCAfterSmearing_; @@ -55,7 +56,10 @@ class CTPPSProtonReconstructionSimulationValidator : public edm::one::EDAnalyzer edm::EDGetTokenT tokenRecoProtonsSingleRP_; edm::EDGetTokenT tokenRecoProtonsMultiRP_; - edm::ESGetToken lhcInfoESToken_; + const edm::ESGetToken lhcInfoToken_; + const edm::ESGetToken lhcInfoPerLSToken_; + const edm::ESGetToken lhcInfoPerFillToken_; + const bool useNewLHCInfo_; std::string outputFile_; @@ -201,14 +205,35 @@ CTPPSProtonReconstructionSimulationValidator::CTPPSProtonReconstructionSimulatio consumes(iConfig.getParameter("tagRecoProtonsSingleRP"))), tokenRecoProtonsMultiRP_( consumes(iConfig.getParameter("tagRecoProtonsMultiRP"))), - lhcInfoESToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoLabel")))), + lhcInfoToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoLabel")))), + lhcInfoPerLSToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoPerLSLabel")))), + lhcInfoPerFillToken_(esConsumes(ESInputTag("", iConfig.getParameter("lhcInfoPerFillLabel")))), + useNewLHCInfo_(iConfig.getParameter("useNewLHCInfo")), outputFile_(iConfig.getParameter("outputFile")) {} //---------------------------------------------------------------------------------------------------- +void CTPPSProtonReconstructionSimulationValidator::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { + edm::ParameterSetDescription desc; + + desc.add("lhcInfoLabel", "")->setComment("label of the LHCInfo record"); + desc.add("lhcInfoPerLSLabel", "")->setComment("label of the LHCInfoPerLS record"); + desc.add("lhcInfoPerFillLabel", "")->setComment("label of the LHCInfoPerFill record"); + desc.add("useNewLHCInfo", false)->setComment("flag whether to use new LHCInfoPer* records or old LHCInfo"); + + desc.add("outputFile", "output.root")->setComment("output file name"); + + desc.addUntracked("verbosity", 0)->setComment("verbosity level"); + + descriptions.add("ctppsProtonReconstructionSimulationValidatorDefault", desc); +} + +//---------------------------------------------------------------------------------------------------- + void CTPPSProtonReconstructionSimulationValidator::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { // get conditions - const auto &lhcInfo = iSetup.getData(lhcInfoESToken_); + const LHCInfoCombined lhcInfoCombined( + iSetup, lhcInfoPerLSToken_, lhcInfoPerFillToken_, lhcInfoToken_, useNewLHCInfo_); // get input edm::Handle hHepMCBeforeSmearing; @@ -319,7 +344,7 @@ void CTPPSProtonReconstructionSimulationValidator::analyze(const edm::Event &iEv if (rec_pr.method() == reco::ForwardProton::ReconstructionMethod::multiRP) meth_idx = 1; - fillPlots(meth_idx, idx, rec_pr, vtx, mom, lhcInfo); + fillPlots(meth_idx, idx, rec_pr, vtx, mom, lhcInfoCombined.energy); } } @@ -355,8 +380,8 @@ void CTPPSProtonReconstructionSimulationValidator::fillPlots(unsigned int meth_i const reco::ForwardProton &rec_pr, const HepMC::FourVector &vtx, const HepMC::FourVector &mom, - const LHCInfo &lhcInfo) { - const double p_nom = lhcInfo.energy(); + const double energy) { + const double p_nom = energy; const double xi_simu = (p_nom - mom.rho()) / p_nom; const double th_x_simu = mom.x() / mom.rho(); const double th_y_simu = mom.y() / mom.rho(); diff --git a/Validation/CTPPS/python/ctppsHepMCDistributionPlotter_cfi.py b/Validation/CTPPS/python/ctppsHepMCDistributionPlotter_cfi.py new file mode 100644 index 0000000000000..28baf6954a35b --- /dev/null +++ b/Validation/CTPPS/python/ctppsHepMCDistributionPlotter_cfi.py @@ -0,0 +1,8 @@ +from Validation.CTPPS.CTPPSHepMCDistributionPlotterDefault_cfi import CTPPSHepMCDistributionPlotterDefault as _CTPPSHepMCDistributionPlotterDefault +CTPPSHepMCDistributionPlotter = _CTPPSHepMCDistributionPlotterDefault.clone() + +from Configuration.Eras.Modifier_run3_common_cff import run3_common +run3_common.toModify(CTPPSHepMCDistributionPlotter, useNewLHCInfo = True) + +from Configuration.Eras.Modifier_ctpps_directSim_cff import ctpps_directSim +ctpps_directSim.toModify(CTPPSHepMCDistributionPlotter, useNewLHCInfo = False) diff --git a/Validation/CTPPS/python/ctppsLHCInfoPlotter_cff.py b/Validation/CTPPS/python/ctppsLHCInfoPlotter_cff.py deleted file mode 100644 index 66f0c853de77c..0000000000000 --- a/Validation/CTPPS/python/ctppsLHCInfoPlotter_cff.py +++ /dev/null @@ -1,3 +0,0 @@ -from Validation.CTPPS.ctppsLHCInfoPlotter_cfi import * -from Configuration.Eras.Modifier_run3_common_cff import run3_common -run3_common.toModify(ctppsLHCInfoPlotter, useNewLHCInfo = True) \ No newline at end of file diff --git a/Validation/CTPPS/python/ctppsLHCInfoPlotter_cfi.py b/Validation/CTPPS/python/ctppsLHCInfoPlotter_cfi.py new file mode 100644 index 0000000000000..4b8f96416747d --- /dev/null +++ b/Validation/CTPPS/python/ctppsLHCInfoPlotter_cfi.py @@ -0,0 +1,8 @@ +from Validation.CTPPS.ctppsLHCInfoPlotterDefault_cfi import ctppsLHCInfoPlotterDefault as _ctppsLHCInfoPlotterDefault +ctppsLHCInfoPlotter = _ctppsLHCInfoPlotterDefault.clone() + +from Configuration.Eras.Modifier_run3_common_cff import run3_common +run3_common.toModify(ctppsLHCInfoPlotter, useNewLHCInfo = True) + +from Configuration.Eras.Modifier_ctpps_directSim_cff import ctpps_directSim +ctpps_directSim.toModify(ctppsLHCInfoPlotter, useNewLHCInfo = False) diff --git a/Validation/CTPPS/python/ctppsProtonReconstructionEfficiencyEstimatorData_cfi.py b/Validation/CTPPS/python/ctppsProtonReconstructionEfficiencyEstimatorData_cfi.py new file mode 100644 index 0000000000000..47d2360e623c3 --- /dev/null +++ b/Validation/CTPPS/python/ctppsProtonReconstructionEfficiencyEstimatorData_cfi.py @@ -0,0 +1,8 @@ +from Validation.CTPPS.ctppsProtonReconstructionEfficiencyEstimatorDataDefault_cfi import ctppsProtonReconstructionEfficiencyEstimatorDataDefault as _ctppsProtonReconstructionEfficiencyEstimatorDataDefault +ctppsProtonReconstructionEfficiencyEstimatorData = _ctppsProtonReconstructionEfficiencyEstimatorDataDefault.clone() + +from Configuration.Eras.Modifier_run3_common_cff import run3_common +run3_common.toModify(ctppsProtonReconstructionEfficiencyEstimatorData, useNewLHCInfo = True) + +from Configuration.Eras.Modifier_ctpps_directSim_cff import ctpps_directSim +ctpps_directSim.toModify(ctppsProtonReconstructionEfficiencyEstimatorData, useNewLHCInfo = False) diff --git a/Validation/CTPPS/python/ctppsProtonReconstructionEfficiencyEstimatorMC_cfi.py b/Validation/CTPPS/python/ctppsProtonReconstructionEfficiencyEstimatorMC_cfi.py new file mode 100644 index 0000000000000..4aa239bd04c70 --- /dev/null +++ b/Validation/CTPPS/python/ctppsProtonReconstructionEfficiencyEstimatorMC_cfi.py @@ -0,0 +1,8 @@ +from Validation.CTPPS.ctppsProtonReconstructionEfficiencyEstimatorMCDefault_cfi import ctppsProtonReconstructionEfficiencyEstimatorMCDefault as _ctppsProtonReconstructionEfficiencyEstimatorMCDefault +ctppsProtonReconstructionEfficiencyEstimatorMC = ctppsProtonReconstructionEfficiencyEstimatorMCDefault.clone() + +from Configuration.Eras.Modifier_run3_common_cff import run3_common +run3_common.toModify(ctppsProtonReconstructionEfficiencyEstimatorMC, useNewLHCInfo = True) + +from Configuration.Eras.Modifier_ctpps_directSim_cff import ctpps_directSim +ctpps_directSim.toModify(ctppsProtonReconstructionEfficiencyEstimatorMC, useNewLHCInfo = False) diff --git a/Validation/CTPPS/python/ctppsProtonReconstructionSimulationValidator_cfi.py b/Validation/CTPPS/python/ctppsProtonReconstructionSimulationValidator_cfi.py new file mode 100644 index 0000000000000..e1c1b4ddee8d9 --- /dev/null +++ b/Validation/CTPPS/python/ctppsProtonReconstructionSimulationValidator_cfi.py @@ -0,0 +1,8 @@ +from Validation.CTPPS.ctppsProtonReconstructionSimulationValidatorDefault_cfi import ctppsProtonReconstructionSimulationValidatorDefault as _ctppsProtonReconstructionSimulationValidatorDefault +ctppsProtonReconstructionSimulationValidator = ctppsProtonReconstructionSimulationValidatorDefault.clone() + +from Configuration.Eras.Modifier_run3_common_cff import run3_common +run3_common.toModify(ctppsProtonReconstructionSimulationValidator, useNewLHCInfo = True) + +from Configuration.Eras.Modifier_ctpps_directSim_cff import ctpps_directSim +ctpps_directSim.toModify(ctppsProtonReconstructionSimulationValidator, useNewLHCInfo = False) diff --git a/Validation/CTPPS/test/simu/run_multiple b/Validation/CTPPS/test/simu/run_multiple index fa9e6a2a8fff2..34cc9042cb851 100755 --- a/Validation/CTPPS/test/simu/run_multiple +++ b/Validation/CTPPS/test/simu/run_multiple @@ -20,7 +20,8 @@ pids="" function RunOne() { local config="$1" - local era="$2" + local era_mod_path="$2" + local era="$3" local cfg="simu_${config}_cfg.py" local log="simu_${config}.log" @@ -29,6 +30,7 @@ function RunOne() local out_protons="simu_${config}_protons.root" cat "$inputDir/template_cfg.py" | sed "\ + s|\$ERA_MOD_PATH|$era_mod_path|;\ s|\$ERA|$era|;\ s|\$CONFIG|$config|;\ s|\$N_EVENTS|$n_events|;\ @@ -43,13 +45,13 @@ function RunOne() #---------------------------------------------------------------------------------------------------- -RunOne "2016" "Run2_2016" +RunOne "2016" "Configuration.Eras" "Run2_2016" -RunOne "2017" "Run2_2017" +RunOne "2017" "Configuration.Eras" "Run2_2017" -RunOne "2018" "Run2_2018" +RunOne "2018" "Configuration.Eras" "Run2_2018" -RunOne "2022" "Run3" +RunOne "2022" "Configuration.ProcessModifiers" "Run3_CTPPS_directSim" rc=0 for pid in $pids diff --git a/Validation/CTPPS/test/simu/template_cfg.py b/Validation/CTPPS/test/simu/template_cfg.py index 5587411a833b9..030f071056534 100644 --- a/Validation/CTPPS/test/simu/template_cfg.py +++ b/Validation/CTPPS/test/simu/template_cfg.py @@ -1,10 +1,10 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_$ERA_cff import * +from $ERA_MOD_PATH.Era_$ERA_cff import * process = cms.Process('CTPPSTest', $ERA) process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') -process.load('Validation.CTPPS.ctppsLHCInfoPlotter_cff') +process.load('Validation.CTPPS.ctppsLHCInfoPlotter_cfi') process.load('Configuration.Generator.randomXiThetaGunProducer_cfi') process.load("CondCore.CondDB.CondDB_cfi") @@ -32,15 +32,8 @@ process.CondDB, toGet = cms.VPSet(cms.PSet( record = cms.string('CTPPSPixelAnalysisMaskRcd'), - tag = cms.string("CTPPSPixelAnalysisMask_Run3_v1_hlt")), - cms.PSet( - record = cms.string('LHCInfoPerLSRcd'), - tag = cms.string("LHCInfoPerLS_endFill_Run3_mc_v1")), - cms.PSet( - record = cms.string('LHCInfoPerFillRcd'), - tag = cms.string("LHCInfoPerFill_endFill_Run3_mc_v1")), - ) -) + tag = cms.string("CTPPSPixelAnalysisMask_Run3_v1_hlt")) + )) # random seeds process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",