19 vector<MSLayer> allLayers;
22 vector<MSLayer>::iterator it;
24 for (it = allLayers.begin(); it != allLayers.end(); it++) {
30 float x0 = getDataX0(*it).x0;
34 float sumX0D = theLayersData.
sumX0D(
zero, middle);
35 dataX0 =
DataX0(x0, sumX0D, cotTheta);
37 float hrange = (it->range().max() - it->range().min()) / 2.;
38 float cot1 = it->position() / (it->range().mean() - hrange / 2);
39 float cot2 = it->position() / (it->range().mean() + hrange / 2);
42 float sum1 = theLayersData.sumX0D(
zero, it->crossing(line1).first);
43 float sum2 = theLayersData.sumX0D(
zero, it->crossing(line2).first);
44 float slope = (
sum2 - sum1) / (1 / cot2 - 1 / cot1);
45 float sumX0D = sum1 +
slope * (1 / cotTheta - 1 / cot1);
46 dataX0 =
DataX0(x0, sumX0D, cotTheta);
47 dataX0.setForwardSumX0DSlope(
slope);
49 setDataX0(*it, dataX0);
50 theLayersData.update(*it);