1 PrimaryVertexValidationTemplate=
""" 6 ################################################################### 8 ################################################################### 9 runboundary = .oO[runboundary]Oo. 11 if(isinstance(runboundary, (list, tuple))): 13 print "Multiple Runs are selected" 16 process.source.firstRun = cms.untracked.uint32(int(runboundary[0])) 18 process.source.firstRun = cms.untracked.uint32(int(runboundary)) 20 ################################################################### 22 ################################################################### 24 print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is simulation!" 27 print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is real DATA!" 28 if ('.oO[lumilist]Oo.'): 29 print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: JSON filtering with: .oO[lumilist]Oo. " 30 import FWCore.PythonUtilities.LumiList as LumiList 31 process.source.lumisToProcess = LumiList.LumiList(filename ='.oO[lumilist]Oo.').getVLuminosityBlockRange() 33 #################################################################### 34 # Produce the Transient Track Record in the event 35 #################################################################### 36 process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi") 38 #################################################################### 39 # Load and Configure event selection 40 #################################################################### 41 process.primaryVertexFilter = cms.EDFilter("VertexSelector", 42 src = cms.InputTag(".oO[VertexCollection]Oo."), 43 cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"), 44 filter = cms.bool(True) 47 process.noscraping = cms.EDFilter("FilterOutScraping", 48 applyfilter = cms.untracked.bool(True), 49 src = cms.untracked.InputTag(".oO[TrackCollection]Oo."), 50 debugOn = cms.untracked.bool(False), 51 numtrack = cms.untracked.uint32(10), 52 thresh = cms.untracked.double(0.25) 56 process.load("Alignment.CommonAlignment.filterOutLowPt_cfi") 57 process.filterOutLowPt.src = ".oO[TrackCollection]Oo." 58 process.filterOutLowPt.ptmin = .oO[ptCut]Oo. 59 process.filterOutLowPt.runControl = .oO[runControl]Oo. 61 process.filterOutLowPt.runControlNumber.extend((runboundary)) 63 process.filterOutLowPt.runControlNumber = [runboundary] 66 process.goodvertexSkim = cms.Sequence(process.noscraping + process.filterOutLowPt) 68 process.goodvertexSkim = cms.Sequence(process.primaryVertexFilter + process.noscraping + process.filterOutLowPt) 70 #################################################################### 71 # Deterministic annealing clustering 72 #################################################################### 74 print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running DA Algorithm!" 75 process.PVValidation = cms.EDAnalyzer("PrimaryVertexValidation", 76 TrackCollectionTag = cms.InputTag("FinalTrackRefitter"), 77 VertexCollectionTag = cms.InputTag(".oO[VertexCollection]Oo."), 78 Debug = cms.bool(False), 79 storeNtuple = cms.bool(False), 80 useTracksFromRecoVtx = cms.bool(False), 81 isLightNtuple = cms.bool(True), 82 askFirstLayerHit = cms.bool(False), 83 probePt = cms.untracked.double(.oO[ptCut]Oo.), 84 probeEta = cms.untracked.double(.oO[etaCut]Oo.), 85 doBPix = cms.untracked.bool(.oO[doBPix]Oo.), 86 doFPix = cms.untracked.bool(.oO[doFPix]Oo.), 87 numberOfBins = cms.untracked.int32(.oO[numberOfBins]Oo.), 88 runControl = cms.untracked.bool(.oO[runControl]Oo.), 89 runControlNumber = cms.untracked.vuint32(runboundary), 91 TkFilterParameters = cms.PSet(algorithm=cms.string('filter'), 92 maxNormalizedChi2 = cms.double(5.0), # chi2ndof < 5 93 minPixelLayersWithHits = cms.int32(2), # PX hits > 2 94 minSiliconLayersWithHits = cms.int32(5), # TK hits > 5 95 maxD0Significance = cms.double(5.0), # fake cut (requiring 1 PXB hit) 96 minPt = cms.double(0.0), # better for softish events 97 maxEta = cms.double(5.0), # as per recommendation in PR #18330 98 trackQuality = cms.string("any") 101 ## MM 04.05.2017 (use settings as in: https://github.com/cms-sw/cmssw/pull/18330) 102 TkClusParameters=cms.PSet(algorithm=cms.string('DA_vect'), 103 TkDAClusParameters = cms.PSet(coolingFactor = cms.double(0.6), # moderate annealing speed 104 Tmin = cms.double(2.0), # end of vertex splitting 105 Tpurge = cms.double(2.0), # cleaning 106 Tstop = cms.double(0.5), # end of annealing 107 vertexSize = cms.double(0.006), # added in quadrature to track-z resolutions 108 d0CutOff = cms.double(3.), # downweight high IP tracks 109 dzCutOff = cms.double(3.), # outlier rejection after freeze-out (T<Tmin) 110 zmerge = cms.double(1e-2), # merge intermediat clusters separated by less than zmerge 111 uniquetrkweight = cms.double(0.8) # require at least two tracks with this weight at T=Tpurge 116 #################################################################### 118 #################################################################### 120 print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running GAP Algorithm!" 121 process.PVValidation = cms.EDAnalyzer("PrimaryVertexValidation", 122 TrackCollectionTag = cms.InputTag("FinalTrackRefitter"), 123 VertexCollectionTag = cms.InputTag(".oO[VertexCollection]Oo."), 124 Debug = cms.bool(False), 125 isLightNtuple = cms.bool(True), 126 storeNtuple = cms.bool(False), 127 useTracksFromRecoVtx = cms.bool(False), 128 askFirstLayerHit = cms.bool(False), 129 probePt = cms.untracked.double(.oO[ptCut]Oo.), 130 probeEta = cms.untracked.double(.oO[etaCut]Oo.), 131 doBPix = cms.untracked.bool(.oO[doBPix]Oo.), 132 doFPix = cms.untracked.bool(.oO[doFPix]Oo.), 133 numberOfBins = cms.untracked.int32(.oO[numberOfBins]Oo.), 134 runControl = cms.untracked.bool(.oO[runControl]Oo.), 135 runControlNumber = cms.untracked.vuint32(int(.oO[runboundary]Oo.)), 137 TkFilterParameters = cms.PSet(algorithm=cms.string('filter'), 138 maxNormalizedChi2 = cms.double(5.0), # chi2ndof < 20 139 minPixelLayersWithHits=cms.int32(2), # PX hits > 2 140 minSiliconLayersWithHits = cms.int32(5), # TK hits > 5 141 maxD0Significance = cms.double(5.0), # fake cut (requiring 1 PXB hit) 142 minPt = cms.double(0.0), # better for softish events 143 maxEta = cms.double(5.0), # as per recommendation in PR #18330 144 trackQuality = cms.string("any") 147 TkClusParameters = cms.PSet(algorithm = cms.string('gap'), 148 TkGapClusParameters = cms.PSet(zSeparation = cms.double(0.2) # 0.2 cm max separation betw. clusters 158 process.p = cms.Path(process.goodvertexSkim* 159 process.seqTrackselRefit* 160 process.PVValidation) 165 PVValidationScriptTemplate=
""" 167 source /afs/cern.ch/cms/caf/setup.sh 169 echo ----------------------- 170 echo Job started at `date` 171 echo ----------------------- 173 export theLabel=.oO[alignmentName]Oo. 174 export theDate=.oO[runboundary]Oo. 177 cd .oO[CMSSW_BASE]Oo./src 178 export SCRAM_ARCH=.oO[SCRAM_ARCH]Oo. 179 eval `scram runtime -sh` 182 rfmkdir -p .oO[datadir]Oo. 183 rfmkdir -p .oO[workingdir]Oo. 184 rfmkdir -p .oO[logdir]Oo. 185 rm -f .oO[logdir]Oo./*.stdout 186 rm -f .oO[logdir]Oo./*.stderr 188 if [[ $HOSTNAME = lxplus[0-9]*[.a-z0-9]* ]] # check for interactive mode 190 rfmkdir -p .oO[workdir]Oo. 191 rm -f .oO[workdir]Oo./* 194 mkdir -p $cwd/TkAllInOneTool 195 cd $cwd/TkAllInOneTool 202 eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo./plots/ 203 for RootOutputFile in $(ls *root ) 205 xrdcp -f ${RootOutputFile} root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./${RootOutputFile} 206 rfcp ${RootOutputFile} .oO[workingdir]Oo. 209 cp .oO[Alignment/OfflineValidation]Oo./macros/FitPVResiduals.C . 210 cp .oO[Alignment/OfflineValidation]Oo./macros/CMS_lumi.C . 211 cp .oO[Alignment/OfflineValidation]Oo./macros/CMS_lumi.h . 213 if [[ .oO[pvvalidationreference]Oo. == *store* ]]; then xrdcp -f .oO[pvvalidationreference]Oo. PVValidation_reference.root; else ln -fs .oO[pvvalidationreference]Oo. ./PVValidation_reference.root; fi 215 root -b -q "FitPVResiduals.C(\\"${PWD}/${RootOutputFile}=${theLabel},${PWD}/PVValidation_reference.root=Design simulation\\",true,true,\\"$theDate\\")" 217 mkdir -p .oO[plotsdir]Oo. 218 for PngOutputFile in $(ls *png ); do 219 xrdcp -f ${PngOutputFile} root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./plots/${PngOutputFile} 220 rfcp ${PngOutputFile} .oO[plotsdir]Oo. 223 for PdfOutputFile in $(ls *pdf ); do 224 xrdcp -f ${PdfOutputFile} root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./plots/${PdfOutputFile} 225 rfcp ${PdfOutputFile} .oO[plotsdir]Oo. 228 mkdir .oO[plotsdir]Oo./Biases/ 229 mkdir .oO[plotsdir]Oo./Biases/dzPhi 230 mkdir .oO[plotsdir]Oo./Biases/dxyPhi 231 mkdir .oO[plotsdir]Oo./Biases/dzEta 232 mkdir .oO[plotsdir]Oo./Biases/dxyEta 233 mkdir .oO[plotsdir]Oo./Fit 234 mkdir .oO[plotsdir]Oo./dxyVsEta 235 mkdir .oO[plotsdir]Oo./dzVsEta 236 mkdir .oO[plotsdir]Oo./dxyVsPhi 237 mkdir .oO[plotsdir]Oo./dzVsPhi 238 mkdir .oO[plotsdir]Oo./dxyVsEtaNorm 239 mkdir .oO[plotsdir]Oo./dzVsEtaNorm 240 mkdir .oO[plotsdir]Oo./dxyVsPhiNorm 241 mkdir .oO[plotsdir]Oo./dzVsPhiNorm 243 mv .oO[plotsdir]Oo./BiasesCanvas* .oO[plotsdir]Oo./Biases/ 244 mv .oO[plotsdir]Oo./dzPhiBiasCanvas* .oO[plotsdir]Oo./Biases/dzPhi 245 mv .oO[plotsdir]Oo./dxyPhiBiasCanvas* .oO[plotsdir]Oo./Biases/dxyPhi 246 mv .oO[plotsdir]Oo./dzEtaBiasCanvas* .oO[plotsdir]Oo./Biases/dzEta 247 mv .oO[plotsdir]Oo./dxyEtaBiasCanvas* .oO[plotsdir]Oo./Biases/dxyEta 248 mv .oO[plotsdir]Oo./dzPhiTrendFit* .oO[plotsdir]Oo./Fit 249 mv .oO[plotsdir]Oo./dxyEtaTrendNorm* .oO[plotsdir]Oo./dxyVsEtaNorm 250 mv .oO[plotsdir]Oo./dzEtaTrendNorm* .oO[plotsdir]Oo./dzVsEtaNorm 251 mv .oO[plotsdir]Oo./dxyPhiTrendNorm* .oO[plotsdir]Oo./dxyVsPhiNorm 252 mv .oO[plotsdir]Oo./dzPhiTrendNorm* .oO[plotsdir]Oo./dzVsPhiNorm 253 mv .oO[plotsdir]Oo./dxyEtaTrend* .oO[plotsdir]Oo./dxyVsEta 254 mv .oO[plotsdir]Oo./dzEtaTrend* .oO[plotsdir]Oo./dzVsEta 255 mv .oO[plotsdir]Oo./dxyPhiTrend* .oO[plotsdir]Oo./dxyVsPhi 256 mv .oO[plotsdir]Oo./dzPhiTrend* .oO[plotsdir]Oo./dzVsPhi 258 wget https://raw.githubusercontent.com/mmusich/PVToolScripts/master/PolishedScripts/index.php 260 cp index.php .oO[plotsdir]Oo./Biases/ 261 cp index.php .oO[plotsdir]Oo./Biases/dzPhi 262 cp index.php .oO[plotsdir]Oo./Biases/dxyPhi 263 cp index.php .oO[plotsdir]Oo./Biases/dzEta 264 cp index.php .oO[plotsdir]Oo./Biases/dxyEta 265 cp index.php .oO[plotsdir]Oo./Fit 266 cp index.php .oO[plotsdir]Oo./dxyVsEta 267 cp index.php .oO[plotsdir]Oo./dzVsEta 268 cp index.php .oO[plotsdir]Oo./dxyVsPhi 269 cp index.php .oO[plotsdir]Oo./dzVsPhi 270 cp index.php .oO[plotsdir]Oo./dxyVsEtaNorm 271 cp index.php .oO[plotsdir]Oo./dzVsEtaNorm 272 cp index.php .oO[plotsdir]Oo./dxyVsPhiNorm 273 cp index.php .oO[plotsdir]Oo./dzVsPhiNorm 276 echo ----------------------- 277 echo Job ended at `date` 278 echo ----------------------- 285 PrimaryVertexPlotExecution=
""" 286 #make primary vertex validation plots 288 rfcp .oO[plottingscriptpath]Oo. . 289 root -x -b -q .oO[plottingscriptname]Oo.++ 291 for PdfOutputFile in $(ls *pdf ); do 292 xrdcp -f ${PdfOutputFile} root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./plots/${PdfOutputFile} 293 rfcp ${PdfOutputFile} .oO[datadir]Oo./.oO[PlotsDirName]Oo. 296 for PngOutputFile in $(ls *png ); do 297 xrdcp -f ${PngOutputFile} root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./plots/${PngOutputFile} 298 rfcp ${PngOutputFile} .oO[datadir]Oo./.oO[PlotsDirName]Oo. 306 PrimaryVertexPlotTemplate=
""" 307 /**************************************** 308 This can be run directly in root, or you 309 can run ./TkAlMerge.sh in this directory 310 ****************************************/ 312 #include "Alignment/OfflineValidation/macros/FitPVResiduals.C" 314 void TkAlPrimaryVertexValidationPlot() 317 // initialize the plot y-axis ranges 318 thePlotLimits->init(.oO[m_dxyPhiMax]Oo., // mean of dxy vs Phi 319 .oO[m_dzPhiMax]Oo., // mean of dz vs Phi 320 .oO[m_dxyEtaMax]Oo., // mean of dxy vs Eta 321 .oO[m_dzEtaMax]Oo., // mean of dz vs Eta 322 .oO[m_dxyPhiNormMax]Oo., // mean of dxy vs Phi (norm) 323 .oO[m_dzPhiNormMax]Oo., // mean of dz vs Phi (norm) 324 .oO[m_dxyEtaNormMax]Oo., // mean of dxy vs Eta (norm) 325 .oO[m_dzEtaNormMax]Oo., // mean of dz vs Eta (norm) 326 .oO[w_dxyPhiMax]Oo., // width of dxy vs Phi 327 .oO[w_dzPhiMax]Oo., // width of dz vs Phi 328 .oO[w_dxyEtaMax]Oo., // width of dxy vs Eta 329 .oO[w_dzEtaMax]Oo., // width of dz vs Eta 330 .oO[w_dxyPhiNormMax]Oo., // width of dxy vs Phi (norm) 331 .oO[w_dzPhiNormMax]Oo., // width of dz vs Phi (norm) 332 .oO[w_dxyEtaNormMax]Oo., // width of dxy vs Eta (norm) 333 .oO[w_dzEtaNormMax]Oo. // width of dz vs Eta (norm) 336 .oO[PlottingInstantiation]Oo. 337 FitPVResiduals("",.oO[stdResiduals]Oo.,.oO[doMaps]Oo.,"",.oO[autoLimits]Oo.);