Skip to content

Commit

Permalink
Merge pull request #324 from cms-nanoAOD/branch_10_6_0_pre4
Browse files Browse the repository at this point in the history
Update master to CMSSW_10_6_0_pre4
  • Loading branch information
peruzzim authored Apr 26, 2019
2 parents 8376baf + 1fef057 commit 5fbcce2
Show file tree
Hide file tree
Showing 1,520 changed files with 78,789 additions and 61,058 deletions.
19 changes: 19 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
Language: Cpp
BasedOnStyle: Google
ColumnLimit: 120
#didn't we want to change this?
NamespaceIndentation: All
SortIncludes: false
IndentWidth: 2
AccessModifierOffset: -2
PenaltyBreakComment: 30
PenaltyExcessCharacter: 100
AlignAfterOpenBracket: Align
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BinPackParameters: false
AlwaysBreakTemplateDeclarations: Yes
ReflowComments: false
BinPackArguments: false
BinPackParameters: false
7 changes: 4 additions & 3 deletions Alignment/CommonAlignment/scripts/tkal_create_file_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import print_function

from builtins import range
import os
import re
import sys
Expand Down Expand Up @@ -581,7 +582,7 @@ def _create_json_file(self, name, first, last = None):
name += "_JSON.txt"
print_msg("Creating JSON file: "+name)

json_file = LumiList.LumiList(runs = xrange(first, last+1))
json_file = LumiList.LumiList(runs = range(first, last+1))
if self._args.json:
global_json = LumiList.LumiList(filename = self._args.json)
json_file = json_file & global_json
Expand Down Expand Up @@ -912,7 +913,7 @@ def das_client(query, check_key = None):
"""

error = True
for i in xrange(5): # maximum of 5 tries
for i in range(5): # maximum of 5 tries
try:
das_data = cmssw_das_client.get_data(query, limit = 0)
except IOError as e:
Expand Down Expand Up @@ -1127,7 +1128,7 @@ def get_chunks(long_list, chunk_size):
- `chunk_size`: maximum size of created sub-lists
"""

for i in xrange(0, len(long_list), chunk_size):
for i in range(0, len(long_list), chunk_size):
yield long_list[i:i+chunk_size]


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from builtins import range
import os
import FWCore.ParameterSet.Config as cms

Expand Down Expand Up @@ -34,7 +35,7 @@ def set_pede_option(process, option, drop = False):
existing_options = process.AlignmentProducer.algoConfig.pedeSteerer.options

exists = False
for i in xrange(len(existing_options)):
for i in range(len(existing_options)):
if existing_options[i].split()[0] == option.split()[0]:
existing_options[i] = option.strip()
exists = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
# JOBSP3 - possible name as given to mps_setup.pl -N <name> ...
# JOBID - ID of the LSF/HTCondor job

