From f3ce2a2ec81589857735a1da7dbdbc9903c653d1 Mon Sep 17 00:00:00 2001
From: zhang <zhang@9a6e40ed-f3a0-4838-9b4a-bf418f78e88d>
Date: Tue, 11 Oct 2011 16:29:08 +0000
Subject: [PATCH] Add features to do ID correction. (Based on the functions in
 nsrl-ii_lib.cc)

---
 tracy/tools/soltracy.cc | 43 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/tracy/tools/soltracy.cc b/tracy/tools/soltracy.cc
index 647db9f..a07b176 100644
--- a/tracy/tools/soltracy.cc
+++ b/tracy/tools/soltracy.cc
@@ -711,6 +711,49 @@ int main(int argc, char *argv[]) {
       fclose(outf);
     }
 
+  }
+  
+  /*
+To do ID correction.
+Based on parts of functions get_param( ) & ID_corr(), etc in nsls-ii_lib.cc 
+*/
+  else if(strcmp(CommandStr,"IDCorrFlag") == 0) {
+   
+    int k = 0;
+  
+  printf("Begin ID matching:................ \n");
+    
+  // read the family index of quadrupoles used for ID correction
+    if (N_calls > 0) {
+      if (N_Fam > N_Fam_max) {
+        printf("get_param: N_Fam > N_Fam_max: %d (%d)\n",
+	       N_Fam, N_Fam_max);
+        exit_(0);
+      }
+
+    for (k = 0; k < N_Fam; k++)
+      Q_Fam[k] = ElemIndex(IDCq_name[k]);
+    }
+
+    // ID correction
+    for (int k = 0; k < 11; k++)
+    printf("%d\n",Q_Fam[k]);
+
+
+    ini_ID_corr();
+    printlatt("linlat00.out");
+
+    ID_corr0();
+    printlatt("linlat01.out");
+
+  // exit(0);
+
+    ini_ID_corr();
+    printlatt("linlat0.out");
+
+    ID_corr(N_calls,N_steps);
+    printlatt("linlat1.out");
+
   }
   else
     printf("Wrong!!!!!");
-- 
GitLab