Updates for better DQM.  

Now, we use the reconstructor
to properly pedestal subtract and gain calibrate the 
signals.   This allows us - since the signals are now on
the same footing - to fit a function the summed spectra. 
The fit function used is a Landau convolved with a Gaussian. 
The quality is set based on chi^2/nu of the fits, as well
as the relative errors of the fit parameters.  Both pieces
of information is shown on the plots by adding TLatex 
objects to the TH1::fListOfFunctions.   The color of the 
function line reflects the quality (green: good, orange: 
problem, red: bad). 

Also, the average number of read-out errors per sub-detector
FMD1, 2, and 3 are computed and the quality set based on this 
number.  The means are shown on the plot together with the 
used thresholds.  Again, the color of the text reflects the 
quality.  

In all cases, the quality of the individual plots are set on
the objects themselves in the member TObject::fUniqueID.  This 
can then be retrieved by a Amore agent script to set the quality
of the individual objects in the Amore environment.   This script
is simple and looks like 

  // -*- mode: C++ -*-
  #include <map>

  void
  FMDshifterQuality(TObjArray* objs, map<string,int>* map)
  {
    for (Int_t i = 0; i < objs->GetEntriesFast(); i++) { 
      TObject* o = objs->At(i);
      if (!o) continue; 
      // Printf("Setting quality of %s to %d", o->GetName(), o->GetUniqueID());
      std::string s(o->GetName());
      (*map)[s] = o->GetUniqueID();
    }
  }

This should be added to the AMORE database at P2, and the fmd.configfile 
should look like 

  # QA species definition. Options: [default] [calib] [low] [high] [cosmic]
  qa_species default calib low high cosmic

  # Low cut for fitting energy loss specrta 
   ELossLowCut     0.3
  # Number of RMS to fit beyound maximum 
  ELossNRMS       2.
  # Cut on chi^2/nu of fit for bad value 
  ELossBadChi2Nu  100.
  # Cut on chi^2/nu of fit for f**ked up value
  ELossFkupChi2Nu 200.
  # Least number of entries before fitting 
  ELossMinEntries 10000.
  # Cut on average number of R/O errors per detector
  ROErrorsBad     0.31
  # Cut on average number of R/O errors per detector
  ROErrorsFkup    0.51

  # qaTresholdsDownoad 0

  # _macroDownload 1
  _macroExec1 FMDshifterQuality.C  
  #
  # EOF 
  #

The AliFMDQAChecker now also properly uses the QA thresholds from
the P2 environment by querying the (specific) CDB storage.  To set 
this up, a QAThresholds.configfile should be added for the FMD detector 
with the content: 

  #
  # Thresholds for the FMD
  #

  # Cut on chi^2/nu of fit for bad value 
  ELossBadChi2Nu D 100.
  # Cut on chi^2/nu of fit for f**ked up value
  ELossFkupChi2Nu D 200
  # Cut on parameter relative error 
  ELossGoodParError D 0.1
  # Cut on average number of R/O errors per detector
  ROErrorsBad D 0.31
  # Cut on average number of R/O errors per detector
  ROErrorsFkup D 0.51

  #
  # EOF 
  #

The revision should eventually be ported to the release, but
I'd like to do some more checks when I'm back from vacation.

Christian


git-svn-id: https://alisoft.cern.ch/AliRoot/trunk@57862 f7af4fe6-9843-0410-8265-dc069ae4e863
Update


git-svn-id: https://alisoft.cern.ch/AliRoot/trunk@57863 f7af4fe6-9843-0410-8265-dc069ae4e863