]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONQADataMakerRec.cxx
Fixes for bug #49914: Compilation breaks in trunk, and bug #48629: Trunk cannot read...
[u/mrichter/AliRoot.git] / MUON / AliMUONQADataMakerRec.cxx
index a8220226fb730324410a78cdb92319d7ffa4e619..b343c9f10ebcd9db9767bfbf62d70302113daca9 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+// $Id$
+
 // --- MUON header files ---
 #include "AliMUONQADataMakerRec.h"
 
+#include "AliMUON2DMap.h"
 #include "AliMUONCluster.h"  
+#include "AliMUONConstants.h"  
+#include "AliMUONDDLTrigger.h"
+#include "AliMUONDarcHeader.h"
+#include "AliMUONDigitMaker.h"
+#include "AliMUONLocalStruct.h"
+#include "AliMUONLocalTrigger.h"
 #include "AliMUONRawStreamTracker.h"
 #include "AliMUONRawStreamTrigger.h"
-#include "AliMUONConstants.h"  
-#include "AliMUONVClusterStore.h"
+#include "AliMUONRegHeader.h"
+#include "AliMUONTrackerDataMaker.h"
+#include "AliMUONTriggerDisplay.h"
 #include "AliMUONVCluster.h"
-
-#include "AliMUONDigitMaker.h"
+#include "AliMUONVClusterStore.h"
+#include "AliMUONVDigit.h"
 #include "AliMUONVDigitStore.h"
+#include "AliMUONVTrackerData.h"
 #include "AliMUONVTriggerStore.h"
-#include "AliMUONVDigit.h"
-#include "AliMUONLocalTrigger.h"
-
-#include "AliMUONDDLTrigger.h"
-#include "AliMUONRegHeader.h"
-#include "AliMUONDarcHeader.h"
-#include "AliMUONLocalStruct.h"
-
-#include "AliMUONGeometryTransformer.h"
-
-#include "AliMpDDLStore.h"
-#include "AliMpVSegmentation.h"
-#include "AliMpSegmentation.h"
-#include "AliMpConstants.h"
-#include "AliMpPad.h"
+#include "AliMUONTrack.h"
+#include "AliMUONTrackParam.h"
+#include "AliMUONESDInterface.h"
+#include "AliMUONCalibrationData.h"
 #include "AliMpBusPatch.h"
-#include "AliMpTriggerCrate.h"
-#include "AliMpLocalBoard.h"
 #include "AliMpCDB.h"
+#include "AliMpConstants.h"
+#include "AliMpDDLStore.h"
+#include "AliMpDEIterator.h"
+#include "AliMpDEManager.h"
+#include "AliMpLocalBoard.h"
+#include "AliMpStationType.h"
+#include "AliMpTriggerCrate.h"
+#include "AliMpDCSNamer.h"
+#include "AliRawEventHeaderBase.h"
 
 // --- AliRoot header files ---
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
 #include "AliESDEvent.h"
 #include "AliESDMuonTrack.h"
 #include "AliESDMuonCluster.h"
 #include "AliLog.h"
 #include "AliRawReader.h"
 #include "AliQAChecker.h"
+#include "AliCodeTimer.h"
+#include "AliDCSValue.h"
 
 // --- ROOT system ---
 #include <TClonesArray.h>
@@ -61,7 +72,6 @@
 #include <TH1I.h> 
 #include <TH2F.h>
 #include <TH3F.h> 
-#include <TLorentzVector.h>
 #include <Riostream.h>
 
 //-----------------------------------------------------------------------------
@@ -69,7 +79,7 @@
 ///
 /// MUON base class for quality assurance data (histo) maker
 ///
-/// \author C. Finck
+/// \author C. Finck, D. Stocco, L. Aphecetche
 
 /// \cond CLASSIMP
 ClassImp(AliMUONQADataMakerRec)
@@ -77,36 +87,58 @@ ClassImp(AliMUONQADataMakerRec)
            
 //____________________________________________________________________________ 
 AliMUONQADataMakerRec::AliMUONQADataMakerRec() : 
-    AliQADataMakerRec(AliQA::GetDetName(AliQA::kMUON), "MUON Quality Assurance Data Maker"),
-    fIsInitRaws(kFALSE),
-    fIsInitRecPoints(kFALSE),
-    fIsInitESDs(kFALSE),
-    fDigitStore(0x0),
-    fTriggerStore(0x0),
-    fDigitMaker(0x0)
+AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
+fIsInitRaws(kFALSE),
+fIsInitRecPointsTracker(kFALSE),
+fIsInitRecPointsTrigger(kFALSE),
+fIsInitESDs(kFALSE),
+fDigitStore(0x0),
+fTriggerStore(0x0),
+fDigitMaker(0x0),
+fClusterStore(0x0),
+fTrackerDataMaker(0x0)
 {
     /// ctor
-  fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1");
-  fDigitMaker = new AliMUONDigitMaker(kTRUE);
+       
+  AliDebug(1,"");
+
+       Ctor();
+}
+
+//____________________________________________________________________________ 
+void
+AliMUONQADataMakerRec::Ctor()
+{
+       /// Init some members
+       fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1");
+       fDigitMaker = new AliMUONDigitMaker(kTRUE);
 }
 
 //____________________________________________________________________________ 
 AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm) :
-    AliQADataMakerRec(qadm),
-    fIsInitRaws(kFALSE),
-    fIsInitRecPoints(kFALSE),
-    fIsInitESDs(kFALSE),
-    fDigitStore(0x0),
-    fTriggerStore(0x0),
-    fDigitMaker(0x0)
+AliQADataMakerRec(qadm),
+fIsInitRaws(kFALSE),
+fIsInitRecPointsTracker(kFALSE),
+fIsInitRecPointsTrigger(kFALSE),
+fIsInitESDs(kFALSE),
+fDigitStore(0x0),
+fTriggerStore(0x0),
+fDigitMaker(0x0),
+fClusterStore(0x0),
+fTrackerDataMaker(0x0)
 {
     ///copy ctor 
+
+    AliDebug(1,"");
+
+
     SetName((const char*)qadm.GetName()) ; 
     SetTitle((const char*)qadm.GetTitle()); 
 
-    // Do not copy the digit store and digit maker, but create its own ones
-    fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1");
-    fDigitMaker = new AliMUONDigitMaker(kTRUE);
+       // Do not copy the digit store and digit maker, but create its own ones
+       
+       Ctor();
+       
 }
 
 //__________________________________________________________________
