1 from alternateValidationTemplates
import *
2 from offlineValidationTemplates
import *
3 from primaryVertexValidationTemplates
import *
4 from geometryComparisonTemplates
import *
5 from monteCarloValidationTemplates
import *
6 from trackSplittingValidationTemplates
import *
7 from zMuMuValidationTemplates
import *
8 from TkAlExceptions
import AllInOneError
20 loadGlobalTagTemplate=
""" 22 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") 23 from Configuration.AlCa.GlobalTag import GlobalTag 24 process.GlobalTag = GlobalTag(process.GlobalTag,".oO[GlobalTag]Oo.") 30 conditionsTemplate=
""" 31 process.conditionsIn.oO[rcdName]Oo. = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone( 32 connect = cms.string('.oO[connectString]Oo.'), 33 toGet = cms.VPSet(cms.PSet(record = cms.string('.oO[rcdName]Oo.'), 34 tag = cms.string('.oO[tagName]Oo.') 38 process.prefer_conditionsIn.oO[rcdName]Oo. = cms.ESPrefer("PoolDBESSource", "conditionsIn.oO[rcdName]Oo.") 49 #export STAGE_SVCCLASS=cmscafuser 50 #save path to the LSF batch working directory (/pool/lsf) 52 export LSFWORKDIR=`pwd -P` 53 echo LSF working directory is $LSFWORKDIR 54 source /afs/cern.ch/cms/caf/setup.sh 55 eos='/afs/cern.ch/project/eos/installation/cms/bin/eos.select' 56 export X509_USER_PROXY=.oO[scriptsdir]Oo./.user_proxy 57 cd .oO[CMSSW_BASE]Oo./src 58 export SCRAM_ARCH=.oO[SCRAM_ARCH]Oo. 60 #rfmkdir -p .oO[datadir]Oo. &>! /dev/null 62 #remove possible result file from previous runs 63 previous_results=$($eos ls /store/caf/user/$USER/.oO[eosdir]Oo.) 64 for file in ${previous_results} 66 if [ ${file} = /store/caf/user/$USER/.oO[eosdir]Oo./.oO[outputFile]Oo. ] 68 xrdcp -f root://eoscms//eos/cms${file} root://eoscms//eos/cms${file}.bak 72 if [[ $HOSTNAME = lxplus[0-9]*[.a-z0-9]* ]] # check for interactive mode 74 rfmkdir -p .oO[workdir]Oo. 75 rm -f .oO[workdir]Oo./* 78 mkdir -p $LSFWORKDIR/TkAllInOneTool 79 cd $LSFWORKDIR/TkAllInOneTool 82 # rm -f .oO[workdir]Oo./* 90 echo "List of files in $(pwd):" 97 rfmkdir -p .oO[logdir]Oo. >&! /dev/null 98 gzip -f LOGFILE_*_.oO[name]Oo..log 99 find . -maxdepth 1 -name "LOGFILE*.oO[alignmentName]Oo.*" -print | xargs -I {} bash -c "rfcp {} .oO[logdir]Oo." 101 #copy root files to eos 102 $eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo. 103 if [ .oO[parallelJobs]Oo. -eq 1 ] 105 root_files=$(ls --color=never -d *.oO[alignmentName]Oo.*.root) 107 root_files=$(ls --color=never -d *.oO[alignmentName]Oo._.oO[nIndex]Oo.*.root) 111 for file in ${root_files} 113 xrdcp -f ${file} root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo. 118 if [[ $HOSTNAME = lxplus[0-9]*[.a-z0-9]* ]] # check for interactive mode 120 rm -rf .oO[workdir]Oo. 129 import FWCore.ParameterSet.Config as cms 131 process = cms.Process(".oO[ProcessName]Oo.") 133 .oO[datasetDefinition]Oo. 135 .oO[LoadBasicModules]Oo. 136 .oO[TrackSelectionRefitting]Oo. 137 .oO[LoadGlobalTagTemplate]Oo. 139 .oO[ValidationConfig]Oo. 140 .oO[FileOutputTemplate]Oo. 149 process.options = cms.untracked.PSet( 150 wantSummary = cms.untracked.bool(False), 151 Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal 152 fileMode = cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries 155 process.load("FWCore.MessageLogger.MessageLogger_cfi") 156 process.MessageLogger.destinations = ['cout', 'cerr'] 157 process.MessageLogger.cerr.FwkReport.reportEvery = 1000 158 process.MessageLogger.statistics.append('cout') 164 CommonTrackSelectionRefitting =
""" 165 import Alignment.CommonAlignment.tools.trackselectionRefitting as trackselRefit 166 process.seqTrackselRefit = trackselRefit.getSequence(process, '.oO[trackcollection]Oo.', 167 TTRHBuilder='.oO[ttrhbuilder]Oo.', 168 usePixelQualityFlag=.oO[usepixelqualityflag]Oo., 169 openMassWindow=.oO[openmasswindow]Oo., 170 cosmicsDecoMode=.oO[cosmicsdecomode]Oo., 171 cosmicsZeroTesla=.oO[cosmics0T]Oo., 172 momentumConstraint=.oO[momentumconstraint]Oo., 173 cosmicTrackSplitting=.oO[istracksplitting]Oo., 174 use_d0cut=.oO[use_d0cut]Oo., 181 SingleTrackRefitter =
""" 182 process.load("RecoTracker.TrackProducer.TrackRefitters_cff") 183 process.TrackRefitter.src = ".oO[TrackCollection]Oo." 184 process.TrackRefitter.TTRHBuilder = ".oO[ttrhbuilder]Oo." 185 process.TrackRefitter.NavigationSchool = "" 191 LoadBasicModules =
""" 192 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff") 193 process.load("Configuration.Geometry.GeometryDB_cff") 194 process.load('Configuration.StandardSequences.Services_cff') 195 process.load("Configuration.StandardSequences..oO[magneticField]Oo._cff") 201 FileOutputTemplate =
""" 202 process.TFileService = cms.Service("TFileService", 203 fileName = cms.string('.oO[outputFile]Oo.') 210 DefinePath_CommonSelectionRefitting =
""" 211 process.p = cms.Path( 212 process.seqTrackselRefit*.oO[ValidationSequence]Oo.) 219 eos='/afs/cern.ch/project/eos/installation/cms/bin/eos.select' 221 cd .oO[CMSSW_BASE]Oo./src 222 export SCRAM_ARCH=.oO[SCRAM_ARCH]Oo. 223 eval `scramv1 ru -sh` 225 #create results-directory and copy used configuration there 226 rfmkdir -p .oO[datadir]Oo. 227 rfcp .oO[logdir]Oo./usedConfiguration.ini .oO[datadir]Oo. 229 if [[ $HOSTNAME = lxplus[0-9]*[.a-z0-9]* ]] # check for interactive mode 231 mkdir -p .oO[workdir]Oo. 236 echo "Working directory: $(pwd -P)" 238 ############################################################################### 239 # download root files from eos 240 root_files=$($eos ls /store/caf/user/$USER/.oO[eosdir]Oo. \ 241 | grep ".root$" | grep -v "result.root$") 242 #for file in ${root_files} 244 # xrdcp -f root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./${file} . 251 .oO[CompareAlignments]Oo. 253 .oO[RunValidationPlots]Oo. 259 #zip stdout and stderr from the farm jobs 261 find . -name "*.stderr" -exec gzip -f {} \; 262 find . -name "*.stdout" -exec gzip -f {} \; 268 mergeParallelResults=
""" 274 ls -al .oO[mergeParallelFilePrefixes]Oo. > .oO[datadir]Oo./log_rootfilelist.txt 276 # Remove parallel job files 283 compareAlignmentsExecution=
""" 284 #merge for .oO[validationId]Oo. if it does not exist or is not up-to-date 285 echo -e "\n\nComparing validations" 286 $eos mkdir -p /store/caf/user/$USER/.oO[eosdir]Oo./ 287 cp .oO[Alignment/OfflineValidation]Oo./scripts/compareFileAges.C . 288 root -x -q -b -l "compareFileAges.C(\\\"root://eoscms.cern.ch//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./.oO[validationId]Oo._result.root\\\", \\\".oO[compareStringsPlain]Oo.\\\")" 289 comparisonNeeded=${?} 291 if [[ ${comparisonNeeded} -eq 1 ]] 293 cp .oO[compareAlignmentsPath]Oo. . 294 root -x -q -b -l '.oO[compareAlignmentsName]Oo.++(\".oO[compareStrings]Oo.\", ".oO[legendheader]Oo.", ".oO[customtitle]Oo.", ".oO[customrighttitle]Oo.", .oO[bigtext]Oo.)' 295 mv result.root .oO[validationId]Oo._result.root 296 xrdcp -f .oO[validationId]Oo._result.root root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo. 298 echo ".oO[validationId]Oo._result.root is up-to-date, no need to compare again." 299 xrdcp -f root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./.oO[validationId]Oo._result.root . 313 datasetpath = .oO[dataset]Oo. 314 pset = .oO[cfgFile]Oo. 315 total_number_of_.oO[McOrData]Oo. 316 number_of_jobs = .oO[numberOfJobs]Oo. 317 output_file = .oO[outputFile]Oo. 318 runselection = .oO[runRange]Oo. 319 lumi_mask = .oO[JSON]Oo. 324 storage_element = T2_CH_CERN 325 user_remote_dir = .oO[eosdir]Oo. 326 ui_working_dir = .oO[crabWorkingDir]Oo. 327 # script_exe = .oO[script]Oo. 331 queue = .oO[queue]Oo. 348 if not templateName
in globals().
keys():
349 msg =
"unknown template to replace %s"%templateName
351 if not alternateTemplateName
in globals().
keys():
352 msg =
"unknown template to replace %s"%alternateTemplateName
354 globals()[ templateName ] = globals()[ alternateTemplateName ]
def alternateTemplate(templateName, alternateTemplateName)
Alternate Templates ###