Make a plot with the largest data point out of two ###########.
116 if graph1.GetN() != graph2.GetN() :
118 print "Plots don't have the same number of points!"
119 print "Error: ", graph1.GetN()
120 print "Middle: ", graph2.GetN()
123 largestGraph = graph1.Clone()
125 for iPoint
in xrange(0, graph1.GetN()) :
128 graph1PointX = Double(0)
129 graph1PointY = Double(0)
130 graph1ErrorX = graph1.GetErrorX(iPoint)
131 graph1ErrorY = graph1.GetErrorY(iPoint)
133 graph1.GetPoint(iPoint,graph1PointX,graph1PointY)
135 graph2PointX = Double(0)
136 graph2PointY = Double(0)
137 graph2ErrorX = graph2.GetErrorX(iPoint)
138 graph2ErrorY = graph2.GetErrorY(iPoint)
140 graph2.GetPoint(iPoint,graph2PointX,graph2PointY)
143 if graph1PointX - graph2PointX > 0.0001 :
144 print "Points are not ordered!"
145 print "graph1: ", graph1PointX
146 print "graph2: ", graph2PointX
149 largestPoint = Double(0)
152 if fabs(fabs(1-graph1PointY) - fabs(1-graph2PointY)) > 1000 :
153 print "found bad data point: ", graph1PointX, graph2PointY
154 if fabs(1-graph1PointY) > 100 :
155 largestPoint = graph2PointY
156 largestPointErrorX = graph2ErrorX
157 largestPointErrorY = graph2ErrorY
158 if fabs(1-graph2PointY) > 100 :
159 largestPoint = graph1PointX
160 largestPointErrorX = graph1ErrorX
161 largestPointErrorY = graph1ErrorY
164 elif fabs(1-graph1PointY) > fabs(1-graph2PointY) :
165 largestPoint = graph1PointY
166 largestPointErrorX = graph1ErrorX
167 largestPointErrorY = graph1ErrorY
170 largestPoint = graph2PointY
171 largestPointErrorX = graph2ErrorX
172 largestPointErrorY = graph2ErrorY
174 print "newpoint:", largestPoint, largestPointErrorY
177 largestGraph.SetPoint(iPoint, graph1PointX, largestPoint)
178 largestGraph.SetPointError(iPoint, largestPointErrorX, largestPointErrorY)