200 likes | 313 Views
Siamese and Girders in PTC. Etienne Forest KEK/CERN. Elements and Fibres. In PTC the equivalent of magnet in MAD-X or other codes, is the object of type ELEMENT. Therefore if I refer to a magnet in this document; it is the type ELEMENT of the code.
E N D
Siamese and Girders in PTC Etienne Forest KEK/CERN
Elements and Fibres • In PTC the equivalent of magnet in MAD-X or other codes, is the object of type ELEMENT. Therefore if I refer to a magnet in this document; it is the type ELEMENT of the code. • In PTC, magnets are not the objects which appear sequentially in a beam line. This is the novel aspect of PTC. A beam line in PTC, which is of type LAYOUT, is made of fibres of type FIBRE. • The idea is that the same magnet can appear in several beam lines (common elements) or it can reappear in the same beam line several times non-trivially (in a recirculator). • Each fibre has a pointer to a magnet and to Euclidean patches which connect this magnet geometrically and energetically to its surrounding fibre. • The fibre has a chart which localises it in space in its ideal position and energy. Generally it is not the position produced by a MAD8 survey. In fact the position is arbitrary.
Siamese and girders • Several magnets can be glued together. For example in LHC, the magnets are actually two bore magnets: one inner pipe for the inner ring and one outer pipe for the outer ring. One could imagine more magnets glued together: for example in a recirculator. • In PTC such magnets are called Siamese. They are joined and the user can misaligned them as a block with a special command. • A girder is collection of Siamese and regular magnets which can be moved together. It is obviously a super set.
Siamese and Girder in type Element • The magnet has the following pointers TYPE(FIBRE_APPEARANCE), POINTER :: DOKO TYPE(ELEMENT), POINTER :: SIAMESE TYPE(ELEMENT), POINTER :: GIRDER TYPE(AFFINE_FRAME), POINTER :: SIAMESE_FRAME TYPE(AFFINE_FRAME), POINTER :: GIRDER_FRAME
Siamese creation Siamese are formed by making a circular list using the pointer SIAMESE Actual Code m1 m2 m1%siamese => m2 m2%siamese => m3 m3%siamese => m4 m4%siamese => m1 m4 m3
Siamese Frame for Misalignments • If the reader wants a special frame to define the misalignments of the siamese, he must use a set of commands to create this frame • Decide with respect to what magnet the frame is defined • Allocate the frame. For example, if we pick m1, then we must use • Call alloc_af(m1%siamese_frame)
continued • Next we must find the angle and the translation between the entrance frame of m1 and the frame chosen A=(M1%P%F%O+M4%P%F%O)/2.D0 ENT=M1%P%F%MID CALL FIND_PATCH(M1%P%F%A,M1%P%F%ENT, A, ENT, & M1%SIAMESE_FRAME%D,M1%SIAMESE_FRAME%ANGLE) • Of course if SIAMESE_FRAME%Dand if SIAMESE_FRAME%ANGLEare already known, they can be directly set!
Misalignment Command for Siamese Choose a magnet of the siamese (anyone), say m1, then chose a fibre which contains m1, say p1, then the command can be (see next page): CALL MISALIGN_SIAMESE(P1,X,ADD=.TRUE.) X(1:3) = (dx,dy,dz) and X(4:6) = (ax,ay,az) • All the commands are in the PTC order. There is no way around this. Therefore the user has two choices: • Call the misalign commands in successions to realize his particular convention: the ADD=.true. is useful in this context. • Use PTC geometrical routines to create the correct input. PTC is very powerful in this case. • N.B. Look in the tracking routine to see what the PTC order is! • N.B. Beware of reverse propagators. The misalignments are defined in the natural frame of the magnet irrespective of reverse or forward.
Command MISALIGN_SIAMESE MISALIGN_SIAMESE(S2,S1,OMEGA,BASIS,ADD) The red quantities are optional. Here is the actual code. FOUND=.FALSE. ADDIN=.FALSE. CALL FIND_AFFINE_SIAMESE(S2,CN,FOUND) ! Looking for siamese IF(FOUND) CALL FIND_FRAME_SIAMESE(CN,B,EXI,ADD) IF(PRESENT(ADD)) ADDIN=ADD IF(PRESENT(OMEGA)) THEN! Arbitrary Origin OMEGAT=OMEGA ELSE OMEGAT=S2%CHART%F%O ! Centre of magnet otherwise ENDIF IF(PRESENT(BASIS)) THEN! Arbitrary Basis BASIST=BASIS ELSE BASIST=S2%CHART%F%MID ! Centre of Magnet Otherwise ENDIF IF((.NOT.PRESENT(OMEGA)).AND.(.NOT.PRESENT(BASIS))) THEN IF(FOUND) THEN ! If no special basis and no special origin OMEGAT=B ! and siamese is found, then it uses the siamese basis BASIST=EXI ! Notice that if ADD=true, the siamese frames move with the magnets ENDIF ENDIF
Girder creation Girders are formed by making a circular list using the pointer GIRDER Actual Code m1 m2 m1%girder => m2 m2%girder => m3 m3%girder => m4 m4%girder => m1 m4 m3 The girder looks very much like a siamese, however the girder frame is defined separately. This frame is allocated as follows: CALL ALLOC_AF(M1%GIRDER_FRAME,GIRDER=.TRUE.) M1%GIRDER_FRAME%ENT(1:3,1:3)=ENT(1:3,1:3) M1%GIRDER_FRAME%A(1:3)=A(1:3) M1%GIRDER_FRAME%EXI=ENT M1%GIRDER_FRAME%B=A ENT and A determined the ideal location of the girder in absolute space. EXI and B determined the location of the girder after misalignments.
Misalign Girder MISALIGN_GIRDER has exactly the same input as MISALIGN_SIAMESE Here is an example: Blue siamese has the white frame; the girder has the red frame. X=0.D0 ;X(5)=PI/4.5; CALL MISALIGN_GIRDER(P1,X,ADD=.TRUE.) X(5) = -PI/4.5 CALL MISALIGN_SIAMESE(P1,X,ADD=.TRUE.) Notice that the siamese frame was properly moved by the girder misalignment!
Moving Girders and Siamese Moving girders and siamese can be done automatically in PTC. • No DNA: we have simple rings stored in the MAD Universe. • DNA used: we have complex topologies. In PTC, there are two distinct types operations: placements of the fibre in its ideal position and misalignments of the magnet within the fibre. In a standard ring the there is one fibre per magnet. However in more complex topologies, the same magnet can exist in several fibres since the fibre is really the discretized s-variable. For example in the collision IP of the LHC, the same magnet appears in a fibre of LHC1 and LHC2. To fully exploit these complex lattice, we use the concept of a DNA sequence.
Placement of Siamese and girders • The following subroutine have automatic patching in a normal and DNA based context. • Therefore the basic topology of the lattice(s) • TRANSLATE_MAGNET (R,D,ORDER,BASIS,PATCH,PREC) • TRANSLATE_SIAMESE(S2,D,ORDER,BASIS,PATCH,PREC) • TRANSLATE_GIRDER (S2,D,ORDER,BASIS,PATCH,PREC) • ROTATE_MAGNET (R,ANG,OMEGA,ORDER,BASIS,PATCH,PREC) • ROTATE_SIAMESE(S2,ANG,OMEGA,ORDER,BASIS,PATCH,PREC) • ROTATE_GIRDER (S2,ANG,OMEGA,ORDER,BASIS,PATCH,PREC) The optional variables are in red. Notice that the order of ANG and OMEGA is inverted compared to the standard routines to move beam lines.
Ordinary Lattice • In an ordinary lattice, magnets and fibres are in a one to one correspondence. • We will assume that there is no DNA present • The basic lattice has been created and is trackable. • We now want to move siamese and girders As in the misalignment, select a single element of siamese/girder and call the appropriate routine. X=0.D0 X(5)=PI/4.5 CALL MISALIGN_GIRDER(P1,X,ADD=.TRUE.) X(5)=-PI/4.5 MISALIGN_SIAMESE(P1,X,ADD=.TRUE.) X(5)=-PI/4.5 CALL ROTATE_GIRDER (P1,ANG,PATCH=.TRUE.,PREC=1.D-8)
Frames: translations TRANSLATE_SIAMESE(S2,D,ORDER,BASIS,PATCH,PREC) FOUND=.FALSE. CALL FIND_AFFINE_SIAMESE(S2,CN,FOUND) IF(FOUND) CALL FIND_FRAME_SIAMESE(CN,B,EXI,ADD=MY_FALSE) IF(PRESENT(BASIS)) THEN BASIST=BASIS ELSE IF(FOUND) THEN BASIST=EXI ELSE BASIST=GLOBAL_FRAME ENDIF ENDIF TRANSLATE_GIRDER(S2,D,ORDER,BASIS,PATCH,PREC) FOUND=.FALSE. CALL FIND_AFFINE_GIRDER(S2,CAF,FOUND) IF(FOUND) CALL FIND_FRAME_GIRDER(CAF,B,EXI,ADD=MY_FALSE) IF(PRESENT(BASIS)) THEN BASIST=BASIS ELSE IF(FOUND) THEN BASIST=EXI ELSE BASIST=GLOBAL_FRAME ENDIF ENDIF If a frame is given, then it is used. Otherwise the code looks for a siamese or girder frame. If it fails, the global frame is used. Patch=true : patching is attempted assuming an ordinary lattice. This means that the fibre is patched to its two neighbouring fibres only! (NO DNA, NO POINTED LATTICES) Patches are put on if the norm of the patches is bigger than PREC. (defaulted to a tiny number)
Frames: rotations ROTATE_SIAMESE(S2,ANG,OMEGA,ORDER,BASIS,PATCH,PREC) FOUND=.FALSE. CALL FIND_AFFINE_SIAMESE(S2,CN,FOUND) IF(FOUND) CALL FIND_FRAME_SIAMESE(CN,B,EXI,ADD=MY_FALSE) IF(PRESENT(BASIS)) THEN BASIST=BASIS ELSE IF(FOUND) THEN BASIST=EXI ELSE BASIST=GLOBAL_FRAME ENDIF ENDIF IF(PRESENT(OMEGA)) THEN OMEGAT=OMEGA ELSE IF(FOUND) THEN OMEGAT=B ELSE OMEGAT=GLOBAL_ORIGIN ENDIF ENDIF ROTATE_GIRDER (S2,ANG,OMEGA,ORDER,BASIS,PATCH,PREC) FOUND=.FALSE. CALL FIND_AFFINE_GIRDER(S2,CAF,FOUND) IF(FOUND) CALL FIND_FRAME_GIRDER(CAF,B,EXI,ADD=MY_FALSE) IF(PRESENT(BASIS)) THEN BASIST=BASIS ELSE IF(FOUND) THEN BASIST=EXI ELSE BASIST=GLOBAL_FRAME ENDIF ENDIF IF(PRESENT(OMEGA)) THEN OMEGAT=OMEGA ELSE IF(FOUND) THEN OMEGAT=B ELSE OMEGAT=GLOBAL_ORIGIN ENDIF ENDIF Same story as before concerning patching. Notice that for a rotation, an axis must be defined OMEGA(3) is needed. Patch=true : patching is attempted assuming an ordinary lattice. This means that the fibre is patched to its two neighbouring fibres only! (NO DNA, NO POINTED LATTICES) Patches are put on if the norm of the patches is bigger than PREC. (defaulted to a tiny number)
Lattices with DNA • The user of PTC can create complex topologies anyway he wants too. To do this the standard “moving” routines of PTC are necessary. During that initial creation process patching cannot be fully automatic since the fibres do not yet exist. For example, when I create LHC1, LHC2 is not there yet. Therefore the common IP section cannot be patched to the fibres of a non-existent layout. • Therefore we will be talking here about moving objects in an already trackable completed complex.
DNA • N.B. A complex system can be created without DNA. What follows would NOT work in that case! • If you use DNA, then all the magnets must appear in ordinary layouts only once! These layouts are not for tracking but for data base purposes. They often correspond to MAD8 style trackable beam lines but not necessarily. • Then the actual trackable layouts (recirculators, dog-bones, colliders) must be constructed using a command which appends a fibre whose magnet points at one of the member of the DNA.
Append_point DO J=1,9 P=>LHC1%DNA(J)%L%START DO I=1,LHC1%DNA(J)%L%N CALL APPEND_POINT(LHC1,P) P=>P%NEXT ENDDO ENDDO In this example, nine beam lines were read and store in a MAD_UNIVERSE. LHC1%DNA(1..9)%L points to each of these “DNA” layout. The actual LHC1 is then created using APPEND_POINT(LHC1,P). Actually this LHC1 is mathematically trackable although in reality it might require more manipulations to make it the real thing. Actually at this point in time, it is the survey lattice LHC0, still a fictitious object but PTC would not know. N.B. Append_point takes a object type fibre_appearance and uses it to locate all the appearance of a given magnet.
Fibre_appearance TYPE FIBRE_APPEARANCE TYPE(FIBRE), POINTER :: PARENT_FIBRE TYPE(FIBRE_APPEARANCE), POINTER :: NEXT END TYPE FIBRE_APPEARANCE • In the element, there is an object called “doko” from the Japanese meaning “where”! • A link list is made all the fibres outside the DNA where the magnet appears! • Patching proceeds for all fibres of the DOKO linked list!