1 PrimaryVertexResolutionTemplate=
"""
3 HLTSel = .oO[doTriggerSelection]Oo.
5 ###################################################################
7 ###################################################################
8 runboundary = .oO[runboundary]Oo.
10 if(isinstance(runboundary, (list, tuple))):
12 print "Multiple Runs are selected"
15 process.source.firstRun = cms.untracked.uint32(int(runboundary[0]))
17 process.source.firstRun = cms.untracked.uint32(int(runboundary))
20 ###################################################################
21 # The trigger filter module
22 ###################################################################
23 from HLTrigger.HLTfilters.triggerResultsFilter_cfi import *
24 process.theHLTFilter = triggerResultsFilter.clone(
25 triggerConditions = cms.vstring(.oO[triggerBits]Oo.),
26 hltResults = cms.InputTag( "TriggerResults", "", "HLT" ),
27 l1tResults = cms.InputTag( "" ),
28 throw = cms.bool(False)
31 ###################################################################
33 ###################################################################
34 process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi")
36 from RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi import offlinePrimaryVertices
37 process.offlinePrimaryVerticesFromRefittedTrks = offlinePrimaryVertices.clone()
38 process.offlinePrimaryVerticesFromRefittedTrks.TrackLabel = cms.InputTag("TrackRefitter")
39 process.offlinePrimaryVerticesFromRefittedTrks.vertexCollections.maxDistanceToBeam = 1
40 process.offlinePrimaryVerticesFromRefittedTrks.TkFilterParameters.maxNormalizedChi2 = 20
41 process.offlinePrimaryVerticesFromRefittedTrks.TkFilterParameters.minSiliconLayersWithHits = 5
42 process.offlinePrimaryVerticesFromRefittedTrks.TkFilterParameters.maxD0Significance = 5.0
43 process.offlinePrimaryVerticesFromRefittedTrks.TkFilterParameters.minPixelLayersWithHits = 2
45 ###################################################################
46 # The PV resolution module
47 ###################################################################
48 process.PrimaryVertexResolution = cms.EDAnalyzer('SplitVertexResolution',
49 storeNtuple = cms.bool(False),
50 vtxCollection = cms.InputTag("offlinePrimaryVerticesFromRefittedTrks"),
51 trackCollection = cms.InputTag("TrackRefitter"),
52 minVertexNdf = cms.untracked.double(10.),
53 minVertexMeanWeight = cms.untracked.double(0.5),
54 runControl = cms.untracked.bool(.oO[runControl]Oo.),
55 runControlNumber = cms.untracked.vuint32(runboundary)
64 process.theValidSequence = cms.Sequence(process.offlineBeamSpot +
65 process.TrackRefitter +
66 process.offlinePrimaryVerticesFromRefittedTrks +
67 process.PrimaryVertexResolution)
69 process.p = cms.Path(process.theHLTFilter + process.theValidSequence)
71 process.p = cms.Path(process.theValidSequence)
76 PVResolutionScriptTemplate=
"""#!/bin/bash
77 source /afs/cern.ch/cms/caf/setup.sh
78 export X509_USER_PROXY=.oO[scriptsdir]Oo./.user_proxy
80 source /afs/cern.ch/cms/caf/setup.sh
82 echo -----------------------
83 echo Job started at `date`
84 echo -----------------------
86 export theLabel=.oO[alignmentName]Oo.
87 export theDate=.oO[runboundary]Oo.
90 cd .oO[CMSSW_BASE]Oo./src
91 export SCRAM_ARCH=.oO[SCRAM_ARCH]Oo.
92 eval `scram runtime -sh`
95 mkdir -p .oO[datadir]Oo.
96 mkdir -p .oO[workingdir]Oo.
97 mkdir -p .oO[logdir]Oo.
98 rm -f .oO[logdir]Oo./*.stdout
99 rm -f .oO[logdir]Oo./*.stderr
101 if [[ $HOSTNAME = lxplus[0-9]*[.a-z0-9]* ]] # check for interactive mode
103 mkdir -p .oO[workdir]Oo.
104 rm -f .oO[workdir]Oo./*
107 mkdir -p $cwd/TkAllInOneTool
108 cd $cwd/TkAllInOneTool
115 eos mkdir -p /store/group/alca_trackeralign/AlignmentValidation/.oO[eosdir]Oo./plots/
117 for RootOutputFile in $(ls *root )
119 xrdcp -f ${RootOutputFile} root://eoscms//eos/cms/store/group/alca_trackeralign/AlignmentValidation/.oO[eosdir]Oo./${RootOutputFile}
120 cp ${RootOutputFile} .oO[workingdir]Oo.
123 cp .oO[Alignment/OfflineValidation]Oo./macros/FitPVResolution.C .
124 cp .oO[Alignment/OfflineValidation]Oo./macros/CMS_lumi.C .
125 cp .oO[Alignment/OfflineValidation]Oo./macros/CMS_lumi.h .
127 if [[ .oO[pvresolutionreference]Oo. == *store* ]]; then xrdcp -f .oO[pvresolutionreference]Oo. PVValidation_reference.root; else ln -fs .oO[pvresolutionreference]Oo. ./PVResolution_reference.root; fi
129 root -b -q "FitPVResolution.C(\\"${PWD}/${RootOutputFile}=${theLabel},${PWD}/PVValidation_reference.root=Design simulation\\",\\"$theDate\\")"
131 mkdir -p .oO[plotsdir]Oo.
132 for PngOutputFile in $(ls *png ); do
133 xrdcp -f ${PngOutputFile} root://eoscms//eos/cms/store/group/alca_trackeralign/AlignmentValidation/.oO[eosdir]Oo./plots/${PngOutputFile}
134 cp ${PngOutputFile} .oO[plotsdir]Oo.
137 for PdfOutputFile in $(ls *pdf ); do
138 xrdcp -f ${PdfOutputFile} root://eoscms//eos/cms/store/group/alca_trackeralign/AlignmentValidation/.oO[eosdir]Oo./plots/${PdfOutputFile}
139 cp ${PdfOutputFile} .oO[plotsdir]Oo.
142 echo -----------------------
143 echo Job ended at `date`
144 echo -----------------------
151 PVResolutionPlotExecution=
"""
152 #make primary vertex validation plots
154 cp .oO[plottingscriptpath]Oo. .
155 root -x -b -q .oO[plottingscriptname]Oo.++
157 for PdfOutputFile in $(ls *pdf ); do
158 xrdcp -f ${PdfOutputFile} root://eoscms//eos/cms/store/group/alca_trackeralign/AlignmentValidation/.oO[eosdir]Oo./plots/${PdfOutputFile}
159 cp ${PdfOutputFile} .oO[datadir]Oo./.oO[PlotsDirName]Oo.
162 for PngOutputFile in $(ls *png ); do
163 xrdcp -f ${PngOutputFile} root://eoscms//eos/cms/store/group/alca_trackeralign/AlignmentValidation/.oO[eosdir]Oo./plots/${PngOutputFile}
164 cp ${PngOutputFile} .oO[datadir]Oo./.oO[PlotsDirName]Oo.
172 PVResolutionPlotTemplate=
"""
173 /****************************************
174 This can be run directly in root, or you
175 can run ./TkAlMerge.sh in this directory
176 ****************************************/
178 #include "Alignment/OfflineValidation/macros/FitPVResolution.C"
180 void TkAlPrimaryVertexResolutionPlot()
183 // initialize the plot y-axis ranges
184 .oO[PlottingInstantiation]Oo.
185 FitPVResolution("","");