@@ -114,6 +146,8 @@ AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMak
 {
   /// Assignment operator
 
+  AliDebug(1,"");
+
   // check assignment to self
   if (this == &qadm) return *this;
 
@@ -126,64 +160,506 @@ AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMak
 AliMUONQADataMakerRec::~AliMUONQADataMakerRec()
 {
     /// dtor
-    delete fDigitStore;
-    delete fTriggerStore;
-    delete fDigitMaker;
+  
+  AliDebug(1,"");
+
+  AliCodeTimerAuto("");
+  
+  delete fDigitStore;
+  delete fTriggerStore;
+  delete fDigitMaker;
+  delete fClusterStore;
+  delete fTrackerDataMaker;
 }
 
 //____________________________________________________________________________ 
-void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list)
+void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
 {
-    ///Detector specific actions at end of cycle
-
-    // Display trigger histos in a more user friendly way
-    DisplayTriggerInfo(task);
-
-    // do the QA checking
-    AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ;
+  ///Detector specific actions at end of cycle
+  
+  AliCodeTimerAuto("");
+  
+  // Display trigger histos in a more user friendly way
+  DisplayTriggerInfo(task);
+  
+  for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+    SetEventSpecie(specie) ; 
+    if ( task == AliQAv1::kRAWS && fTrackerDataMaker ) 
+      {
+        TIter next(list[specie]);
+        TObject* o;
+        Bool_t alreadyThere(kFALSE);
+        while ( ( o = next() ) && !alreadyThere )
+          {
+            TString classname(o->ClassName());
+            if ( classname.Contains("TrackerData") ) alreadyThere = kTRUE;
+          }
+        if (!alreadyThere && fTrackerDataMaker) 
+          {
+            AliInfo("Adding fTrackerDataMaker to the list of qa objects");
+            list[specie]->AddAt(fTrackerDataMaker->Data(),(Int_t)kTrackerData);
+          }
+          if ( fTrackerDataMaker ) 
+            {
+              TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy);
+              hbp->Reset();
+              TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
+              AliMpBusPatch* bp(0x0);
+              AliMUONVTrackerData* data = fTrackerDataMaker->Data();
+              Int_t occDim = 2;
+      
+              while ( ( bp = static_cast<AliMpBusPatch*>(nextBP())) )
+                {
+                  Int_t busPatchId = bp->GetId();
+                  Int_t bin = hbp->FindBin(busPatchId);
+                  hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim));
+                }
+            }
+      }
+    
+    // Normalize RecPoints histos
+    if ( task == AliQAv1::kRECPOINTS ) {
+      
+      TH1* hTrackerClusterChargePerChMean = GetRecPointsData(kTrackerClusterChargePerChMean);
+      TH1* hTrackerClusterChargePerChSigma = GetRecPointsData(kTrackerClusterChargePerChSigma);
+      TH1* hTrackerClusterMultiplicityPerChMean = GetRecPointsData(kTrackerClusterMultiplicityPerChMean);
+      TH1* hTrackerClusterMultiplicityPerChSigma = GetRecPointsData(kTrackerClusterMultiplicityPerChSigma);
+      TH1* hTrackerClusterChargePerDEMean = GetRecPointsData(kTrackerClusterChargePerDEMean);
+      TH1* hTrackerClusterMultiplicityPerDEMean = GetRecPointsData(kTrackerClusterMultiplicityPerDEMean);
+      
+      // loop over chambers
+      for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
+       
+       TH1* hTrackerClusterChargePerChamber = GetRecPointsData(kTrackerClusterChargePerChamber+iCh);
+       Double_t sigmaCharge = hTrackerClusterChargePerChamber->GetRMS();
+       hTrackerClusterChargePerChMean->SetBinContent(iCh+1, hTrackerClusterChargePerChamber->GetMean());
+       hTrackerClusterChargePerChMean->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetMeanError());
+       hTrackerClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
+       hTrackerClusterChargePerChSigma->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetRMSError());
+       
+       TH1* hTrackerClusterMultiplicityPerChamber = GetRecPointsData(kTrackerClusterMultiplicityPerChamber+iCh);
+       Double_t sigmaSize = hTrackerClusterMultiplicityPerChamber->GetRMS();
+       hTrackerClusterMultiplicityPerChMean->SetBinContent(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMean());
+       hTrackerClusterMultiplicityPerChMean->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMeanError());
+       hTrackerClusterMultiplicityPerChSigma->SetBinContent(iCh+1, sigmaSize);
+       hTrackerClusterMultiplicityPerChSigma->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetRMSError());
+       
+       // loop over DE into chamber iCh
+       AliMpDEIterator it;
+       it.First(iCh);
+       while ( !it.IsDone()) {
+         
+         Int_t iDE = it.CurrentDEId();
+         
+         TH1* hTrackerClusterChargePerDE = GetRecPointsData(kTrackerClusterChargePerDE+iDE);
+         hTrackerClusterChargePerDEMean->SetBinContent(iDE+1, hTrackerClusterChargePerDE->GetMean());
+         Double_t nClusters = hTrackerClusterChargePerDE->GetEntries();
+         if (nClusters > 1) hTrackerClusterChargePerDEMean->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
+         else hTrackerClusterChargePerDEMean->SetBinError(iDE+1, hTrackerClusterChargePerChamber->GetXaxis()->GetXmax());
+         
+         TH1* hTrackerClusterMultiplicityPerDE = GetRecPointsData(kTrackerClusterMultiplicityPerDE+iDE);
+         hTrackerClusterMultiplicityPerDEMean->SetBinContent(iDE+1, hTrackerClusterMultiplicityPerDE->GetMean());
+         nClusters = hTrackerClusterMultiplicityPerDE->GetEntries();
+         if (nClusters > 1) hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nClusters));
+         else hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, hTrackerClusterMultiplicityPerChamber->GetXaxis()->GetXmax());
+         
+         it.Next();
+       }
+         
+      }
+      
+    }
+    
+    // Normalize ESD histos
+    if ( task == AliQAv1::kESDS ) {
+      
+      Double_t nTracks = GetESDsData(kESDnClustersPerTrack)->GetEntries();
+      if (nTracks <= 0) continue;
+      
+      TH1* hESDnClustersPerCh = GetESDsData(kESDnClustersPerCh);
+      TH1* hESDnClustersPerDE = GetESDsData(kESDnClustersPerDE);
+      TH1* hESDClusterChargePerChMean = GetESDsData(kESDClusterChargePerChMean);
+      TH1* hESDClusterChargePerChSigma = GetESDsData(kESDClusterChargePerChSigma);
+      TH1* hESDClusterSizePerChMean = GetESDsData(kESDClusterSizePerChMean);
+      TH1* hESDClusterSizePerChSigma = GetESDsData(kESDClusterSizePerChSigma);
+      TH1* hESDResidualXPerChMean = GetESDsData(kESDResidualXPerChMean);
+      TH1* hESDResidualXPerChSigma = GetESDsData(kESDResidualXPerChSigma);
+      TH1* hESDResidualYPerChMean = GetESDsData(kESDResidualYPerChMean);
+      TH1* hESDResidualYPerChSigma = GetESDsData(kESDResidualYPerChSigma);
+      TH1* hESDLocalChi2XPerChMean = GetESDsData(kESDLocalChi2XPerChMean);
+      TH1* hESDLocalChi2YPerChMean = GetESDsData(kESDLocalChi2YPerChMean);
+      TH1* hESDClusterChargePerDE = GetESDsData(kESDClusterChargePerDE);
+      TH1* hESDClusterSizePerDE = GetESDsData(kESDClusterSizePerDE);
+      TH1* hESDResidualXPerDEMean = GetESDsData(kESDResidualXPerDEMean);
+      TH1* hESDResidualXPerDESigma = GetESDsData(kESDResidualXPerDESigma);
+      TH1* hESDResidualYPerDEMean = GetESDsData(kESDResidualYPerDEMean);
+      TH1* hESDResidualYPerDESigma = GetESDsData(kESDResidualYPerDESigma);
+      TH1* hESDLocalChi2XPerDEMean = GetESDsData(kESDLocalChi2XPerDEMean);
+      TH1* hESDLocalChi2YPerDEMean = GetESDsData(kESDLocalChi2YPerDEMean);
+      TH1* hESDnTotClustersPerCh = GetESDsData(kESDnTotClustersPerCh);
+      TH1* hESDnTotClustersPerDE = GetESDsData(kESDnTotClustersPerDE);
+      TH1* hESDnTotFullClustersPerDE = GetESDsData(kESDnTotFullClustersPerDE);
+      TH1* hESDSumClusterChargePerDE = GetESDsData(kESDSumClusterChargePerDE);
+      TH1* hESDSumClusterSizePerDE = GetESDsData(kESDSumClusterSizePerDE);
+      TH1* hESDSumResidualXPerDE = GetESDsData(kESDSumResidualXPerDE);
+      TH1* hESDSumResidualYPerDE = GetESDsData(kESDSumResidualYPerDE);
+      TH1* hESDSumResidualX2PerDE = GetESDsData(kESDSumResidualX2PerDE);
+      TH1* hESDSumResidualY2PerDE = GetESDsData(kESDSumResidualY2PerDE);
+      TH1* hESDSumLocalChi2XPerDE = GetESDsData(kESDSumLocalChi2XPerDE);
+      TH1* hESDSumLocalChi2YPerDE = GetESDsData(kESDSumLocalChi2YPerDE);
+                         
+      hESDnClustersPerCh->Reset();
+      hESDnClustersPerDE->Reset();
+      hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks);
+      hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks);
+      
+      // loop over chambers
+      for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
+       
+       TH1* hESDClusterChargeInCh = GetESDsData(kESDClusterChargeInCh+iCh);
+       Double_t sigmaCharge = hESDClusterChargeInCh->GetRMS();
+       hESDClusterChargePerChMean->SetBinContent(iCh+1, hESDClusterChargeInCh->GetMean());
+       hESDClusterChargePerChMean->SetBinError(iCh+1, hESDClusterChargeInCh->GetMeanError());
+       hESDClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
+       hESDClusterChargePerChSigma->SetBinError(iCh+1, hESDClusterChargeInCh->GetRMSError());
+       
+       TH1* hESDClusterSizeInCh = GetESDsData(kESDClusterSizeInCh+iCh);
+       Double_t sigmaSize = hESDClusterSizeInCh->GetRMS();
+       hESDClusterSizePerChMean->SetBinContent(iCh+1, hESDClusterSizeInCh->GetMean());
+       hESDClusterSizePerChMean->SetBinError(iCh+1, hESDClusterSizeInCh->GetMeanError());
+       hESDClusterSizePerChSigma->SetBinContent(iCh+1, sigmaSize);
+       hESDClusterSizePerChSigma->SetBinError(iCh+1, hESDClusterSizeInCh->GetRMSError());
+       
+       TH1* hESDResidualXInCh = GetESDsData(kESDResidualXInCh+iCh);
+       Double_t sigmaResidualX = hESDResidualXInCh->GetRMS();
+       hESDResidualXPerChMean->SetBinContent(iCh+1, hESDResidualXInCh->GetMean());
+       hESDResidualXPerChMean->SetBinError(iCh+1, hESDResidualXInCh->GetMeanError());
+       hESDResidualXPerChSigma->SetBinContent(iCh+1, sigmaResidualX);
+       hESDResidualXPerChSigma->SetBinError(iCh+1, hESDResidualXInCh->GetRMSError());
+       
+       TH1* hESDResidualYInCh = GetESDsData(kESDResidualYInCh+iCh);
+       Double_t sigmaResidualY = hESDResidualYInCh->GetRMS();
+       hESDResidualYPerChMean->SetBinContent(iCh+1, hESDResidualYInCh->GetMean());
+       hESDResidualYPerChMean->SetBinError(iCh+1, hESDResidualYInCh->GetMeanError());
+       hESDResidualYPerChSigma->SetBinContent(iCh+1, sigmaResidualY);
+       hESDResidualYPerChSigma->SetBinError(iCh+1, hESDResidualYInCh->GetRMSError());
+       
+       TH1* hESDLocalChi2XInCh = GetESDsData(kESDLocalChi2XInCh+iCh);
+       Double_t sigmaLocalChi2X = hESDLocalChi2XInCh->GetRMS();
+       hESDLocalChi2XPerChMean->SetBinContent(iCh+1, hESDLocalChi2XInCh->GetMean());
+       hESDLocalChi2XPerChMean->SetBinError(iCh+1, hESDLocalChi2XInCh->GetMeanError());
+       
+       TH1* hESDLocalChi2YInCh = GetESDsData(kESDLocalChi2YInCh+iCh);
+       Double_t sigmaLocalChi2Y = hESDLocalChi2YInCh->GetRMS();
+       hESDLocalChi2YPerChMean->SetBinContent(iCh+1, hESDLocalChi2YInCh->GetMean());
+       hESDLocalChi2YPerChMean->SetBinError(iCh+1, hESDLocalChi2YInCh->GetMeanError());
+       
+       // loop over DE into chamber iCh
+       AliMpDEIterator it;
+       it.First(iCh);
+       while ( !it.IsDone()) {
+         
+         Int_t iDE = it.CurrentDEId();
+         
+         Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1);
+         if (nClusters > 1) {
+           
+           hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters);
+           hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
+           
+           Double_t meanResX = hESDSumResidualXPerDE->GetBinContent(iDE+1)/nClusters;
+           hESDResidualXPerDEMean->SetBinContent(iDE+1, meanResX);
+           hESDResidualXPerDEMean->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(nClusters));
+           hESDResidualXPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
+           hESDResidualXPerDESigma->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(2.*nClusters));
+           
+           Double_t meanResY = hESDSumResidualYPerDE->GetBinContent(iDE+1)/nClusters;
+           hESDResidualYPerDEMean->SetBinContent(iDE+1, meanResY);
+           hESDResidualYPerDEMean->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(nClusters));
+           hESDResidualYPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
+           hESDResidualYPerDESigma->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters));
+           
+           hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters);
+           hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters));
+           
+           hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters);
+           hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters));
+           
+         } else {
+           
+           hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1));
+           hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax());
+           
+           hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1));
+           hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
+           hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.);
+           hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
+           
+           hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1));
+           hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
+           hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.);
+           hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
+           
+           hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1));
+           hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax());
+           
+           hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1));
+           hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax());
+           
+         }
+         
+         Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1);
+         if (nFullClusters > 1) {
+           
+           hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters);
+           hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters));
+           
+         } else {
+           
+           hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1));
+           hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax());
+           
+         }
+         
+         it.Next();
+       }
+       
+      }
+      
+    }
+    
+  }
+  
+  // do the QA checking
+  AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ;
 }
 
 //____________________________________________________________________________ 
 void AliMUONQADataMakerRec::InitRaws()
 {
     /// create Raws histograms in Raws subdir
-    TH1I* h0 = new TH1I("hRawBusPatch", "buspatch distribution",  1932, 1, 1932); 
-    Add2RawsList(h0, kRawBusPatch);
+       
+  AliCodeTimerAuto("");
+  
+  Bool_t forExpert(kTRUE);
+  
+       if ( ! AliCDBManager::Instance()->GetDefaultStorage() )
+       {
+               AliError("CDB default storage not set. Cannot work.");
+               fIsInitRaws=kFALSE;
+       }
+       
+       TH3F* h3 = new TH3F("hTriggerScalersBendPlane", "Trigger scalers in bending plane",
+                                                                                       4, 10.5, 14.5,
+                                                                                       234, 0.5, 234.5,
+                                                                                       16, -0.5, 15.5);
+       h3->GetXaxis()->SetTitle("Chamber");
+       h3->GetYaxis()->SetTitle("Board");
+       h3->GetZaxis()->SetTitle("Strip");
+       Add2RawsList(h3, kTriggerScalersBP,forExpert);
+       
+       TH3F* h4 = new TH3F("hTriggerScalersNonBendPlane", "Trigger scalers in non-bending plane",
+                                                                                       4, 10.5, 14.5,
+                                                                                       234, 0.5, 234.5,
+                                                                                       16, -0.5, 15.5);
+       h4->GetXaxis()->SetTitle("Chamber");
+       h4->GetYaxis()->SetTitle("Board");
+       h4->GetZaxis()->SetTitle("Strip");
+       Add2RawsList(h4, kTriggerScalersNBP,forExpert);
+       
+       AliMUONTriggerDisplay triggerDisplay;
+       TString histoName, histoTitle;
+       for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
+               TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
+               for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
+                       histoName = Form("hScalers%sChamber%i", cathName.Data(), 11+iChamber);
+                       histoTitle = Form("Chamber %i: Scalers %s", 11+iChamber, cathName.Data());
+                       TH2F* h5 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips, 
+                                                                             iCath, iChamber, histoTitle);
+                       Add2RawsList(h5, kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber,!forExpert);
+               }
+       }
 
