]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changes required in QA for the amoreQAshifter agent; change units of titles from...
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Nov 2009 12:48:24 +0000 (12:48 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Nov 2009 12:48:24 +0000 (12:48 +0000)
EMCAL/AliEMCALQAChecker.cxx
EMCAL/AliEMCALQAChecker.h
EMCAL/AliEMCALQADataMakerRec.cxx
EMCAL/AliEMCALQADataMakerRec.h

index d032630f5486cb79f080a299a2be754d228cba73..61302b2d2effbe89df59598e8079dcea5d48080c 100644 (file)
 
   Based on PHOS code written by
   Y. Schutz CERN July 2007
-*/
+
+ For the moment we only implement the checking of raw data QA 
+ by looking at the average at the each tower.
+ We count the times of the response for each tower, the propability for all towers should be the same (given value) 
+ depending on that value, the resulting QA flag is info, warning, error or fatal. 
+ Also we check the percentage of towers inside the average for each SM
+
+ -- Yaxian Mao, CCNU/CERN/LPSC
+ */
+
 
 // --- ROOT system ---
 #include <TClass.h>
-#include <TH1F.h> 
+#include <TH1.h> 
+#include <TF1.h> 
 #include <TH1I.h> 
 #include <TIterator.h> 
 #include <TKey.h> 
 #include <TFile.h> 
+#include <TLine.h>
+#include <TPaveText.h>
+#include <TMath.h>
 
 // --- Standard library ---
 
 #include "AliQAv1.h"
 #include "AliQAChecker.h"
 #include "AliEMCALQAChecker.h"
+#include "AliEMCALQADataMakerRec.h"
 
 ClassImp(AliEMCALQAChecker)
 
+//__________________________________________________________________
+AliEMCALQAChecker::AliEMCALQAChecker() : 
+AliQACheckerBase("EMCAL","EMCAL Quality Assurance Data Maker"),
+fLine(new TLine*[fknSM]),
+fHref(new TLine*[fknSM]),
+fText(NULL)
+{
+       /// ctor
+  for (Int_t sm = 0 ; sm < fknSM ; sm++){
+    fLine[sm] = NULL ; 
+    fHref[sm] = NULL ; 
+  }
+}          
+
+//__________________________________________________________________
+AliEMCALQAChecker::~AliEMCALQAChecker() 
+{
+       /// dtor
+  delete [] fLine ; 
+  delete [] fHref ;
+  if (fText) 
+    delete fText ; 
+}
+
+//__________________________________________________________________
+AliEMCALQAChecker::AliEMCALQAChecker(const AliEMCALQAChecker& qac) : 
+AliQACheckerBase(qac.GetName(), qac.GetTitle()), 
+fLine(new TLine*[fknSM]),
+fHref(new TLine*[fknSM]),
+fText(qac.fText)
+{
+       /// copy ctor 
+  for (Int_t sm = 0 ; sm < fknSM ; sm++){
+    fLine[sm] = qac.fLine[sm] ; 
+    fHref[sm] = qac.fHref[sm] ; 
+  }
+}   
+//__________________________________________________________________
+AliEMCALQAChecker& AliEMCALQAChecker::operator = (const AliEMCALQAChecker &qac)
+{
+  fText = qac.fText;
+
+  for (Int_t sm = 0 ; sm < fknSM ; sm++){
+    fLine[sm] = qac.fLine[sm] ; 
+    fHref[sm] = qac.fHref[sm] ; 
+  }
+  return *this ;
+}
+
+//______________________________________________________________________________
+Double_t *
+AliEMCALQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, AliDetectorRecoParam * /*recoParam*/)
+{
+       /// Check objects in list
+       
+       if ( index == AliQAv1::kRAW ) 
+       {
+               return CheckRaws(list);
+               printf ("checkers for task %d \n", index) ;             
+       }
+       
+       if ( index == AliQAv1::kREC)
+       {
+               return CheckRecPoints(list);
+       }
+       
+       if ( index == AliQAv1::kESD )
+       {
+               return CheckESD(list);
+       }
+       AliWarning(Form("Checker for task %d not implement for the moment",index));
+       return NULL;
+}
+
+//______________________________________________________________________________
+TH1* 
+AliEMCALQAChecker::GetHisto(TObjArray* list, const char* hname, Int_t specie) const
+{
+       /// Get a given histo from the list
+       TH1* h = static_cast<TH1*>(list->FindObject(Form("%s_%s",AliRecoParam::GetEventSpecieName(specie),hname)));
+       if (!h)
+       {
+               AliError(Form("Did not find expected histo %s",hname));
+       }
+       return h;
+}
+
+//______________________________________________________________________________
+Double_t 
+AliEMCALQAChecker::MarkHisto(TH1& histo, Double_t value) const
+{
+       /// Mark histo as originator of some QA error/warning
+       
+       if ( value != 1.0 )
+       {
+               histo.SetBit(AliQAv1::GetQABit());
+       }
+       
+       return value;
+}
+
+
+//______________________________________________________________________________
+Double_t *
+AliEMCALQAChecker::CheckRaws(TObjArray ** list)
+{
+       /// Check raws
+  
+  Float_t kThreshold = 80. ; 
+
+       Double_t * test = new Double_t[AliRecoParam::kNSpecies] ;
+       for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+               test[specie] = 1.0 ; 
+               if ( !AliQAv1::Instance()->IsEventSpecieSet(specie)) 
+                       continue ; 
+               if (list[specie]->GetEntries() == 0)  
+                       test[specie] = 0. ; // nothing to check
+               else {
+                       TH1 * hdata = (TH1*)list[specie]->At(kTowerHG) ; 
+                       if(hdata->GetEntries()==0)
+                               continue;
+      Int_t  nbin   = hdata->GetNbinsX() ;
+      Int_t  nTower = nbin/4 ;
+      if(fText) {
+        fText->DeleteText() ; 
+        fText->Clear() ;
+      }
+      else {
+        fText = new TPaveText(0.3,0.6,0.7,0.9,"NDC") ;
+      }
+      fText->AddText(Form("OK if more than %2.2f %% inside aver-sigma < HG counts < aver+sigma", kThreshold));
+                       //TPaveText * fText[fknSM] = {0};
+      Double_t rv    = 0. ;
+                       for(Int_t iSM = 0 ; iSM < fknSM ; iSM++){
+        TString projname = Form("proj_%d",iSM);
+        Double_t aver  = 0. ;
+        Double_t recal = 0 ;
+        Double_t init  = 0. ;
+        Double_t mean  = 0. ;
+        Double_t width = 0. ;
+        Int_t flag     = 0 ;
+        Double_t ratio = 0. ;
+        TH1F * proj    = NULL  ;         
+                               for(Int_t iTower = iSM*nTower ; iTower<(iSM+1)*nTower ; iTower++){
+                                       aver += hdata->GetBinContent(iTower);
+                                       //printf("Tower: %d has counts = %f\n",iTower, hdata->GetBinContent(iTower));
+                               }
+                               aver /=nTower;
+                               AliInfo(Form("SM: %d has average = %f\n",iSM, aver));
+                               Double_t ymin = hdata->GetBinContent(hdata->GetMinimumBin());
+                               Double_t ymax = hdata->GetBinContent(hdata->GetMaximumBin());
+        proj = new TH1F(projname,projname,nbin,-aver,aver);
+        
+                               fLine[iSM] = dynamic_cast<TLine*>(hdata->GetListOfFunctions()->FindObject(fLine[iSM]));
+                               if (!fLine[iSM]) {
+          fLine[iSM] = new TLine((iSM+1)*nTower,ymin,(iSM+1)*nTower,ymax);
+          fLine[iSM]->SetLineColor(1);
+          fLine[iSM]->SetLineWidth(2);
+          hdata->GetListOfFunctions()->Add(fLine[iSM]);  
+          list[specie]->AddAt(hdata, kTowerHG) ; 
+        }          
+        else {
+          fLine[iSM]->SetX1((iSM+1)*nTower) ; 
+          fLine[iSM]->SetY1(ymin) ; 
+          fLine[iSM]->SetX2((iSM+1)*nTower) ; 
+          fLine[iSM]->SetY2(ymax) ; 
+        }
+               
+                               //Double_t size = 0.24 ;
+                               //fText[iSM] = new TPaveText(0.1+size*iSM,0.7,size*(iSM+1),0.9,"NDC");
+                               for(Int_t iTower = iSM*nTower ; iTower<(iSM+1)*nTower ; iTower++){
+                                       proj->Fill(hdata->GetBinContent(iTower)-aver);
+                               }       
+                               proj->Fit("gaus","","QNO");
+                               mean=proj->GetFunction("gaus")->GetParameter(1);
+                               width=proj->GetFunction("gaus")->GetParameter(2);
+        AliInfo(Form("aver = %f, mean = %f, sigma =%f\n",aver,mean, width));
+        //if mean or sigma is too huge from the fitting, fitting failed 
+        if(aver < 0 || width/aver >2.) flag = -1 ;
+        else {   //recalculate the average if the fitting didn't give the initial average          
+          aver+=mean;
+                                 init=TMath::Abs(mean/aver); 
+           while(init>0.01){
+            if(flag) flag = 0 ;
+            for(Int_t iTower = iSM*nTower ; iTower < (iSM+1)*nTower ; iTower++){
+                                       if(hdata->GetBinContent(iTower)>(aver-width) && hdata->GetBinContent(iTower)<(aver+width)){
+                                             flag++ ;
+                                             recal += hdata->GetBinContent(iTower);
+                }
+                                   }
+            recal/=flag;
+            aver =(aver+recal)/2 ;  
+            init=(aver-recal)/(aver+recal) ;   
+          } //recalculate the average 
+          if(flag)ratio=100.0*flag/nTower ;  //counting how many towers used for average recalculation
+          rv+=TMath::Abs((aver-recal)/(aver+recal)) ; 
+          AliInfo(Form("SM %d has %2.2f %% chanhel works \n", iSM, ratio));
+        }
+                               fHref[iSM] = dynamic_cast<TLine*>(hdata->GetListOfFunctions()->FindObject(fHref[iSM]));
+        if(!fHref[iSM]) {
+          fHref[iSM] = new TLine(iSM*nTower,aver,(iSM+1)*nTower,aver);
+          hdata->GetListOfFunctions()->Add(fHref[iSM]);  
+          list[specie]->AddAt(hdata, kTowerHG) ; 
+        }          
+        else {
+          fHref[iSM]->Clear() ; 
+          fHref[iSM]->SetX1(iSM*nTower) ; 
+          fHref[iSM]->SetY1(aver) ; 
+          fHref[iSM]->SetX2((iSM+1)*nTower) ; 
+          fHref[iSM]->SetY2(aver) ; 
+        } 
+        hdata->Paint() ; 
+                               if(ratio<= kThreshold && flag >0){ //if towers used for average recalculation smaller than 10%, then the problem on this SM
+                            //fText->SetFillColor(2);
+          fHref[iSM]->SetLineColor(2);
+          fHref[iSM]->SetLineWidth(2);
+          fText->SetFillColor(2);
+                                       fText->AddText(Form("SM %d: NOK = %2.0f %% channels OK!!!",iSM,ratio));
+                                       //fText[iSM]->AddText(Form("SM %d NOT OK, only %5.2f %% works!!!",iSM,flag/nTower));
+                               }
+                               else if (flag == -1 || flag == 0 || ratio == 0.) {
+          fText->SetFillColor(2);
+          fHref[iSM]->SetLineColor(2);
+          fHref[iSM]->SetLineWidth(2);
+          fText->SetFillColor(2);
+                                       fText->AddText(Form("SM %d: NOK Fitting failed",iSM,ratio));
+                                   //fText[iSM]->AddText(Form("SM %d has %5.2f %% towers wok normally",iSM,flag/nTower));
+                               }       else {
+          fText->SetFillColor(3);
+          fHref[iSM]->SetLineColor(3);
+          fHref[iSM]->SetLineWidth(2);
+                                       fText->AddText(Form("SM %d: OK = %2.0f %% channels OK",iSM,ratio));
+                                   //fText[iSM]->AddText(Form("SM %d has %5.2f %% towers wok normally",iSM,flag/nTower));
+                               }
+        hdata->Paint() ; 
+                       //hdata->GetListOfFunctions()->Add(fText[iSM]);
+        delete proj ; 
+      }
+                       rv/=fknSM;
+                       hdata->GetListOfFunctions()->Add(fText);
+      hdata->Paint() ; 
+                       if ( rv <=0.1 ) 
+                       {
+                               AliInfo(Form("Got a small deviation rv = %f from average, SM works fine",rv));
+                               test[specie] =  0.05;
+                       }
+                       
+                       if ( rv <=0.5 && rv >0.1 ) 
+                       {
+                               AliWarning(Form("Got a deviation rv = %f from average, be careful!",rv));
+                               test[specie] =  0.3;
+                       }
+                       
+                       if ( rv <=0.5 && rv >0.8 ) 
+                       {
+                               AliError(Form("Got a large deviation of %f from average for SMs!!!",rv));
+                               test[specie] =  0.7;
+                       }
+                       if ( rv >0.8 ) 
+                       {
+                               AliError(Form("Got too large deviation of %f from average !!!???",rv));
+                               test[specie] =  0.9;
+                       }
+               }
+                               
+       }
+       return test ;
+}
+
+//______________________________________________________________________________
+void AliEMCALQAChecker::Init(const AliQAv1::DETECTORINDEX_t det) 
+{
+       /// intialises QA and QA checker settings
+       AliQAv1::Instance(det) ; 
+       Float_t hiValue[AliQAv1::kNBIT] ; 
+       Float_t lowValue[AliQAv1::kNBIT] ;
+       lowValue[AliQAv1::kINFO]      = 0.0   ; 
+       hiValue[AliQAv1::kINFO]       = 0.1 ; 
+       hiValue[AliQAv1::kWARNING]    = 0.5; 
+       lowValue[AliQAv1::kWARNING]   = 0.1 ; 
+       lowValue[AliQAv1::kERROR]     = 0.5   ; 
+       hiValue[AliQAv1::kERROR]      = 0.8 ; 
+       lowValue[AliQAv1::kFATAL]     = 0.8   ; 
+       hiValue[AliQAv1::kFATAL]      = 1.0 ; 
+       SetHiLo(&hiValue[0], &lowValue[0]) ; 
+}
 
