From d635108ae195127908eb310a01fa432ac7e98d52 Mon Sep 17 00:00:00 2001
From: zhang <zhang@9a6e40ed-f3a0-4838-9b4a-bf418f78e88d>
Date: Fri, 8 Apr 2011 17:03:01 +0000
Subject: [PATCH] 08/04/2011   Add comments

---
 tracy/tracy/inc/tracy.h   |  2 ++
 tracy/tracy/src/t2elem.cc | 33 +++++++++++++++++++++++++++++----
 tracy/tracy/src/t2lat.cc  |  6 +++---
 tracy/tracy/src/t2ring.cc |  2 +-
 tracy/tracy/src/tracy.cc  |  3 ++-
 5 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/tracy/tracy/inc/tracy.h b/tracy/tracy/inc/tracy.h
index 046b825..6723865 100644
--- a/tracy/tracy/inc/tracy.h
+++ b/tracy/tracy/inc/tracy.h
@@ -146,12 +146,14 @@ extern void EigenVal(double (*Ai)[mnp], long n, double *wr, double *wi);
 
 extern void t2init(void);
 
+/****** for orbit correction *********/
 extern void prt_gcmat(int bpm, int corr, int plane);
 
 extern void gcmat(int bpm, int corr, int plane);
 
 extern void lsoc(int niter, int bpm, int corr, int plane);
 
+
 /**** same as asctime in C without the \n at the end****/
 char *asctime2(const struct tm *timeptr);
 struct tm* GetTime(void);
diff --git a/tracy/tracy/src/t2elem.cc b/tracy/tracy/src/t2elem.cc
index 7ceadb3..6aadc67 100644
--- a/tracy/tracy/src/t2elem.cc
+++ b/tracy/tracy/src/t2elem.cc
@@ -3042,7 +3042,7 @@ double Mpole_GetPB(int Fnum1, int Knum1, int Order);
  Input:
  Fnum1 Famility number
  Knum1 Kids number
- Order mutipole component (K=2 for quadrupole)
+ Order mutipole component 1 for dipole, 2 for quadrupole)
 
  Output:
  none
@@ -3914,8 +3914,9 @@ void Solenoid_Init(int Fnum1) {
 
  Purpose:
  called by Cell_SetdP
- Compute full multipole composent as sum of design, systematic
- and random part.
+ Update full multipole composent as sum of design, systematic
+ and random part; and update the maximum order of the multipole 
+ component p_order.
  The ramdom error is the multiplication of PBrms and PBrnd
  Compute transport matrix if quadrupole (Order=2)
  Set multipole order to Order if multipole (Order >2)
@@ -4006,6 +4007,7 @@ void Mpole_DefPBpar(int Fnum1, int Knum1, int Order, double PBpar) {
     M->PBpar[Order + HOMmax] = PBpar;
 }
 
+
 void Mpole_DefPBsys(int Fnum1, int Knum1, int Order, double PBsys) {
     /*Fnum1, Knum1, Order : integer*/
     elemtype *elemp;
@@ -4016,7 +4018,18 @@ void Mpole_DefPBsys(int Fnum1, int Knum1, int Order, double PBsys) {
 
     M->PBsys[Order + HOMmax] = PBsys;
 }
-
+/*********************************************************************
+void Mpole_SetdS(int Fnum1, int Knum1)
+		       
+  Purpose:
+     Set misalignment error to the element with Fnum and Knum 
+  
+  Input:   
+     Fnum1          family number
+     Knum1          kid number
+    
+     
+**********************************************************************/
 void Mpole_SetdS(int Fnum1, int Knum1) {
     int j;
     CellType *cellp;
@@ -4031,6 +4044,18 @@ void Mpole_SetdS(int Fnum1, int Knum1) {
     cellconcat = false;
 }
 
+/*********************************************************************
+void Mpole_SetdT(int Fnum1, int Knum1)
+		       
+  Purpose:
+     Set rotation error to the element with Fnum and Knum 
+  
+  Input:   
+     Fnum1          family number
+     Knum1          kid number
+    
+     
+**********************************************************************/
 void Mpole_SetdT(int Fnum1, int Knum1) {
     CellType *cellp;
     elemtype *elemp;
diff --git a/tracy/tracy/src/t2lat.cc b/tracy/tracy/src/t2lat.cc
index ced0f6e..54ae28f 100644
--- a/tracy/tracy/src/t2lat.cc
+++ b/tracy/tracy/src/t2lat.cc
@@ -7,9 +7,9 @@ L. Nadolski   SOLEIL        2002          Link to NAFF, Radia field maps
 J. Bengtsson  NSLS-II, BNL  2004 -        
 
 */
-/* Current revision $Revision: 1.16 $
+/* Current revision $Revision: 1.17 $
  On branch $Name: not supported by cvs2svn $
- Latest change $Date: 2011-03-23 08:10:31 $ by $Author: zhang $
+ Latest change $Date: 2011-04-08 17:01:00 $ by $Author: zhang $
 */
 
 
@@ -2120,7 +2120,7 @@ static bool Lat_DealElement(FILE **fi_, FILE **fo_, long *cc_, long *ll_,
     getest__(P_expset(SET, 1 << ((long)comma)), "<, > expected", &V);
     GetSym__(&V);
     QL = 0.0;   /* L */
-    QK = 0.0;   /* K */
+    QK = 0.0;   /* K, quadrupole components*/
     k1 = 0;   /* N */
     t  = 0.0;   /* T */
     t1 = 0.0;   /* T1 */
diff --git a/tracy/tracy/src/t2ring.cc b/tracy/tracy/src/t2ring.cc
index 274ccf4..142468e 100644
--- a/tracy/tracy/src/t2ring.cc
+++ b/tracy/tracy/src/t2ring.cc
@@ -734,7 +734,7 @@ void Ring_Twiss(bool chroma, double dP)
   // Get eigenvalues and eigenvectors for the one turn transfer matrix
   GDiag(n, Cell[globval.Cell_nLoc].S, globval.Ascr, globval.Ascrinv, R,
         globval.OneTurnMat, globval.Omega, globval.Alphac);
-
+  // Puts zeroes in constant part of da map
   putlinmat(n, globval.Ascr, AScr);
   
   if (!globval.Cavity_on) 
diff --git a/tracy/tracy/src/tracy.cc b/tracy/tracy/src/tracy.cc
index 1e5ae15..7ab5015 100644
--- a/tracy/tracy/src/tracy.cc
+++ b/tracy/tracy/src/tracy.cc
@@ -33,7 +33,7 @@
 
 #include "pascalio.cc"
 
-#include "lsoc.cc"
+#include "lsoc.cc" //for COD correction
 
 #include "prtmfile.cc"
 #include "rdmfile.cc"
@@ -50,6 +50,7 @@
 
 #include "nsls-ii_lib.cc"
 
+/* new added since 2010 at soleil */
 #include "max4_lib.cc"
 #include "soleilcommon.cc"
 #include "read_script.cc"
-- 
GitLab