From 31ad25b138578c0aac761d9851e442a07fa23d4f Mon Sep 17 00:00:00 2001 From: zhang <zhang@9a6e40ed-f3a0-4838-9b4a-bf418f78e88d> Date: Thu, 30 Jun 2011 16:38:46 +0000 Subject: [PATCH] 30/06/2011 Get the family index of RF cavity and check whether RF harmonic number is defined or not for the lattice of the ring. --- tracy/tracy/src/soleilcommon.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tracy/tracy/src/soleilcommon.cc b/tracy/tracy/src/soleilcommon.cc index 1a619de..bfc0c24 100644 --- a/tracy/tracy/src/soleilcommon.cc +++ b/tracy/tracy/src/soleilcommon.cc @@ -73,7 +73,10 @@ 02/06/08 energy RF acceptance set to 1 just to avoid overflow during tracking 22/06/10 add new globval. flag and modify new name of variables from Tracy III Read_Lattice(), which is defined in physlib.cc - + 30/06/11 Get the family index of RF cavity for the lattice of ring; and check whether the RF harmonic number is defined. This is critical to get the + correct COD for the lattice with negative momentum compact factor. + + ****************************************************************************/ void Read_Lattice(char *fic) { @@ -142,6 +145,16 @@ void Read_Lattice(char *fic) // for a ring if (globval.RingType == 1) { + /* find the family index of RF cavity*/ + for(i=0; i<=globval.Cell_nLoc; i++){ + if(Cell[i].Elem.Pkind == Cavity) + globval.cav = ElemIndex(Cell[i].Elem.PName); + } + /*check whether the RF cavity hormonic number is defined or not*/ + if(Cell[Elem_GetPos(globval.cav, 1)].Elem.C->Ph == 0){ + printf("soleilcommon: Error!!! Define RF cavity harmonic number in the lattice!\n"); + exit_(1); + } /* Defines global variables for Tracy code */ -- GitLab