CMS 3D CMS Logo

Functions | Variables
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)
 

Variables

 input_range
 
 jdata
 
 lumi_data
 
 lumi_ranges
 
 output_files_list
 

Function Documentation

◆ check_lumi_ranges()

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

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

23 def check_lumi_ranges(given_lumi_list , sub_range):
24  for lumi_r in given_lumi_list:
25  if match_in(sub_range, lumi_r):
26  return True
27  return False
28 

References match_in().

Referenced by process_lumi().

◆ match_in()

def das-selected-lumis.match_in (   sub_list,
  lumi_list 
)

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

18 def match_in(sub_list,lumi_list):
19  for i in range(int(sub_list[0]),int(sub_list[1])+1):
20  if i >= int(lumi_list[0]) and i <= int(lumi_list[1]): return True
21  return False
22 

References createfilelist.int, and FastTimerService_cff.range.

Referenced by check_lumi_ranges().

◆ process_lumi()

def das-selected-lumis.process_lumi (   data)

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

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

References check_lumi_ranges(), and print().

Variable Documentation

◆ input_range

das-selected-lumis.input_range

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

◆ jdata

das-selected-lumis.jdata

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

Referenced by jpt::Map.Map().

◆ lumi_data

das-selected-lumis.lumi_data

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

◆ lumi_ranges

das-selected-lumis.lumi_ranges

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

◆ output_files_list

das-selected-lumis.output_files_list

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

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
das-selected-lumis.process_lumi
def process_lumi(data)
Definition: das-selected-lumis.py:29
das-selected-lumis.check_lumi_ranges
def check_lumi_ranges(given_lumi_list, sub_range)
Definition: das-selected-lumis.py:23
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
createfilelist.int
int
Definition: createfilelist.py:10
das-selected-lumis.match_in
def match_in(sub_list, lumi_list)
Definition: das-selected-lumis.py:18