-    TH1I* h1 = new TH1I("hRawCharge", "Charge distribution in rawdata", 4096, 0, 4095); 
-    Add2RawsList(h1, kRawCharge);
-               
-    for (Int_t iDDL = 0; iDDL < 20; ++iDDL) 
-    {
-      TH1F* h2 = new TH1F(Form("%s%d", "hRawBusPatchDDL", iDDL), Form("%s %d","RAW Buspatch distribution for DDL", iDDL), 50, 0, 49); 
-      Add2RawsList(h2, kRawBuspatchDDL+iDDL);
-    }
+       TH2F* h6 = new TH2F("hTriggerRPCI", "Trigger RPC currents",
+                           4, 10.5, 14.5,
+                           18, -0.5, 17.5);
+       h6->GetXaxis()->SetTitle("Chamber");
+       h6->GetYaxis()->SetTitle("RPC");
+       Add2RawsList(h6, kTriggerRPCi, forExpert);
+
+       TH2F* h7 = new TH2F("hTriggerRPCHV", "Trigger RPC HV",
+                           4, 10.5, 14.5,
+                           18, -0.5, 17.5);
+       h7->GetXaxis()->SetTitle("Chamber");
+       h7->GetYaxis()->SetTitle("RPC");
+       Add2RawsList(h7, kTriggerRPChv, forExpert);
+       
+       for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
+         histoName = Form("hRPCIChamber%i", 11+iChamber);
+         histoTitle = Form("Chamber %i: RPC Currents (#muA)", 11+iChamber);
+         TH2F* h8 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplaySlats, 
+                                                               0, iChamber, histoTitle);
+         Add2RawsList(h8, kTriggerIDisplay + iChamber, !forExpert);
+       }
 
-    TH3F* h3 = new TH3F("hTriggerScalersBendPlane", "Trigger scalers in bending plane",
-                       4, 10.5, 14.5,
-                       234, 0.5, 234.5,
-                       16, -0.5, 15.5);
-    h3->GetXaxis()->SetTitle("Chamber");
-    h3->GetYaxis()->SetTitle("Board");
-    h3->GetZaxis()->SetTitle("Strip");
-    Add2RawsList(h3, kTriggerScalersBP);
+       for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
+         histoName = Form("hRPCHVChamber%i", 11+iChamber);
+         histoTitle = Form("Chamber %i: RPC HV (V)", 11+iChamber);
+         TH2F* h9 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplaySlats, 
+                                                               0, iChamber, histoTitle);
+         Add2RawsList(h9, kTriggerHVDisplay + iChamber, !forExpert);
+       }
 
-    TH3F* h4 = new TH3F("hTriggerScalersNonBendPlane", "Trigger scalers in non-bending plane",
-                       4, 10.5, 14.5,
-                       234, 0.5, 234.5,
-                       16, -0.5, 15.5);
-    h4->GetXaxis()->SetTitle("Chamber");
-    h4->GetYaxis()->SetTitle("Board");
-    h4->GetZaxis()->SetTitle("Strip");
-    Add2RawsList(h4, kTriggerScalersNBP);
+       TH1F* h10 = new TH1F("hTriggerScalersTime", "Trigger scalers acquisition time", 1, 0.5, 1.5);
+       h10->GetXaxis()->SetBinLabel(1, "One-bin histogram: bin is filled at each scaler event.");
+       h10->GetYaxis()->SetTitle("Cumulated scaler time (s)");
+       Add2RawsList(h10, kTriggerScalersTime, !forExpert);
+       
+  Int_t nbp(0);
+  TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
+  while (next())
+  {
+    ++nbp;
+  }
+  
+  TH1* hbp = new TH1F("hTrackerBusPatchOccupancy","Occupancy of bus patches",
+                      nbp,-0.5,nbp-0.5);
+  
+  Add2RawsList(hbp,kTrackerBusPatchOccupancy,!forExpert);
+
+  const Bool_t histogram(kFALSE);
 
-    fIsInitRaws = InitDisplayHistos(AliQA::kRAWS);
+  fTrackerDataMaker = new AliMUONTrackerDataMaker(GetRecoParam(),
+                                                  AliCDBManager::Instance()->GetRun(),
+                                                  0x0,
+                                                  AliCDBManager::Instance()->GetDefaultStorage()->GetURI(),
+                                                  "NOGAIN",
+                                                  histogram,
+                                                  0.0,0.0);
+               
+  fTrackerDataMaker->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
+       
+  fTrackerDataMaker->SetRunning(kTRUE);
+  
+       fIsInitRaws = kTRUE;
 }
 
 //____________________________________________________________________________ 
 void AliMUONQADataMakerRec::InitRecPoints()
 {
-    /// create Reconstructed Points histograms in RecPoints subdir
+       /// create Reconstructed Points histograms in RecPoints subdir
+  
+  AliCodeTimerAuto("");
+  
+       InitRecPointsTrigger();
+       InitRecPointsTracker();
+}
+
+//____________________________________________________________________________ 
+void AliMUONQADataMakerRec::InitRecPointsTracker()
+{
+  /// create Reconstructed Points histograms in RecPoints subdir for the
+  /// MUON tracker subsystem.
+  
+  AliCodeTimerAuto("");
+  
+  Bool_t forExpert(kTRUE);
+  TH1I *h1I;
+  TH1F *h1F;
+  TH2F *h2F;
+  
+  // histograms per chamber
+  Int_t nCh = AliMpConstants::NofTrackingChambers();
+  for ( Int_t i = 0; i < nCh; ++i ) 
+  {
+    h1I = new TH1I(Form("hTrackerClusterMultiplicityForChamber%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads})",i+1), 100,0,100);
+    Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerChamber+i,forExpert);
+    
+    h1I = new TH1I(Form("hTrackerClusterChargeForChamber%d",i+1), Form("cluster charge distribution in chamber %d;charge (ADC counts)",i+1), 500,0,5000);
+    Add2RecPointsList(h1I,kTrackerClusterChargePerChamber+i,forExpert);
+    
+    Float_t rMax = AliMUONConstants::Rmax(i/2);
+    h2F = new TH2F(Form("hTrackerClusterHitMapForChamber%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1), 100, -rMax, rMax, 100, -rMax, rMax);
+    Add2RecPointsList(h2F, kTrackerClusterHitMapPerChamber+i,forExpert);
+  }
+  
+  // summary histograms per chamber
+  h1I = new TH1I("hTrackerNumberOfClustersPerChamber", "Number of clusters per chamber;chamber ID;n_{clusters}", nCh,-0.5,nCh-0.5);
+  Add2RecPointsList(h1I,kTrackerNumberOfClustersPerChamber,forExpert);
+  
+  h1F = new TH1F("hTrackerClusterMultiplicityPerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh,-0.5,nCh-0.5);
+  h1F->SetOption("P");
+  h1F->SetMarkerStyle(kFullDotMedium);
+  h1F->SetMarkerColor(kRed);
+  Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChMean,forExpert);
+  
+  h1F = new TH1F("hTrackerClusterMultiplicityPerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh,-0.5,nCh-0.5);
+  h1F->SetOption("P");
+  h1F->SetMarkerStyle(kFullDotMedium);
+  h1F->SetMarkerColor(kRed);
+  Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChSigma,forExpert);
+  
+  h1F = new TH1F("hTrackerClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (ADC counts)", nCh,-0.5,nCh-0.5);
+  h1F->SetOption("P");
+  h1F->SetMarkerStyle(kFullDotMedium);
+  h1F->SetMarkerColor(kRed);
+  Add2RecPointsList(h1F, kTrackerClusterChargePerChMean,forExpert);
+  
+  h1F = new TH1F("hTrackerClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (ADC counts)", nCh,-0.5,nCh-0.5);
+  h1F->SetOption("P");
+  h1F->SetMarkerStyle(kFullDotMedium);
+  h1F->SetMarkerColor(kRed);
+  Add2RecPointsList(h1F, kTrackerClusterChargePerChSigma,forExpert);
+  
+  // histograms per DE
+  Int_t ndes(0);
+  AliMpDEIterator it;
+  it.First();
+  while ( !it.IsDone())
+  {
+    Int_t detElemId = it.CurrentDEId();
+    
+    if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
+    {
+      ndes = TMath::Max(ndes,detElemId);
+      
+      h1I = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), Form("cluster size distribution in detection element %d;size (n_{pads})",detElemId), 100,0,100);
+      Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerDE+detElemId,forExpert);
+      
+      h1I = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), Form("cluster charge distribution in detection element %d;charge (ADC counts)",detElemId), 500,0,5000);
+      Add2RecPointsList(h1I,kTrackerClusterChargePerDE+detElemId,forExpert);
+    }
+    
+    it.Next();
+  }
+  
+  // summary histograms per DE
+  h1I = new TH1I("hTrackerNumberOfClustersPerDE", "Number of clusters per detection element;DetElem ID;n_{clusters}", ndes+1,-0.5,ndes+0.5);
+  Add2RecPointsList(h1I, kTrackerNumberOfClustersPerDE,!forExpert);
+  
+  h1F = new TH1F("hTrackerClusterMultiplicityPerDEMean", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", ndes+1,-0.5,ndes+0.5);
+  h1F->SetOption("P");
+  h1F->SetMarkerStyle(kFullDotMedium);
+  h1F->SetMarkerColor(kRed);
+  Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerDEMean,forExpert);
+  
+  h1F = new TH1F("hTrackerClusterChargePerDEMean", "cluster mean charge per DE;DetElem ID;<charge> (ADC counts)", ndes+1,-0.5,ndes+0.5);
+  h1F->SetOption("P");
+  h1F->SetMarkerStyle(kFullDotMedium);
+  h1F->SetMarkerColor(kRed);
+  Add2RecPointsList(h1F, kTrackerClusterChargePerDEMean,forExpert);
+  
+  fIsInitRecPointsTracker=kTRUE;
+}
+
+//____________________________________________________________________________ 
+void AliMUONQADataMakerRec::InitRecPointsTrigger()
+{
+       /// create Reconstructed Points histograms in RecPoints subdir for the
+       /// MUON Trigger subsystem.
+       
+  Bool_t forExpert(kTRUE);
+  
     TH3F* h0 = new TH3F("hTriggerDigitsBendPlane", "Trigger digits in bending plane",
                        4, 10.5, 14.5,
                        234, 0.5, 234.5,
@@ -191,7 +667,7 @@ void AliMUONQADataMakerRec::InitRecPoints()
     h0->GetXaxis()->SetTitle("Chamber");
     h0->GetYaxis()->SetTitle("Board");
     h0->GetZaxis()->SetTitle("Strip");
-    Add2RecPointsList(h0, kTriggerDigitsBendPlane);
+    Add2RecPointsList(h0, kTriggerDigitsBendPlane,forExpert);
 
     TH3F* h1 = new TH3F("hTriggerDigitsNonBendPlane", "Trigger digits in non-bending plane",
                        4, 10.5, 14.5,
@@ -200,40 +676,240 @@ void AliMUONQADataMakerRec::InitRecPoints()
     h1->GetXaxis()->SetTitle("Chamber");
     h1->GetYaxis()->SetTitle("Board");
     h1->GetZaxis()->SetTitle("Strip");
-    Add2RecPointsList(h1, kTriggerDigitsNonBendPlane);
+    Add2RecPointsList(h1, kTriggerDigitsNonBendPlane,forExpert);
 
     TH1F* h2 = new TH1F("hTriggeredBoards", "Triggered boards", 234, 0.5, 234.5);
-    Add2RecPointsList(h2, kTriggeredBoards);
+    Add2RecPointsList(h2, kTriggeredBoards,forExpert);
+
+    AliMUONTriggerDisplay triggerDisplay;
+    TString histoName, histoTitle;
+    for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
+      TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
+      for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
+       histoName = Form("hTriggerDigits%sChamber%i", cathName.Data(), 11+iChamber);
+       histoTitle = Form("Chamber %i: Fired pads %s", 11+iChamber, cathName.Data());
+       TH2F* h3 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips, 
+                                                             iCath, iChamber, histoTitle);
+       Add2RecPointsList(h3, kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber,!forExpert);
+      }
+    }
 
