CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
das-selected-lumis Namespace Reference

Functions

def check_lumi_ranges
 
def match_in
 
def process_lumi
 

Variables

list input_range = []
 
tuple jdata = sys.stdin.read()
 
tuple lumi_data = json.loads(jdata)
 
list lumi_ranges = sys.argv[1]
 
list output_files_list = []
 

Function Documentation

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

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

References match_in().

Referenced by process_lumi().

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

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

References sistrip::SpyUtilities.range().

Referenced by check_lumi_ranges().

18 
19 def match_in(sub_list,lumi_list):
20  for i in range(int(sub_list[0]),int(sub_list[1])+1):
21  if len(lumi_list) == 1:
22  if i == int(lumi_list[0]): return True
23  else:
24  if i >= int(lumi_list[0]) and i <= int(lumi_list[1]): return True
25  return False
const uint16_t range(const Frame &aFrame)
def das-selected-lumis.process_lumi (   data)

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

References check_lumi_ranges(), and print().

32 
33 def process_lumi(data):
34  for lumi_info in data:
35  if isinstance(lumi_info['lumi'], list):
36  lumi_nums = lumi_info['lumi'][0]['number']
37  lumi_file = lumi_info['file'][0]['name']
38  else:
39  lumi_nums = lumi_info['lumi']['number']
40  lumi_file = lumi_info['file']['name']
41  if not isinstance(lumi_nums[0], list): lumi_rang = [ [n,n] for n in lumi_nums ]
42  else: lumi_rang = lumi_nums
43  for sub_list in lumi_rang:
44  if check_lumi_ranges(input_range,tuple(sub_list)):
45  output_files_list.append(lumi_file)
46  break
47  for out_file_name in output_files_list:
48  print(out_file_name)
49 
50 #Get file names for desired lumi ranges
51 process_lumi(lumi_data)
52 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

Variable Documentation

list das-selected-lumis.input_range = []

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

tuple das-selected-lumis.jdata = sys.stdin.read()

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

Referenced by jpt::Map.Map().

list das-selected-lumis.lumi_data = json.loads(jdata)

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

list das-selected-lumis.lumi_ranges = sys.argv[1]

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

list das-selected-lumis.output_files_list = []

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