diff --git a/Alignment/CommonAlignment/python/tools/trackselectionRefitting.py b/Alignment/CommonAlignment/python/tools/trackselectionRefitting.py index dff04b2a4b835..f936131c428b5 100644 --- a/Alignment/CommonAlignment/python/tools/trackselectionRefitting.py +++ b/Alignment/CommonAlignment/python/tools/trackselectionRefitting.py @@ -2,6 +2,9 @@ import sys import FWCore.ParameterSet.Config as cms +def customlog(s): + print("# MSG-i trackselectionRefitting: %s" % s) + def getSequence(process, collection, saveCPU = False, TTRHBuilder = "WithAngleAndTemplate", @@ -52,13 +55,13 @@ def getSequence(process, collection, # resolve default values incl. consistency checks # ################################################### - print("g4Refitting=",g4Refitting) + customlog("g4Refitting=%s" % g4Refitting) if usePixelQualityFlag is None: if "Template" not in TTRHBuilder: usePixelQualityFlag = False # not defined without templates - print("Using 'TTRHBuilder' without templates:", TTRHBuilder) - print(" --> Turning off pixel quality flag in hit filter.") + customlog("Using 'TTRHBuilder' without templates %s" % TTRHBuilder) + customlog(" --> Turning off pixel quality flag in hit filter.") else: usePixelQualityFlag = True # default for usage with templates @@ -375,11 +378,11 @@ def getSequence(process, collection, else: if mods[-1][-1]["method"] == "load" and \ not mods[-1][-1].get("clone", False): - print("Name of the last module needs to be modifiable.") + customlog("Name of the last module needs to be modifiable.") sys.exit(1) if g4Refitting: - print("Here we must include geopro first") + customlog("Here we must include geopro first") process.load('Configuration.StandardSequences.GeometryDB_cff') process.load("TrackPropagation.Geant4e.geantRefit_cff") modules.append(getattr(process,"geopro")) @@ -457,7 +460,7 @@ def _getModule(process, src, modType, moduleName, options, **kwargs): obj = getattr(process, objTuple[1]) moduleName = objTuple[1] else: - print("Unknown method:", method) + customlog("Unknown method: %s" % method) sys.exit(1) if modType == "TrackSplitting": diff --git a/Alignment/OfflineValidation/bin/exceptions.h b/Alignment/OfflineValidation/bin/exceptions.h index 865c495750dbc..e15c71e24739f 100644 --- a/Alignment/OfflineValidation/bin/exceptions.h +++ b/Alignment/OfflineValidation/bin/exceptions.h @@ -49,8 +49,6 @@ namespace AllInOneConfig { std::cerr << colorify("Logic Error: ") << e.what() << '\n'; } catch (const std::exception &e) { std::cerr << colorify("Standard Error: ") << e.what() << '\n'; - } catch (...) { - std::cerr << colorify("Unkown failure\n"); } return EXIT_FAILURE; } diff --git a/Alignment/OfflineValidation/bin/jetHtPlotter.cc b/Alignment/OfflineValidation/bin/jetHtPlotter.cc index 2995523482bc8..116a7e72b0913 100644 --- a/Alignment/OfflineValidation/bin/jetHtPlotter.cc +++ b/Alignment/OfflineValidation/bin/jetHtPlotter.cc @@ -46,7 +46,7 @@ void drawSingleHistogram(TH1D *histogram[kMaxFiles], bool logScale, int color[kMaxFiles]) { // Create and setup the histogram drawer - JDrawer *drawer = new JDrawer(); + const auto &drawer = std::make_unique(); drawer->SetLogY(logScale); drawer->SetTopMargin(0.08); @@ -812,7 +812,7 @@ void jetHtPlotter(std::string configurationFileName) { // Draw the plots // =============================================== - JDrawer *drawer = new JDrawer(); + const auto &drawer = std::make_unique(); TLegend *legend[nMaxLegendColumns]; int columnOrder[nMaxLegendColumns]; bool noIovFound = true; diff --git a/Alignment/OfflineValidation/interface/PlotAlignmentValidation.h b/Alignment/OfflineValidation/interface/PlotAlignmentValidation.h index 0fb37f0fc8c06..613f67f65d4d5 100644 --- a/Alignment/OfflineValidation/interface/PlotAlignmentValidation.h +++ b/Alignment/OfflineValidation/interface/PlotAlignmentValidation.h @@ -1,6 +1,7 @@ #ifndef ALIGNMENT_OFFLINEVALIDATION_PLOTALIGNNMENTVALIDATION_H_ #define ALIGNMENT_OFFLINEVALIDATION_PLOTALIGNNMENTVALIDATION_H_ +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Alignment/OfflineValidation/interface/TkAlStyle.h" #include "Alignment/OfflineValidation/interface/TkOffTreeVariables.h" diff --git a/Alignment/OfflineValidation/plugins/DMRChecker.cc b/Alignment/OfflineValidation/plugins/DMRChecker.cc index ab507e5e2cfe6..2a47fecf1f546 100644 --- a/Alignment/OfflineValidation/plugins/DMRChecker.cc +++ b/Alignment/OfflineValidation/plugins/DMRChecker.cc @@ -2101,7 +2101,7 @@ void DMRChecker::fillDescriptions(edm::ConfigurationDescriptions &descriptions) desc.add("BeamSpotTag", edm::InputTag("offlineBeamSpot")); desc.add("VerticesTag", edm::InputTag("offlinePrimaryVertices")); desc.add("isCosmics", false); - descriptions.add("DMRChecker", desc); + descriptions.addWithDefaultLabel(desc); } DEFINE_FWK_MODULE(DMRChecker); diff --git a/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc b/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc index 39cc8b0895d6d..9968e50d0ed48 100644 --- a/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc +++ b/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc @@ -1138,7 +1138,7 @@ void GeneralPurposeTrackAnalyzer::fillDescriptions(edm::ConfigurationDescription desc.add("BeamSpotTag", edm::InputTag("offlineBeamSpot")); desc.add("VerticesTag", edm::InputTag("offlinePrimaryVertices")); desc.add("isCosmics", false); - descriptions.add("GeneralPurposeTrackAnalyzer", desc); + descriptions.addWithDefaultLabel(desc); } DEFINE_FWK_MODULE(GeneralPurposeTrackAnalyzer); diff --git a/Alignment/OfflineValidation/plugins/JetHTAnalyzer.cc b/Alignment/OfflineValidation/plugins/JetHTAnalyzer.cc index e785214506d07..a01f52fd448a9 100644 --- a/Alignment/OfflineValidation/plugins/JetHTAnalyzer.cc +++ b/Alignment/OfflineValidation/plugins/JetHTAnalyzer.cc @@ -56,18 +56,12 @@ // // class declaration // - -// If the analyzer does not use TFileService, please remove -// the template argument to the base class so the class inherits -// from edm::one::EDAnalyzer<> -// This will improve performance in multithreaded jobs. - using reco::TrackCollection; class JetHTAnalyzer : public edm::one::EDAnalyzer { public: explicit JetHTAnalyzer(const edm::ParameterSet&); - ~JetHTAnalyzer() override; + ~JetHTAnalyzer() override = default; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); static bool mysorter(reco::Track i, reco::Track j) { return (i.pt() > j.pt()); } @@ -78,23 +72,23 @@ class JetHTAnalyzer : public edm::one::EDAnalyzer { void endJob() override; // ----------member data --------------------------- + const edm::InputTag pvsTag_; + const edm::EDGetTokenT pvsToken_; - edm::InputTag pvsTag_; - edm::EDGetTokenT pvsToken_; + const edm::InputTag tracksTag_; + const edm::EDGetTokenT tracksToken_; - edm::InputTag tracksTag_; - edm::EDGetTokenT tracksToken_; + const edm::InputTag triggerTag_; + const edm::EDGetTokenT triggerToken_; - edm::InputTag triggerTag_; - edm::EDGetTokenT triggerToken_; + const int printTriggerTable_; + const double minVtxNdf_; + const double minVtxWgt_; - int printTriggerTable_; - double minVtxNdf_; - double minVtxWgt_; - - std::vector profilePtBorders_; - std::vector iovList_; + const std::vector profilePtBorders_; + const std::vector iovList_; + // output histograms edm::Service outfile_; TH1F* h_ntrks; TH1F* h_probePt; @@ -106,6 +100,9 @@ class JetHTAnalyzer : public edm::one::EDAnalyzer { TH1F* h_probeDzErr; SmartSelectionMonitor mon; + + // for the conversions + static constexpr double cmToum = 10000; }; // @@ -127,11 +124,6 @@ JetHTAnalyzer::JetHTAnalyzer(const edm::ParameterSet& iConfig) usesResource(TFileService::kSharedResource); } -// -// Default destructor -// -JetHTAnalyzer::~JetHTAnalyzer() = default; - // // member functions // @@ -140,8 +132,6 @@ JetHTAnalyzer::~JetHTAnalyzer() = default; void JetHTAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace edm; - const double cmToum = 10000; - const auto& vertices = iEvent.get(pvsToken_); const reco::VertexCollection& pvtx = vertices; @@ -341,7 +331,12 @@ void JetHTAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& description desc.add("vtxCollection", edm::InputTag("offlinePrimaryVerticesFromRefittedTrks")); desc.add("triggerResults", edm::InputTag("TriggerResults", "", "HLT")); desc.add("trackCollection", edm::InputTag("TrackRefitter")); - descriptions.add("JetHTAnalyzer", desc); + desc.add("printTriggerTable", false); + desc.add("minVertexNdf", 10.); + desc.add("minVertexMeanWeight", 0.5); + desc.add>("profilePtBorders", {3, 5, 10, 20, 50, 100}); + desc.add>("iovList", {0, 500000}); + descriptions.addWithDefaultLabel(desc); } //define this as a plug-in diff --git a/Alignment/OfflineValidation/src/PlotAlignmentValidation.cc b/Alignment/OfflineValidation/src/PlotAlignmentValidation.cc index 8f6dda57f2239..81b6048d2a261 100644 --- a/Alignment/OfflineValidation/src/PlotAlignmentValidation.cc +++ b/Alignment/OfflineValidation/src/PlotAlignmentValidation.cc @@ -2239,6 +2239,7 @@ double PlotAlignmentValidation::resampleTestOfEqualRMS(TH1F* h1, TH1F* h2, int n test_mean += abs(d1 - d2 - rmsdiff); } test_mean /= numSamples; + edm::LogPrint("") << "test mean:" << test_mean; //p value double p = 0; for (double d : diff) { @@ -2283,6 +2284,7 @@ double PlotAlignmentValidation::resampleTestOfEqualMeans(TH1F* h1, TH1F* h2, int test_mean += abs(d1 - d2 - meandiff); } test_mean /= numSamples; + edm::LogPrint("") << "test mean:" << test_mean; //p-value double p = 0; for (double d : diff) { diff --git a/Alignment/OfflineValidation/src/PreparePVTrends.cc b/Alignment/OfflineValidation/src/PreparePVTrends.cc index b97c312b2d3bc..1d62812d2ca76 100644 --- a/Alignment/OfflineValidation/src/PreparePVTrends.cc +++ b/Alignment/OfflineValidation/src/PreparePVTrends.cc @@ -663,6 +663,12 @@ pv::biases PreparePVTrends::getBiases(TH1F *hist) /*--------------------------------------------------------------------*/ { int nbins = hist->GetNbinsX(); + // if there are no bins in the histogram then return default constructed object + // shouldn't really ever happen + if (nbins <= 0) { + logError << "No bins in the input histogram"; + return pv::biases(); + } //extract median from histogram double *y = new double[nbins]; @@ -712,6 +718,8 @@ pv::biases PreparePVTrends::getBiases(TH1F *hist) delete theZero; delete displaced; + delete[] y; + delete[] err; return result; } diff --git a/Alignment/OfflineValidation/test/PVValidation_TEMPL_cfg.py b/Alignment/OfflineValidation/test/PVValidation_TEMPL_cfg.py index 55afdae9869fe..e954f8cd615e5 100644 --- a/Alignment/OfflineValidation/test/PVValidation_TEMPL_cfg.py +++ b/Alignment/OfflineValidation/test/PVValidation_TEMPL_cfg.py @@ -1,4 +1,3 @@ -from __future__ import print_function import FWCore.ParameterSet.Config as cms import sys @@ -45,7 +44,7 @@ def customiseKinksAndBows(process): # Event source and run selection ################################################################### if (useFileList): - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Reading local input files list") + print("############ testPVValidation_cfg.py: msg%-i: Reading local input files list") readFiles = cms.untracked.vstring() readFiles.extend(FILESOURCETEMPLATE) process.source = cms.Source("PoolSource", @@ -53,7 +52,7 @@ def customiseKinksAndBows(process): duplicateCheckMode = cms.untracked.string('checkAllFilesOpened') ) else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Reading from configuration fragment") + print("############ testPVValidation_cfg.py: msg%-i: Reading from configuration fragment") process.load("Alignment.OfflineValidation.DATASETTEMPLATE") ################################################################### @@ -67,12 +66,12 @@ def customiseKinksAndBows(process): # JSON Filtering ################################################################### if isMC: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is simulation!") + print("############ testPVValidation_cfg.py: msg%-i: This is simulation!") runboundary = 1 else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is real DATA!") + print("############ testPVValidation_cfg.py: msg%-i: This is real DATA!") if ('LUMILISTTEMPLATE'): - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: JSON filtering with: LUMILISTTEMPLATE") + print("############ testPVValidation_cfg.py: msg%-i: JSON filtering with: LUMILISTTEMPLATE") import FWCore.PythonUtilities.LumiList as LumiList process.source.lumisToProcess = LumiList.LumiList(filename ='LUMILISTTEMPLATE').getVLuminosityBlockRange() @@ -110,7 +109,7 @@ def customiseKinksAndBows(process): process.GlobalTag = GlobalTag(process.GlobalTag, 'GLOBALTAGTEMPLATE', '') if allFromGT: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: All is taken from GT") + print("############ testPVValidation_cfg.py: msg%-i: All is taken from GT") else: #################################################################### # Get Alignment and APE constants @@ -121,16 +120,16 @@ def customiseKinksAndBows(process): # Kinks and Bows (optional) #################################################################### if applyBows: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Applying TrackerSurfaceDeformations!") + print("############ testPVValidation_cfg.py: msg%-i: Applying TrackerSurfaceDeformations!") process=customiseKinksAndBows(process) else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: MultiPVValidation: Not applying TrackerSurfaceDeformations!") + print("############ testPVValidation_cfg.py: msg%-i: MultiPVValidation: Not applying TrackerSurfaceDeformations!") #################################################################### # Extra corrections not included in the GT #################################################################### if applyExtraConditions: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Applying extra calibration constants!") + print("############ testPVValidation_cfg.py: msg%-i: Applying extra calibration constants!") import CalibTracker.Configuration.Common.PoolDBESSource_cfi @@ -138,7 +137,7 @@ def customiseKinksAndBows(process): ##### END OF EXTRA CONDITIONS else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Not applying extra calibration constants!") + print("############ testPVValidation_cfg.py: msg%-i: Not applying extra calibration constants!") #################################################################### @@ -224,10 +223,10 @@ def customiseKinksAndBows(process): #################################################################### def switchClusterizerParameters(da): if da: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running DA Algorithm!") + print("############ testPVValidation_cfg.py: msg%-i: Running DA Algorithm!") return DAClusterizationParams else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running GAP Algorithm!") + print("############ testPVValidation_cfg.py: msg%-i: Running GAP Algorithm!") return GapClusterizationParams #################################################################### diff --git a/Alignment/OfflineValidation/test/PVValidation_T_cfg.py b/Alignment/OfflineValidation/test/PVValidation_T_cfg.py index 24ab7925009d4..a6c39a694dd8e 100644 --- a/Alignment/OfflineValidation/test/PVValidation_T_cfg.py +++ b/Alignment/OfflineValidation/test/PVValidation_T_cfg.py @@ -1,4 +1,3 @@ -from __future__ import print_function import FWCore.ParameterSet.Config as cms from enum import Enum import sys @@ -16,6 +15,11 @@ class RefitType(Enum): process = cms.Process("PrimaryVertexValidation") +################################################################### +# Set the process to run multi-threaded +################################################################### +process.options.numberOfThreads = 8 + ################################################################### def customiseAlignmentAndAPE(process): ################################################################### @@ -64,10 +68,10 @@ def customiseKinksAndBows(process): # JSON Filtering ################################################################### if isMC: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is Simulation!") + print("############ testPVValidation_cfg.py: msg%-i: This is Simulation!") runboundary = 1 else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is DATA!") + print("############ testPVValidation_cfg.py: msg%-i: This is DATA!") import FWCore.PythonUtilities.LumiList as LumiList process.source.lumisToProcess = LumiList.LumiList(filename ='LUMILISTTEMPLATE').getVLuminosityBlockRange() @@ -105,7 +109,7 @@ def customiseKinksAndBows(process): process.GlobalTag = GlobalTag(process.GlobalTag, 'GLOBALTAGTEMPLATE', '') if allFromGT: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: All is taken from GT") + print("############ testPVValidation_cfg.py: msg%-i: All is taken from GT") else: #################################################################### # Get Alignment constants and APE @@ -116,10 +120,10 @@ def customiseKinksAndBows(process): # Kinks and Bows (optional) #################################################################### if applyBows: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Applying TrackerSurfaceDeformations!") + print("############ testPVValidation_cfg.py: msg%-i: Applying TrackerSurfaceDeformations!") process=customiseKinksAndBows(process) else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: MultiPVValidation: Not applying TrackerSurfaceDeformations!") + print("############ testPVValidation_cfg.py: msg%-i: MultiPVValidation: Not applying TrackerSurfaceDeformations!") #################################################################### # Extra corrections not included in the GT @@ -130,7 +134,7 @@ def customiseKinksAndBows(process): ##### END OF EXTRA CONDITIONS else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Not applying extra calibration constants!") + print("############ testPVValidation_cfg.py: msg%-i: Not applying extra calibration constants!") #################################################################### # Load and Configure event selection @@ -204,7 +208,7 @@ def customiseKinksAndBows(process): if(theRefitter == RefitType.COMMON): - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: using the common track selection and refit sequence!") + print("############ testPVValidation_cfg.py: msg%-i: using the common track selection and refit sequence!") #################################################################### # Load and Configure Common Track Selection and refitting sequence #################################################################### @@ -226,7 +230,7 @@ def customiseKinksAndBows(process): elif (theRefitter == RefitType.STANDARD): - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: using the standard single refit sequence!") + print("############ testPVValidation_cfg.py: msg%-i: using the standard single refit sequence!") #################################################################### # Load and Configure Measurement Tracker Event # (needed in case NavigationSchool is set != '') @@ -285,10 +289,10 @@ def customiseKinksAndBows(process): #################################################################### def switchClusterizerParameters(da): if da: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running DA Algorithm!") + print("############ testPVValidation_cfg.py: msg%-i: Running DA Algorithm!") return DAClusterizationParams else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running GAP Algorithm!") + print("############ testPVValidation_cfg.py: msg%-i: Running GAP Algorithm!") return GapClusterizationParams #################################################################### diff --git a/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py b/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py index 18f579cb92cfc..abaf96cb64b0f 100644 --- a/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py +++ b/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py @@ -5,7 +5,6 @@ here doing refit of tracks and vertices using latest alignment ''' -from __future__ import print_function import FWCore.ParameterSet.Config as cms from fnmatch import fnmatch import FWCore.ParameterSet.VarParsing as VarParsing @@ -13,6 +12,11 @@ process = cms.Process("PrimaryVertexResolution") +################################################################### +# Set the process to run multi-threaded +################################################################### +process.options.numberOfThreads = 8 + ################################################################### def best_match(rcd): ################################################################### diff --git a/Alignment/OfflineValidation/test/testTrackAnalyzers.cc b/Alignment/OfflineValidation/test/testTrackAnalyzers.cc index e9d149a63ba0a..479d34ee2463f 100644 --- a/Alignment/OfflineValidation/test/testTrackAnalyzers.cc +++ b/Alignment/OfflineValidation/test/testTrackAnalyzers.cc @@ -9,9 +9,9 @@ TEST_CASE("GeneralPurposeTrackAnalyzer tests", "[GeneralPurposeTrackAnalyzer]") //The python configuration const std::string baseConfig{ R"_(from FWCore.TestProcessor.TestProcess import * -from Alignment.OfflineValidation.GeneralPurposeTrackAnalyzer_cfi import GeneralPurposeTrackAnalyzer +from Alignment.OfflineValidation.generalPurposeTrackAnalyzer_cfi import generalPurposeTrackAnalyzer process = TestProcess() -process.trackAnalyzer = GeneralPurposeTrackAnalyzer +process.trackAnalyzer = generalPurposeTrackAnalyzer process.moduleToTest(process.trackAnalyzer) process.add_(cms.Service('MessageLogger')) process.add_(cms.Service('TFileService',fileName=cms.string('tesTrackAnalyzer1.root'))) @@ -45,9 +45,9 @@ TEST_CASE("DMRChecker tests", "[DMRChecker]") { //The python configuration const std::string baseConfig{ R"_(from FWCore.TestProcessor.TestProcess import * -from Alignment.OfflineValidation.DMRChecker_cfi import DMRChecker +from Alignment.OfflineValidation.dmrChecker_cfi import dmrChecker process = TestProcess() -process.dmrAnalyzer = DMRChecker +process.dmrAnalyzer = dmrChecker process.moduleToTest(process.dmrAnalyzer) process.add_(cms.Service('MessageLogger')) process.add_(cms.Service('TFileService',fileName=cms.string('tesTrackAnalyzer2.root'))) diff --git a/Alignment/OfflineValidation/test/test_all_cfg.py b/Alignment/OfflineValidation/test/test_all_cfg.py index 34e1f6c15d434..757ccdd56b130 100644 --- a/Alignment/OfflineValidation/test/test_all_cfg.py +++ b/Alignment/OfflineValidation/test/test_all_cfg.py @@ -1,8 +1,7 @@ -from __future__ import print_function import FWCore.ParameterSet.Config as cms import sys from enum import Enum -from Alignment.OfflineValidation.TkAlAllInOneTool.defaultInputFiles_cff import filesDefaultMC_Realistic2022 +from Alignment.OfflineValidation.TkAlAllInOneTool.defaultInputFiles_cff import filesDefaultMC_TTBarPU class RefitType(Enum): STANDARD = 1 @@ -17,11 +16,16 @@ class RefitType(Enum): process = cms.Process("Demo") +################################################################### +# Set the process to run multi-threaded +################################################################### +process.options.numberOfThreads = 8 + ################################################################### # Event source and run selection ################################################################### process.source = cms.Source("PoolSource", - fileNames = filesDefaultMC_Realistic2022, + fileNames = filesDefaultMC_TTBarPU, duplicateCheckMode = cms.untracked.string('checkAllFilesOpened') ) @@ -33,10 +37,10 @@ class RefitType(Enum): # JSON Filtering ################################################################### if isMC: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is Simulation!") + print("############ testPVValidation_cfg.py: msg%-i: This is Simulation!") runboundary = 1 else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is DATA!") + print("############ testPVValidation_cfg.py: msg%-i: This is DATA!") import FWCore.PythonUtilities.LumiList as LumiList process.source.lumisToProcess = LumiList.LumiList(filename ='None').getVLuminosityBlockRange() @@ -86,10 +90,10 @@ class RefitType(Enum): #################################################################### process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2022_realistic', '') if allFromGT: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: All is taken from GT") + print("############ testPVValidation_cfg.py: msg%-i: All is taken from GT") else: #################################################################### # Get Alignment constants @@ -122,7 +126,7 @@ class RefitType(Enum): # Kinks and Bows (optional) #################################################################### if applyBows: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Applying TrackerSurfaceDeformations!") + print("############ testPVValidation_cfg.py: msg%-i: Applying TrackerSurfaceDeformations!") process.trackerBows = cms.ESSource("PoolDBESSource",CondDBSetup, connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'), toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerSurfaceDeformationRcd'), @@ -132,7 +136,7 @@ class RefitType(Enum): ) process.es_prefer_Bows = cms.ESPrefer("PoolDBESSource", "trackerBows") else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: MultiPVValidation: Not applying TrackerSurfaceDeformations!") + print("############ testPVValidation_cfg.py: msg%-i: MultiPVValidation: Not applying TrackerSurfaceDeformations!") #################################################################### # Extra corrections not included in the GT @@ -143,7 +147,7 @@ class RefitType(Enum): ##### END OF EXTRA CONDITIONS else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Not applying extra calibration constants!") + print("############ testPVValidation_cfg.py: msg%-i: Not applying extra calibration constants!") #################################################################### # Load and Configure event selection @@ -181,7 +185,7 @@ class RefitType(Enum): if(theRefitter == RefitType.COMMON): - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: using the common track selection and refit sequence!") + print("############ testPVValidation_cfg.py: msg%-i: using the common track selection and refit sequence!") #################################################################### # Load and Configure Common Track Selection and refitting sequence #################################################################### @@ -200,7 +204,7 @@ class RefitType(Enum): elif (theRefitter == RefitType.STANDARD): - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: using the standard single refit sequence!") + print("############ testPVValidation_cfg.py: msg%-i: using the standard single refit sequence!") #################################################################### # Load and Configure Measurement Tracker Event # (needed in case NavigationSchool is set != '') @@ -261,10 +265,10 @@ class RefitType(Enum): #################################################################### def switchClusterizerParameters(da): if da: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running DA Algorithm!") + print("############ testPVValidation_cfg.py: msg%-i: Running DA Algorithm!") return DAClusterizationParams else: - print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running GAP Algorithm!") + print("############ testPVValidation_cfg.py: msg%-i: Running GAP Algorithm!") return GapClusterizationParams ####################################################################