Index: /GLBFrejus/HEAD/src/discoCP.cxx
===================================================================
--- /GLBFrejus/HEAD/src/discoCP.cxx	(revision 148)
+++ /GLBFrejus/HEAD/src/discoCP.cxx	(revision 149)
@@ -30,4 +30,5 @@
   7/7/05  JEC introduce the Mass hierachy and Octant degeneracy from Th.Schwetz
   8/7/05  JEC introduce data card management
+  17/5/06 JEC add  TEST_OCTANT to avoid pb if theta23=pi/4. 
  */
 
@@ -35,4 +36,5 @@
 #define DELTA_0   0.0
 #define DELTA_PI  M_PI 
+#define TEST_OCTANT false
 
 
@@ -47,17 +49,20 @@
 //---------------------------------------------------------------------
 bool test_th23(glb_params fit_values) {
-  double fit_th23 = glbGetOscParams(fit_values, GLB_THETA_23);
-  
-  // testing if fit_th23 is at the same side as the true value
-  
-  return  ( 
-	   (WRONG_TH23 == 0 && 
-	    (TH23 > M_PI/4. && fit_th23 > M_PI/4.) ||
-	    (TH23 < M_PI/4. && fit_th23 < M_PI/4.))
-	   ||
-	   (WRONG_TH23 == 1 && 
-	    (TH23 > M_PI/4. && fit_th23 < M_PI/4.) ||
-	    (TH23 < M_PI/4. && fit_th23 > M_PI/4.))
-	   );
+  if(TEST_OCTANT) {
+    double fit_th23 = glbGetOscParams(fit_values, GLB_THETA_23);
+    
+    // testing if fit_th23 is at the same side as the true value
+    
+    return  ( 
+	     (WRONG_TH23 == 0 && 
+	      (TH23 > M_PI/4. && fit_th23 > M_PI/4.) ||
+	      (TH23 < M_PI/4. && fit_th23 < M_PI/4.))
+	     ||
+	     (WRONG_TH23 == 1 && 
+	      (TH23 > M_PI/4. && fit_th23 < M_PI/4.) ||
+	      (TH23 < M_PI/4. && fit_th23 > M_PI/4.))
+	     );
+  }
+  return true;
 }//same_th23
 
@@ -101,15 +106,15 @@
 
   fileDataCard >> DUMMYSTR >> WRONG_TH23; 
-  std::cout << DUMMYSTR << WRONG_TH23 << std::endl; 
+  std::cout << DUMMYSTR << " " << WRONG_TH23 << std::endl; 
   fileDataCard >> DUMMYSTR >> WRONG_HIER;
-  std::cout << DUMMYSTR << WRONG_HIER << std::endl; 
+  std::cout << DUMMYSTR << " " << WRONG_HIER << std::endl; 
   fileDataCard >> DUMMYSTR >> TH12;  
-  std::cout << DUMMYSTR << TH12 << std::endl; 
+  std::cout << DUMMYSTR << " " << TH12 << std::endl; 
   fileDataCard >> DUMMYSTR >> TH23;  
-  std::cout << DUMMYSTR << TH23 << std::endl; 
+  std::cout << DUMMYSTR << " " << TH23 << std::endl; 
   fileDataCard >> DUMMYSTR >> DMQ21;  
-  std::cout << DUMMYSTR << DMQ21 << std::endl; 
+  std::cout << DUMMYSTR << " " << DMQ21 << std::endl; 
   fileDataCard >> DUMMYSTR >> DMQ31;  
-  std::cout << DUMMYSTR << DMQ31 << std::endl; 
+  std::cout << DUMMYSTR << " " << DMQ31 << std::endl; 
   fileDataCard >> DUMMYSTR >> ROOTFILENAME;  
 
@@ -127,11 +132,11 @@
 
   fileDataCard >> DUMMYSTR >> ND;  
-  std::cout << DUMMYSTR << ND  << std::endl; 
+  std::cout << DUMMYSTR << " "  << ND  << std::endl; 
   fileDataCard >> DUMMYSTR >> NTH;  
-  std::cout << DUMMYSTR << NTH  << std::endl; 
+  std::cout << DUMMYSTR << " " << NTH  << std::endl; 
   fileDataCard >> DUMMYSTR >> LOG10MIN;  
-  std::cout << DUMMYSTR << LOG10MIN << std::endl; 
+  std::cout << DUMMYSTR << " " << LOG10MIN << std::endl; 
   fileDataCard >> DUMMYSTR >> LOG10MAX;  
-  std::cout << DUMMYSTR << LOG10MAX << std::endl; 
+  std::cout << DUMMYSTR << " "  << LOG10MAX << std::endl; 
 
 
@@ -184,7 +189,11 @@
   // minimizer
   glb_params input_errors = glbAllocParams();
