diff --git a/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc b/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc index 9968e50d0ed48..195a354c2c45e 100644 --- a/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc +++ b/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc @@ -34,6 +34,7 @@ // user include files #include "CommonTools/TrackerMap/interface/TrackerMap.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "CondCore/SiPixelPlugins/interface/SiPixelPayloadInspectorHelper.h" #include "CondFormats/AlignmentRecord/interface/GlobalPositionRcd.h" #include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h" #include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" @@ -90,10 +91,14 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer()), - latencyToken_(esConsumes()), geomTokenBR_(esConsumes()), trackerTopologyTokenBR_(esConsumes()), siPixelFedCablingMapTokenBR_(esConsumes()) { + doLatencyAnalysis_ = pset.getParameter("doLatencyAnalysis"); + if (doLatencyAnalysis_) { + latencyToken_ = esConsumes(); + } + usesResource(TFileService::kSharedResource); TkTag_ = pset.getParameter("TkTag"); @@ -152,7 +157,7 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer geomToken_; const edm::ESGetToken magFieldToken_; - const edm::ESGetToken latencyToken_; + edm::ESGetToken latencyToken_; const edm::ESGetToken geomTokenBR_; const edm::ESGetToken trackerTopologyTokenBR_; @@ -282,9 +287,8 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer theTrackCollectionToken_; edm::EDGetTokenT hltresultsToken_; @@ -310,18 +315,10 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer trackCollection = event.getHandle(theTrackCollectionToken_); - // geometry setup const TrackerGeometry *theGeometry = &setup.getData(geomToken_); - // switch on the phase1 - if ((theGeometry->isThere(GeomDetEnumerators::P1PXB)) || (theGeometry->isThere(GeomDetEnumerators::P1PXEC))) { - isPhase1_ = true; - } else { - isPhase1_ = false; - } - + edm::Handle trackCollection = event.getHandle(theTrackCollectionToken_); const reco::TrackCollection tC = *(trackCollection.product()); itrks += tC.size(); @@ -387,12 +384,12 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzerfillSelectedRocs(detid_db, rocsToMask, 1); - - if (!isPhase1_) { + if (phase_ == SiPixelPI::phase::zero) { pmap->fill(detid_db, 1); - } else { + } else if (phase_ == SiPixelPI::phase::one) { + rocsToMask.set(rocId); + pixelrocsmap_->fillSelectedRocs(detid_db, rocsToMask, 1); + if (subid == PixelSubdetector::PixelBarrel) { pixelmap->fillBarrelBin("entriesBarrel", detid_db, 1); } else { @@ -426,7 +423,7 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzerisValid()) { + if ((*iHit)->isValid() && phase_ != SiPixelPI::phase::two) { tmap->fill(detId.rawId(), 1); } } @@ -720,19 +717,37 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzersingleReadOutMode() == 1) { - mode = 1; // peak mode - } else if (apvlat->singleReadOutMode() == 0) { - mode = -1; // deco mode + const TrackerGeometry *trackerGeometry = &setup.getData(geomTokenBR_); + if (trackerGeometry->isThere(GeomDetEnumerators::P2PXB) || trackerGeometry->isThere(GeomDetEnumerators::P2PXEC)) { + phase_ = SiPixelPI::phase::two; + } else if (trackerGeometry->isThere(GeomDetEnumerators::P1PXB) || + trackerGeometry->isThere(GeomDetEnumerators::P1PXEC)) { + phase_ = SiPixelPI::phase::one; + } else { + phase_ = SiPixelPI::phase::zero; + } + + // if it's a phase-2 geometry there are no phase-1 conditions + if (phase_ == SiPixelPI::phase::two) { + mode = 0; + } else { + if (doLatencyAnalysis_) { + //SiStrip Latency + const SiStripLatency *apvlat = &setup.getData(latencyToken_); + if (apvlat->singleReadOutMode() == 1) { + mode = 1; // peak mode + } else if (apvlat->singleReadOutMode() == 0) { + mode = -1; // deco mode + } + } else { + mode = 0; + } } conditionsMap_[run.run()].first = mode; conditionsMap_[run.run()].second = B_; // init the sipixel coordinates - const TrackerGeometry *trackerGeometry = &setup.getData(geomTokenBR_); const TrackerTopology *trackerTopology = &setup.getData(trackerTopologyTokenBR_); const SiPixelFedCablingMap *siPixelFedCablingMap = &setup.getData(siPixelFedCablingMapTokenBR_); @@ -753,8 +768,6 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzerGetXaxis()->SetBinLabel((the_r - theRuns_.front()) + 1, std::to_string(the_r).c_str()); } - if (!isPhase1_) { - pmap->save(true, 0, 0, "PixelHitMap.pdf", 600, 800); - pmap->save(true, 0, 0, "PixelHitMap.png", 500, 750); - } + if (phase_ < SiPixelPI::phase::two) { + if (phase_ == SiPixelPI::phase::zero) { + pmap->save(true, 0, 0, "PixelHitMap.pdf", 600, 800); + pmap->save(true, 0, 0, "PixelHitMap.png", 500, 750); + } - tmap->save(true, 0, 0, "StripHitMap.pdf"); - tmap->save(true, 0, 0, "StripHitMap.png"); + tmap->save(true, 0, 0, "StripHitMap.pdf"); + tmap->save(true, 0, 0, "StripHitMap.png"); - gStyle->SetPalette(kRainBow); - pixelmap->beautifyAllHistograms(); + gStyle->SetPalette(kRainBow); + pixelmap->beautifyAllHistograms(); - TCanvas cB("CanvBarrel", "CanvBarrel", 1200, 1000); - pixelmap->drawBarrelMaps("entriesBarrel", cB); - cB.SaveAs("pixelBarrelEntries.png"); + TCanvas cB("CanvBarrel", "CanvBarrel", 1200, 1000); + pixelmap->drawBarrelMaps("entriesBarrel", cB); + cB.SaveAs("pixelBarrelEntries.png"); - TCanvas cF("CanvForward", "CanvForward", 1600, 1000); - pixelmap->drawForwardMaps("entriesForward", cF); - cF.SaveAs("pixelForwardEntries.png"); + TCanvas cF("CanvForward", "CanvForward", 1600, 1000); + pixelmap->drawForwardMaps("entriesForward", cF); + cF.SaveAs("pixelForwardEntries.png"); - TCanvas cRocs = TCanvas("cRocs", "cRocs", 1200, 1600); - pixelrocsmap_->drawMaps(cRocs, "Pixel on-track clusters occupancy"); - cRocs.SaveAs("Phase1PixelROCMaps_fullROCs.png"); + TCanvas cRocs = TCanvas("cRocs", "cRocs", 1200, 1600); + pixelrocsmap_->drawMaps(cRocs, "Pixel on-track clusters occupancy"); + cRocs.SaveAs("Phase1PixelROCMaps_fullROCs.png"); + } } //************************************************************* @@ -1138,6 +1151,7 @@ void GeneralPurposeTrackAnalyzer::fillDescriptions(edm::ConfigurationDescription desc.add("BeamSpotTag", edm::InputTag("offlineBeamSpot")); desc.add("VerticesTag", edm::InputTag("offlinePrimaryVertices")); desc.add("isCosmics", false); + desc.add("doLatencyAnalysis", true); descriptions.addWithDefaultLabel(desc); } diff --git a/Alignment/OfflineValidation/python/TkAlAllInOneTool/defaultInputFiles_cff.py b/Alignment/OfflineValidation/python/TkAlAllInOneTool/defaultInputFiles_cff.py index 9b5f6cb491899..75dfdf9e9df3e 100644 --- a/Alignment/OfflineValidation/python/TkAlAllInOneTool/defaultInputFiles_cff.py +++ b/Alignment/OfflineValidation/python/TkAlAllInOneTool/defaultInputFiles_cff.py @@ -14,6 +14,23 @@ '/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' ) +filesDefaultMC_TTBarPUPhase2 = cms.untracked.vstring( + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/ALCARECO/TkAlMinBias-125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/27b7ab93-1d2b-4f4a-a98e-68386c314b5e.root', + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/ALCARECO/TkAlMinBias-125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/45b3c086-a3ac-429e-845f-4796ba8f2d3f.root', + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/ALCARECO/TkAlMinBias-125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/b82f7b2d-1e7f-43ce-a7bc-dc44ce3b2358.root' +) + +filesDefaultMC_TTBarPUPhase2RECO = cms.untracked.vstring( + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/GEN-SIM-RECO/125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/22e22ae6-a353-4f2e-815e-cc5efee37af9.root', + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/GEN-SIM-RECO/125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/87ea36b3-b17a-4f5a-ab5a-0973e684db1b.root', + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/GEN-SIM-RECO/125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/e9de823f-35f7-4493-ba4a-c1d9671d2d70.root', + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/GEN-SIM-RECO/125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/9c5055d6-5f74-4e26-8166-1f65cc7e6e5c.root', + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/GEN-SIM-RECO/125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/678538ab-9e17-4880-b27a-b7b5b045124d.root', + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/GEN-SIM-RECO/125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/7f9af44d-aff5-41be-9d0d-3cbbd35b19dd.root', + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/GEN-SIM-RECO/125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/d8d6b261-4897-4ee4-9210-d68041b3dd67.root', + '/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/GEN-SIM-RECO/125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/04fa3331-7c8a-420d-b07a-d677e2caf992.root' +) + filesDefaultData_JetHTRun2018D = cms.untracked.vstring( '/store/data/Run2018D/JetHT/ALCARECO/TkAlMinBias-12Nov2019_UL2018-v3/270000/AF80DFBE-C277-1142-AE8F-71FE4444370A.root' ) diff --git a/Alignment/OfflineValidation/test/test_all_Phase2_cfg.py b/Alignment/OfflineValidation/test/test_all_Phase2_cfg.py new file mode 100644 index 0000000000000..02f5b471b7b98 --- /dev/null +++ b/Alignment/OfflineValidation/test/test_all_Phase2_cfg.py @@ -0,0 +1,357 @@ +import FWCore.ParameterSet.Config as cms +import sys +from enum import Enum +from Alignment.OfflineValidation.TkAlAllInOneTool.defaultInputFiles_cff import filesDefaultMC_TTBarPUPhase2RECO + +class RefitType(Enum): + STANDARD = 1 + COMMON = 2 + +isDA = True +isMC = True +allFromGT = True +applyBows = True +applyExtraConditions = True +theRefitter = RefitType.STANDARD +_theTrackCollection = "generalTracks" #"ALCARECOTkAlMinBias" unfortunately not yet + +from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 +process = cms.Process("Demo",Phase2C17I13M9) + +################################################################### +# Set the process to run multi-threaded +################################################################### +process.options.numberOfThreads = 8 + +################################################################### +# Event source and run selection +################################################################### +process.source = cms.Source("PoolSource", + fileNames = filesDefaultMC_TTBarPUPhase2RECO, + duplicateCheckMode = cms.untracked.string('checkAllFilesOpened') + ) + +runboundary = 1 +process.source.firstRun = cms.untracked.uint32(int(runboundary)) +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) ) + +################################################################### +# JSON Filtering +################################################################### +if isMC: + print("############ testPVValidation_cfg.py: msg%-i: This is Simulation!") + runboundary = 1 +else: + print("############ testPVValidation_cfg.py: msg%-i: This is DATA!") + import FWCore.PythonUtilities.LumiList as LumiList + process.source.lumisToProcess = LumiList.LumiList(filename ='None').getVLuminosityBlockRange() + +################################################################### +# Messages +################################################################### +process.load('FWCore.MessageService.MessageLogger_cfi') +process.MessageLogger.cerr.enable = False +process.MessageLogger.PrimaryVertexValidation=dict() +process.MessageLogger.SplitVertexResolution=dict() +process.MessageLogger.FilterOutLowPt=dict() +process.MessageLogger.cout = cms.untracked.PSet( + enable = cms.untracked.bool(True), + threshold = cms.untracked.string("INFO"), + default = cms.untracked.PSet(limit = cms.untracked.int32(0)), + FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(-1), + reportEvery = cms.untracked.int32(1000) + ), + PrimaryVertexValidation = cms.untracked.PSet( limit = cms.untracked.int32(-1)), + SplitVertexResolution = cms.untracked.PSet( limit = cms.untracked.int32(-1)), + FilterOutLowPt = cms.untracked.PSet( limit = cms.untracked.int32(-1)), + enableStatistics = cms.untracked.bool(True) + ) + +#################################################################### +# Produce the Transient Track Record in the event +#################################################################### +process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi") + +#################################################################### +# Get the Magnetic Field +#################################################################### +process.load('Configuration.StandardSequences.MagneticField_cff') + +################################################################### +# Standard loads +################################################################### +#process.load("Configuration.Geometry.GeometryRecoDB_cff") +process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff') + +#################################################################### +# Get the BeamSpot +#################################################################### +process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff") + +#################################################################### +# Get the GlogalTag +#################################################################### +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') + +if allFromGT: + print("############ testPVValidation_cfg.py: msg%-i: All is taken from GT") +else: + #################################################################### + # Get Alignment constants + #################################################################### + from CondCore.DBCommon.CondDBSetup_cfi import * + process.trackerAlignment = cms.ESSource("PoolDBESSource",CondDBSetup, + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'), + timetype = cms.string("runnumber"), + toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerAlignmentRcd'), + tag = cms.string('TrackerAlignment_Upgrade2017_design_v4') + ) + ) + ) + process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource", "trackerAlignment") + + #################################################################### + # Get APE + #################################################################### + process.setAPE = cms.ESSource("PoolDBESSource",CondDBSetup, + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'), + timetype = cms.string("runnumber"), + toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerAlignmentErrorExtendedRcd'), + tag = cms.string('TrackerAlignmentErrorsExtended_Upgrade2017_design_v0') + ) + ) + ) + process.es_prefer_setAPE = cms.ESPrefer("PoolDBESSource", "setAPE") + + #################################################################### + # Kinks and Bows (optional) + #################################################################### + if applyBows: + 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'), + tag = cms.string('TrackerSurfaceDeformations_zero') + ) + ) + ) + process.es_prefer_Bows = cms.ESPrefer("PoolDBESSource", "trackerBows") + else: + print("############ testPVValidation_cfg.py: msg%-i: MultiPVValidation: Not applying TrackerSurfaceDeformations!") + + #################################################################### + # Extra corrections not included in the GT + #################################################################### + if applyExtraConditions: + + import CalibTracker.Configuration.Common.PoolDBESSource_cfi + ##### END OF EXTRA CONDITIONS + + else: + print("############ testPVValidation_cfg.py: msg%-i: Not applying extra calibration constants!") + +#################################################################### +# Load and Configure event selection +#################################################################### +process.primaryVertexFilter = cms.EDFilter("VertexSelector", + src = cms.InputTag("offlinePrimaryVertices"), + cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"), + filter = cms.bool(True) + ) + +process.noscraping = cms.EDFilter("FilterOutScraping", + applyfilter = cms.untracked.bool(True), + src = cms.untracked.InputTag(_theTrackCollection), + debugOn = cms.untracked.bool(False), + numtrack = cms.untracked.uint32(10), + thresh = cms.untracked.double(0.25) + ) + +process.noslowpt = cms.EDFilter("FilterOutLowPt", + applyfilter = cms.untracked.bool(True), + src = cms.untracked.InputTag(_theTrackCollection), + debugOn = cms.untracked.bool(False), + numtrack = cms.untracked.uint32(0), + thresh = cms.untracked.int32(1), + ptmin = cms.untracked.double(3.), + runControl = cms.untracked.bool(True), + runControlNumber = cms.untracked.vuint32(int(runboundary)) + ) + +if isMC: + process.goodvertexSkim = cms.Sequence(process.noscraping) +else: + process.goodvertexSkim = cms.Sequence(process.primaryVertexFilter + process.noscraping + process.noslowpt) + + +if(theRefitter == RefitType.COMMON): + + print("############ testPVValidation_cfg.py: msg%-i: using the common track selection and refit sequence!") + #################################################################### + # Load and Configure Common Track Selection and refitting sequence + #################################################################### + import Alignment.CommonAlignment.tools.trackselectionRefitting as trackselRefit + process.seqTrackselRefit = trackselRefit.getSequence(process, 'ALCARECOTkAlMinBias', + isPVValidation=True, + TTRHBuilder='WithAngleAndTemplate', + usePixelQualityFlag=True, + openMassWindow=False, + cosmicsDecoMode=True, + cosmicsZeroTesla=False, + momentumConstraint=None, + cosmicTrackSplitting=False, + use_d0cut=False, + ) + +elif (theRefitter == RefitType.STANDARD): + + print("############ testPVValidation_cfg.py: msg%-i: using the standard single refit sequence!") + #################################################################### + # Load and Configure Measurement Tracker Event + # (needed in case NavigationSchool is set != '') + #################################################################### + # process.load("RecoTracker.MeasurementDet.MeasurementTrackerEventProducer_cfi") + # process.MeasurementTrackerEvent.pixelClusterProducer = 'ALCARECOTkAlMinBias' + # process.MeasurementTrackerEvent.stripClusterProducer = 'ALCARECOTkAlMinBias' + # process.MeasurementTrackerEvent.inactivePixelDetectorLabels = cms.VInputTag() + # process.MeasurementTrackerEvent.inactiveStripDetectorLabels = cms.VInputTag() + + #################################################################### + # Load and Configure TrackRefitter + #################################################################### + process.load("RecoTracker.TrackProducer.TrackRefitters_cff") + import RecoTracker.TrackProducer.TrackRefitters_cff + process.FinalTrackRefitter = RecoTracker.TrackProducer.TrackRefitter_cfi.TrackRefitter.clone() + process.FinalTrackRefitter.src = _theTrackCollection + process.FinalTrackRefitter.TrajectoryInEvent = True + process.FinalTrackRefitter.NavigationSchool = '' + process.FinalTrackRefitter.TTRHBuilder = "WithAngleAndTemplate" + + #################################################################### + # Sequence + #################################################################### + process.seqTrackselRefit = cms.Sequence(process.offlineBeamSpot* + # in case NavigatioSchool is set !='' + #process.MeasurementTrackerEvent* + process.FinalTrackRefitter) + +#################################################################### +# Output file +#################################################################### +process.TFileService = cms.Service("TFileService", + fileName=cms.string("PVValidation_test_0.root") + ) + +#################################################################### +# Imports of parameters +#################################################################### +from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi import offlinePrimaryVertices +## modify the parameters which differ +FilteringParams = offlinePrimaryVertices.TkFilterParameters.clone( + maxNormalizedChi2 = 5.0, # chi2ndof < 5 + maxD0Significance = 5.0, # fake cut (requiring 1 PXB hit) + maxEta = 5.0, # as per recommendation in PR #18330 +) + +## MM 04.05.2017 (use settings as in: https://github.com/cms-sw/cmssw/pull/18330) +from RecoVertex.PrimaryVertexProducer.TkClusParameters_cff import DA_vectParameters +DAClusterizationParams = DA_vectParameters.clone() + +GapClusterizationParams = cms.PSet(algorithm = cms.string('gap'), + TkGapClusParameters = cms.PSet(zSeparation = cms.double(0.2)) # 0.2 cm max separation betw. clusters + ) + +#################################################################### +# Deterministic annealing clustering or Gap clustering +#################################################################### +def switchClusterizerParameters(da): + if da: + print("############ testPVValidation_cfg.py: msg%-i: Running DA Algorithm!") + return DAClusterizationParams + else: + print("############ testPVValidation_cfg.py: msg%-i: Running GAP Algorithm!") + return GapClusterizationParams + +#################################################################### +# Configure the PVValidation Analyzer module +#################################################################### +process.PVValidation = cms.EDAnalyzer("PrimaryVertexValidation", + TrackCollectionTag = cms.InputTag("FinalTrackRefitter"), + VertexCollectionTag = cms.InputTag("offlinePrimaryVertices"), + Debug = cms.bool(False), + storeNtuple = cms.bool(False), + useTracksFromRecoVtx = cms.bool(False), + isLightNtuple = cms.bool(True), + askFirstLayerHit = cms.bool(False), + forceBeamSpot = cms.untracked.bool(False), + probePt = cms.untracked.double(3.), + minPt = cms.untracked.double(1.), + maxPt = cms.untracked.double(30.), + runControl = cms.untracked.bool(True), + runControlNumber = cms.untracked.vuint32(int(runboundary)), + TkFilterParameters = FilteringParams, + TkClusParameters = switchClusterizerParameters(isDA) + ) + +#################################################################### +# Path +#################################################################### +process.p = cms.Path(process.goodvertexSkim* + process.seqTrackselRefit* + process.PVValidation) + +## PV refit part +process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi") +process.offlinePrimaryVerticesFromRefittedTrks = offlinePrimaryVertices.clone() +process.offlinePrimaryVerticesFromRefittedTrks.TrackLabel = cms.InputTag("FinalTrackRefitter") +process.offlinePrimaryVerticesFromRefittedTrks.vertexCollections.maxDistanceToBeam = 1 +process.offlinePrimaryVerticesFromRefittedTrks.TkFilterParameters.maxNormalizedChi2 = 20 +process.offlinePrimaryVerticesFromRefittedTrks.TkFilterParameters.minSiliconLayersWithHits = 5 +process.offlinePrimaryVerticesFromRefittedTrks.TkFilterParameters.maxD0Significance = 5.0 +# as it was prior to https://github.com/cms-sw/cmssw/commit/c8462ae4313b6be3bbce36e45373aa6e87253c59 +process.offlinePrimaryVerticesFromRefittedTrks.TkFilterParameters.maxD0Error = 1.0 +process.offlinePrimaryVerticesFromRefittedTrks.TkFilterParameters.maxDzError = 1.0 +process.offlinePrimaryVerticesFromRefittedTrks.TkFilterParameters.minPixelLayersWithHits = 2 + +################################################################### +# The trigger filter module +################################################################### +from HLTrigger.HLTfilters.triggerResultsFilter_cfi import * +process.HLTFilter = triggerResultsFilter.clone( + triggerConditions = cms.vstring("HLT_ZeroBias_*"), + #triggerConditions = cms.vstring("HLT_HT*"), + hltResults = cms.InputTag( "TriggerResults", "", "HLT" ), + l1tResults = cms.InputTag( "" ), + throw = cms.bool(False) +) + +################################################################### +# The analysis module +################################################################### +process.myanalysis = cms.EDAnalyzer("GeneralPurposeTrackAnalyzer", + TkTag = cms.InputTag('FinalTrackRefitter'), + doLatencyAnalysis = cms.bool(False), + isCosmics = cms.bool(False) + ) + +################################################################### +# The PV resolution module +################################################################### +process.PrimaryVertexResolution = cms.EDAnalyzer('SplitVertexResolution', + storeNtuple = cms.bool(True), + vtxCollection = cms.InputTag("offlinePrimaryVerticesFromRefittedTrks"), + trackCollection = cms.InputTag("FinalTrackRefitter"), + minVertexNdf = cms.untracked.double(10.), + minVertexMeanWeight = cms.untracked.double(0.5), + runControl = cms.untracked.bool(True), + runControlNumber = cms.untracked.vuint32(int(runboundary)) + ) + +process.p2 = cms.Path(process.HLTFilter + + process.seqTrackselRefit + + process.offlinePrimaryVerticesFromRefittedTrks + + process.PrimaryVertexResolution + + process.myanalysis + ) diff --git a/Alignment/OfflineValidation/test/test_all_cfg.py b/Alignment/OfflineValidation/test/test_all_cfg.py index 757ccdd56b130..ef79abc96d7ea 100644 --- a/Alignment/OfflineValidation/test/test_all_cfg.py +++ b/Alignment/OfflineValidation/test/test_all_cfg.py @@ -13,8 +13,9 @@ class RefitType(Enum): applyBows = True applyExtraConditions = True theRefitter = RefitType.COMMON +_theTrackCollection = 'generalTracks' # 'ALCARECOTkAlMinBias' -process = cms.Process("Demo") +process = cms.Process("Demo") ################################################################### # Set the process to run multi-threaded @@ -160,7 +161,7 @@ class RefitType(Enum): process.noscraping = cms.EDFilter("FilterOutScraping", applyfilter = cms.untracked.bool(True), - src = cms.untracked.InputTag("generalTracks"), + src = cms.untracked.InputTag(_theTrackCollection), debugOn = cms.untracked.bool(False), numtrack = cms.untracked.uint32(10), thresh = cms.untracked.double(0.25) @@ -168,7 +169,7 @@ class RefitType(Enum): process.noslowpt = cms.EDFilter("FilterOutLowPt", applyfilter = cms.untracked.bool(True), - src = cms.untracked.InputTag("generalTracks"), + src = cms.untracked.InputTag(_theTrackCollection), debugOn = cms.untracked.bool(False), numtrack = cms.untracked.uint32(0), thresh = cms.untracked.int32(1), @@ -190,7 +191,7 @@ class RefitType(Enum): # Load and Configure Common Track Selection and refitting sequence #################################################################### import Alignment.CommonAlignment.tools.trackselectionRefitting as trackselRefit - process.seqTrackselRefit = trackselRefit.getSequence(process, 'generalTracks', + process.seqTrackselRefit = trackselRefit.getSequence(process, _theTrackCollection, isPVValidation=True, TTRHBuilder='WithAngleAndTemplate', usePixelQualityFlag=True, @@ -210,8 +211,8 @@ class RefitType(Enum): # (needed in case NavigationSchool is set != '') #################################################################### # process.load("RecoTracker.MeasurementDet.MeasurementTrackerEventProducer_cfi") - # process.MeasurementTrackerEvent.pixelClusterProducer = 'generalTracks' - # process.MeasurementTrackerEvent.stripClusterProducer = 'generalTracks' + # process.MeasurementTrackerEvent.pixelClusterProducer = '_theTrackCollection' + # process.MeasurementTrackerEvent.stripClusterProducer = '_theTrackCollection' # process.MeasurementTrackerEvent.inactivePixelDetectorLabels = cms.VInputTag() # process.MeasurementTrackerEvent.inactiveStripDetectorLabels = cms.VInputTag() @@ -221,7 +222,7 @@ class RefitType(Enum): process.load("RecoTracker.TrackProducer.TrackRefitters_cff") import RecoTracker.TrackProducer.TrackRefitters_cff process.FinalTrackRefitter = RecoTracker.TrackProducer.TrackRefitter_cfi.TrackRefitter.clone() - process.FinalTrackRefitter.src = "generalTracks" + process.FinalTrackRefitter.src = _theTrackCollection process.FinalTrackRefitter.TrajectoryInEvent = True process.FinalTrackRefitter.NavigationSchool = '' process.FinalTrackRefitter.TTRHBuilder = "WithAngleAndTemplate" diff --git a/Alignment/OfflineValidation/test/test_unitGeneralTrackAnalyser.sh b/Alignment/OfflineValidation/test/test_unitGeneralTrackAnalyser.sh index 7aa97ac16be09..f8fb7d36ad9de 100755 --- a/Alignment/OfflineValidation/test/test_unitGeneralTrackAnalyser.sh +++ b/Alignment/OfflineValidation/test/test_unitGeneralTrackAnalyser.sh @@ -4,5 +4,6 @@ function die { echo $1: status $2 ; exit $2; } echo "TESTING Alignment/OfflineValidation ..." cmsRun ${LOCAL_TEST_DIR}/test_all_cfg.py || die "Failure running test_all_cfg.py" $? +cmsRun ${LOCAL_TEST_DIR}/test_all_Phase2_cfg.py || die "Failure running test_all_Phase2_cfg.py" $? cmsRun ${LOCAL_TEST_DIR}/inspectData_cfg.py unitTest=True || die "Failure running inspectData_cfg.py" $?