22 detector_root_name="Detector",
23 start_index_for_detector_root_name=0):
25 function create big data i.e. detector_name, detector_parent_id relating to
26 the detector name, and parent as API add_detector(self, name, parent_id) required
28 :param detector_number: number of detectors that well be generated - default number is 10
29 :param parent_id: parent path of detector - default None
30 :param detector_root_name: base name for a detector - default value is "Detector"
31 :param start_index_for_detector_root_name:
32 start index of increase progressively with detector root name - default is 0
33 :return list with tuples that can be input for pytests.
34 :return example [('Detector0', None), ('Detector1', None)...]
37 root = detector_root_name
38 area = range(start_index_for_detector_root_name,
39 start_index_for_detector_root_name + detector_number)
42 detector_name_root_with_number = root + str(start)
43 item = (detector_name_root_with_number, parent_id)
44 group_detectors.append(item)
46 return group_detectors
50 number_subdetectors_of_each_detector=4,
51 detector_root_name="detector",
53 group_detector_parent=[]):
55 function create multilevel of detectors , which is like n-tree
56 (each detector has many layers of subdetectors)
58 :param level: define layers of detectors tree, default is 5
59 :param number_subdetectors_of_each_detector: define number of
60 subdetectors for each parent detector, default is 4
61 :param detector_root_name: define the base name of detector,
62 default value is "detector"
63 :param parent_path: specify parent_path of subdetector,
64 if there is no basic detector can be used,
65 it should be None as create first level detectors, default is None
66 :param[inout] group_detector_parent: a list stores
67 the data structure of multilevel detector, default is []
68 return null. The result will be stored in the group_detector_parent param.
70 usage example: create_multilevel_detectors(5, 4, "detector", None, group_detector_parent)
71 example explanation: it create a five levels detectors tree each detector has 4 subdetector,
80 number_subdetectors_of_each_detector, parent_path, detector_root_name)
82 for first_level_item
in first_level_detector:
83 group_detector_parent.append(first_level_item)
84 detector_name = first_level_item[0]
86 if parent_path
is None:
89 path = parent_path +
"/" + detector_name
92 "sub" + detector_root_name, path,
93 group_detector_parent)