index b40dbdcfa74c8dd17aed5771647cda0ffc58c8a4..d413a172634b2face2011bcd42a8bc33a6b9902b 100644 (file)
@@ -10,6 +10,8 @@
 
   Based on PHOS code written by
   Y. Schutz CERN July 2007
+  
+  Implemented by Yaxian Mao (CERN Oct. 2009)
 */
 
 
 class TFile ; 
 class TH1F ; 
 class TH1I ; 
+class TH1 ;
+class TLine ;
+class TPaveText ;
+class TObjArray;
 
 // --- Standard library ---
 
@@ -27,14 +33,60 @@ class AliEMCALLoader ;
 class AliEMCALQAChecker: public AliQACheckerBase {
 
 public:
-  AliEMCALQAChecker() : AliQACheckerBase("EMCAL","EMCAL Quality Assurance Data Maker") {;}          // ctor
-  virtual ~AliEMCALQAChecker() {;} // dtor
+       //Histograms for Raw data control
+       enum HRawType_t { 
+               // first normal Low Gain and High Gain info
+    kNsmodLG,kNsmodHG,kTimeLG,kTimeHG,
+    kSigLG,kSigHG,kNtotLG,kNtotHG,kTowerHG,kTowerLG,
+               kPedLG,kPedHG,
+               kPedRMSLG,kPedRMSHG,
+               // then TRU info
+               kNsmodTRU,kTimeTRU,
+               kSigTRU,kNtotTRU,
+               kPedTRU,kPedRMSTRU,
+               // and also LED Mon info
+               kNsmodLGLEDMon,kNsmodHGLEDMon,kTimeLGLEDMon,kTimeHGLEDMon,
+               kSigLGLEDMon,kSigHGLEDMon,kNtotLGLEDMon,kNtotHGLEDMon,
+               kPedLGLEDMon,kPedHGLEDMon,
+               kPedRMSLGLEDMon,kPedRMSHGLEDMon
+       } ;
+       
+       //Histograms for RecPoints  control
+       enum HRPType_t {kRecPE,kRecPM,kRecPDigM};
+       
+       //Histograms for ESDs  control
+       enum HESDType_t {kESDCaloClusE,kESDCaloClusM,kESDCaloCellA,kESDCaloCellM} ;
 
-private:
+  AliEMCALQAChecker() ;        // ctor
   AliEMCALQAChecker(const AliEMCALQAChecker& qac);
   AliEMCALQAChecker& operator = (const AliEMCALQAChecker& qac) ;
+  virtual ~AliEMCALQAChecker() ; // dtor
+       
+  virtual void   Init(const AliQAv1::DETECTORINDEX_t det) ; 
+
+protected:
+               
+       virtual Double_t * Check(AliQAv1::ALITASK_t index, TObjArray ** list,  AliDetectorRecoParam * /*recoParam*/) ;
+       //virtual void SetQA(AliQAv1::ALITASK_t index, Double_t * value) const ;        
+       
+       Double_t * CheckRaws(TObjArray ** list);
+       Double_t * CheckRecPoints(TObjArray** /*list*/){return NULL;}
+       Double_t * CheckESD(TObjArray** /*list*/){return NULL;}
+       TH1* GetHisto(TObjArray* list, const char* hname, Int_t specie) const;
+       Double_t MarkHisto(TH1& histo, Double_t value) const;
+       
+       
+private:
+       //TH1F * htemp; //a tempory histrogram for getting the mean and sigma
+       //Double_t fMean; //mean value 
+       //Double_t fWidth; //sigma of the distribution
+  static const Int_t fknSM = 4;    //! number of current SM
+  TLine **     fLine       ; //! line to distinguish the different SM
+  TLine **     fHref       ; //! Line marking the average value for each SM
+  TPaveText *  fText  ;      //! Information text for the quality of each SM
+
   
-  ClassDef(AliEMCALQAChecker,1)  // description 
+  ClassDef(AliEMCALQAChecker,2)  // description 
 
 };
 
