10 from ROOT
import TFile, TTree
12 from Alignment.MillePedeAlignmentAlgorithm.mpsvalidate
import geometrydata
16 """ Creates a list of the aligned strucutres. Get the fields out of the
17 TrackerTree.root file.
26 return geometrydata.data[objid].name
29 return geometrydata.data[objid].subdetid
32 return geometrydata.data[objid].discriminator
35 return geometrydata.data[objid].ndiscriminator
39 for line
in MillePedeUser:
41 if (line.ObjId != 1
and 999999
not in map(abs, line.Par)):
50 self.structures.append(
51 Structure(name, subdetid, discriminator, ndiscriminator))
59 ranges = struct.ndiscriminator
60 pranges = [range(1, x+1)
for x
in ranges]
63 for number
in itertools.product(*pranges):
65 pattern =
dict(
zip(struct.discriminator, number))
68 for (key, value)
in pattern.items())
70 detids = self.
get_detids(struct.subdetid, pattern)
72 child =
Structure(name, struct.subdetid, detids=detids)
73 struct.children.append(child)
79 treeFile = TFile(os.path.join(self.config.mpspath,
"TrackerTree.root"))
80 tree = treeFile.Get(
"TrackerTreeGenerator/TrackerTree/TrackerTree")
84 if (line.SubdetId == subdetid):
87 if (
"half" in pattern):
88 if (line.Half != pattern[
"half"]):
91 if (
"side" in pattern):
92 if (line.Side != pattern[
"side"]):
95 if (
"layer" in pattern):
96 if (line.Layer != pattern[
"layer"]):
99 if (
"rod" in pattern):
100 if (line.Rod != pattern[
"rod"]):
103 if (
"ring" in pattern):
104 if (line.Ring != pattern[
"ring"]):
107 if (
"petal" in pattern):
108 if (line.Petal != pattern[
"petal"]):
111 if (
"blade" in pattern):
112 if (line.Blade != pattern[
"blade"]):
115 if (
"panel" in pattern):
116 if (line.Panel != pattern[
"panel"]):
119 if (
"outerinner" in pattern):
120 if (line.OuterInner != pattern[
"outerinner"]):
123 if (
"module" in pattern):
124 if (line.Module != pattern[
"module"]):
127 detids.append(line.RawId)
132 """ A object represents a physical strucutre
135 def __init__(self, name, subdetid, discriminator=[], ndiscriminator=[], detids=[]):
bool any(const std::vector< T > &v, const T &what)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
static std::string join(char **cmd)