-    fIsInitRecPoints = InitDisplayHistos(AliQA::kRECPOINTS);
+    TH2F* h4 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto("hFiredBoardsDisplay", AliMUONTriggerDisplay::kDisplayBoards,
+                                                         0, 0, "Fired boards");
+    Add2RecPointsList(h4, kTriggerBoardsDisplay,!forExpert);
+       
+       fIsInitRecPointsTrigger = kTRUE;
 }
 
 
 //____________________________________________________________________________ 
 void AliMUONQADataMakerRec::InitESDs()
 {
-    ///create ESDs histograms in ESDs subdir
-  TH1F* h0 = new TH1F("hESDnTracks", "ESDs track number distribution", 30, 0., 30.);  
-  Add2ESDsList(h0, kESDnTracks);
+  ///create ESDs histograms in ESDs subdir
+  
+  Bool_t forExpert(kTRUE);
+  
+  Int_t nCh = AliMUONConstants::NTrackingCh();
+  Int_t nDE = 1100;
+  
+  // track info
+  TH1F* hESDnTracks = new TH1F("hESDnTracks", "number of tracks;n_{tracks}", 20, 0., 20.);
+  Add2ESDsList(hESDnTracks, kESDnTracks,!forExpert);
 
-  TH1F* h1 = new TH1F("hESDMomentum", "ESDs P distribution", 300, 0., 300) ; 
-  Add2ESDsList(h1, kESDMomentum);
+  TH1F* hESDMatchTrig = new TH1F("hESDMatchTrig", "number of tracks matched with trigger;n_{tracks}", 20, 0., 20.);
+  Add2ESDsList(hESDMatchTrig, kESDMatchTrig,!forExpert);
+  
+  TH1F* hESDMomentum = new TH1F("hESDMomentum", "momentum distribution;p (GeV/c)", 300, 0., 300);
+  Add2ESDsList(hESDMomentum, kESDMomentum,forExpert);
 
-  TH1F* h2 = new TH1F("hESDPt", "ESDs Pt distribution", 200, 0., 50) ; 
-  Add2ESDsList(h2, kESDPt);
+  TH1F* hESDPt = new TH1F("hESDPt", "transverse momentum distribution;p_{t} (GeV/c)", 200, 0., 50);
+  Add2ESDsList(hESDPt, kESDPt,forExpert);
 
-  TH1F* h3 = new TH1F("hESDRapidity", "ESDs rapidity distribution", 200, -4.5,-2.) ; 
-  Add2ESDsList(h3, kESDRapidity);
+  TH1F* hESDRapidity = new TH1F("hESDRapidity", "rapidity distribution;rapidity", 200, -4.5, -2.);
+  Add2ESDsList(hESDRapidity, kESDRapidity,forExpert);
 
-  for (Int_t i = 0; i < AliMUONConstants::NTrackingCh(); ++i) 
-  {
-    TH2F* h4 = new TH2F(Form("%s%d", "hESDClusterHitMap", i), 
-                    Form("%s %d", "ESD Clusters hit distribution for chamber", i),
-                    100, -1*AliMUONConstants::Rmax(i/2), AliMUONConstants::Rmax(i/2),
-                    100, -1*AliMUONConstants::Rmax(i/2), AliMUONConstants::Rmax(i/2)); 
-    Add2ESDsList(h4, kESDClusterHitMap+i);
+  TH1F* hESDChi2 = new TH1F("hESDChi2", "normalized #chi^{2} distribution;#chi^{2} / ndf", 500, 0., 50.);
+  Add2ESDsList(hESDChi2, kESDChi2,forExpert);
+  
+  TH1F* hESDProbChi2 = new TH1F("hESDProbChi2", "distribution of probability of #chi^{2};prob(#chi^{2})", 100, 0., 1.);
+  Add2ESDsList(hESDProbChi2, kESDProbChi2,forExpert);
+  
+  // cluster info
+  for (Int_t i = 0; i < nCh; i++) {
+    Float_t rMax = AliMUONConstants::Rmax(i/2);
+    TH2F* hESDClusterHitMap = new TH2F(Form("hESDClusterHitMap%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1),
+                                      100, -rMax, rMax, 100, -rMax, rMax);
+    Add2ESDsList(hESDClusterHitMap, kESDClusterHitMap+i,forExpert);
+  }
+  
+  TH1F* hESDnClustersPerTrack = new TH1F("hESDnClustersPerTrack", "number of associated clusters per track;n_{clusters}", 20, 0., 20.);
+  Add2ESDsList(hESDnClustersPerTrack, kESDnClustersPerTrack,!forExpert);
+  
+  TH1F* hESDnClustersPerCh = new TH1F("hESDnClustersPerCh", "averaged number of clusters per chamber per track;chamber ID;<n_{clusters}>", nCh, -0.5, nCh-0.5);
+  hESDnClustersPerCh->SetFillColor(kRed);
+  Add2ESDsList(hESDnClustersPerCh, kESDnClustersPerCh,forExpert);
+  
+  TH1F* hESDnClustersPerDE = new TH1F("hESDnClustersPerDE", "averaged number of clusters per DE per track;DetElem ID;<n_{clusters}>", nDE+1, -0.5, nDE+0.5);
+  hESDnClustersPerDE->SetFillColor(kRed);
+  Add2ESDsList(hESDnClustersPerDE, kESDnClustersPerDE,forExpert);
+  
+  for (Int_t i = 0; i < nCh; i++) {
+    TH1F* hESDClusterChargeInCh = new TH1F(Form("hESDClusterChargeInCh%d",i+1), Form("cluster charge distribution in chamber %d;charge (ADC counts)",i+1), 500, 0., 5000.);
+    Add2ESDsList(hESDClusterChargeInCh, kESDClusterChargeInCh+i,forExpert);
   }
   
+  TH1F* hESDClusterChargePerChMean = new TH1F("hESDClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (ADC counts)", nCh, -0.5, nCh-0.5);
+  hESDClusterChargePerChMean->SetOption("P");
+  hESDClusterChargePerChMean->SetMarkerStyle(kFullDotMedium);
+  hESDClusterChargePerChMean->SetMarkerColor(kRed);
+  Add2ESDsList(hESDClusterChargePerChMean, kESDClusterChargePerChMean,forExpert);
+  
+  TH1F* hESDClusterChargePerChSigma = new TH1F("hESDClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (ADC counts)", nCh, -0.5, nCh-0.5);
+  hESDClusterChargePerChSigma->SetOption("P");
+  hESDClusterChargePerChSigma->SetMarkerStyle(kFullDotMedium);
+  hESDClusterChargePerChSigma->SetMarkerColor(kRed);
+  Add2ESDsList(hESDClusterChargePerChSigma, kESDClusterChargePerChSigma,forExpert);
+  
+  TH1F* hESDClusterChargePerDE = new TH1F("hESDClusterChargePerDE", "cluster mean charge per DE;DetElem ID;<charge> (ADC counts)", nDE+1, -0.5, nDE+0.5);
+  hESDClusterChargePerDE->SetOption("P");
+  hESDClusterChargePerDE->SetMarkerStyle(kFullDotMedium);
+  hESDClusterChargePerDE->SetMarkerColor(kRed);
+  Add2ESDsList(hESDClusterChargePerDE, kESDClusterChargePerDE,forExpert);
+  
+  for (Int_t i = 0; i < nCh; i++) {
+    TH1F* hESDClusterSizeInCh = new TH1F(Form("hESDClusterSizeInCh%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads})",i+1), 200, 0., 200.);
+    Add2ESDsList(hESDClusterSizeInCh, kESDClusterSizeInCh+i,forExpert);
+  }
+  
+  TH1F* hESDClusterSizePerChMean = new TH1F("hESDClusterSizePerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh, -0.5, nCh-0.5);
+  hESDClusterSizePerChMean->SetOption("P");
+  hESDClusterSizePerChMean->SetMarkerStyle(kFullDotMedium);
+  hESDClusterSizePerChMean->SetMarkerColor(kRed);
+  Add2ESDsList(hESDClusterSizePerChMean, kESDClusterSizePerChMean,forExpert);
+  
+  TH1F* hESDClusterSizePerChSigma = new TH1F("hESDClusterSizePerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh, -0.5, nCh-0.5);
+  hESDClusterSizePerChSigma->SetOption("P");
+  hESDClusterSizePerChSigma->SetMarkerStyle(kFullDotMedium);
+  hESDClusterSizePerChSigma->SetMarkerColor(kRed);
+  Add2ESDsList(hESDClusterSizePerChSigma, kESDClusterSizePerChSigma,forExpert);
+  
+  TH1F* hESDClusterSizePerDE = new TH1F("hESDClusterSizePerDE", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", nDE+1, -0.5, nDE+0.5);
+  hESDClusterSizePerDE->SetOption("P");
+  hESDClusterSizePerDE->SetMarkerStyle(kFullDotMedium);
+  hESDClusterSizePerDE->SetMarkerColor(kRed);
+  Add2ESDsList(hESDClusterSizePerDE, kESDClusterSizePerDE,forExpert);
+  
+  // cluster - track info
+  for (Int_t i = 0; i < nCh; i++) {
+    TH1F* hESDResidualXInCh = new TH1F(Form("hESDResidualXInCh%d",i+1), Form("cluster-track residual-X distribution in chamber %d;#Delta_{X} (cm)",i+1), 1000, -5., 5.);
+    Add2ESDsList(hESDResidualXInCh, kESDResidualXInCh+i,forExpert);
+    
+    TH1F* hESDResidualYInCh = new TH1F(Form("hESDResidualYInCh%d",i+1), Form("cluster-track residual-Y distribution in chamber %d;#Delta_{Y} (cm)",i+1), 1000, -1., 1.);
+    Add2ESDsList(hESDResidualYInCh, kESDResidualYInCh+i,forExpert);
+    
+    TH1F* hESDLocalChi2XInCh = new TH1F(Form("hESDLocalChi2XInCh%d",i+1), Form("local chi2-X distribution in chamber %d;local #chi^{2}_{X}",i+1), 1000, 0., 25);
+    Add2ESDsList(hESDLocalChi2XInCh, kESDLocalChi2XInCh+i,forExpert);
+    
+    TH1F* hESDLocalChi2YInCh = new TH1F(Form("hESDLocalChi2YInCh%d",i+1), Form("local chi2-Y distribution in chamber %d;local #chi^{2}_{Y}",i+1), 1000, 0., 25);
+    Add2ESDsList(hESDLocalChi2YInCh, kESDLocalChi2YInCh+i,forExpert);
+  }
+  
+  TH1F* hESDResidualXPerChMean = new TH1F("hESDResidualXPerChMean", "cluster-track residual-X per Ch: mean;chamber ID;<#Delta_{X}> (cm)", nCh, -0.5, nCh-0.5);
+  hESDResidualXPerChMean->SetOption("P");
+  hESDResidualXPerChMean->SetMarkerStyle(kFullDotMedium);
+  hESDResidualXPerChMean->SetMarkerColor(kRed);
+  Add2ESDsList(hESDResidualXPerChMean, kESDResidualXPerChMean,forExpert);
+  
+  TH1F* hESDResidualYPerChMean = new TH1F("hESDResidualYPerChMean", "cluster-track residual-Y per Ch: mean;chamber ID;<#Delta_{Y}> (cm)", nCh, -0.5, nCh-0.5);
+  hESDResidualYPerChMean->SetOption("P");
+  hESDResidualYPerChMean->SetMarkerStyle(kFullDotMedium);
+  hESDResidualYPerChMean->SetMarkerColor(kRed);
+  Add2ESDsList(hESDResidualYPerChMean, kESDResidualYPerChMean,forExpert);
+  
+  TH1F* hESDResidualXPerChSigma = new TH1F("hESDResidualXPerChSigma", "cluster-track residual-X per Ch: sigma;chamber ID;#sigma_{X} (cm)", nCh, -0.5, nCh-0.5);
+  hESDResidualXPerChSigma->SetOption("P");
+  hESDResidualXPerChSigma->SetMarkerStyle(kFullDotMedium);
+  hESDResidualXPerChSigma->SetMarkerColor(kRed);
+  Add2ESDsList(hESDResidualXPerChSigma, kESDResidualXPerChSigma,forExpert);
+  
+  TH1F* hESDResidualYPerChSigma = new TH1F("hESDResidualYPerChSigma", "cluster-track residual-Y per Ch: sigma;chamber ID;#sigma_{Y} (cm)", nCh, -0.5, nCh-0.5);
+  hESDResidualYPerChSigma->SetOption("P");
+  hESDResidualYPerChSigma->SetMarkerStyle(kFullDotMedium);
+  hESDResidualYPerChSigma->SetMarkerColor(kRed);
+  Add2ESDsList(hESDResidualYPerChSigma, kESDResidualYPerChSigma,forExpert);
+  
+  TH1F* hESDLocalChi2XPerChMean = new TH1F("hESDLocalChi2XPerChMean", "local chi2-X per Ch: mean;chamber ID;<local #chi^{2}_{X}>", nCh, -0.5, nCh-0.5);
+  hESDLocalChi2XPerChMean->SetOption("P");
+  hESDLocalChi2XPerChMean->SetMarkerStyle(kFullDotMedium);
+  hESDLocalChi2XPerChMean->SetMarkerColor(kRed);
+  Add2ESDsList(hESDLocalChi2XPerChMean, kESDLocalChi2XPerChMean,forExpert);
+  
+  TH1F* hESDLocalChi2YPerChMean = new TH1F("hESDLocalChi2YPerChMean", "local chi2-Y per Ch: mean;chamber ID;<local #chi^{2}_{Y}>", nCh, -0.5, nCh-0.5);
+  hESDLocalChi2YPerChMean->SetOption("P");
+  hESDLocalChi2YPerChMean->SetMarkerStyle(kFullDotMedium);
+  hESDLocalChi2YPerChMean->SetMarkerColor(kRed);
+  Add2ESDsList(hESDLocalChi2YPerChMean, kESDLocalChi2YPerChMean,forExpert);
+  
+  TH1F* hESDResidualXPerDEMean = new TH1F("hESDResidualXPerDEMean", "cluster-track residual-X per DE: mean;DetElem ID;<#Delta_{X}> (cm)", nDE+1, -0.5, nDE+0.5);
+  hESDResidualXPerDEMean->SetOption("P");
+  hESDResidualXPerDEMean->SetMarkerStyle(kFullDotMedium);
+  hESDResidualXPerDEMean->SetMarkerColor(kRed);
+  Add2ESDsList(hESDResidualXPerDEMean, kESDResidualXPerDEMean,forExpert);
+  
+  TH1F* hESDResidualYPerDEMean = new TH1F("hESDResidualYPerDEMean", "cluster-track residual-Y per DE: mean;DetElem ID;<#Delta_{Y}> (cm)", nDE+1, -0.5, nDE+0.5);
+  hESDResidualYPerDEMean->SetOption("P");
+  hESDResidualYPerDEMean->SetMarkerStyle(kFullDotMedium);
+  hESDResidualYPerDEMean->SetMarkerColor(kRed);
+  Add2ESDsList(hESDResidualYPerDEMean, kESDResidualYPerDEMean,forExpert);
+  
+  TH1F* hESDResidualXPerDESigma = new TH1F("hESDResidualXPerDESigma", "cluster-track residual-X per DE: sigma;DetElem ID;#sigma_{X} (cm)", nDE+1, -0.5, nDE+0.5);
+  hESDResidualXPerDESigma->SetOption("P");
+  hESDResidualXPerDESigma->SetMarkerStyle(kFullDotMedium);
+  hESDResidualXPerDESigma->SetMarkerColor(kRed);
+  Add2ESDsList(hESDResidualXPerDESigma, kESDResidualXPerDESigma,forExpert);
+  
+  TH1F* hESDResidualYPerDESigma = new TH1F("hESDResidualYPerDESigma", "cluster-track residual-Y per DE: sigma;DetElem ID;#sigma_{Y} (cm)", nDE+1, -0.5, nDE+0.5);
+  hESDResidualYPerDESigma->SetOption("P");
+  hESDResidualYPerDESigma->SetMarkerStyle(kFullDotMedium);
+  hESDResidualYPerDESigma->SetMarkerColor(kRed);
+  Add2ESDsList(hESDResidualYPerDESigma, kESDResidualYPerDESigma,forExpert);
+  
+  TH1F* hESDLocalChi2XPerDEMean = new TH1F("hESDLocalChi2XPerDEMean", "local chi2-X per DE: mean;DetElem ID;<local #chi^{2}_{X}>", nDE+1, -0.5, nDE+0.5);
+  hESDLocalChi2XPerDEMean->SetOption("P");
+  hESDLocalChi2XPerDEMean->SetMarkerStyle(kFullDotMedium);
+  hESDLocalChi2XPerDEMean->SetMarkerColor(kRed);
+  Add2ESDsList(hESDLocalChi2XPerDEMean, kESDLocalChi2XPerDEMean,forExpert);
+  
+  TH1F* hESDLocalChi2YPerDEMean = new TH1F("hESDLocalChi2YPerDEMean", "local chi2-Y per DE: mean;DetElem ID;<local #chi^{2}_{Y}>", nDE+1, -0.5, nDE+0.5);
+  hESDLocalChi2YPerDEMean->SetOption("P");
+  hESDLocalChi2YPerDEMean->SetMarkerStyle(kFullDotMedium);
+  hESDLocalChi2YPerDEMean->SetMarkerColor(kRed);
+  Add2ESDsList(hESDLocalChi2YPerDEMean, kESDLocalChi2YPerDEMean,forExpert);
+  
+  // intermediate histograms
+  TH1F* hESDnTotClustersPerCh = new TH1F("hESDnTotClustersPerCh", "total number of associated clusters per chamber;chamber ID;#Sigma(n_{clusters})", nCh, -0.5, nCh-0.5);
+  Add2ESDsList(hESDnTotClustersPerCh, kESDnTotClustersPerCh, forExpert);
+  TH1F* hESDnTotClustersPerDE = new TH1F("hESDnTotClustersPerDE", "total number of associated clusters per DE;DetElem ID;#Sigma(n_{clusters})", nDE+1, -0.5, nDE+0.5);
+  Add2ESDsList(hESDnTotClustersPerDE, kESDnTotClustersPerDE, forExpert);
+  TH1F* hESDnTotFullClustersPerDE = new TH1F("hESDnTotFullClustersPerDE", "total number of associated clusters containing pad info per DE;DetElem ID;#Sigma(n_{full clusters})", nDE+1, -0.5, nDE+0.5);
+  Add2ESDsList(hESDnTotFullClustersPerDE, kESDnTotFullClustersPerDE, forExpert);
+  TH1F* hESDSumClusterChargePerDE = new TH1F("hESDSumClusterChargePerDE", "sum of cluster charge per DE;DetElem ID;#Sigma(charge) (ADC counts)", nDE+1, -0.5, nDE+0.5);
+  Add2ESDsList(hESDSumClusterChargePerDE, kESDSumClusterChargePerDE, forExpert);
+  TH1F* hESDSumClusterSizePerDE = new TH1F("hESDSumClusterSizePerDE", "sum of cluster size per DE;DetElem ID;#Sigma(size) (n_{pads})", nDE+1, -0.5, nDE+0.5);
+  Add2ESDsList(hESDSumClusterSizePerDE, kESDSumClusterSizePerDE, forExpert);
+  TH1F* hESDSumResidualXPerDE = new TH1F("hESDSumResidualXPerDE", "sum of cluster-track residual-X per DE;DetElem ID;#Sigma(#Delta_{X}) (cm)", nDE+1, -0.5, nDE+0.5);
+  Add2ESDsList(hESDSumResidualXPerDE, kESDSumResidualXPerDE, forExpert);
+  TH1F* hESDSumResidualYPerDE = new TH1F("hESDSumResidualYPerDE", "sum of cluster-track residual-Y per DE;DetElem ID;#Sigma(#Delta_{Y}) (cm)", nDE+1, -0.5, nDE+0.5);
+  Add2ESDsList(hESDSumResidualYPerDE, kESDSumResidualYPerDE, forExpert);
+  TH1F* hESDSumResidualX2PerDE = new TH1F("hESDSumResidualX2PerDE", "sum of cluster-track residual-X**2 per DE;DetElem ID;#Sigma(#Delta_{X}^{2}) (cm^{2})", nDE+1, -0.5, nDE+0.5);
+  Add2ESDsList(hESDSumResidualX2PerDE, kESDSumResidualX2PerDE, forExpert);
+  TH1F* hESDSumResidualY2PerDE = new TH1F("hESDSumResidualY2PerDE", "sum of cluster-track residual-Y**2 per DE;DetElem ID;#Sigma(#Delta_{Y}^{2}) (cm^{2})", nDE+1, -0.5, nDE+0.5);
+  Add2ESDsList(hESDSumResidualY2PerDE, kESDSumResidualY2PerDE, forExpert);
+  TH1F* hESDSumLocalChi2XPerDE = new TH1F("hESDSumLocalChi2XPerDE", "sum of local chi2-X per DE;DetElem ID;#Sigma(local #chi^{2}_{X})", nDE+1, -0.5, nDE+0.5);
+  Add2ESDsList(hESDSumLocalChi2XPerDE, kESDSumLocalChi2XPerDE, forExpert);
+  TH1F* hESDSumLocalChi2YPerDE = new TH1F("hESDSumLocalChi2YPerDE", "sum of local chi2-Y per DE;DetElem ID;#Sigma(local #chi^{2}_{Y})", nDE+1, -0.5, nDE+0.5);
+  Add2ESDsList(hESDSumLocalChi2YPerDE, kESDSumLocalChi2YPerDE, forExpert);
+  
   fIsInitESDs =  kTRUE;
 }
 
@@ -248,25 +924,31 @@ void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
       return;
     }    
 
-    Int_t busPatchId;
-    UShort_t manuId;  
-    UChar_t channelId;
-    UShort_t charge;
-
+  if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent ) 
+  {
     rawReader->Reset();
-    AliMUONRawStreamTracker rawStreamTrack(rawReader);
-    rawStreamTrack.First();
-    while( rawStreamTrack.Next(busPatchId, manuId, channelId, charge) ) {
-  
-      GetRawsData(kRawBusPatch)->Fill(busPatchId);
-      GetRawsData(kRawCharge)->Fill(charge);
-      Int_t iDDL = rawStreamTrack.GetCurentDDL();
-      GetRawsData(kRawBuspatchDDL + iDDL)->Fill(AliMpBusPatch::GetLocalBusID(busPatchId, iDDL));
-               
-                 
-    } // Next digit
+    MakeRawsTracker(rawReader);
+  }
+  
+  rawReader->Reset();    
+  MakeRawsTrigger(rawReader);
+}
 
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::MakeRawsTracker(AliRawReader* rawReader)
+{
+       /// make QA for rawdata tracker
+       
+       ((AliMUONTrackerDataMaker*)fTrackerDataMaker)->SetRawReader(rawReader);
+       
+       fTrackerDataMaker->ProcessEvent();
+}
 
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::MakeRawsTrigger(AliRawReader* rawReader)
+{
+       /// make QA for rawdata trigger
+       
     // Get trigger scalers
 
     Int_t loCircuit=0;
@@ -282,6 +964,12 @@ void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
       AliMUONDDLTrigger* ddlTrigger = rawStreamTrig.GetDDLTrigger();
       AliMUONDarcHeader* darcHeader = ddlTrigger->GetDarcHeader();
 
+      if (darcHeader->GetGlobalFlag()){
+        UInt_t nOfClocks = darcHeader->GetGlobalClock();
+        Double_t nOfSeconds = ((Double_t) nOfClocks) / 40e6; // 1 clock each 25 ns
+        ((TH1F*)GetRawsData(kTriggerScalersTime))->Fill(1., nOfSeconds);
+      }
+
       Int_t nReg = darcHeader->GetRegHeaderEntries();
     
       for(Int_t iReg = 0; iReg < nReg ;iReg++)
@@ -335,15 +1023,67 @@ void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
 //____________________________________________________________________________
 void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
 {
-  
-    /// makes data from trigger response
-      
-    if ( ! fIsInitRecPoints ) {
-      AliWarningStream() 
-        << "Skipping function due to a failure in Init" << endl;
-      return;
-    }    
+       /// Fill histograms from treeR
+       
+       if (fIsInitRecPointsTracker) MakeRecPointsTracker(clustersTree);
+       if (fIsInitRecPointsTrigger) MakeRecPointsTrigger(clustersTree);
+}
+
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree)
+{
+       /// Fill histograms related to tracker clusters 
+       
+       // First things first : do we have clusters in the TreeR ?
+       // In "normal" production mode, it should be perfectly normal
+       // *not* to have them.
+       // But if for some reason we de-activated the combined tracking,
+       // then we have clusters in TreeR, so let's take that opportunity
+       // to QA them...
+       
+       if (!fClusterStore)
+       {
+               AliCodeTimerAuto("ClusterStore creation");
+               fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
+               if (!fClusterStore) 
+               {
+                       fIsInitRecPointsTracker = kFALSE;
+                       return;
+               }
+       }
+       
+       AliCodeTimerAuto("");
+       
+       fClusterStore->Connect(*clustersTree,kFALSE);
+       clustersTree->GetEvent(0);
+
+       TIter next(fClusterStore->CreateIterator());
+       AliMUONVCluster* cluster;
+       
+       while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
+       {
+               Int_t detElemId = cluster->GetDetElemId();
+               Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
+               
+               GetRecPointsData(kTrackerNumberOfClustersPerDE)->Fill(detElemId);
+               GetRecPointsData(kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge());
+               GetRecPointsData(kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits());
+
+               GetRecPointsData(kTrackerNumberOfClustersPerChamber)->Fill(chamberId);
+               GetRecPointsData(kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge());
+               GetRecPointsData(kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits());
+               GetRecPointsData(kTrackerClusterHitMapPerChamber+chamberId)->Fill(cluster->GetX(),cluster->GetY());
+               
+       }
+       
+       fClusterStore->Clear();
+}
 
+//____________________________________________________________________________
+void AliMUONQADataMakerRec::MakeRecPointsTrigger(TTree* clustersTree)
+{
+       /// makes data from trigger response
+      
     // Fired pads info
     fDigitStore->Clear();
 
@@ -393,36 +1133,89 @@ void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
 //____________________________________________________________________________
 void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd)
 {
-    /// make QA data from ESDs
-
-    if ( ! fIsInitESDs ) {
-      AliWarningStream() 
-        << "Skipping function due to a failure in Init" << endl;
-      return;
-    }    
-
-    TLorentzVector v1;
-
-    Int_t nTracks = (Int_t)esd->GetNumberOfMuonTracks() ; 
-    GetESDsData(0)->Fill(nTracks);
-
-    for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
-
-      AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iTrack);
-      muonTrack->LorentzP(v1);
-
-      GetESDsData(1)->Fill(v1.P());
-      GetESDsData(2)->Fill(v1.Pt());
-      GetESDsData(3)->Fill(v1.Rapidity());
-
-      TClonesArray clusters =  muonTrack->GetClusters();
-
-      for (Int_t iCluster = 0; iCluster <clusters.GetEntriesFast(); ++iCluster) {
-       AliESDMuonCluster* cluster = (AliESDMuonCluster*)clusters.At(iCluster);
-       GetESDsData(kESDClusterHitMap+cluster->GetChamberId())
-          ->Fill(cluster->GetX(), cluster->GetY());
+  /// make QA data from ESDs
+  
+  if ( ! fIsInitESDs ) {
+    AliWarningStream() 
+    << "Skipping function due to a failure in Init" << endl;
+    return;
+  }    
+  
+  // load ESD event in the interface
+  AliMUONESDInterface esdInterface;
+  if (GetRecoParam()) AliMUONESDInterface::ResetTracker(GetRecoParam());
+  else AliError("Unable to get recoParam: use default ones for residual calculation");
+  esdInterface.LoadEvent(*esd);
+  
+  GetESDsData(kESDnTracks)->Fill(esdInterface.GetNTracks());
+  
+  Int_t nTrackMatchTrig = 0;
+  
+  // loop over tracks
+  Int_t nTracks = (Int_t) esd->GetNumberOfMuonTracks(); 
+  for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
+    
+    // get the ESD track and skip "ghosts"
+    AliESDMuonTrack* esdTrack = esd->GetMuonTrack(iTrack);
+    if (!esdTrack->ContainTrackerData()) continue;
+    
+    // get corresponding MUON track
+    AliMUONTrack* track = esdInterface.FindTrack(esdTrack->GetUniqueID());
+    
+    if (esdTrack->ContainTriggerData()) nTrackMatchTrig++;
+    
+    GetESDsData(kESDMomentum)->Fill(esdTrack->P());
+    GetESDsData(kESDPt)->Fill(esdTrack->Pt());
+    GetESDsData(kESDRapidity)->Fill(esdTrack->Y());
+    GetESDsData(kESDChi2)->Fill(track->GetNormalizedChi2());
+    GetESDsData(kESDProbChi2)->Fill(TMath::Prob(track->GetGlobalChi2(),track->GetNDF()));
+    GetESDsData(kESDnClustersPerTrack)->Fill(track->GetNClusters());
+    
+    // loop over clusters
+    AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->First());
+    while (trackParam) {
+      
+      AliMUONVCluster* cluster = trackParam->GetClusterPtr();
+      Int_t chId = cluster->GetChamberId();
+      Int_t deID = cluster->GetDetElemId();
+      Double_t residualX = cluster->GetX() - trackParam->GetNonBendingCoor();
+      Double_t residualY = cluster->GetY() - trackParam->GetBendingCoor();
+      Double_t localChi2X = (cluster->GetErrX2() > 0.) ? residualX*residualX/cluster->GetErrX2() : 0.;
+      Double_t localChi2Y = (cluster->GetErrY2() > 0.) ? residualY*residualY/cluster->GetErrY2() : 0.;
+      
+      GetESDsData(kESDClusterHitMap+chId)->Fill(cluster->GetX(), cluster->GetY());
+      
+      GetESDsData(kESDnTotClustersPerCh)->Fill(chId);
+      GetESDsData(kESDnTotClustersPerDE)->Fill(deID);
+      
+      GetESDsData(kESDClusterChargeInCh+chId)->Fill(cluster->GetCharge());
+      GetESDsData(kESDSumClusterChargePerDE)->Fill(deID, cluster->GetCharge());
+      
+      if (cluster->GetNDigits() > 0) { // discard clusters with pad not stored in ESD
+       GetESDsData(kESDnTotFullClustersPerDE)->Fill(deID);
+        GetESDsData(kESDClusterSizeInCh+chId)->Fill(cluster->GetNDigits());
+       GetESDsData(kESDSumClusterSizePerDE)->Fill(deID, cluster->GetNDigits());
       }
+      
+      GetESDsData(kESDResidualXInCh+chId)->Fill(residualX);
+      GetESDsData(kESDResidualYInCh+chId)->Fill(residualY);
+      GetESDsData(kESDSumResidualXPerDE)->Fill(deID, residualX);
+      GetESDsData(kESDSumResidualYPerDE)->Fill(deID, residualY);
+      GetESDsData(kESDSumResidualX2PerDE)->Fill(deID, residualX*residualX);
+      GetESDsData(kESDSumResidualY2PerDE)->Fill(deID, residualY*residualY);
+      
+      GetESDsData(kESDLocalChi2XInCh+chId)->Fill(localChi2X);
+      GetESDsData(kESDLocalChi2YInCh+chId)->Fill(localChi2Y);
+      GetESDsData(kESDSumLocalChi2XPerDE)->Fill(deID, localChi2X);
+      GetESDsData(kESDSumLocalChi2YPerDE)->Fill(deID, localChi2Y);
+      
+      trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->After(trackParam));
     }
+    
+  }
+  
+  GetESDsData(kESDMatchTrig)->Fill(nTrackMatchTrig);
+  
 }
 
 //____________________________________________________________________________ 
