Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 6356)
+++ trunk/MagicSoft/Mars/Changelog	(revision 6357)
@@ -21,4 +21,13 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2005/02/10 Abelardo Moralejo 
+
+   * macros/mccalibrate.C 
+     - Added possibility to calibrate in photons or photoelectrons
+
+   * macros/starmc2.C
+     - Added comment about value of cleaning levels
+
 
  2005/02/10 Markus Gaug 
Index: trunk/MagicSoft/Mars/macros/mccalibrate.C
===================================================================
--- trunk/MagicSoft/Mars/macros/mccalibrate.C	(revision 6356)
+++ trunk/MagicSoft/Mars/macros/mccalibrate.C	(revision 6357)
@@ -45,22 +45,24 @@
   TString* CalibrationFilename;
 
-  CalibrationFilename = new TString("/data1/magic/mc_data/root/Period021_0.73_mirror/gammas_nonoise/Gamma_*root");  // File to be used for the calibration (must be a camera file without added noise)
-
-  Char_t* AnalysisFilename = "/data1/magic/mc_data/root/Period021_0.73_mirror/gammas_wobble/used/Gamma_*.root";  // File to be analyzed
+  CalibrationFilename = new TString("/users/emc/moralejo/mcdata/Period021_0.73_mirror/gammas_nonoise/Gamma_*root");  // File to be used for the calibration (must be a camera file without added noise)
+
+  Char_t* AnalysisFilename = "Gamma_*.root";  // File to be analyzed
 
   Char_t* OutFilename      = "calibrated_gamma.root";  // Output file name
 
 
-  //  MExtractSignal    sigextract;  
   // (other extraction methods can be used)
-  //  sigextract.SetSaturationLimit(240);
-  // Defines when to switch to low gain
-  // Define FADC slices to be integrated in high and low gain:
-  //  sigextract.SetRange(5, 10, 5, 10);
-
-  MExtractFixedWindowPeakSearch sigextract;
-  sigextract.SetWindows(6, 6, 4);
-
-
+  //    MExtractFixedWindowPeakSearch sigextract;
+  //    sigextract.SetWindows(6, 6, 4);
+
+  MExtractTimeAndChargeDigitalFilter sigextract;
+  sigextract.SetNameWeightsFile("/users/emc/moralejo/Mars/msignal/MC_weights.dat");
+  sigextract.SetRange(1, 14, 3, 14);
+
+
+  MMcCalibrationUpdate  mccalibupdate;
+  ///// User change: calibrate in photons or phe- :
+  mccalibupdate.SetSignalType(MCalibrateData::kPhe);
+  //  mccalibupdate.SetSignalType(MCalibrateData::kPhot);
 
   // ---------------------------------------------------------------------
@@ -100,6 +102,4 @@
   // Creates MPointingPos object and fill it with the telescope orientation
   // information taken from MMcEvt.
-
-  MMcCalibrationUpdate  mccalibupdate;
 
   MCalibrateData calib; 
@@ -111,4 +111,8 @@
 
   calib.SetCalibrationMode(MCalibrateData::kFfactor);
+  // Do not change the CalibrationMode above for MC...!
+
+  // Now set also whether to calibrate in photons or phe-:
+  calib.SetSignalType(mccalibupdate.GetSignalType());
 
   MImgCleanStd clean;
Index: trunk/MagicSoft/Mars/macros/starmc2.C
===================================================================
--- trunk/MagicSoft/Mars/macros/starmc2.C	(revision 6356)
+++ trunk/MagicSoft/Mars/macros/starmc2.C	(revision 6357)
@@ -38,5 +38,5 @@
 void starmc2()
 {
-  Char_t* AnalysisFilename = "../calibrated_gamma.root"; // File to be analyzed
+  Char_t* AnalysisFilename = "calibrated_gamma.root"; // File to be analyzed
 
   TString* OutFilename1;
@@ -48,5 +48,7 @@
   OutFilename2 = new TString("star_gamma_test.root");    // Output file name 2 (train)
 
-  Float_t CleanLev[2] = {3., 2.}; // Tail cuts for image analysis
+  MImgCleanStd      clean(4.5, 3.); // Applies tail cuts to image.
+  // WARNING: the tightness of the tail cuts depends on the signal extraction method
+  // used in mccalibrate.C!! (some methods result in positively biased signals)
 
   // ------------------------------------------------------------------
@@ -81,5 +83,4 @@
   read.DisableAutoScheme();
 
-  MImgCleanStd      clean(CleanLev[0], CleanLev[1]); // Applies tail cuts to image.
 
   MHillasCalc       hcalc; // Calculates Hillas parameters not dependent on source position.
