CMS 3D CMS Logo

Functions
das-selected-lumis Namespace Reference

Functions

def check_lumi_ranges (given_lumi_list, sub_range)
 
def match_in (sub_list, lumi_list)
 
def process_lumi (data)
 

Function Documentation

def das-selected-lumis.check_lumi_ranges (   given_lumi_list,
  sub_range 
)

Definition at line 24 of file das-selected-lumis.py.

References match_in().

Referenced by process_lumi().

24 def check_lumi_ranges(given_lumi_list , sub_range):
25  for lumi_r in given_lumi_list:
26  if match_in(sub_range, lumi_r):
27  return True
28  return False
29 
def check_lumi_ranges(given_lumi_list, sub_range)
def match_in(sub_list, lumi_list)
def das-selected-lumis.match_in (   sub_list,
  lumi_list 
)

Definition at line 17 of file das-selected-lumis.py.

References genParticles_cff.map.

Referenced by check_lumi_ranges().

17 def match_in(sub_list,lumi_list):
18  sub_list = map(int,sub_list)
19  lumi_list = map(int,lumi_list)
20  for i in range(sub_list[0],sub_list[1]+1):
21  if i >= lumi_list[0] and i <= lumi_list[1]: return True
22  return False
23 
def match_in(sub_list, lumi_list)
def das-selected-lumis.process_lumi (   data)

Definition at line 30 of file das-selected-lumis.py.

References check_lumi_ranges().

30 def process_lumi(data):
31  for lumi_info in data:
32  if isinstance(lumi_info['lumi'], list):
33  lumi_nums = lumi_info['lumi'][0]['number']
34  lumi_file = lumi_info['file'][0]['name']
35  else:
36  lumi_nums = lumi_info['lumi']['number']
37  lumi_file = lumi_info['file']['name']
38  if not isinstance(lumi_nums[0], list): lumi_rang = [ [n,n] for n in lumi_nums ]
39  else: lumi_rang = lumi_nums
40  for sub_list in lumi_rang:
41  if check_lumi_ranges(input_range,tuple(sub_list)):
42  output_files_list.append(lumi_file)
43  break
44  for out_file_name in output_files_list:
45  print out_file_name
46 
47 #Get file names for desired lumi ranges
48 process_lumi(lumi_data)
49 
50 
def check_lumi_ranges(given_lumi_list, sub_range)