@@ -433,388 +1226,170 @@ void AliMUONQADataMakerRec::StartOfDetectorCycle()
 }
 
 //____________________________________________________________________________ 
-void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQA::TASKINDEX_t task)
+void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQAv1::TASKINDEX_t task)
 {
   //
   /// Display trigger information in a user-friendly way:
   /// from local board and strip numbers to their position on chambers
   //
-  if(task!=AliQA::kRECPOINTS && task!=AliQA::kRAWS) return;
-
-  AliMpCDB::LoadDDLStore();
 
-  Int_t detElemId;
-  Float_t xg1, yg1, zg1, xg2, yg2, zg2, binContent;
-  Float_t xLocal1=0., yLocal1=0., xLocal2=0., yLocal2=0., xWidth=0., yWidth=0.;
-  Float_t x1Label, y1Label, x2Label, y2Label;
-  Int_t x1Int, x2Int, y1Int, y2Int;
-  Int_t binCh, binBoard, binStrip;
-
-  AliMUONGeometryTransformer transform;
-  transform.LoadGeometryData();
+  if(task!=AliQAv1::kRECPOINTS && task!=AliQAv1::kRAWS) return;
 
+  AliMUONTriggerDisplay triggerDisplay;
+  
   TH3F* histoStrips=0x0;
   TH2F* histoDisplayStrips=0x0;
-  TH2F* histoDisplayBoards=0x0;
-  TH1F* histoBoards=0x0;
 
-  const Float_t kShift = 0.15;
-
-  for (Int_t iCath = 0; iCath < 2; ++iCath)
+  for (Int_t iCath = 0; iCath < AliMpConstants::NofCathodes(); iCath++)
   {
-
-    if(task==AliQA::kRECPOINTS){
+    if(task==AliQAv1::kRECPOINTS){
       ERecPoints hindex 
        = ( iCath == 0 ) ? kTriggerDigitsBendPlane : kTriggerDigitsNonBendPlane;
       histoStrips = (TH3F*)GetRecPointsData(hindex);
-      histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards);
     }
-    else if(task==AliQA::kRAWS){
+    else if(task==AliQAv1::kRAWS){
       ERaw hindex 
        = ( iCath == 0 ) ? kTriggerScalersBP : kTriggerScalersNBP;
       histoStrips = (TH3F*)GetRawsData(hindex);
-      if(histoStrips->GetEntries()==0) return; // No scalers found
+      if(histoStrips->GetEntries()==0) continue; // No scalers found
     }
     
-    // Load mapping
-    if ( ! AliMpSegmentation::Instance(kFALSE) ) {
-      /// Load mapping
-      if ( ! AliMpCDB::LoadDDLStore() ) {
-        AliError("Could not access mapping from OCDB !");
-        return;
-      }
-    }  
-
-    for (Int_t iChamber = 0; iChamber < 4; ++iChamber)
+    for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++)
     {
-      Int_t iCh = iChamber + AliMpConstants::NofTrackingChambers();
-
-      if(task==AliQA::kRECPOINTS){
-       histoDisplayStrips = (TH2F*)GetRecPointsData(kTriggerDigitsDisplay + 4*iCath + iChamber);
-       histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay);
+      if(task==AliQAv1::kRECPOINTS){
+       histoDisplayStrips = (TH2F*)GetRecPointsData(kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
       }
-      else if(task==AliQA::kRAWS){
-       histoDisplayStrips = (TH2F*)GetRawsData(kTriggerScalersDisplay + 4*iCath + iChamber);
+      else if(task==AliQAv1::kRAWS){
+       histoDisplayStrips = (TH2F*)GetRawsData(kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
+      }
+      Int_t bin = histoStrips->GetXaxis()->FindBin(11+iChamber);
+      histoStrips->GetXaxis()->SetRange(bin,bin);
+      TH2F* inputHisto = (TH2F*)histoStrips->Project3D("zy");
+      triggerDisplay.FillDisplayHistogram(inputHisto, histoDisplayStrips, AliMUONTriggerDisplay::kDisplayStrips, iCath, iChamber);
+      if(task==AliQAv1::kRAWS) {
+        Float_t acquisitionTime = ((TH1F*)GetRawsData(kTriggerScalersTime))->GetBinContent(1);
+        histoDisplayStrips->Scale(1./acquisitionTime);
       }
-
-      for(Int_t iBoard=1; iBoard<=234; iBoard++){
-       // get detElemId
-       detElemId = AliMpDDLStore::Instance()->GetDEfromLocalBoard(iBoard, iCh);
-
-       if (!detElemId) continue;
-
-       AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(iBoard, false);
-
-       // skip copy cards
-       if( !localBoard->IsNotified()) 
-         continue;
-
-       const AliMpVSegmentation* seg 
-         = AliMpSegmentation::Instance()
-         ->GetMpSegmentation(detElemId, AliMp::GetCathodType(iCath));  
-        
-       // loop over strips
-       for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) 
-       {
-         AliMpPad pad = seg->PadByLocation(AliMpIntPair(iBoard,ibitxy),kFALSE);
-                        
-         if (!pad.IsValid())
-           continue;
-
-         if(iCath==0){ // Geometry info from bending plane only
-           if(ibitxy==0) {
-             xLocal1 = pad.Position().X();
-             yLocal1 = pad.Position().Y();
-             xWidth = pad.Dimensions().X();
-             yWidth = pad.Dimensions().Y();
-           }
-           xLocal2 = pad.Position().X();
-           yLocal2 = pad.Position().Y();
-         }
-
-         Float_t dimX = pad.Dimensions().X();
-         Float_t dimY = pad.Dimensions().Y();
-
-         Float_t stripX = pad.Position().X();
-         Float_t stripY = pad.Position().Y();
-                  
-         transform.Local2Global(detElemId, stripX, stripY, 0, xg1, yg1, zg1);
-
-         x1Int = histoDisplayStrips->GetXaxis()->FindBin(xg1 - dimX + kShift);
-         y1Int = histoDisplayStrips->GetYaxis()->FindBin(yg1 - dimY + kShift);
-         x2Int = histoDisplayStrips->GetXaxis()->FindBin(xg1 + dimX - kShift);
-         y2Int = histoDisplayStrips->GetYaxis()->FindBin(yg1 + dimY - kShift);
-
-         binCh = histoStrips->GetXaxis()->FindBin(iCh+1);
-         binBoard = histoStrips->GetYaxis()->FindBin(iBoard);
-         binStrip = histoStrips->GetZaxis()->FindBin(ibitxy);
-         binContent = histoStrips->GetBinContent(binCh, binBoard, binStrip);
-
-         if(binContent==0) continue;
-
-         for(Int_t binX=x1Int; binX<=x2Int; binX++){
-           for(Int_t binY=y1Int; binY<=y2Int; binY++){       
-             histoDisplayStrips->SetBinContent(binX, binY, binContent);
-           }
-         }
-       }// ibitxy
-
-       if(task != AliQA::kRECPOINTS) continue;
-       if(iCath>0 || iChamber>0) continue; // Geometry info from bending plane only
-       transform.Local2Global(detElemId, xLocal1, yLocal1, 0, xg1, yg1, zg1);
-       transform.Local2Global(detElemId, xLocal2, yLocal2, 0, xg2, yg2, zg2);
-
-       // Per board
-       x1Label = TMath::Min(xg1,xg2) - xWidth + kShift;
-       y1Label = TMath::Min(yg1,yg2) - yWidth + kShift;
-       x2Label = TMath::Max(xg1,xg2) + xWidth - kShift;
-       y2Label = TMath::Max(yg1,yg2) + yWidth - kShift;
-
-       x1Int = histoDisplayBoards->GetXaxis()->FindBin(x1Label);
-       y1Int = histoDisplayBoards->GetYaxis()->FindBin(y1Label);
-       x2Int = histoDisplayBoards->GetXaxis()->FindBin(x2Label);
-       y2Int = histoDisplayBoards->GetYaxis()->FindBin(y2Label);
-
-       binBoard = histoBoards->GetXaxis()->FindBin(iBoard);
-       binContent = histoBoards->GetBinContent(binBoard);
-
-       if(binContent==0) continue;
-
-       for(Int_t binX=x1Int; binX<=x2Int; binX++){
-         for(Int_t binY=y1Int; binY<=y2Int; binY++){
-           histoDisplayBoards->SetBinContent(binX, binY, binContent);
-         }
-       }
-      } // iBoard
     } // iChamber
   } // iCath
-}
-
-
-//____________________________________________________________________________ 
-Bool_t AliMUONQADataMakerRec::InitDisplayHistos(AliQA::TASKINDEX_t task)
-{
-  //
-  /// Initialize trigger information display histograms,
-  /// using mapping and geometry
-  //
-  AliMpCDB::LoadDDLStore();
-
-  const Int_t kNumOfBoards = AliMpConstants::NofLocalBoards();
-
-  AliMUONGeometryTransformer transform;
-  transform.LoadGeometryData();
-
-  TString cathCode[2] = {"BendPlane", "NonBendPlane"};
 
-  TArrayF xLocal1[4], yLocal1[4], xLocal2[4], yLocal2[4], xWidth[4], yWidth[4];
-
-  TArrayF xAxisStrip[8];
-  TArrayF yAxisStrip[8];
-  TArrayF xAxisBoard[8];
-  TArrayF yAxisBoard[8];
-
-  TH2F* histoStrips=0x0;
-  TH2F* histoBoards=0x0;
-
-  const Float_t kResetValue=1234567.;
-   
-  for(Int_t ch=0; ch<4; ch++){
-    xLocal1[ch].Set(kNumOfBoards);
-    yLocal1[ch].Set(kNumOfBoards);
-    xLocal2[ch].Set(kNumOfBoards);
-    yLocal2[ch].Set(kNumOfBoards);
-    xWidth[ch].Set(kNumOfBoards);
-    yWidth[ch].Set(kNumOfBoards);
-  }
-
-  for(Int_t cath=0; cath<2; cath++){
-    for(Int_t ch=0; ch<4; ch++){
-      Int_t chCath = 4*cath + ch;
-      xAxisBoard[chCath].Set(60);
-      xAxisBoard[chCath].Reset(kResetValue);
-      yAxisBoard[chCath].Set(60);
-      yAxisBoard[chCath].Reset(kResetValue);
-
-      xAxisStrip[chCath].Set(700);
-      xAxisStrip[chCath].Reset(kResetValue);
-      yAxisStrip[chCath].Set(700);
-      yAxisStrip[chCath].Reset(kResetValue);
+  if(task==AliQAv1::kRAWS){    
+    TH2F* histoI  = (TH2F*) GetRawsData(kTriggerRPCi);
+    TH2F* histoHV = (TH2F*) GetRawsData(kTriggerRPChv);
+    FillTriggerDCSHistos();
+    for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++) {
+      Int_t bin = histoI->GetXaxis()->FindBin(11+iChamber);
+      TH2F* histoDisplayI = (TH2F*)GetRawsData(kTriggerIDisplay + iChamber);
+      triggerDisplay.FillDisplayHistogram(histoI->ProjectionY("_px", bin, bin), histoDisplayI, AliMUONTriggerDisplay::kDisplaySlats, 0, iChamber);
+      TH2F* histoDisplayHV = (TH2F*)GetRawsData(kTriggerHVDisplay + iChamber);
+      bin = histoHV->GetXaxis()->FindBin(11+iChamber);
+      triggerDisplay.FillDisplayHistogram(histoHV->ProjectionY("_px", bin, bin), histoDisplayHV, AliMUONTriggerDisplay::kDisplaySlats, 0, iChamber);
     }
   }
-   
-  Float_t xg1, yg1, zg1, xg2, yg2, zg2;
-
-  TString histoName, histoTitle;
-
-  const Float_t kShift = 0.;
-
-  // Load mapping
-  if ( ! AliMpSegmentation::Instance(kFALSE) ) {
-    /// Load mapping
-    if ( ! AliMpCDB::LoadDDLStore() ) {
-      AliError("Could not access mapping from OCDB !");
-      return kFALSE;
-    }
-  }  
-
-  for(Int_t iCath=0; iCath<2; iCath++){
-    for (Int_t iChamber = 0; iChamber < 4; ++iChamber) {
-      Int_t iCh = iChamber + AliMpConstants::NofTrackingChambers();
-      for(Int_t iLoc = 0; iLoc < 234; iLoc++) {  
-       Int_t iBoard = iLoc+1;
-       Int_t detElemId = AliMpDDLStore::Instance()->GetDEfromLocalBoard(iBoard, iCh);
-
-       if (!detElemId) continue;
-
-       AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(iBoard, kFALSE);
-
-       // skip copy cards
-       if( !localBoard->IsNotified()) 
-         continue;
-
-       // get segmentation
-       const AliMpVSegmentation* seg = AliMpSegmentation::Instance()
-         ->GetMpSegmentation(detElemId,
-                             AliMp::GetCathodType(iCath));
-
-       Int_t chCath = 4*iCath + iChamber;
-       // loop over strips
-       for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) {
-         // get pad from electronics
-         AliMpPad pad = seg->PadByLocation(AliMpIntPair(iBoard,ibitxy),kFALSE);
-
-         if (!pad.IsValid()) continue;
-
-         if(iCath==0){
-           if(ibitxy==0) {
-             xLocal1[iChamber][iLoc] = pad.Position().X();
-             yLocal1[iChamber][iLoc] = pad.Position().Y();
-             xWidth[iChamber][iLoc] = pad.Dimensions().X();
-             yWidth[iChamber][iLoc] = pad.Dimensions().Y();
-           }
-           xLocal2[iChamber][iLoc] = pad.Position().X();
-           yLocal2[iChamber][iLoc] = pad.Position().Y();
-         }
-
-         // Check fired pads
-         Float_t dimX = pad.Dimensions().X();
-         Float_t dimY = pad.Dimensions().Y();
-     
-         Float_t stripX = pad.Position().X();
-         Float_t stripY = pad.Position().Y();
 
-         transform.Local2Global(detElemId, stripX, stripY, 0, xg1, yg1, zg1);
-
-         AddSortedPoint(xg1 - dimX + kShift, xAxisStrip[chCath], kResetValue);
-         AddSortedPoint(xg1 + dimX - kShift, xAxisStrip[chCath], kResetValue);
+  if(task==AliQAv1::kRECPOINTS){
+    TH1F* histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards);
+    TH2F* histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay);
+    triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0);
+  }
+}
 
-         AddSortedPoint(yg1 - dimY + kShift, yAxisStrip[chCath], kResetValue);
-         AddSortedPoint(yg1 + dimY - kShift, yAxisStrip[chCath], kResetValue);
-       } // loop on strips  
 
-       transform.Local2Global(detElemId, xLocal1[iChamber][iLoc], yLocal1[iChamber][iLoc], 0, xg1, yg1, zg1);
-       transform.Local2Global(detElemId, xLocal2[iChamber][iLoc], yLocal2[iChamber][iLoc], 0, xg2, yg2, zg2);
+//_____________________________________________________________________________
+Bool_t 
+AliMUONQADataMakerRec::FillTriggerDCSHistos()
+{
+  /// Get HV and currents values for one trigger chamber
+  
+  AliCodeTimerAuto("");
 
-       // Per board
-       AddSortedPoint(TMath::Min(xg1,xg2) - xWidth[iChamber][iLoc] + kShift, xAxisBoard[chCath], kResetValue);
-       AddSortedPoint(TMath::Max(xg1,xg2) + xWidth[iChamber][iLoc] - kShift, xAxisBoard[chCath], kResetValue);
+  AliMUONCalibrationData calibrationData(AliCDBManager::Instance()->GetRun());
 
-       AddSortedPoint(TMath::Min(yg1,yg2) - yWidth[iChamber][iLoc] + kShift, yAxisBoard[chCath], kResetValue);
-       AddSortedPoint(TMath::Max(yg1,yg2) + yWidth[iChamber][iLoc] - kShift, yAxisBoard[chCath], kResetValue);
-      } // loop on local boards 
-    } // loop on chambers
-  } // loop on cathodes
+  TMap* triggerDcsMap = calibrationData.TriggerDCS();
 