+  //JEC 17-05-06 use 10% except for Dm2_21 4%
+//   glbDefineParams(input_errors, 
+// 		  TH12*0.05, 0., TH23*0.30, 0., 
+// 		  DMQ21*0.05, fabs(DMQ31)*0.30);
   glbDefineParams(input_errors, 
-		  TH12*0.05, 0., TH23*0.30, 0., 
-		  DMQ21*0.05, fabs(DMQ31)*0.30);
+		  TH12*0.10, 0., TH23*0.10, 0., 
+		  DMQ21*0.04, fabs(DMQ31)*0.10);
   glbSetDensityParams(input_errors, 0.05, GLB_ALL);
   glbSetInputErrors(input_errors);
@@ -213,6 +222,6 @@
     
     for(int j = 0; j < ND; j++) {
-      //scan de 0 a +Pi pour delta_CP
-      delta =  M_PI * double(j) / (ND-1);
+      //scan de 0 a +2Pi pour delta_CP
+      delta =  2.0 * M_PI * double(j) / (ND-1);
 
       std::cout << "Consider (k,j) = (" << k << "," << j << ")" << std::endl;
Index: /GLBFrejus/HEAD/src/discoTheta13.cxx
===================================================================
--- /GLBFrejus/HEAD/src/discoTheta13.cxx	(revision 148)
+++ /GLBFrejus/HEAD/src/discoTheta13.cxx	(revision 149)
@@ -24,12 +24,13 @@
   experiment may be fit by Theta13 = 0 
   the true values are used to build the referenced experiments
-  use chi2Theta to marginalized over all parameters except Theta
+  use chi2Delta to marginalized over all parameters except delta
+  
   
   11/7/05 JEC creation
-  31/10/05 JEC correct the comment chi2Theta
  */
 
 
 #define TH13_0   0.0
+#define TEST_OCTANT false
 
 int WRONG_TH23, WRONG_HIER; //condition on octant/hierarchy
@@ -43,17 +44,20 @@
 //---------------------------------------------------------------------
 bool test_th23(glb_params fit_values) {
-  double fit_th23 = glbGetOscParams(fit_values, GLB_THETA_23);
-  
-  // testing if fit_th23 is at the same side as the true value
-  
-  return  ( 
-	   (WRONG_TH23 == 0 && 
-	    (TH23 > M_PI/4. && fit_th23 > M_PI/4.) ||
-	    (TH23 < M_PI/4. && fit_th23 < M_PI/4.))
-	   ||
-	   (WRONG_TH23 == 1 && 
-	    (TH23 > M_PI/4. && fit_th23 < M_PI/4.) ||
-	    (TH23 < M_PI/4. && fit_th23 > M_PI/4.))
-	   );
+  if(TEST_OCTANT) {
+    double fit_th23 = glbGetOscParams(fit_values, GLB_THETA_23);
+    
+    // testing if fit_th23 is at the same side as the true value
+    
+    return  ( 
+	     (WRONG_TH23 == 0 && 
+	      (TH23 > M_PI/4. && fit_th23 > M_PI/4.) ||
+	      (TH23 < M_PI/4. && fit_th23 < M_PI/4.))
+	     ||
+	     (WRONG_TH23 == 1 && 
+	      (TH23 > M_PI/4. && fit_th23 < M_PI/4.) ||
+	      (TH23 < M_PI/4. && fit_th23 > M_PI/4.))
+	     );
+  }
+  return true;
 }//same_th23
 
Index: /GLBFrejus/HEAD/src/sensi.cxx
===================================================================
--- /GLBFrejus/HEAD/src/sensi.cxx	(revision 148)
+++ /GLBFrejus/HEAD/src/sensi.cxx	(revision 149)
@@ -25,18 +25,21 @@
   use glbChiDeltaTheta to marginalized other all parameters except of 
   the current delta and theta
+
+  24/10/05 (JEC) 
+  . transfert the #defined variables to Data Cards
+  . polish the code
+
  */
-//FIXME: transfert the #defined variables to Data Cards
-#define TH12 ( 0.5 * asin(sqrt(0.82)) )
-#define TH23 ( M_PI/4.0 )
-
-#define TH13   0.0  
-#define DELTA  0.0
-
-#define DMQ21 8.2e-5
-#define DMQ31 2.5e-3
-
-
-int WRONG_TH23, WRONG_HIER;
-
+
+float TH12, TH23,DMQ21,DMQ31; //theta12,theta23,Dm^2_21,Dm^2_31
+
+//The true value Theta13 and Delta_CP
+#define TH13_0   0.0  
+#define DELTA_0  0.0
+
+int ND; //number of bins to scan delta parameter [-pi,+pi]
+int NTH; //number of bins to scan theta13 parameter
+float LOG10MIN; //minimal Log10(sin^2(2theta13))
+float LOG10MAX; //minimal Log10(sin^2(2theta13))
 
 /**************************************/
@@ -46,4 +49,37 @@
 int main(int argc, char *argv[])
 {
+  //Process data card file
+  std::string ROOTDIR = getenv("GLBFREJUSROOT");
+  std::string DATACARD;
+  DATACARD = ROOTDIR + "/run/sensi.data"; 
+  std::ifstream fileDataCard;
+  std::cout << "Open DataCard file : " << DATACARD <<std::endl;
+  fileDataCard.open(DATACARD.data());
+  std::string DUMMYSTR; //comment string of the variables
+
+  std::string ROOTFILENAME;
+
+  fileDataCard >> DUMMYSTR >> TH12;  
+  std::cout << DUMMYSTR << TH12 << std::endl; 
+  fileDataCard >> DUMMYSTR >> TH23;  
+  std::cout << DUMMYSTR << TH23 << std::endl; 
+  fileDataCard >> DUMMYSTR >> DMQ21;  
+  std::cout << DUMMYSTR << DMQ21 << std::endl; 
+  fileDataCard >> DUMMYSTR >> DMQ31;  
+  std::cout << DUMMYSTR << DMQ31 << std::endl; 
+  fileDataCard >> DUMMYSTR >> ROOTFILENAME;  
+  ROOTFILENAME += ".root";
+  std::cout << DUMMYSTR <<ROOTFILENAME  << std::endl; 
+
+  fileDataCard >> DUMMYSTR >> ND;  
+  std::cout << DUMMYSTR << ND  << std::endl; 
+  fileDataCard >> DUMMYSTR >> NTH;  
+  std::cout << DUMMYSTR << NTH  << std::endl; 
+  fileDataCard >> DUMMYSTR >> LOG10MIN;  
+  std::cout << DUMMYSTR << LOG10MIN << std::endl; 
+  fileDataCard >> DUMMYSTR >> LOG10MAX;  
+  std::cout << DUMMYSTR << LOG10MAX << std::endl; 
+
+
   //init AIDA for Histo/Tuple
   AIDA::IAnalysisFactory* aida = AIDA_createAnalysisFactory();
@@ -57,5 +93,5 @@
   std::string opts = "export=root";
   AIDA::ITree* fTree = 
-    treeFactory->create("SPLDeltaTheta2+8OldFluxCorr.root","root",false,true,opts);
+    treeFactory->create(ROOTFILENAME,"root",false,true,opts);
   delete treeFactory;
 
@@ -88,5 +124,5 @@
   // true values (reference for future Chi2 computations) 
   glb_params true_values = glbAllocParams();
-  glbDefineParams(true_values, TH12, TH13, TH23, DELTA, DMQ21, DMQ31);
+  glbDefineParams(true_values, TH12, TH13_0, TH23, DELTA_0, DMQ21, DMQ31);
   glbPrintParams(stdout,true_values);
   
@@ -96,5 +132,5 @@
   // set Starting Values
   glb_params start_values = glbAllocParams();
-  glbDefineParams(start_values, TH12, TH13, TH23, DELTA, DMQ21, DMQ31);
+  glbDefineParams(start_values, TH12, TH13_0, TH23, DELTA_0, DMQ21, DMQ31);
   glbSetStartingValues(start_values);
   glbPrintParams(stdout,start_values);
@@ -103,5 +139,5 @@
   // init test values
   glb_params test_values = glbAllocParams();
-  glbDefineParams(test_values, TH12, TH13, TH23, DELTA, DMQ21, DMQ31);
+  glbDefineParams(test_values, TH12, TH13_0, TH23, DELTA_0, DMQ21, DMQ31);
   glbPrintParams(stdout,test_values);
 
@@ -122,9 +158,4 @@
 
 
-#define ND  31  
-#define NTH 41
-#define LOG10MIN -4.0
-#define LOG10MAX -1.0
-
   std::cout << "Start to loop...." << std::endl;
 
@@ -147,11 +178,10 @@
       glbSetOscParams(test_values, th, GLB_THETA_13);
       
+      std::cout << "Consider (k,j) = (" << k << "," << j << ")" << std::endl;
       //Param correlation
       res = glbChiThetaDelta(test_values,fit_values,0);
-
-      std::cout << "delta j:" << j << " theta13 k:" << k
-		<< " chi2 : " << res
-		<< std::endl;
-
+      
+
+      //For sensitivity plot store the outcome of the fit
       fit_theta12 = glbGetOscParams(fit_values, GLB_THETA_12);
       fit_theta13 = glbGetOscParams(fit_values, GLB_THETA_13);