from builtins import range
import datetime
import time
import os
Expand Down Expand Up @@ -146,7 +147,7 @@ def print_memdb(self):
#print interesting Job-level lists ---- to add: t/evt, fix remarks
print('### dir jobid stat try rtime nevt remark weight name')
print("------------------------------------------------------------------------------")
for i in xrange(self.nJobs):
for i in range(self.nJobs):
print('%03d %6s %9s %6s %3d %5d %8d %8s %5s %s' % (
self.JOBNUMBER[i],
self.JOBDIR[i],
Expand All @@ -161,7 +162,7 @@ def print_memdb(self):

#print merge Jobs if merge mode
if self.driver == 'merge':
for i in xrange(self.nJobs,len(self.JOBDIR)):
for i in range(self.nJobs,len(self.JOBDIR)):
print('%s %6s %9s %6s %3d %5d %8d %8s %5s %s' % (
'MMM',
self.JOBDIR[i],
Expand Down Expand Up @@ -217,7 +218,7 @@ def write_db(self):
DBFILE.write("%s\n" % item)

#write mps.db jobinfo
for i in xrange(len(self.JOBID)):
for i in range(len(self.JOBID)):
DBFILE.write('%03d:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s\n' %
(i+1,
self.JOBDIR[i],
Expand Down
3 changes: 2 additions & 1 deletion Alignment/MillePedeAlignmentAlgorithm/python/mpslib/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import print_function
from builtins import range
import os
import re
import sys
Expand Down Expand Up @@ -248,7 +249,7 @@ def remove_existing_object(path):
except OSError as e:
if e.args != (13, "Permission denied"): raise
backup_path = path.rstrip("/")+"~"
for _ in xrange(5):
for _ in range(5):
try:
if os.path.exists(backup_path): remove_method(backup_path)
move_method(path, backup_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Creates beamer out of the histograms, parsed data and a given template.
##

from builtins import range
import logging
import os
import string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# a list of PlotData objects.
##

from builtins import range
import logging

import ROOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# as humanreadable text.
##

from builtins import range
import logging

import ROOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Classes which provide the geometry information.
##

from builtins import range
import itertools
import os

Expand Down Expand Up @@ -71,7 +72,7 @@ def create_children_list(self):
# loop over discriminators -> create patterns
# pattern {"half": 2, "side": 2, "layer": 6, ...}
ranges = struct.ndiscriminator
pranges = [range(1, x+1) for x in ranges]
pranges = [list(range(1, x+1)) for x in ranges]
# loop over all possible combinations of the values of the
# discriminators
for number in itertools.product(*pranges):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Creates pdf out of the histograms, parsed data and a given template.
##

from builtins import range
import logging
import os
import string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# list with the PlotData of the histograms
##

from builtins import range
import logging

import ROOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# get a time dependent plot.
##

from builtins import range
import logging

import ROOT
Expand Down
3 changes: 2 additions & 1 deletion Alignment/MillePedeAlignmentAlgorithm/scripts/mps_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# It also retirieves number of events from alignment.log and cputime from STDOUT

from __future__ import print_function
from builtins import range
import Alignment.MillePedeAlignmentAlgorithm.mpslib.Mpslibclass as mpslib
import subprocess
import re
Expand All @@ -28,7 +29,7 @@
eoslsoutput = ""

# loop over FETCH jobs
for i in xrange(len(lib.JOBID)):
for i in range(len(lib.JOBID)):
# FIXME use bools?
batchSuccess = 0
batchExited = 0
Expand Down
3 changes: 2 additions & 1 deletion Alignment/MillePedeAlignmentAlgorithm/scripts/mps_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# hence this function does hardly anything except for calling
# mps_check.py.

from builtins import range
import Alignment.MillePedeAlignmentAlgorithm.mpslib.Mpslibclass as mpslib
import os

Expand All @@ -18,7 +19,7 @@
lib.read_db()

# loop over DONE jobs
for i in xrange(len(lib.JOBID)):
for i in range(len(lib.JOBID)):
# check also "FETCH" to recover from possibly failed runs of 'mps_fetch.py'
if lib.JOBSTATUS[i] in ("DONE", "EXIT", "FETCH", "DISABLEDFETCH"):
# move the LSF output to /jobData/
Expand Down
7 changes: 4 additions & 3 deletions Alignment/MillePedeAlignmentAlgorithm/scripts/mps_fire.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# mps_fire.py -h

from __future__ import print_function
from builtins import range
import Alignment.MillePedeAlignmentAlgorithm.mpslib.Mpslibclass as mpslib
import Alignment.MillePedeAlignmentAlgorithm.mpslib.tools as mps_tools
import os
Expand Down Expand Up @@ -256,7 +257,7 @@ def write_HTCondor_submit_file_mille(path, script, lib, proxy_path=None):
resources = '-q '+resources

nSub = 0 # number of submitted Jobs
for i in xrange(lib.nJobs):
for i in range(lib.nJobs):
if lib.JOBDIR[i] not in job_mask: continue
if lib.JOBSTATUS[i] == 'SETUP':
if nSub < args.maxJobs:
Expand Down Expand Up @@ -319,7 +320,7 @@ def write_HTCondor_submit_file_mille(path, script, lib, proxy_path=None):

# check whether all other jobs are OK
mergeOK = True
for i in xrange(lib.nJobs):
for i in range(lib.nJobs):
if lib.JOBSTATUS[i] != 'OK':
if 'DISABLED' not in lib.JOBSTATUS[i]:
mergeOK = False
Expand Down Expand Up @@ -420,7 +421,7 @@ def write_HTCondor_submit_file_mille(path, script, lib, proxy_path=None):
job_submit_file]
else:
submission = ["bsub", "-J", curJobName, resources, scriptPath]
for _ in xrange(5):
for _ in range(5):
try:
result = subprocess.check_output(submission, stderr=subprocess.STDOUT)
break
Expand Down
5 changes: 3 additions & 2 deletions Alignment/MillePedeAlignmentAlgorithm/scripts/mps_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# mps_merge.pl [-c] inCfg mergeCfg mergeDir njobs

from __future__ import print_function
from builtins import range
import Alignment.MillePedeAlignmentAlgorithm.mpslib.Mpslibclass as mpslib
import re
import os
Expand Down Expand Up @@ -74,7 +75,7 @@
# build list of binary files
binaryList = ''
firstentry = True
for i in xrange(nJobs):
for i in range(nJobs):
separator = ',\n '
if firstentry:
separator = '\n '
Expand Down Expand Up @@ -105,7 +106,7 @@
# build list of tree files
treeList =''
firstentry = True
for i in xrange(nJobs):
for i in range(nJobs):
separator = ',\n '
if firstentry:
separator = '\n '
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

from __future__ import print_function
from builtins import range
import os
import subprocess
import argparse
Expand All @@ -20,29 +21,29 @@
# read mps.db
lib = mpslib.jobdatabase()
lib.read_db()
for i in xrange(lib.nJobs):
for i in range(lib.nJobs):
print(lib.JOBSP3[i])

# count how much jobs there are of each dataset
occurences = []
items = []
for i in xrange(lib.nJobs):
for i in range(lib.nJobs):
if lib.JOBSP3[i] not in items:
items.append(lib.JOBSP3[i])

for i in xrange(len(items)):
for i in range(len(items)):
occurences.append(lib.JOBSP3.count(items[i]))

# copy files from eos and combine root-files of each dataset with "hadd"
counter = 0
for i in xrange(len(items)):
for i in range(len(items)):
command = 'hadd '
command += 'monitormerge_'+items[i]+'.root '
for j in xrange(occurences[i]):
for j in range(occurences[i]):
os.system('cp '+eosDir+'/millePedeMonitor%03d.root .' % (counter+j+1))
command += 'millePedeMonitor%03d.root ' % (counter+j+1)
os.system(command)
for j in xrange(occurences[i]):
for j in range(occurences[i]):
os.system('rm millePedeMonitor%03d.root' % (counter+j+1))
counter += occurences[i]

Expand Down
5 changes: 3 additions & 2 deletions Alignment/MillePedeAlignmentAlgorithm/scripts/mps_setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

from __future__ import print_function
from builtins import range
import os
import re
import sys
Expand Down Expand Up @@ -166,7 +167,7 @@
os.makedirs("jobData")
nJobExist = 0;

for j in xrange(1, args.n_jobs + 1):
for j in range(1, args.n_jobs + 1):
i = j+nJobExist
jobdir = "job{0:03d}".format(i)
print("jobdir", jobdir)
Expand Down Expand Up @@ -216,7 +217,7 @@


# Create (update) the local database
for j in xrange(1, args.n_jobs + 1):
for j in range(1, args.n_jobs + 1):
i = j+nJobExist
jobdir = "job{0:03d}".format(i)
lib.JOBDIR.append(jobdir)
Expand Down
3 changes: 2 additions & 1 deletion Alignment/MillePedeAlignmentAlgorithm/scripts/mps_splice.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
from __future__ import print_function
from builtins import range
import re
import argparse
import math
Expand Down Expand Up @@ -59,7 +60,7 @@
numberOfExtends = int(math.ceil(numberOfFiles/255.))

# Create and insert the readFile.extend lines
for j in xrange(numberOfExtends):
for j in range(numberOfExtends):
insertBlock = "readFiles.extend([\n "
i=0
currentStart = j*255
Expand Down
3 changes: 2 additions & 1 deletion Alignment/MillePedeAlignmentAlgorithm/scripts/mps_update.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
from __future__ import print_function
from builtins import range
import os
import re
import subprocess
Expand Down Expand Up @@ -46,7 +47,7 @@ def fill_time_info(mps_index, status, cpu_time):
lib.read_db()

submitted_jobs = {}
for i in xrange(len(lib.JOBID)):
for i in range(len(lib.JOBID)):
submitted = True
for status in ("SETUP", "OK", "DONE", "FETCH", "ABEND", "WARN", "FAIL"):
if status in lib.JOBSTATUS[i]:
Expand Down
1 change: 1 addition & 0 deletions Alignment/MuonAlignment/python/MCScenario_CRAFT1_22X.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# ./Alignment/MuonAlignment/python/geometryXMLtoCSV.py < MCScenario_CRAFT1_22X_CHECKME.xml > MCScenario_CRAFT1_22X_CHECKME.csv
# and then open MCScenario_CRAFT1_22X_CHECKME.csv in Excel

from builtins import range
import random, os
from math import *

Expand Down
Loading

0 comments on commit 5fbcce2

Please sign in to comment.