-  const Float_t kMinDiff = 0.1;
+  if ( !triggerDcsMap ) 
+  {
+    AliError("Cannot fill DCS histos, as triggerDcsMap is NULL");
+    return kFALSE;
+  }
 
-  // Book histos
-  for(Int_t iCath=0; iCath<2; iCath++){
-    for(Int_t iChamber=0; iChamber<4; iChamber++){
-      Int_t chCath = 4*iCath + iChamber;
-      Int_t ipoint=0;
-      while(TMath::Abs(xAxisStrip[chCath][ipoint]-kResetValue)>kMinDiff) { ipoint++; }
-      xAxisStrip[chCath].Set(ipoint);
+  AliMpDEIterator deIt;
+  
+  deIt.First();
+    
+  AliMpDCSNamer triggerDcsNamer("TRIGGER");
 
-      ipoint = 0;
-      while(TMath::Abs(yAxisStrip[chCath][ipoint]-kResetValue)>kMinDiff) { ipoint++; }
-      yAxisStrip[chCath].Set(ipoint);
+  TH2* currHisto = 0x0;
 
-      ipoint = 0;
-      while(TMath::Abs(xAxisBoard[chCath][ipoint]-kResetValue)>kMinDiff) { ipoint++; }
-      xAxisBoard[chCath].Set(ipoint);
+  Bool_t error = kFALSE;
+  
+  while ( !deIt.IsDone() )
+  {
+    Int_t detElemId = deIt.CurrentDEId();
+    
+    if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) {
 
-      ipoint = 0;
-      while(TMath::Abs(yAxisBoard[chCath][ipoint]-kResetValue)>kMinDiff) { ipoint++; }
-      yAxisBoard[chCath].Set(ipoint);
+      Int_t iChamber = AliMpDEManager::GetChamberId(detElemId);
+      Int_t slat = detElemId%100;
 
-      if(task==AliQA::kRECPOINTS){
-       histoName = Form("hTriggerDigits%sChamber%i", cathCode[iCath].Data(), 11+iChamber);
-       histoTitle = Form("Chamber %i: Fired pads %s", 11+iChamber, cathCode[iCath].Data());
-      }
-      else if(task==AliQA::kRAWS){
-       histoName = Form("hScalers%sChamber%i", cathCode[iCath].Data(), 11+iChamber);
-       histoTitle = Form("Chamber %i: Scalers %s", 11+iChamber, cathCode[iCath].Data());
-      }
-      histoStrips = new TH2F(histoName.Data(), histoTitle.Data(), 
-                            xAxisStrip[chCath].GetSize()-1, xAxisStrip[chCath].GetArray(),
-                            yAxisStrip[chCath].GetSize()-1, yAxisStrip[chCath].GetArray());
-      histoStrips->SetXTitle("X (cm)");
-      histoStrips->SetYTitle("Y (cm)");
-
-      if(task==AliQA::kRECPOINTS){
-       Add2RecPointsList(histoStrips, kTriggerDigitsDisplay + 4*iCath + iChamber);
-      }
-      else if(task==AliQA::kRAWS){
-       Add2RawsList(histoStrips, kTriggerScalersDisplay + 4*iCath + iChamber);
-      }
+      for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
+       TString currAlias = triggerDcsNamer.DCSChannelName(detElemId, 0, iMeas);
 
-      if(task != AliQA::kRECPOINTS) continue;
-      if(iCath>0 || iChamber>0) continue;
+       AliDebug(2, Form("\nDetElemId %i   dcsAlias %s", detElemId, currAlias.Data()));
 
-      histoName = "hFiredBoardsDisplay";
-      histoTitle = "Fired boards";
-      histoBoards = new TH2F(histoName.Data(), histoTitle.Data(), 
-                            xAxisBoard[chCath].GetSize()-1, xAxisBoard[chCath].GetArray(),
-                            yAxisBoard[chCath].GetSize()-1, yAxisBoard[chCath].GetArray());
-      histoBoards->SetXTitle("X (cm)");
-      histoBoards->SetYTitle("Y (cm)");
+       TPair* triggerDcsPair = static_cast<TPair*>(triggerDcsMap->FindObject(currAlias.Data()));
 
-      Add2RecPointsList(histoBoards, kTriggerBoardsDisplay + 4*iCath + iChamber);
-    } // loop on chamber
-  } // loop on cathode
-  
-  return kTRUE;
+       if (!triggerDcsPair)
+       {
+         AliError(Form("Did not find expected alias (%s) for DE %d",
+                       currAlias.Data(),detElemId));  
+         error = kTRUE;
+       }
+       else
+       {
+         TObjArray* values = static_cast<TObjArray*>(triggerDcsPair->Value());
+         if (!values)
+         {
+           AliError(Form("Could not get values for alias %s",currAlias.Data()));
+           error = kTRUE;
+         }
+         else
+         {
+           TIter next(values);
+           AliDCSValue* val;
+
+           while ( ( val = static_cast<AliDCSValue*>(next()) ) )
+           {
+             Float_t hvi = val->GetFloat();
+
+             AliDebug(2, Form("Value %f", hvi));
+
+             switch(iMeas){
+             case AliMpDCSNamer::kDCSI:
+               currHisto = (TH2F*) GetRawsData(kTriggerRPCi);
+               break;
+             case AliMpDCSNamer::kDCSHV:
+               currHisto = (TH2F*) GetRawsData(kTriggerRPChv);
+               break;
+             } 
+             Int_t binX = currHisto->GetXaxis()->FindBin(iChamber+1);
+             Int_t binY = currHisto->GetYaxis()->FindBin(slat);
+             currHisto->SetBinContent(binX, binY, hvi);
+           } // loop on values
+         } // if (!values)
+       } // if (!triggerDcsPair)
+      } // loop on measured types (HV and currents)
+    } // if (stationType == kStationTrigger)
+
+    deIt.Next();
+  }
+  return error;
 }
 
