I was working these days on the GLAD magnet map and R3BRoot and I have found a few problems. Could you please (all) discuss and confirm them?

After confirmation that I do not miss something, I can commit the solutions...

I assume that the transformation between R3B and GLAD map field coordinates is:

X_R3B = X_MAP * cos(14) - Z_MAP * sin(14)

Z_R3B = X_MAP * sin(14) + Z_MAP * cos(14) + 163.4 cm

which is a passive transformation (alias) where the X axis is opposite to the usual convention ( X running positive to the left and Z running positive

to the top of the screen). I have tested that corresponds to the values in the map field (

I ask for the magnetic field in R3BRoot.

The first two problems correspond to the code in

1) In the function:

the lines 511 to 521 contains a wrong symmetry operation... in particular line 517 is:

TVector3 B3(-bx, by, -bz);

and should be:

TVector3 B3(bx, by, -bz);

I have checked that this correction produces the same symmetry that is already present in the original field map. This is possible as the map is

slightly larger than a "quadrant" to create the symmetry, so one can test the pseudovectorial character of the field and in which quadrant

the Bx and Bz components should be negative or positive.

2) After the symmetry operation, a -14 degrees rotation is introduced to transform the field components to the R3B coordinate system, as

it is stated in lines 512, 515, 518 and 521. The problem is that the variable

In

and therefore is never set to -14 degrees. That means that all the field components are not rotated, but used in the (wrong) map coordinate system.

Both modifications affect to the sign and value of the Bx and Bz components, which are wrong in R3BRoot. The strong By component is not modified by the corrections.

The third problem corresponds to the positioning of the GLAD volumes (coils, cases, ...) with respect to the map field. The map field should be

symmetrical w.r.t. the magnet coils and the central "trumpet-like" chamber. But the point (0,0,163.4)cm, which is the origin of the field map and

should be in the symmetry axis of the magnet is NOT, as it is shown in the included figure:

In the figure, the orange point at (0,0,163.4)cm in R3B coordinates is the center of the map field, which is clearly not in the symmetry axis of the magnet case.

So, if the map field should be transformed as stated before, the GLAD volumes should be displaced around 23.4cm along the beam line, in the

direction of the beam, to locate the point (0,0,163.4)cm symmetric. This corresponds to a transformation with a rotation of -14 degrees and

a translation of approx. (-36.34, 0, 330.7)cm instead of the present value of (-42, 0, 308)cm in

My estimate is not very precise, it was based on the observation that the point will be symmetric moving it 23.4 cm along the beam line.

So, many things to check and correct...

NOTE: the code corresponds to current dev version. The macros to obtain the images and results use the following GLAD geometry:

run->AddModule(new R3BGladMagnet("glad_v17_flange.geo.root"));

and the following line to load the GLAD field map, with scale 1:

R3BGladFieldMap* magField = new R3BGladFieldMap("R3BGladMap");

]]>

To point 1) Was probably mistyped. Your correction is valid.

2) Concerning fYAngle being not properly set - also true.

3) Here I will not agree immediately. When calculating the shift of GLAD in cave, I was overlaying the complete picture of the field map on top of glad geometry. In particular the coils are nicely visible when one plots By component for Y=0 plane. Could you please cross-check this?

Best regards,

Dima]]>

Best regards,

Dima

]]>

thank you very much for the macro. I have used it to produce the 2D ZCOL histogram with the By field map and the (black) lines reproducing the beam line

and the entrance point at GLAD. I superposed the GLAD case with the proper scale (orange point on top is at 500mm, red cross its the origina of field map).

It is clear to me that there is a slight mismatch and the geometry volumes are displace to the right (in the picture) and probably closer to the target than they should be.

I will try to get more information and suggest a symmetric point compatible with the cave situation.

Best regards,]]>

regarding the displacement of the geometry of the GLAD volumes:

- as the GLAD entrance tube seems to be perfectly centred with the beam line, the only freedom is to move it along the beam line.

- as the point (0,0,163.4)cm, center of the map field, should be in the symmetry axis of the GLAD volume

the only coherent position of the GLAD volume in

Double_t glad_angle = 14.0; // deg

Double_t distanceToTarget = 331.8528; // cm

Double_t zeroLineOffset = -42.0; // cm

instead of the present values:

Double_t glad_angle = 14.0; // deg

Double_t distanceToTarget = 308.8; // cm

Double_t zeroLineOffset = -42.0; // cm

the calculation of the additional displacement of 23.0528cm is explained in the attached figure.

Please, check and complain if there is any problem with the new position or it could be incompatible for any reason.

Regards,]]>