index 6b1ddaedcbfb11e85c7210f9f327df8c3f7c63db..41af966aa085207e0225778f31574924aa184fa4 100644 (file)
-/**************************************************************************\r
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- *                                                                        *\r
- * Author: The ALICE Off-line Project.                                    *\r
- * Contributors are mentioned in the code where appropriate.              *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          *\r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
-/*\r
-Based on the QA code for PHOS written by Yves Schutz July 2007\r
-\r
-Authors:  J.Klay (Cal Poly) May 2008\r
-          S. Salur LBL April 2008\r
\r
-Created one histogram for QA shifter;\r
-The idea:average counts for all the towers should be flat \r
-Change all existing histograms as experts\r
- --By Yaxian Mao \r
-\r
-*/\r
-\r
-// --- ROOT system ---\r
-#include <TClonesArray.h>\r
-#include <TFile.h> \r
-#include <TH1F.h> \r
-#include <TH1I.h> \r
-#include <TH2F.h> \r
-#include <TProfile.h> \r
-\r
-// --- Standard library ---\r
-\r
-\r
-// --- AliRoot header files ---\r
-#include "AliESDCaloCluster.h"\r
-#include "AliESDCaloCells.h"\r
-#include "AliESDEvent.h"\r
-#include "AliLog.h"\r
-#include "AliEMCALQADataMakerRec.h"\r
-#include "AliQAChecker.h"\r
-#include "AliEMCALDigit.h" \r
-#include "AliEMCALRecPoint.h" \r
-#include "AliEMCALRawUtils.h"\r
-#include "AliEMCALReconstructor.h"\r
-#include "AliEMCALRecParam.h"\r
-#include "AliRawReader.h"\r
-#include "AliCaloRawStreamV3.h"\r
-#include "AliEMCALGeoParams.h"\r
-\r
-ClassImp(AliEMCALQADataMakerRec)\r
-           \r
-//____________________________________________________________________________ \r
-  AliEMCALQADataMakerRec::AliEMCALQADataMakerRec() : \r
-    AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kEMCAL), "EMCAL Quality Assurance Data Maker"),\r
-    fSuperModules(4), // FIXME!!! number of SuperModules; 4 for 2009; update default to 12 for later runs..\r
-    fFirstPedestalSample(0),\r
-    fLastPedestalSample(15),\r
-    fMinSignalHG(0),\r
-    fMaxSignalHG(AliEMCALGeoParams::fgkSampleMax)\r
-   {\r
-  // ctor\r
-}\r
-\r
-//____________________________________________________________________________ \r
-AliEMCALQADataMakerRec::AliEMCALQADataMakerRec(const AliEMCALQADataMakerRec& qadm) :\r
-  AliQADataMakerRec(), \r
-  fSuperModules(qadm.GetSuperModules()), \r
-  fFirstPedestalSample(qadm.GetFirstPedestalSample()), \r
-  fLastPedestalSample(qadm.GetLastPedestalSample()),  \r
-  fMinSignalHG(qadm.GetMinSignalHG()),\r
-  fMaxSignalHG(qadm.GetMaxSignalHG())\r
-{\r
-  //copy ctor \r
-  SetName((const char*)qadm.GetName()) ; \r
-  SetTitle((const char*)qadm.GetTitle()); \r
-}\r
-\r
-//__________________________________________________________________\r
-AliEMCALQADataMakerRec& AliEMCALQADataMakerRec::operator = (const AliEMCALQADataMakerRec& qadm )\r
-{\r
-  // Equal operator.\r
-  this->~AliEMCALQADataMakerRec();\r
-  new(this) AliEMCALQADataMakerRec(qadm);\r
-  return *this;\r
-}\r
\r
-//____________________________________________________________________________ \r
-void AliEMCALQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)\r
-{\r
-  //Detector specific actions at end of cycle\r
-       \r
-  if(fCycleCounter)\r
-         GetRawsData(kNEventsPerTower)->Scale(1./fCycleCounter);\r
-       \r
-  // do the QA checking\r
-  AliQAChecker::Instance()->Run(AliQAv1::kEMCAL, task, list) ;  \r
-}\r
-\r
-//____________________________________________________________________________ \r
-void AliEMCALQADataMakerRec::InitESDs()\r
-{\r
-  //Create histograms to controll ESD\r
-  const Bool_t expert   = kTRUE ; \r
-  const Bool_t image    = kTRUE ; \r
-  \r
-  TH1F * h1 = new TH1F("hESDCaloClusterE",  "ESDs CaloCluster energy in EMCAL;Energy [MeV];Counts",    200, 0., 20.) ; \r
-  h1->Sumw2() ;\r
-  Add2ESDsList(h1, kESDCaloClusE, !expert, image)  ;                                                     \r
-\r
-  TH1I * h2 = new TH1I("hESDCaloClusterM", "ESDs CaloCluster multiplicity in EMCAL;# of Clusters;Entries", 100, 0,  100) ; \r
-  h2->Sumw2() ;\r
-  Add2ESDsList(h2, kESDCaloClusM, !expert, image)  ;\r
-\r
-  TH1F * h3 = new TH1F("hESDCaloCellA",  "ESDs CaloCell amplitude in EMCAL;Energy [MeV];Counts",    500, 0., 250.) ; \r
-  h3->Sumw2() ;\r
-  Add2ESDsList(h3, kESDCaloCellA, !expert, image)  ;  \r
\r
-  TH1I * h4 = new TH1I("hESDCaloCellM", "ESDs CaloCell multiplicity in EMCAL;# of Clusters;Entries", 200, 0,  1000) ; \r
-  h4->Sumw2() ;\r
-  Add2ESDsList(h4, kESDCaloCellM, !expert, image) ;\r
-       \r
-}\r
-\r
-//____________________________________________________________________________ \r
-void AliEMCALQADataMakerRec::InitDigits()\r
-{\r
-  // create Digits histograms in Digits subdir\r
-  const Bool_t expert   = kTRUE ; \r
-  const Bool_t image    = kTRUE ; \r
-  \r
-  TH1I * h0 = new TH1I("hEmcalDigits",    "Digits amplitude distribution in EMCAL;Amplitude [ADC counts];Counts",    500, 0, 500) ; \r
-  h0->Sumw2() ;\r
-  Add2DigitsList(h0, 0, !expert, image) ;\r
-  TH1I * h1 = new TH1I("hEmcalDigitsMul", "Digits multiplicity distribution in EMCAL;# of Digits;Entries", 200, 0, 2000) ; \r
-  h1->Sumw2() ;\r
-  Add2DigitsList(h1, 1, !expert, image) ;\r
-}\r
-\r
-//____________________________________________________________________________ \r
-void AliEMCALQADataMakerRec::InitRecPoints()\r
-{\r
-  // create Reconstructed Points histograms in RecPoints subdir\r
-  const Bool_t expert   = kTRUE ; \r
-  const Bool_t image    = kTRUE ; \r
-  \r
-  TH1F* h0 = new TH1F("hEMCALRpE","EMCAL RecPoint energies;Energy [MeV];Counts",200, 0.,20.); //GeV\r
-  h0->Sumw2();\r
-  Add2RecPointsList(h0,kRecPE, !expert, image);\r
-\r
-  TH1I* h1 = new TH1I("hEMCALRpM","EMCAL RecPoint multiplicities;# of Clusters;Entries",100,0,100);\r
-  h1->Sumw2();\r
-  Add2RecPointsList(h1,kRecPM, !expert, image);\r
-\r
-  TH1I* h2 = new TH1I("hEMCALRpDigM","EMCAL RecPoint Digit Multiplicities;# of Digits;Entries",20,0,20);\r
-  h2->Sumw2();\r
-  Add2RecPointsList(h2,kRecPDigM, !expert, image);\r
-\r
-}\r
-\r
-//____________________________________________________________________________ \r
-void AliEMCALQADataMakerRec::InitRaws()\r
-{\r
-  // create Raws histograms in Raws subdir\r
-   const Bool_t expert   = kTRUE ; \r
-   const Bool_t saveCorr = kTRUE ; \r
-   const Bool_t image    = kTRUE ; \r
-\r
-  int nTowersPerSM = AliEMCALGeoParams::fgkEMCALRows * AliEMCALGeoParams::fgkEMCALCols; // number of towers in a SuperModule; 24x48\r
-  int nTot = fSuperModules * nTowersPerSM; // max number of towers in all SuperModules\r
-\r
-  // counter info: number of channels per event (bins are SM index)\r
-  TProfile * h0 = new TProfile("hLowEmcalSupermodules", "Low Gain EMC: # of towers vs SuperMod;SM Id;# of towers",\r
-                              fSuperModules, -0.5, fSuperModules-0.5) ;\r
-  Add2RawsList(h0, kNsmodLG, expert, image, !saveCorr) ;\r
-  TProfile * h1 = new TProfile("hHighEmcalSupermodules", "High Gain EMC: # of towers vs SuperMod;SM Id;# of towers",  \r
-                              fSuperModules, -0.5, fSuperModules-0.5) ; \r
-  Add2RawsList(h1, kNsmodHG, expert, image, !saveCorr) ;\r
-\r
-  // where did max sample occur? (bins are towers)\r
-  TProfile * h2 = new TProfile("hLowEmcalRawtime", "Low Gain EMC: Time at Max vs towerId;Tower Id;Time [ticks]", \r
-                              nTot, -0.5, nTot-0.5) ;\r
-  Add2RawsList(h2, kTimeLG, expert, image, !saveCorr) ;\r
-  TProfile * h3 = new TProfile("hHighEmcalRawtime", "High Gain EMC: Time at Max vs towerId;Tower Id;Time [ticks]", \r
-                              nTot, -0.5, nTot-0.5) ;\r
-  Add2RawsList(h3, kTimeHG, expert, image, !saveCorr) ;\r
-\r
-  // how much above pedestal was the max sample?  (bins are towers)\r
-  TProfile * h4 = new TProfile("hLowEmcalRawMaxMinusMin", "Low Gain EMC: Max - Min vs towerId;Tower Id;Max-Min [ADC counts]", \r
-                              nTot, -0.5, nTot-0.5) ;\r
-  Add2RawsList(h4, kSigLG, expert, image, !saveCorr) ;\r
-  TProfile * h5 = new TProfile("hHighEmcalRawMaxMinusMin", "High Gain EMC: Max - Min vs towerId;Tower Id;Max-Min [ADC counts]",\r
-                              nTot, -0.5, nTot-0.5) ;\r
-  Add2RawsList(h5, kSigHG, expert, image, !saveCorr) ;\r
-\r
-  // total counter: channels per event\r
-  TH1I * h6 = new TH1I("hLowNtot", "Low Gain EMC: Total Number of found towers;# of Towers;Counts", 200, 0, nTot) ;\r
-  h6->Sumw2() ;\r
-  Add2RawsList(h6, kNtotLG, expert, image, !saveCorr) ;\r
-  TH1I * h7 = new TH1I("hHighNtot", "High Gain EMC: Total Number of found towers;# of Towers;Counts", 200,0, nTot) ;\r
-  h7->Sumw2() ;\r
-  Add2RawsList(h7, kNtotHG, expert, image, !saveCorr) ;\r
-\r
-  // pedestal (bins are towers)\r
-  TProfile * h8 = new TProfile("hLowEmcalRawPed", "Low Gain EMC: Pedestal vs towerId;Tower Id;Pedestal [ADC counts]", \r
-                              nTot, -0.5, nTot-0.5) ;\r
-  Add2RawsList(h8, kPedLG, expert, image, !saveCorr) ;\r
-  TProfile * h9 = new TProfile("hHighEmcalRawPed", "High Gain EMC: Pedestal vs towerId;Tower Id;Pedestal [ADC counts]",\r
-                              nTot, -0.5, nTot-0.5) ;\r
-  Add2RawsList(h9, kPedHG, expert, image, !saveCorr) ;\r
-\r
-  // pedestal rms (standard dev = sqrt of variance estimator for pedestal) (bins are towers)\r
-  TProfile * h10 = new TProfile("hLowEmcalRawPedRMS", "Low Gain EMC: Pedestal RMS vs towerId;Tower Id;Width [ADC counts]", \r
-                               nTot, -0.5, nTot-0.5) ;\r
-  Add2RawsList(h10, kPedRMSLG, expert, image, !saveCorr) ;\r
-  TProfile * h11 = new TProfile("hHighEmcalRawPedRMS", "High Gain EMC: Pedestal RMS vs towerId;Tower Id;Width [ADC counts]",\r
-                               nTot, -0.5, nTot-0.5) ;\r
-  Add2RawsList(h11, kPedRMSHG, expert, image, !saveCorr) ;\r
-       \r
- //number of events per tower, for shifter fast check          \r
-  TH1I * h12 = new TH1I("hNEventsPerTower", "Number of events per tower;Tower", 200,0, nTot) ;\r
-  h12->Sumw2() ;\r
-  Add2RawsList(h12, kNEventsPerTower, !expert, image, !saveCorr) ;\r
-       \r
-       \r
-\r
-  // now repeat the same for TRU and LEDMon data\r
-  int nTot2x2 = fSuperModules * AliEMCALGeoParams::fgkEMCALTRUsPerSM * AliEMCALGeoParams::fgkEMCAL2x2PerTRU; // max number of TRU channels for all SuperModules\r
-\r
-  // counter info: number of channels per event (bins are SM index)\r
-  TProfile * hT0 = new TProfile("hTRUEmcalSupermodules", "TRU EMC: # of TRU channels vs SuperMod;SM Id;# of TRU channels",\r
-                               fSuperModules, -0.5, fSuperModules-0.5) ;\r
-  Add2RawsList(hT0, kNsmodTRU, expert, image, !saveCorr) ;\r
-\r
-  // where did max sample occur? (bins are TRU channels)\r
-  TProfile * hT1 = new TProfile("hTRUEmcalRawtime", "TRU EMC: Time at Max vs 2x2Id;2x2 Id;Time [ticks]", \r
-                               nTot2x2, -0.5, nTot2x2-0.5) ;\r
-  Add2RawsList(hT1, kTimeTRU, expert, image, !saveCorr) ;\r
-\r
-  // how much above pedestal was the max sample?  (bins are TRU channels)\r
-  TProfile * hT2 = new TProfile("hTRUEmcalRawMaxMinusMin", "TRU EMC: Max - Min vs 2x2Id;2x2 Id;Max-Min [ADC counts]", \r
-                               nTot2x2, -0.5, nTot2x2-0.5) ;\r
-  Add2RawsList(hT2, kSigTRU, expert, image, !saveCorr) ;\r
-\r
-  // total counter: channels per event\r
-  TH1I * hT3 = new TH1I("hTRUNtot", "TRU EMC: Total Number of found TRU channels;# of TRU Channels;Counts", 200, 0, nTot2x2) ;\r
-  hT3->Sumw2() ;\r
-  Add2RawsList(hT3, kNtotTRU, expert, image, !saveCorr) ;\r
-\r
-  // pedestal (bins are TRU channels)\r
-  TProfile * hT4 = new TProfile("hTRUEmcalRawPed", "TRU EMC: Pedestal vs 2x2Id;2x2 Id;Pedestal [ADC counts]", \r
-                               nTot2x2, -0.5, nTot2x2-0.5) ;\r
-  Add2RawsList(hT4, kPedTRU, expert, image, !saveCorr) ;\r
-\r
-  // pedestal rms (standard dev = sqrt of variance estimator for pedestal) (bins are TRU channels)\r
-  TProfile * hT5 = new TProfile("hTRUEmcalRawPedRMS", "TRU EMC: Pedestal RMS vs 2x2Id;2x2 Id;Width [ADC counts]", \r
-                               nTot2x2, -0.5, nTot2x2-0.5) ;\r
-  Add2RawsList(hT5, kPedRMSTRU, expert, image, !saveCorr) ;\r
-\r
-  // and also LED Mon..\r
-  // LEDMon has both high and low gain channels, just as regular FEE/towers\r
-  int nTotLEDMon = fSuperModules * AliEMCALGeoParams::fgkEMCALLEDRefs; // max number of LEDMon channels for all SuperModules\r
-\r
-  // counter info: number of channels per event (bins are SM index)\r
-  TProfile * hL0 = new TProfile("hLowLEDMonEmcalSupermodules", "LowLEDMon Gain EMC: # of strips vs SuperMod;SM Id;# of strips",\r
-                              fSuperModules, -0.5, fSuperModules-0.5) ;\r
-  Add2RawsList(hL0, kNsmodLGLEDMon, expert, image, !saveCorr) ;\r
-  TProfile * hL1 = new TProfile("hHighLEDMonEmcalSupermodules", "HighLEDMon Gain EMC: # of strips vs SuperMod;SM Id;# of strips",  \r
-                              fSuperModules, -0.5, fSuperModules-0.5) ; \r
-  Add2RawsList(hL1, kNsmodHGLEDMon, expert, image, !saveCorr) ;\r
-\r
-  // where did max sample occur? (bins are strips)\r
-  TProfile * hL2 = new TProfile("hLowLEDMonEmcalRawtime", "LowLEDMon Gain EMC: Time at Max vs stripId;Strip Id;Time [ticks]", \r
-                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;\r
-  Add2RawsList(hL2, kTimeLGLEDMon, expert, image, !saveCorr) ;\r
-  TProfile * hL3 = new TProfile("hHighLEDMonEmcalRawtime", "HighLEDMon Gain EMC: Time at Max vs stripId;Strip Id;Time [ticks]", \r
-                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;\r
-  Add2RawsList(hL3, kTimeHGLEDMon, expert, image, !saveCorr) ;\r
-\r
-  // how much above pedestal was the max sample?  (bins are strips)\r
-  TProfile * hL4 = new TProfile("hLowLEDMonEmcalRawMaxMinusMin", "LowLEDMon Gain EMC: Max - Min vs stripId;Strip Id;Max-Min [ADC counts]", \r
-                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;\r
-  Add2RawsList(hL4, kSigLGLEDMon, expert, image, !saveCorr) ;\r
-  TProfile * hL5 = new TProfile("hHighLEDMonEmcalRawMaxMinusMin", "HighLEDMon Gain EMC: Max - Min vs stripId;Strip Id;Max-Min [ADC counts]",\r
-                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;\r
-  Add2RawsList(hL5, kSigHGLEDMon, expert, image, !saveCorr) ;\r
-\r
-  // total counter: channels per event\r
-  TH1I * hL6 = new TH1I("hLowLEDMonNtot", "LowLEDMon Gain EMC: Total Number of found strips;# of Strips;Counts", 200, 0, nTotLEDMon) ;\r
-  hL6->Sumw2() ;\r
-  Add2RawsList(hL6, kNtotLGLEDMon, expert, image, !saveCorr) ;\r
-  TH1I * hL7 = new TH1I("hHighLEDMonNtot", "HighLEDMon Gain EMC: Total Number of found strips;# of Strips;Counts", 200,0, nTotLEDMon) ;\r
-  hL7->Sumw2() ;\r
-  Add2RawsList(hL7, kNtotHGLEDMon, expert, image, !saveCorr) ;\r
-\r
-  // pedestal (bins are strips)\r
-  TProfile * hL8 = new TProfile("hLowLEDMonEmcalRawPed", "LowLEDMon Gain EMC: Pedestal vs stripId;Strip Id;Pedestal [ADC counts]", \r
-                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;\r
-  Add2RawsList(hL8, kPedLGLEDMon, expert, image, !saveCorr) ;\r
-  TProfile * hL9 = new TProfile("hHighLEDMonEmcalRawPed", "HighLEDMon Gain EMC: Pedestal vs stripId;Strip Id;Pedestal [ADC counts]",\r
-                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;\r
-  Add2RawsList(hL9, kPedHGLEDMon, expert, image, !saveCorr) ;\r
-\r
-  // pedestal rms (standard dev = sqrt of variance estimator for pedestal) (bins are strips)\r
-  TProfile * hL10 = new TProfile("hLowLEDMonEmcalRawPedRMS", "LowLEDMon Gain EMC: Pedestal RMS vs stripId;Strip Id;Width [ADC counts]", \r
-                               nTotLEDMon, -0.5, nTotLEDMon-0.5) ;\r
-  Add2RawsList(hL10, kPedRMSLGLEDMon, expert, image, !saveCorr) ;\r
-  TProfile * hL11 = new TProfile("hHighLEDMonEmcalRawPedRMS", "HighLEDMon Gain EMC: Pedestal RMS vs stripId;Strip Id;Width [ADC counts]",\r
-                               nTotLEDMon, -0.5, nTotLEDMon-0.5) ;\r
-  Add2RawsList(hL11, kPedRMSHGLEDMon, expert, image, !saveCorr) ;\r
-  \r
-}\r
-\r
-//____________________________________________________________________________\r
-void AliEMCALQADataMakerRec::MakeESDs(AliESDEvent * esd)\r
-{\r
-  // make QA data from ESDs\r
-\r
-  Int_t nTot = 0 ; \r
-  for ( Int_t index = 0; index < esd->GetNumberOfCaloClusters() ; index++ ) {\r
-    AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;\r
-    if( clu->IsEMCAL() ) {\r
-      GetESDsData(kESDCaloClusE)->Fill(clu->E()) ;\r
-      nTot++ ;\r
-    } \r
-  }\r
-  GetESDsData(kESDCaloClusM)->Fill(nTot) ;\r
-\r
-  //fill calo cells\r
-  AliESDCaloCells* cells = esd->GetEMCALCells();\r
-  GetESDsData(kESDCaloCellM)->Fill(cells->GetNumberOfCells()) ;\r
-\r
-  for ( Int_t index = 0; index < cells->GetNumberOfCells() ; index++ ) {\r
-    GetESDsData(kESDCaloCellA)->Fill(cells->GetAmplitude(index)) ;\r
-  }\r
-\r
-}\r
-\r
-//____________________________________________________________________________\r
-void AliEMCALQADataMakerRec::MakeRaws(AliRawReader* rawReader)\r
-{\r
-  //Fill prepared histograms with Raw digit properties\r
-\r
-  //Raw histogram filling not yet implemented\r
-  //\r
-  //Need to figure out how to get the info we want without having to\r
-  //actually run Raw2Digits twice.\r
-  //I suspect what we actually want is a raw digits method, not a true\r
-  //emcal raw data method, but this doesn't seem to be allowed in\r
-  //AliQADataMakerRec.h\r
-\r
-  // For now, to avoid redoing the expensive signal fits we just\r
-  // look at max vs min of the signal spextra, a la online usage in\r
-  // AliCaloCalibPedestal\r
-\r
-  rawReader->Reset() ;\r
-  AliCaloRawStreamV3 in(rawReader,"EMCAL"); \r
-\r
-  // setup\r
-  int nTowersPerSM = AliEMCALGeoParams::fgkEMCALRows * AliEMCALGeoParams::fgkEMCALCols; // number of towers in a SuperModule; 24x48\r
-  int nRows = AliEMCALGeoParams::fgkEMCALRows; // number of rows per SuperModule\r
-  int nStripsPerSM = AliEMCALGeoParams::fgkEMCALLEDRefs; // number of strips per SuperModule\r
-  int n2x2PerSM = AliEMCALGeoParams::fgkEMCALTRUsPerSM * AliEMCALGeoParams::fgkEMCAL2x2PerTRU; // number of TRU 2x2's per SuperModule\r
-\r
-  int sampleMin = 0; \r
-  int sampleMax = AliEMCALGeoParams::fgkSampleMax; // 0x3ff = 1023 = 10-bit range\r
-\r
-  // for the pedestal calculation\r
-  Bool_t selectPedestalSamples = kTRUE;\r
-\r
-  // SM counters; decl. should be safe, assuming we don't get more than expected SuperModules..\r
-  int nTotalSMLG[AliEMCALGeoParams::fgkEMCALModules] = {0};\r
-  int nTotalSMHG[AliEMCALGeoParams::fgkEMCALModules] = {0};\r
-  int nTotalSMTRU[AliEMCALGeoParams::fgkEMCALModules] = {0};\r
-  int nTotalSMLGLEDMon[AliEMCALGeoParams::fgkEMCALModules] = {0};\r
-  int nTotalSMHGLEDMon[AliEMCALGeoParams::fgkEMCALModules] = {0};\r
-\r
-  // indices for the reading\r
-  int iSM = 0;\r
-  int sample = 0;\r
-  int time = 0;\r
-  // counters, on sample level\r
-  int i = 0; // the sample number in current event.\r
-  int maxTime = 0;\r
-  int startBin = 0;\r
-\r
-  // calc. quantities\r
-  double meanPed = 0, squaredMean = 0, rmsPed = 0;\r
-\r
-  // start loop over input stream  \r
-  while (in.NextDDL()) {\r
-    int iRCU = in.GetDDLNumber() % 2; // RCU0 or RCU1, within SuperModule\r
-    while (in.NextChannel()) {\r
-\r
-      // counters\r
-      int max = sampleMin, min = sampleMax; // min and max sample values\r
-      int nsamples = 0;\r
-\r
-      // for the pedestal calculation\r
-      int sampleSum = 0; // sum of samples\r
-      int squaredSampleSum = 0; // sum of samples squared\r
-      int nSum = 0; // number of samples in sum\r
-      \r
-      while (in.NextBunch()) {\r
-       const UShort_t *sig = in.GetSignals();\r
-       startBin = in.GetStartTimeBin();\r
-       nsamples += in.GetBunchLength();\r
-       for (i = 0; i < in.GetBunchLength(); i++) {\r
-         sample = sig[i];\r
-         time = startBin--;\r
-\r
-         // check if it's a min or max value\r
-         if (sample < min) min = sample;\r
-         if (sample > max) {\r
-           max = sample;\r
-           maxTime = time;\r
-         }\r
-\r
-         // should we add it for the pedestal calculation?\r
-         if ( (fFirstPedestalSample<=time && time<=fLastPedestalSample) || // sample time in range\r
-              !selectPedestalSamples ) { // or we don't restrict the sample range.. - then we'll take all \r
-           sampleSum += sample;\r
-           squaredSampleSum += sample*sample;\r
-           nSum++;\r
-         }\r
-         \r
-       } // loop over samples in bunch\r
-      } // loop over bunches\r
-    \r
-      if (nsamples > 0) { // this check is needed for when we have zero-supp. on, but not sparse readout\r
-\r
-      // calculate pedesstal estimate: mean of possibly selected samples\r
-      if (nSum > 0) {\r
-       meanPed = sampleSum / (1.0 * nSum);\r
-       squaredMean = squaredSampleSum / (1.0 * nSum);\r
-       // The variance (rms squared) is equal to the mean of the squares minus the square of the mean..\r
-       rmsPed = sqrt(squaredMean - meanPed*meanPed); \r
-      }\r
-      else {\r
-       meanPed = 0;\r
-       squaredMean = 0;\r
-       rmsPed  = 0;\r
-      }\r
-\r
-      // it should be enough to check the SuperModule info for each DDL really, but let's keep it here for now\r
-      iSM = in.GetModule(); //The modules are numbered starting from 0\r
-\r
-      if (iSM>=0 && iSM<fSuperModules) { // valid module reading, can go on with filling\r
-\r
-       if ( in.IsLowGain() || in.IsHighGain() ) { // regular towers\r
-         int towerId = iSM*nTowersPerSM + in.GetColumn()*nRows + in.GetRow();\r
-       \r
-               GetRawsData(kNEventsPerTower)->Fill(towerId);\r
-       \r
-\r
-         if ( in.IsLowGain() ) { \r
-           //fill the low gain histograms, and counters\r
-           nTotalSMLG[iSM]++; // one more channel found\r
-           GetRawsData(kSigLG)->Fill(towerId, max - min);\r
-           GetRawsData(kTimeLG)->Fill(towerId, maxTime);\r
-           if (nSum>0) { // only fill pedestal info in case it could be calculated\r
-             GetRawsData(kPedLG)->Fill(towerId, meanPed);\r
-             GetRawsData(kPedRMSLG)->Fill(towerId, rmsPed);\r
-           }\r
-         } // gain==0\r
-         else if ( in.IsHighGain() ) {         \r
-           //fill the high gain ones\r
-           nTotalSMHG[iSM]++; // one more channel found\r
-           int signal = max - min;\r
-           // only fill the max-min signal info and maxTime, if the\r
-           // signal was in the selected range \r
-           if ( (signal > fMinSignalHG) && (signal < fMaxSignalHG) ) { \r
-             GetRawsData(kSigHG)->Fill(towerId, signal);\r
-             GetRawsData(kTimeHG)->Fill(towerId, maxTime);\r
-           } // signal\r
-           if (nSum>0) { // only fill pedestal info in case it could be calculated\r
-             GetRawsData(kPedHG)->Fill(towerId, meanPed);\r
-             GetRawsData(kPedRMSHG)->Fill(towerId, rmsPed);\r
-           }\r
-         }\r
-       } // low or high gain\r
-       // TRU\r
-       else if ( in.IsTRUData() ) {\r
-         // for TRU data, the mapping class holds the TRU internal 2x2 number (0..95) in the Column var..\r
-         int iTRU = iRCU; //TRU0 is from RCU0, TRU1 from RCU1\r
-         if (iRCU>0 && in.GetBranch()>0) iTRU=2; // TRU2 is from branch B on RCU1\r
-         int TRU2x2Id = iSM*n2x2PerSM + iTRU*AliEMCALGeoParams::fgkEMCAL2x2PerTRU \r
-           + in.GetColumn();\r
-\r
-         //fill the low gain histograms, and counters\r
-         nTotalSMTRU[iSM]++; // one more channel found\r
-         GetRawsData(kSigTRU)->Fill(TRU2x2Id, max - min);\r
-         GetRawsData(kTimeTRU)->Fill(TRU2x2Id, maxTime);\r
-         if (nSum>0) { // only fill pedestal info in case it could be calculated\r
-           GetRawsData(kPedTRU)->Fill(TRU2x2Id, meanPed);\r
-           GetRawsData(kPedRMSTRU)->Fill(TRU2x2Id, rmsPed);\r
-         }\r
-       }\r
-       // LED Mon\r
-       else if ( in.IsLEDMonData() ) {\r
-         // for LED Mon data, the mapping class holds the gain info in the Row variable\r
-         // and the Strip number in the Column..\r
-         int gain = in.GetRow(); \r
-         int stripId = iSM*nStripsPerSM + in.GetColumn();\r
-         \r
-         if ( gain == 0 ) { \r
-           //fill the low gain histograms, and counters\r
-           nTotalSMLGLEDMon[iSM]++; // one more channel found\r
-           GetRawsData(kSigLGLEDMon)->Fill(stripId, max - min);\r
-           GetRawsData(kTimeLGLEDMon)->Fill(stripId, maxTime);\r
-           if (nSum>0) { // only fill pedestal info in case it could be calculated\r
-             GetRawsData(kPedLGLEDMon)->Fill(stripId, meanPed);\r
-             GetRawsData(kPedRMSLGLEDMon)->Fill(stripId, rmsPed);\r
-           }\r
-         } // gain==0\r
-         else if ( gain == 1 ) {               \r
-           //fill the high gain ones\r
-           nTotalSMHGLEDMon[iSM]++; // one more channel found\r
-           GetRawsData(kSigHGLEDMon)->Fill(stripId, max - min);\r
-           GetRawsData(kTimeHGLEDMon)->Fill(stripId, maxTime);\r
-           if (nSum>0) { // only fill pedestal info in case it could be calculated\r
-             GetRawsData(kPedHGLEDMon)->Fill(stripId, meanPed);\r
-             GetRawsData(kPedRMSHGLEDMon)->Fill(stripId, rmsPed);\r
-           }\r
-         } // low or high gain\r
-       } // LEDMon\r
-\r
-      } // SM index OK\r
-\r
-      } // nsamples>0 check, some data found for this channel; not only trailer/header\r
-    }// end while over channel \r
-   \r
-  }//end while over DDL's, of input stream \r
-\r
-  // let's also fill the SM and event counter histograms\r
-  int nTotalHG = 0;\r
-  int nTotalLG = 0;\r
-  int nTotalTRU = 0;\r
-  int nTotalHGLEDMon = 0;\r
-  int nTotalLGLEDMon = 0;\r
-  for (iSM=0; iSM<fSuperModules; iSM++) {  \r
-    nTotalLG += nTotalSMLG[iSM]; \r
-    nTotalHG += nTotalSMHG[iSM]; \r
-    nTotalTRU += nTotalSMTRU[iSM]; \r
-    nTotalLG += nTotalSMLGLEDMon[iSM]; \r
-    nTotalHG += nTotalSMHGLEDMon[iSM]; \r
-    GetRawsData(kNsmodLG)->Fill(iSM, nTotalSMLG[iSM]); \r
-    GetRawsData(kNsmodHG)->Fill(iSM, nTotalSMHG[iSM]); \r
-    GetRawsData(kNsmodTRU)->Fill(iSM, nTotalSMTRU[iSM]); \r
-    GetRawsData(kNsmodLGLEDMon)->Fill(iSM, nTotalSMLGLEDMon[iSM]); \r
-    GetRawsData(kNsmodHGLEDMon)->Fill(iSM, nTotalSMHGLEDMon[iSM]); \r
-  }\r
-  GetRawsData(kNtotLG)->Fill(nTotalLG);\r
-  GetRawsData(kNtotHG)->Fill(nTotalHG);\r
-  GetRawsData(kNtotTRU)->Fill(nTotalTRU);\r
-  GetRawsData(kNtotLGLEDMon)->Fill(nTotalLGLEDMon);\r
-  GetRawsData(kNtotHGLEDMon)->Fill(nTotalHGLEDMon);\r
-\r
-  // just in case the next rawreader consumer forgets to reset; let's do it here again..\r
-  rawReader->Reset() ;\r
-\r
-  return;\r
-}\r
-\r
-//____________________________________________________________________________\r
-void AliEMCALQADataMakerRec::MakeDigits()\r
-{\r
-  // makes data from Digits\r
-\r
-  GetDigitsData(1)->Fill(fDigitsArray->GetEntriesFast()) ; \r
-  TIter next(fDigitsArray) ; \r
-  AliEMCALDigit * digit ; \r
-  while ( (digit = dynamic_cast<AliEMCALDigit *>(next())) ) {\r
-    GetDigitsData(0)->Fill( digit->GetAmp()) ;\r
-  }  \r
-  \r
-}\r
-\r
-//____________________________________________________________________________\r
-void AliEMCALQADataMakerRec::MakeDigits(TTree * digitTree)\r
-{\r
-  // makes data from Digit Tree\r
-  if (fDigitsArray) \r
-    fDigitsArray->Clear() ; \r
-  else\r
-    fDigitsArray = new TClonesArray("AliEMCALDigit", 1000) ; \r
-  \r
-  TBranch * branch = digitTree->GetBranch("EMCAL") ;\r
-  if ( ! branch ) {\r
-    AliWarning("EMCAL branch in Digit Tree not found") ; \r
-  } else {\r
-    branch->SetAddress(&fDigitsArray) ;\r
-    branch->GetEntry(0) ; \r
-    MakeDigits() ; \r
-  }\r
-  \r
-}\r
-\r
-//____________________________________________________________________________\r
-void AliEMCALQADataMakerRec::MakeRecPoints(TTree * clustersTree)\r
-{\r
-  // makes data from RecPoints\r
-  TBranch *emcbranch = clustersTree->GetBranch("EMCALECARP");\r
-  if (!emcbranch) { \r
-    AliError("can't get the branch with the EMCAL clusters !");\r
-    return;\r
-  }\r
-  \r
-  TObjArray * emcrecpoints = new TObjArray(100) ;\r
-  emcbranch->SetAddress(&emcrecpoints);\r
-  emcbranch->GetEntry(0);\r
-  \r
-  GetRecPointsData(kRecPM)->Fill(emcrecpoints->GetEntriesFast()) ; \r
-  TIter next(emcrecpoints) ; \r
-  AliEMCALRecPoint * rp ; \r
-  while ( (rp = dynamic_cast<AliEMCALRecPoint *>(next())) ) {\r
-    GetRecPointsData(kRecPE)->Fill( rp->GetEnergy()) ;\r
-    GetRecPointsData(kRecPDigM)->Fill(rp->GetMultiplicity());\r
-  }\r
-  emcrecpoints->Delete();\r
-  delete emcrecpoints;\r
-  \r
-}\r
-\r
-//____________________________________________________________________________ \r
-void AliEMCALQADataMakerRec::StartOfDetectorCycle()\r
-{\r
-  //Detector specific actions at start of cycle\r
-  \r
-}\r
-\r
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+/*
+Based on the QA code for PHOS written by Yves Schutz July 2007
+
+Authors:  J.Klay (Cal Poly) May 2008
+          S. Salur LBL April 2008
+Created one histogram for QA shifter;
+The idea:average counts for all the towers should be flat 
+Change all existing histograms as experts
+ --By Yaxian Mao 
+
+*/
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h> 
+#include <TH1F.h> 
+#include <TH1I.h> 
+#include <TH2F.h> 
+#include <TProfile.h> 
+
+// --- Standard library ---
+
+
+// --- AliRoot header files ---
+#include "AliESDCaloCluster.h"
+#include "AliESDCaloCells.h"
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliEMCALQADataMakerRec.h"
+#include "AliQAChecker.h"
+#include "AliEMCALDigit.h" 
+#include "AliEMCALRecPoint.h" 
+#include "AliEMCALRawUtils.h"
+#include "AliEMCALReconstructor.h"
+#include "AliEMCALRecParam.h"
+#include "AliRawReader.h"
+#include "AliCaloRawStreamV3.h"
+#include "AliEMCALGeoParams.h"
+
+ClassImp(AliEMCALQADataMakerRec)
+           
+//____________________________________________________________________________ 
+  AliEMCALQADataMakerRec::AliEMCALQADataMakerRec() : 
+    AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kEMCAL), "EMCAL Quality Assurance Data Maker"),
+    fSuperModules(4), // FIXME!!! number of SuperModules; 4 for 2009; update default to 12 for later runs..
+    fFirstPedestalSample(0),
+    fLastPedestalSample(15),
+    fMinSignalHG(0),
+    fMaxSignalHG(AliEMCALGeoParams::fgkSampleMax)
+   {
+  // ctor
+}
+
+//____________________________________________________________________________ 
+AliEMCALQADataMakerRec::AliEMCALQADataMakerRec(const AliEMCALQADataMakerRec& qadm) :
+  AliQADataMakerRec(), 
+  fSuperModules(qadm.GetSuperModules()), 
+  fFirstPedestalSample(qadm.GetFirstPedestalSample()), 
+  fLastPedestalSample(qadm.GetLastPedestalSample()),  
+  fMinSignalHG(qadm.GetMinSignalHG()),
+  fMaxSignalHG(qadm.GetMaxSignalHG())
+{
+  //copy ctor 
+  SetName((const char*)qadm.GetName()) ; 
+  SetTitle((const char*)qadm.GetTitle()); 
+}
+
+//__________________________________________________________________
+AliEMCALQADataMakerRec& AliEMCALQADataMakerRec::operator = (const AliEMCALQADataMakerRec& qadm )
+{
+  // Equal operator.
+  this->~AliEMCALQADataMakerRec();
+  new(this) AliEMCALQADataMakerRec(qadm);
+  return *this;
+}
+//____________________________________________________________________________ 
+void AliEMCALQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
+{
+  //Detector specific actions at end of cycle
+       
+//  if(fCycleCounter)
+//       GetRawsData(kNEventsPerTower)->Scale(1./fCycleCounter);
+
+  // do the QA checking
+  AliQAChecker::Instance()->Run(AliQAv1::kEMCAL, task, list) ;  
+}
+
+//____________________________________________________________________________ 
+void AliEMCALQADataMakerRec::InitESDs()
+{
+  //Create histograms to controll ESD
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1F * h1 = new TH1F("hESDCaloClusterE",  "ESDs CaloCluster energy in EMCAL;Energy [GeV];Counts",    200, 0., 100.) ; 
+  h1->Sumw2() ;
+  Add2ESDsList(h1, kESDCaloClusE, !expert, image)  ;                                                     
+
+  TH1I * h2 = new TH1I("hESDCaloClusterM", "ESDs CaloCluster multiplicity in EMCAL;# of Clusters;Entries", 100, 0,  100) ; 
+  h2->Sumw2() ;
+  Add2ESDsList(h2, kESDCaloClusM, !expert, image)  ;
+
+  TH1F * h3 = new TH1F("hESDCaloCellA",  "ESDs CaloCell amplitude in EMCAL;Energy [GeV];Counts",    500, 0., 50.) ; 
+  h3->Sumw2() ;
+  Add2ESDsList(h3, kESDCaloCellA, !expert, image)  ;  
+  TH1I * h4 = new TH1I("hESDCaloCellM", "ESDs CaloCell multiplicity in EMCAL;# of Clusters;Entries", 200, 0,  1000) ; 
+  h4->Sumw2() ;
+  Add2ESDsList(h4, kESDCaloCellM, !expert, image) ;
+       
+}
+
+//____________________________________________________________________________ 
+void AliEMCALQADataMakerRec::InitDigits()
+{
+  // create Digits histograms in Digits subdir
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1I * h0 = new TH1I("hEmcalDigits",    "Digits amplitude distribution in EMCAL;Amplitude [ADC counts];Counts",    500, 0, 500) ; 
+  h0->Sumw2() ;
+  Add2DigitsList(h0, 0, !expert, image) ;
+  TH1I * h1 = new TH1I("hEmcalDigitsMul", "Digits multiplicity distribution in EMCAL;# of Digits;Entries", 200, 0, 2000) ; 
+  h1->Sumw2() ;
+  Add2DigitsList(h1, 1, !expert, image) ;
+}
+
+//____________________________________________________________________________ 
+void AliEMCALQADataMakerRec::InitRecPoints()
+{
+  // create Reconstructed Points histograms in RecPoints subdir
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1F* h0 = new TH1F("hEMCALRpE","EMCAL RecPoint energies;Energy [GeV];Counts",200, 0.,20.); //GeV
+  h0->Sumw2();
+  Add2RecPointsList(h0,kRecPE, !expert, image);
+
+  TH1I* h1 = new TH1I("hEMCALRpM","EMCAL RecPoint multiplicities;# of Clusters;Entries",100,0,100);
+  h1->Sumw2();
+  Add2RecPointsList(h1,kRecPM, !expert, image);
+
+  TH1I* h2 = new TH1I("hEMCALRpDigM","EMCAL RecPoint Digit Multiplicities;# of Digits;Entries",20,0,20);
+  h2->Sumw2();
+  Add2RecPointsList(h2,kRecPDigM, !expert, image);
+
+}
+
+//____________________________________________________________________________ 
+void AliEMCALQADataMakerRec::InitRaws()
+{
+  // create Raws histograms in Raws subdir
+   const Bool_t expert   = kTRUE ; 
+   const Bool_t saveCorr = kTRUE ; 
+   const Bool_t image    = kTRUE ; 
+
+  int nTowersPerSM = AliEMCALGeoParams::fgkEMCALRows * AliEMCALGeoParams::fgkEMCALCols; // number of towers in a SuperModule; 24x48
+  int nTot = fSuperModules * nTowersPerSM; // max number of towers in all SuperModules
+
+  // counter info: number of channels per event (bins are SM index)
+  TProfile * h0 = new TProfile("hLowEmcalSupermodules", "Low Gain EMC: # of towers vs SuperMod;SM Id;# of towers",
+                              fSuperModules, -0.5, fSuperModules-0.5) ;
+  Add2RawsList(h0, kNsmodLG, expert, image, !saveCorr) ;
+  TProfile * h1 = new TProfile("hHighEmcalSupermodules", "High Gain EMC: # of towers vs SuperMod;SM Id;# of towers",  
+                              fSuperModules, -0.5, fSuperModules-0.5) ; 
+  Add2RawsList(h1, kNsmodHG, expert, image, !saveCorr) ;
+
+  // where did max sample occur? (bins are towers)
+  TProfile * h2 = new TProfile("hLowEmcalRawtime", "Low Gain EMC: Time at Max vs towerId;Tower Id;Time [ticks]", 
+                              nTot, -0.5, nTot-0.5) ;
+  Add2RawsList(h2, kTimeLG, expert, image, !saveCorr) ;
+  TProfile * h3 = new TProfile("hHighEmcalRawtime", "High Gain EMC: Time at Max vs towerId;Tower Id;Time [ticks]", 
+                              nTot, -0.5, nTot-0.5) ;
+  Add2RawsList(h3, kTimeHG, expert, image, !saveCorr) ;
+
+  // how much above pedestal was the max sample?  (bins are towers)
+  TProfile * h4 = new TProfile("hLowEmcalRawMaxMinusMin", "Low Gain EMC: Max - Min vs towerId;Tower Id;Max-Min [ADC counts]", 
+                              nTot, -0.5, nTot-0.5) ;
+  Add2RawsList(h4, kSigLG, expert, image, !saveCorr) ;
+  TProfile * h5 = new TProfile("hHighEmcalRawMaxMinusMin", "High Gain EMC: Max - Min vs towerId;Tower Id;Max-Min [ADC counts]",
+                              nTot, -0.5, nTot-0.5) ;
+  Add2RawsList(h5, kSigHG, expert, image, !saveCorr) ;
+
+  // total counter: channels per event
+  TH1I * h6 = new TH1I("hLowNtot", "Low Gain EMC: Total Number of found towers;# of Towers;Counts", 200, 0, nTot) ;
+  h6->Sumw2() ;
+  Add2RawsList(h6, kNtotLG, expert, image, !saveCorr) ;
+  TH1I * h7 = new TH1I("hHighNtot", "High Gain EMC: Total Number of found towers;# of Towers;Counts", 200,0, nTot) ;
+  h7->Sumw2() ;
+  Add2RawsList(h7, kNtotHG, expert, image, !saveCorr) ;
+
+  // pedestal (bins are towers)
+  TProfile * h8 = new TProfile("hLowEmcalRawPed", "Low Gain EMC: Pedestal vs towerId;Tower Id;Pedestal [ADC counts]", 
+                              nTot, -0.5, nTot-0.5) ;
+  Add2RawsList(h8, kPedLG, expert, image, !saveCorr) ;
+  TProfile * h9 = new TProfile("hHighEmcalRawPed", "High Gain EMC: Pedestal vs towerId;Tower Id;Pedestal [ADC counts]",
+                              nTot, -0.5, nTot-0.5) ;
+  Add2RawsList(h9, kPedHG, expert, image, !saveCorr) ;
+
+  // pedestal rms (standard dev = sqrt of variance estimator for pedestal) (bins are towers)
+  TProfile * h10 = new TProfile("hLowEmcalRawPedRMS", "Low Gain EMC: Pedestal RMS vs towerId;Tower Id;Width [ADC counts]", 
+                               nTot, -0.5, nTot-0.5) ;
+  Add2RawsList(h10, kPedRMSLG, expert, image, !saveCorr) ;
+  TProfile * h11 = new TProfile("hHighEmcalRawPedRMS", "High Gain EMC: Pedestal RMS vs towerId;Tower Id;Width [ADC counts]",
+                               nTot, -0.5, nTot-0.5) ;
+  Add2RawsList(h11, kPedRMSHG, expert, image, !saveCorr) ;
+       
+ //number of events per tower, for shifter fast check          
+  TH1I * h12 = new TH1I("hTowerHG", "High Gains on the Tower;Tower", nTot,0, nTot) ;
+  h12->Sumw2() ;
+  Add2RawsList(h12, kTowerHG, !expert, image, !saveCorr) ;
+  TH1I * h13 = new TH1I("hTowerLG", "Low Gains on the Tower;Tower", nTot,0, nTot) ;
+  h13->Sumw2() ;
+  Add2RawsList(h13, kTowerLG, !expert, image, !saveCorr) ;             
+
+  // now repeat the same for TRU and LEDMon data
+  int nTot2x2 = fSuperModules * AliEMCALGeoParams::fgkEMCALTRUsPerSM * AliEMCALGeoParams::fgkEMCAL2x2PerTRU; // max number of TRU channels for all SuperModules
+
+  // counter info: number of channels per event (bins are SM index)
+  TProfile * hT0 = new TProfile("hTRUEmcalSupermodules", "TRU EMC: # of TRU channels vs SuperMod;SM Id;# of TRU channels",
+                               fSuperModules, -0.5, fSuperModules-0.5) ;
+  Add2RawsList(hT0, kNsmodTRU, expert, image, !saveCorr) ;
+
+  // where did max sample occur? (bins are TRU channels)
+  TProfile * hT1 = new TProfile("hTRUEmcalRawtime", "TRU EMC: Time at Max vs 2x2Id;2x2 Id;Time [ticks]", 
+                               nTot2x2, -0.5, nTot2x2-0.5) ;
+  Add2RawsList(hT1, kTimeTRU, expert, image, !saveCorr) ;
+
+  // how much above pedestal was the max sample?  (bins are TRU channels)
+  TProfile * hT2 = new TProfile("hTRUEmcalRawMaxMinusMin", "TRU EMC: Max - Min vs 2x2Id;2x2 Id;Max-Min [ADC counts]", 
+                               nTot2x2, -0.5, nTot2x2-0.5) ;
+  Add2RawsList(hT2, kSigTRU, expert, image, !saveCorr) ;
+
+  // total counter: channels per event
+  TH1I * hT3 = new TH1I("hTRUNtot", "TRU EMC: Total Number of found TRU channels;# of TRU Channels;Counts", 200, 0, nTot2x2) ;
+  hT3->Sumw2() ;
+  Add2RawsList(hT3, kNtotTRU, expert, image, !saveCorr) ;
+
+  // pedestal (bins are TRU channels)
+  TProfile * hT4 = new TProfile("hTRUEmcalRawPed", "TRU EMC: Pedestal vs 2x2Id;2x2 Id;Pedestal [ADC counts]", 
+                               nTot2x2, -0.5, nTot2x2-0.5) ;
+  Add2RawsList(hT4, kPedTRU, expert, image, !saveCorr) ;
+
+  // pedestal rms (standard dev = sqrt of variance estimator for pedestal) (bins are TRU channels)
+  TProfile * hT5 = new TProfile("hTRUEmcalRawPedRMS", "TRU EMC: Pedestal RMS vs 2x2Id;2x2 Id;Width [ADC counts]", 
+                               nTot2x2, -0.5, nTot2x2-0.5) ;
+  Add2RawsList(hT5, kPedRMSTRU, expert, image, !saveCorr) ;
+
+  // and also LED Mon..
+  // LEDMon has both high and low gain channels, just as regular FEE/towers
+  int nTotLEDMon = fSuperModules * AliEMCALGeoParams::fgkEMCALLEDRefs; // max number of LEDMon channels for all SuperModules
+
+  // counter info: number of channels per event (bins are SM index)
+  TProfile * hL0 = new TProfile("hLowLEDMonEmcalSupermodules", "LowLEDMon Gain EMC: # of strips vs SuperMod;SM Id;# of strips",
+                              fSuperModules, -0.5, fSuperModules-0.5) ;
+  Add2RawsList(hL0, kNsmodLGLEDMon, expert, image, !saveCorr) ;
+  TProfile * hL1 = new TProfile("hHighLEDMonEmcalSupermodules", "HighLEDMon Gain EMC: # of strips vs SuperMod;SM Id;# of strips",  
+                              fSuperModules, -0.5, fSuperModules-0.5) ; 
+  Add2RawsList(hL1, kNsmodHGLEDMon, expert, image, !saveCorr) ;
+
+  // where did max sample occur? (bins are strips)
+  TProfile * hL2 = new TProfile("hLowLEDMonEmcalRawtime", "LowLEDMon Gain EMC: Time at Max vs stripId;Strip Id;Time [ticks]", 
+                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;
+  Add2RawsList(hL2, kTimeLGLEDMon, expert, image, !saveCorr) ;
+  TProfile * hL3 = new TProfile("hHighLEDMonEmcalRawtime", "HighLEDMon Gain EMC: Time at Max vs stripId;Strip Id;Time [ticks]", 
+                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;
+  Add2RawsList(hL3, kTimeHGLEDMon, expert, image, !saveCorr) ;
+
+  // how much above pedestal was the max sample?  (bins are strips)
+  TProfile * hL4 = new TProfile("hLowLEDMonEmcalRawMaxMinusMin", "LowLEDMon Gain EMC: Max - Min vs stripId;Strip Id;Max-Min [ADC counts]", 
+                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;
+  Add2RawsList(hL4, kSigLGLEDMon, expert, image, !saveCorr) ;
+  TProfile * hL5 = new TProfile("hHighLEDMonEmcalRawMaxMinusMin", "HighLEDMon Gain EMC: Max - Min vs stripId;Strip Id;Max-Min [ADC counts]",
+                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;
+  Add2RawsList(hL5, kSigHGLEDMon, expert, image, !saveCorr) ;
+
+  // total counter: channels per event
+  TH1I * hL6 = new TH1I("hLowLEDMonNtot", "LowLEDMon Gain EMC: Total Number of found strips;# of Strips;Counts", 200, 0, nTotLEDMon) ;
+  hL6->Sumw2() ;
+  Add2RawsList(hL6, kNtotLGLEDMon, expert, image, !saveCorr) ;
+  TH1I * hL7 = new TH1I("hHighLEDMonNtot", "HighLEDMon Gain EMC: Total Number of found strips;# of Strips;Counts", 200,0, nTotLEDMon) ;
+  hL7->Sumw2() ;
+  Add2RawsList(hL7, kNtotHGLEDMon, expert, image, !saveCorr) ;
+
+  // pedestal (bins are strips)
+  TProfile * hL8 = new TProfile("hLowLEDMonEmcalRawPed", "LowLEDMon Gain EMC: Pedestal vs stripId;Strip Id;Pedestal [ADC counts]", 
+                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;
+  Add2RawsList(hL8, kPedLGLEDMon, expert, image, !saveCorr) ;
+  TProfile * hL9 = new TProfile("hHighLEDMonEmcalRawPed", "HighLEDMon Gain EMC: Pedestal vs stripId;Strip Id;Pedestal [ADC counts]",
+                              nTotLEDMon, -0.5, nTotLEDMon-0.5) ;
+  Add2RawsList(hL9, kPedHGLEDMon, expert, image, !saveCorr) ;
+
+  // pedestal rms (standard dev = sqrt of variance estimator for pedestal) (bins are strips)
+  TProfile * hL10 = new TProfile("hLowLEDMonEmcalRawPedRMS", "LowLEDMon Gain EMC: Pedestal RMS vs stripId;Strip Id;Width [ADC counts]", 
+                               nTotLEDMon, -0.5, nTotLEDMon-0.5) ;
+  Add2RawsList(hL10, kPedRMSLGLEDMon, expert, image, !saveCorr) ;
+  TProfile * hL11 = new TProfile("hHighLEDMonEmcalRawPedRMS", "HighLEDMon Gain EMC: Pedestal RMS vs stripId;Strip Id;Width [ADC counts]",
+                               nTotLEDMon, -0.5, nTotLEDMon-0.5) ;
+  Add2RawsList(hL11, kPedRMSHGLEDMon, expert, image, !saveCorr) ;
+  
+}
+
+//____________________________________________________________________________
+void AliEMCALQADataMakerRec::MakeESDs(AliESDEvent * esd)
+{
+  // make QA data from ESDs
+
+  Int_t nTot = 0 ; 
+  for ( Int_t index = 0; index < esd->GetNumberOfCaloClusters() ; index++ ) {
+    AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
+    if( clu->IsEMCAL() ) {
+      GetESDsData(kESDCaloClusE)->Fill(clu->E()) ;
+      nTot++ ;
+    } 
+  }
+  GetESDsData(kESDCaloClusM)->Fill(nTot) ;
+
+  //fill calo cells
+  AliESDCaloCells* cells = esd->GetEMCALCells();
+  GetESDsData(kESDCaloCellM)->Fill(cells->GetNumberOfCells()) ;
+
+  for ( Int_t index = 0; index < cells->GetNumberOfCells() ; index++ ) {
+    GetESDsData(kESDCaloCellA)->Fill(cells->GetAmplitude(index)) ;
+  }
+
+}
+
+//____________________________________________________________________________
+void AliEMCALQADataMakerRec::MakeRaws(AliRawReader* rawReader)
+{
+  //Fill prepared histograms with Raw digit properties
+
+  //Raw histogram filling not yet implemented
+  //
+  //Need to figure out how to get the info we want without having to
+  //actually run Raw2Digits twice.
+  //I suspect what we actually want is a raw digits method, not a true
+  //emcal raw data method, but this doesn't seem to be allowed in
+  //AliQADataMakerRec.h
+
+  // For now, to avoid redoing the expensive signal fits we just
+  // look at max vs min of the signal spextra, a la online usage in
+  // AliCaloCalibPedestal
+
+  rawReader->Reset() ;
+  AliCaloRawStreamV3 in(rawReader,"EMCAL"); 
+
+  // setup
+  int nTowersPerSM = AliEMCALGeoParams::fgkEMCALRows * AliEMCALGeoParams::fgkEMCALCols; // number of towers in a SuperModule; 24x48
+  int nRows = AliEMCALGeoParams::fgkEMCALRows; // number of rows per SuperModule
+  int nStripsPerSM = AliEMCALGeoParams::fgkEMCALLEDRefs; // number of strips per SuperModule
+  int n2x2PerSM = AliEMCALGeoParams::fgkEMCALTRUsPerSM * AliEMCALGeoParams::fgkEMCAL2x2PerTRU; // number of TRU 2x2's per SuperModule
+
+  int sampleMin = 0; 
+  int sampleMax = AliEMCALGeoParams::fgkSampleMax; // 0x3ff = 1023 = 10-bit range
+
+  // for the pedestal calculation
+  Bool_t selectPedestalSamples = kTRUE;
+
+  // SM counters; decl. should be safe, assuming we don't get more than expected SuperModules..
+  int nTotalSMLG[AliEMCALGeoParams::fgkEMCALModules] = {0};
+  int nTotalSMHG[AliEMCALGeoParams::fgkEMCALModules] = {0};
+  int nTotalSMTRU[AliEMCALGeoParams::fgkEMCALModules] = {0};
+  int nTotalSMLGLEDMon[AliEMCALGeoParams::fgkEMCALModules] = {0};
+  int nTotalSMHGLEDMon[AliEMCALGeoParams::fgkEMCALModules] = {0};
+
+  // indices for the reading
+  int iSM = 0;
+  int sample = 0;
+  int time = 0;
+  // counters, on sample level
+  int i = 0; // the sample number in current event.
+  int maxTime = 0;
+  int startBin = 0;
+
+  // calc. quantities
+  double meanPed = 0, squaredMean = 0, rmsPed = 0;
+
+  // start loop over input stream  
+  while (in.NextDDL()) {
+    int iRCU = in.GetDDLNumber() % 2; // RCU0 or RCU1, within SuperModule
+    while (in.NextChannel()) {
+
+      // counters
+      int max = sampleMin, min = sampleMax; // min and max sample values
+      int nsamples = 0;
+
+      // for the pedestal calculation
+      int sampleSum = 0; // sum of samples
+      int squaredSampleSum = 0; // sum of samples squared
+      int nSum = 0; // number of samples in sum
+      
+      while (in.NextBunch()) {
+       const UShort_t *sig = in.GetSignals();
+       startBin = in.GetStartTimeBin();
+       nsamples += in.GetBunchLength();
+       for (i = 0; i < in.GetBunchLength(); i++) {
+         sample = sig[i];
+         time = startBin--;
+
+         // check if it's a min or max value
+         if (sample < min) min = sample;
+         if (sample > max) {
+           max = sample;
+           maxTime = time;
+         }
+
+         // should we add it for the pedestal calculation?
+         if ( (fFirstPedestalSample<=time && time<=fLastPedestalSample) || // sample time in range
+              !selectPedestalSamples ) { // or we don't restrict the sample range.. - then we'll take all 
+           sampleSum += sample;
+           squaredSampleSum += sample*sample;
+           nSum++;
+         }
+         
+       } // loop over samples in bunch
+      } // loop over bunches
+    
+      if (nsamples > 0) { // this check is needed for when we have zero-supp. on, but not sparse readout
+
+      // calculate pedesstal estimate: mean of possibly selected samples
+      if (nSum > 0) {
+       meanPed = sampleSum / (1.0 * nSum);
+       squaredMean = squaredSampleSum / (1.0 * nSum);
+       // The variance (rms squared) is equal to the mean of the squares minus the square of the mean..
+       rmsPed = sqrt(squaredMean - meanPed*meanPed); 
+      }
+      else {
+       meanPed = 0;
+       squaredMean = 0;
+       rmsPed  = 0;
+      }
+
+      // it should be enough to check the SuperModule info for each DDL really, but let's keep it here for now
+      iSM = in.GetModule(); //The modules are numbered starting from 0
+
+      if (iSM>=0 && iSM<fSuperModules) { // valid module reading, can go on with filling
+
+       if ( in.IsLowGain() || in.IsHighGain() ) { // regular towers
+         int towerId = iSM*nTowersPerSM + in.GetColumn()*nRows + in.GetRow();
+       
+
+         if ( in.IsLowGain() ) { 
+           //fill the low gain histograms, and counters
+           nTotalSMLG[iSM]++; // one more channel found
+           GetRawsData(kSigLG)->Fill(towerId, max - min);
+           GetRawsData(kTimeLG)->Fill(towerId, maxTime);
+               GetRawsData(kTowerLG)->Fill(towerId);
+           if (nSum>0) { // only fill pedestal info in case it could be calculated
+             GetRawsData(kPedLG)->Fill(towerId, meanPed);
+             GetRawsData(kPedRMSLG)->Fill(towerId, rmsPed);
+           }
+         } // gain==0
+         else if ( in.IsHighGain() ) {         
+           //fill the high gain ones
+           nTotalSMHG[iSM]++; // one more channel found
+           int signal = max - min;
+           // only fill the max-min signal info and maxTime, if the
+           // signal was in the selected range 
+           if ( (signal > fMinSignalHG) && (signal < fMaxSignalHG) ) { 
+             GetRawsData(kSigHG)->Fill(towerId, signal);
+             GetRawsData(kTimeHG)->Fill(towerId, maxTime);
+                 GetRawsData(kTowerHG)->Fill(towerId);
+           } // signal
+           if (nSum>0) { // only fill pedestal info in case it could be calculated
+             GetRawsData(kPedHG)->Fill(towerId, meanPed);
+             GetRawsData(kPedRMSHG)->Fill(towerId, rmsPed);
+           }
+         }
+       } // low or high gain
+       // TRU
+       else if ( in.IsTRUData() ) {
+         // for TRU data, the mapping class holds the TRU internal 2x2 number (0..95) in the Column var..
+         int iTRU = iRCU; //TRU0 is from RCU0, TRU1 from RCU1
+         if (iRCU>0 && in.GetBranch()>0) iTRU=2; // TRU2 is from branch B on RCU1
+         int TRU2x2Id = iSM*n2x2PerSM + iTRU*AliEMCALGeoParams::fgkEMCAL2x2PerTRU 
+           + in.GetColumn();
+
+         //fill the low gain histograms, and counters
+         nTotalSMTRU[iSM]++; // one more channel found
+         GetRawsData(kSigTRU)->Fill(TRU2x2Id, max - min);
+         GetRawsData(kTimeTRU)->Fill(TRU2x2Id, maxTime);
+         if (nSum>0) { // only fill pedestal info in case it could be calculated
+           GetRawsData(kPedTRU)->Fill(TRU2x2Id, meanPed);
+           GetRawsData(kPedRMSTRU)->Fill(TRU2x2Id, rmsPed);
+         }
+       }
+       // LED Mon
+       else if ( in.IsLEDMonData() ) {
+         // for LED Mon data, the mapping class holds the gain info in the Row variable
+         // and the Strip number in the Column..
+         int gain = in.GetRow(); 
+         int stripId = iSM*nStripsPerSM + in.GetColumn();
+         
+         if ( gain == 0 ) { 
+           //fill the low gain histograms, and counters
+           nTotalSMLGLEDMon[iSM]++; // one more channel found
+           GetRawsData(kSigLGLEDMon)->Fill(stripId, max - min);
+           GetRawsData(kTimeLGLEDMon)->Fill(stripId, maxTime);
+           if (nSum>0) { // only fill pedestal info in case it could be calculated
+             GetRawsData(kPedLGLEDMon)->Fill(stripId, meanPed);
+             GetRawsData(kPedRMSLGLEDMon)->Fill(stripId, rmsPed);
+           }
+         } // gain==0
+         else if ( gain == 1 ) {               
+           //fill the high gain ones
+           nTotalSMHGLEDMon[iSM]++; // one more channel found
+           GetRawsData(kSigHGLEDMon)->Fill(stripId, max - min);
+           GetRawsData(kTimeHGLEDMon)->Fill(stripId, maxTime);
+           if (nSum>0) { // only fill pedestal info in case it could be calculated
+             GetRawsData(kPedHGLEDMon)->Fill(stripId, meanPed);
+             GetRawsData(kPedRMSHGLEDMon)->Fill(stripId, rmsPed);
+           }
+         } // low or high gain
+       } // LEDMon
+
+      } // SM index OK
+
+      } // nsamples>0 check, some data found for this channel; not only trailer/header
+    }// end while over channel 
+   
+  }//end while over DDL's, of input stream 
+
+  // let's also fill the SM and event counter histograms
+  int nTotalHG = 0;
+  int nTotalLG = 0;
+  int nTotalTRU = 0;
+  int nTotalHGLEDMon = 0;
+  int nTotalLGLEDMon = 0;
+  for (iSM=0; iSM<fSuperModules; iSM++) {  
+    nTotalLG += nTotalSMLG[iSM]; 
+    nTotalHG += nTotalSMHG[iSM]; 
+    nTotalTRU += nTotalSMTRU[iSM]; 
+    nTotalLG += nTotalSMLGLEDMon[iSM]; 
+    nTotalHG += nTotalSMHGLEDMon[iSM]; 
+    GetRawsData(kNsmodLG)->Fill(iSM, nTotalSMLG[iSM]); 
+    GetRawsData(kNsmodHG)->Fill(iSM, nTotalSMHG[iSM]); 
+    GetRawsData(kNsmodTRU)->Fill(iSM, nTotalSMTRU[iSM]); 
+    GetRawsData(kNsmodLGLEDMon)->Fill(iSM, nTotalSMLGLEDMon[iSM]); 
+    GetRawsData(kNsmodHGLEDMon)->Fill(iSM, nTotalSMHGLEDMon[iSM]); 
+  }
+  GetRawsData(kNtotLG)->Fill(nTotalLG);
+  GetRawsData(kNtotHG)->Fill(nTotalHG);
+  GetRawsData(kNtotTRU)->Fill(nTotalTRU);
+  GetRawsData(kNtotLGLEDMon)->Fill(nTotalLGLEDMon);
+  GetRawsData(kNtotHGLEDMon)->Fill(nTotalHGLEDMon);
+
+  // just in case the next rawreader consumer forgets to reset; let's do it here again..
+  rawReader->Reset() ;
+
+  return;
+}
+
+//____________________________________________________________________________
+void AliEMCALQADataMakerRec::MakeDigits()
+{
+  // makes data from Digits
+
+  GetDigitsData(1)->Fill(fDigitsArray->GetEntriesFast()) ; 
+  TIter next(fDigitsArray) ; 
+  AliEMCALDigit * digit ; 
+  while ( (digit = dynamic_cast<AliEMCALDigit *>(next())) ) {
+    GetDigitsData(0)->Fill( digit->GetAmp()) ;
+  }  
+  
+}
+
+//____________________________________________________________________________
+void AliEMCALQADataMakerRec::MakeDigits(TTree * digitTree)
+{
+  // makes data from Digit Tree
+  if (fDigitsArray) 
+    fDigitsArray->Clear() ; 
+  else
+    fDigitsArray = new TClonesArray("AliEMCALDigit", 1000) ; 
+  
+  TBranch * branch = digitTree->GetBranch("EMCAL") ;
+  if ( ! branch ) {
+    AliWarning("EMCAL branch in Digit Tree not found") ; 
+  } else {
+    branch->SetAddress(&fDigitsArray) ;
+    branch->GetEntry(0) ; 
+    MakeDigits() ; 
+  }
+  
+}
+
+//____________________________________________________________________________
+void AliEMCALQADataMakerRec::MakeRecPoints(TTree * clustersTree)
+{
+  // makes data from RecPoints
+  TBranch *emcbranch = clustersTree->GetBranch("EMCALECARP");
+  if (!emcbranch) { 
+    AliError("can't get the branch with the EMCAL clusters !");
+    return;
+  }
+  
+  TObjArray * emcrecpoints = new TObjArray(100) ;
+  emcbranch->SetAddress(&emcrecpoints);
+  emcbranch->GetEntry(0);
+  
+  GetRecPointsData(kRecPM)->Fill(emcrecpoints->GetEntriesFast()) ; 
+  TIter next(emcrecpoints) ; 
+  AliEMCALRecPoint * rp ; 
+  while ( (rp = dynamic_cast<AliEMCALRecPoint *>(next())) ) {
+    GetRecPointsData(kRecPE)->Fill( rp->GetEnergy()) ;
+    GetRecPointsData(kRecPDigM)->Fill(rp->GetMultiplicity());
+  }
+  emcrecpoints->Delete();
+  delete emcrecpoints;
+  
+}
+
+//____________________________________________________________________________ 
+void AliEMCALQADataMakerRec::StartOfDetectorCycle()
+{
+  //Detector specific actions at start of cycle
+  
+}
+
index 73caf236512a6c639120921901f77839747fc15f..67f5b68ca7eef690feaf1f82c73bb06490709e1e 100644 (file)
@@ -1,97 +1,97 @@
-#ifndef ALIEMCALQADataMakerRec_H\r
-#define ALIEMCALQADataMakerRec_H\r
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- * See cxx source for full Copyright notice                               */\r
-\r
-/*\r
-  Produces the data needed to calculate the quality assurance. \r
-  All data must be mergeable objects.\r
-\r
-  Based on PHOS code written by\r
-  Y. Schutz CERN July 2007\r
-*/\r
-\r
-\r
-// --- ROOT system ---\r
-class TH1F ; \r
-class TH1I ; \r
-class TObjArray ; \r
-\r
-// --- Standard library ---\r
-\r
-// --- AliRoot header files ---\r
-#include "AliQADataMakerRec.h"\r
-\r
-class AliEMCALQADataMakerRec: public AliQADataMakerRec {\r
-\r
-public:\r
-  //Histograms for Raw data control\r
-  enum HRawType_t { \r
-    // first normal Low Gain and High Gain info\r
-    kNsmodLG,kNsmodHG,kTimeLG,kTimeHG,\r
-    kSigLG,kSigHG,kNtotLG,kNtotHG,kNEventsPerTower,\r
-    kPedLG,kPedHG,\r
-    kPedRMSLG,kPedRMSHG,\r
-    // then TRU info\r
-    kNsmodTRU,kTimeTRU,\r
-    kSigTRU,kNtotTRU,\r
-    kPedTRU,kPedRMSTRU,\r
-    // and also LED Mon info\r
-    kNsmodLGLEDMon,kNsmodHGLEDMon,kTimeLGLEDMon,kTimeHGLEDMon,\r
-    kSigLGLEDMon,kSigHGLEDMon,kNtotLGLEDMon,kNtotHGLEDMon,\r
-    kPedLGLEDMon,kPedHGLEDMon,\r
-    kPedRMSLGLEDMon,kPedRMSHGLEDMon\r
-  } ;\r
-\r
-  //Histograms for RecPoints  control\r
-  enum HRPType_t {kRecPE,kRecPM,kRecPDigM};\r
-\r
-  //Histograms for ESDs  control\r
-  enum HESDType_t {kESDCaloClusE,kESDCaloClusM,kESDCaloCellA,kESDCaloCellM} ;\r
-                 \r
-\r
-public:\r
-  AliEMCALQADataMakerRec() ;          // ctor\r
-  AliEMCALQADataMakerRec(const AliEMCALQADataMakerRec& qadm) ;   \r
-  AliEMCALQADataMakerRec& operator = (const AliEMCALQADataMakerRec& qadm) ;\r
-  virtual ~AliEMCALQADataMakerRec() {;} // dtor\r
-\r
-  void SetSuperModules(int i) {fSuperModules = i;}; //The number of SuperModules\r
-  int GetSuperModules() const {return fSuperModules;}; //The number of SuperModules\r
-\r
-  // for pedestal calculation with raw data\r
-  void SetFirstPedestalSample(int i) {fFirstPedestalSample = i;}; // first sample \r
-  int GetFirstPedestalSample() const {return fFirstPedestalSample;}; // first sample \r
-  void SetLastPedestalSample(int i) {fLastPedestalSample = i;}; // last sample \r
-  int GetLastPedestalSample() const {return fLastPedestalSample;}; // last sample \r
-  // for selection of interesting signal (max-min) range for High Gain channels\r
-  // (useful for MIP/cosmic studies) \r
-  void SetMinSignalHG(int i) {fMinSignalHG = i;}; // minimum signal\r
-  int GetMinSignalHG() const {return fMinSignalHG;}; // minimum signal\r
-  void SetMaxSignalHG(int i) {fMaxSignalHG = i;}; // maximum signal\r
-  int GetMaxSignalHG() const {return fMaxSignalHG;}; // maximum signal\r
-\r
-  virtual void   EndOfDetectorCycle(AliQAv1::TASKINDEX_t, TObjArray ** list) ;\r
-  virtual void   InitESDs() ; \r
-  virtual void   InitDigits() ; \r
-  virtual void   InitRecPoints() ; \r
-  virtual void   InitRaws() ; \r
-  virtual void   MakeESDs(AliESDEvent * esd) ;\r
-  virtual void   MakeDigits() ;\r
-  virtual void   MakeDigits(TTree * digTree) ; \r
-  virtual void   MakeRecPoints(TTree * recpoTree) ; \r
-  virtual void   MakeRaws(AliRawReader* rawReader) ; \r
-  virtual void   StartOfDetectorCycle() ; \r
-\r
-private:\r
-  int fSuperModules; //The number of SuperModules activated\r
-  int fFirstPedestalSample; // first sample for pedestal calculation\r
-  int fLastPedestalSample; // last sample for pedestal calculation\r
-  int fMinSignalHG; // minimum signal, for High Gain channels\r
-  int fMaxSignalHG; // maximum signal, for High Gain channels\r
-\r
-  ClassDef(AliEMCALQADataMakerRec,4)  // description \r
-\r
-};\r
-\r
-#endif // AliEMCALQADataMakerRec_H\r
+#ifndef ALIEMCALQADataMakerRec_H
+#define ALIEMCALQADataMakerRec_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*
+  Produces the data needed to calculate the quality assurance. 
+  All data must be mergeable objects.
+
+  Based on PHOS code written by
+  Y. Schutz CERN July 2007
+*/
+
+
+// --- ROOT system ---
+class TH1F ; 
+class TH1I ; 
+class TObjArray ; 
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliQADataMakerRec.h"
+
+class AliEMCALQADataMakerRec: public AliQADataMakerRec {
+
+public:
+  //Histograms for Raw data control
+  enum HRawType_t { 
+    // first normal Low Gain and High Gain info
+    kNsmodLG,kNsmodHG,kTimeLG,kTimeHG,
+    kSigLG,kSigHG,kNtotLG,kNtotHG,kTowerHG,kTowerLG,
+    kPedLG,kPedHG,
+    kPedRMSLG,kPedRMSHG,
+    // then TRU info
+    kNsmodTRU,kTimeTRU,
+    kSigTRU,kNtotTRU,
+    kPedTRU,kPedRMSTRU,
+    // and also LED Mon info
+    kNsmodLGLEDMon,kNsmodHGLEDMon,kTimeLGLEDMon,kTimeHGLEDMon,
+    kSigLGLEDMon,kSigHGLEDMon,kNtotLGLEDMon,kNtotHGLEDMon,
+    kPedLGLEDMon,kPedHGLEDMon,
+    kPedRMSLGLEDMon,kPedRMSHGLEDMon
+  } ;
+
+  //Histograms for RecPoints  control
+  enum HRPType_t {kRecPE,kRecPM,kRecPDigM};
+
+  //Histograms for ESDs  control
+  enum HESDType_t {kESDCaloClusE,kESDCaloClusM,kESDCaloCellA,kESDCaloCellM} ;
+                 
+
+public:
+  AliEMCALQADataMakerRec() ;          // ctor
+  AliEMCALQADataMakerRec(const AliEMCALQADataMakerRec& qadm) ;   
+  AliEMCALQADataMakerRec& operator = (const AliEMCALQADataMakerRec& qadm) ;
+  virtual ~AliEMCALQADataMakerRec() {;} // dtor
+
+  void SetSuperModules(int i) {fSuperModules = i;}; //The number of SuperModules
+  int GetSuperModules() const {return fSuperModules;}; //The number of SuperModules
+
+  // for pedestal calculation with raw data
+  void SetFirstPedestalSample(int i) {fFirstPedestalSample = i;}; // first sample 
+  int GetFirstPedestalSample() const {return fFirstPedestalSample;}; // first sample 
+  void SetLastPedestalSample(int i) {fLastPedestalSample = i;}; // last sample 
+  int GetLastPedestalSample() const {return fLastPedestalSample;}; // last sample 
+  // for selection of interesting signal (max-min) range for High Gain channels
+  // (useful for MIP/cosmic studies) 
+  void SetMinSignalHG(int i) {fMinSignalHG = i;}; // minimum signal
+  int GetMinSignalHG() const {return fMinSignalHG;}; // minimum signal
+  void SetMaxSignalHG(int i) {fMaxSignalHG = i;}; // maximum signal
+  int GetMaxSignalHG() const {return fMaxSignalHG;}; // maximum signal
+
+  virtual void   EndOfDetectorCycle(AliQAv1::TASKINDEX_t, TObjArray ** list) ;
+  virtual void   InitESDs() ; 
+  virtual void   InitDigits() ; 
+  virtual void   InitRecPoints() ; 
+  virtual void   InitRaws() ; 
+  virtual void   MakeESDs(AliESDEvent * esd) ;
+  virtual void   MakeDigits() ;
+  virtual void   MakeDigits(TTree * digTree) ; 
+  virtual void   MakeRecPoints(TTree * recpoTree) ; 
+  virtual void   MakeRaws(AliRawReader* rawReader) ; 
+  virtual void   StartOfDetectorCycle() ; 
+
+private:
+  int fSuperModules; //The number of SuperModules activated
+  int fFirstPedestalSample; // first sample for pedestal calculation
+  int fLastPedestalSample; // last sample for pedestal calculation
+  int fMinSignalHG; // minimum signal, for High Gain channels
+  int fMaxSignalHG; // maximum signal, for High Gain channels
+
+  ClassDef(AliEMCALQADataMakerRec,4)  // description 
+
+};
+
+#endif // AliEMCALQADataMakerRec_H