-
 //____________________________________________________________________________ 
-Bool_t AliMUONQADataMakerRec::AddSortedPoint(Float_t currVal, TArrayF& position, const Float_t kResetValue)
-{
-  //
-  /// Add sorted point in array according to an increasing order.
-  /// Used to build display histograms axis.
-  //
-  Int_t nEntries = position.GetSize();
-  Float_t tmp1, tmp2;
-  const Float_t kMinDiff = 0.1;
-  for(Int_t i=0; i<nEntries; i++){
-    if(TMath::Abs(position[i]-currVal)<kMinDiff) return kFALSE;
-    if(TMath::Abs(position[i]-kResetValue)<kMinDiff) {
-      position[i] = currVal;
-      return kTRUE;
-    }
-    if(currVal>position[i]) continue;
-    tmp1 = position[i];
-    position[i] = currVal;
-    for(Int_t j=i+1; j<nEntries; j++){
-      tmp2 = position[j];
-      position[j] = tmp1;
-      tmp1 = tmp2;
-      if(tmp1==kResetValue) break;
-    }
-    return kTRUE;
-  }
-  return kFALSE;
+AliMUONVTrackerData* AliMUONQADataMakerRec::GetTrackerData() const
+{ 
+  
+  return fTrackerDataMaker->Data(); 
+  
 }
-