]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HMPID/AliHMPIDQADataMakerRec.cxx
Making AliLog true instanton (Jimmy)
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDQADataMakerRec.cxx
index 642b03f952ddade06798b568bc5f3114ded797c5..69b0e4727b27b3967f9db6a296340dcdf2f00a24 100644 (file)
@@ -32,6 +32,7 @@
 #include "AliLog.h"
 #include "AliHMPIDDigit.h"
 #include "AliHMPIDHit.h"
+#include "AliHMPIDDigit.h"
 #include "AliHMPIDCluster.h"
 #include "AliHMPIDQADataMakerRec.h"
 #include "AliHMPIDQAChecker.h"
@@ -49,14 +50,14 @@ ClassImp(AliHMPIDQADataMakerRec)
            
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   AliHMPIDQADataMakerRec::AliHMPIDQADataMakerRec() : 
-  AliQADataMakerRec(AliQA::GetDetName(AliQA::kHMPID), "HMPID Quality Assurance Data Maker"),fEvtRaw(0)
+  AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kHMPID), "HMPID Quality Assurance Data Maker"),fEvtRaw(0), fChannel(0)
 {
   // ctor
 }
 
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 AliHMPIDQADataMakerRec::AliHMPIDQADataMakerRec(const AliHMPIDQADataMakerRec& qadm) :
-  AliQADataMakerRec(),fEvtRaw(qadm.fEvtRaw)
+  AliQADataMakerRec(),fEvtRaw(qadm.fEvtRaw), fChannel(qadm.fChannel)
 {
   //copy ctor 
   SetName((const char*)qadm.GetName()) ; 
@@ -72,35 +73,60 @@ AliHMPIDQADataMakerRec& AliHMPIDQADataMakerRec::operator = (const AliHMPIDQAData
   return *this;
 }
  
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDQADataMakerRec::InitDigits()
+{
+  // create Digits histograms in Digits subdir
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1F *hDigChEvt = new TH1F("hDigChEvt","Chamber occupancy per event;Occupancy [%];Counts",AliHMPIDParam::kMaxCh+1,AliHMPIDParam::kMinCh,AliHMPIDParam::kMaxCh+1);
+  TH1F *hDigPcEvt = new TH1F("hDigPcEvt","PC occupancy",156,-1,77);
+  TH2F *hDigMap[7];
+  TH1F *hDigQ[42];
+  for(Int_t iCh =0; iCh < 7; iCh++){
+    hDigMap[iCh] = new TH2F(Form("MapCh%i",iCh),Form("Digit Map in Chamber %i",iCh),159,0,159,143,0,143);
+    for(Int_t iPc =0; iPc < 6; iPc++ ){
+      hDigQ[iCh*6+iPc] = new TH1F(Form("QCh%iPc%i        ",iCh,iPc),Form("Charge of digits (ADC) in Chamber %i and PC %i;Charge [ADC counts];Counts",iCh,iPc),4100,0,4100);
+    }
+  }
+  
+  Add2DigitsList(hDigChEvt,0, !expert, image);
+  Add2DigitsList(hDigPcEvt,1,expert, !image);
+  for(Int_t iMap=0; iMap < 7; iMap++) Add2DigitsList(hDigMap[iMap],2+iMap,expert, !image);
+  for(Int_t iH =0; iH < 42 ; iH++) Add2DigitsList(hDigQ[iH]    ,9+iH,expert,!image);
+}
+
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDQADataMakerRec::InitRecPoints()
 {
   // create cluster histograms in RecPoint subdir
-
-  TProfile *hCluMult          = new TProfile("CluMult"   ,"Cluster multiplicity per chamber"    , 16, -1 , 7  , 0, 500);
-  Add2RecPointsList(hCluMult    , 0);
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  TProfile *hCluMult          = new TProfile("CluMult"   ,"Cluster multiplicity per chamber;Chamber Id;# of clusters"    , 16, -1 , 7  , 0, 500);
+  Add2RecPointsList(hCluMult    , 0,expert, !image);
   
-  TH2F *hCluFlg          = new TH2F("CluFlg"      ,"Cluster flag  "                              ,  56  ,-1.5, 12.5, 70, -0.5, 6.5);
-  Add2RecPointsList(hCluFlg    , 1);
+  TH2F *hCluFlg          = new TH2F("CluFlg"      ,"Cluster flag;??;??"                              ,  56  ,-1.5, 12.5, 70, -0.5, 6.5);
+  Add2RecPointsList(hCluFlg    , 1,expert, !image);
   
   TH1F *hCluSizeMip[7], *hCluSizePho[7];
   
   TH1F *hCluQSect[42], *hCluQSectZoom[42];
   
   for(Int_t iCh =0; iCh <7; iCh++){
-   hCluSizeMip[iCh] = new TH1F(Form("CluSizeMipCh%i",iCh),Form("Cluster size  MIP  (cluster Q > 100 ADC) in Chamber %i",iCh),  50  , 0  , 50  );
-  Add2RecPointsList(hCluSizeMip[iCh], iCh+2);
-
-   hCluSizePho[iCh]  = new TH1F(Form("CluSizePho%i",iCh ),Form("Cluster size  Phots(cluster Q < 100 ADC) in Chamber %i",iCh),  50  , 0  , 50  );
-  Add2RecPointsList(hCluSizePho[iCh], iCh+7+2);
+    hCluSizeMip[iCh] = new TH1F(Form("CluSizeMipCh%i",iCh),Form("Cluster size  MIP  (cluster Q > 100 ADC) in Chamber %i;Size [MIP];Counts",iCh),  50  , 0  , 50  );
+    Add2RecPointsList(hCluSizeMip[iCh], iCh+2,expert,!image);
 
+    hCluSizePho[iCh]  = new TH1F(Form("CluSizePho%i",iCh ),Form("Cluster size  Phots(cluster Q < 100 ADC) in Chamber %i;Size [MIP];Counts",iCh),  50  , 0  , 50  );
+    Add2RecPointsList(hCluSizePho[iCh], iCh+7+2,expert,!image);
+    
     for(Int_t iSect =0; iSect < 6; iSect++){
-      hCluQSectZoom[iCh*6+iSect] = new TH1F(Form("QClusCh%iSect%iZoom",iCh,iSect) ,Form("Zoom on Cluster charge (ADC) in Chamber %i and sector %i",iCh,iSect),100,0,100);
-      Add2RecPointsList(hCluQSectZoom[iCh*6+iSect],2+14+iCh*6+iSect);
-
-      hCluQSect[iCh*6+iSect] = new TH1F(Form("QClusCh%iSect%i",iCh,iSect) ,Form("Cluster charge (ADC) in Chamber %i and sector %i",iCh,iSect),250,0,5000);
-      Add2RecPointsList(hCluQSect[iCh*6+iSect],2+14+42+iCh*6+iSect);
-
+      hCluQSectZoom[iCh*6+iSect] = new TH1F(Form("QClusCh%iSect%iZoom",iCh,iSect) ,Form("Zoom on Cluster charge (ADC) in Chamber %i and sector %i;Charge [ADC counts];Counts",iCh,iSect),100,0,100);
+      Add2RecPointsList(hCluQSectZoom[iCh*6+iSect],2+14+iCh*6+iSect,expert,!image);
+      
+      hCluQSect[iCh*6+iSect] = new TH1F(Form("QClusCh%iSect%i",iCh,iSect) ,Form("Cluster charge (ADC) in Chamber %i and sector %i;Charge [ADC counts];Counts",iCh,iSect),250,0,5000);
+      Add2RecPointsList(hCluQSect[iCh*6+iSect],2+14+42+iCh*6+iSect, !expert, image);
     }  
   }
 }
@@ -113,57 +139,81 @@ void AliHMPIDQADataMakerRec::InitRaws()
 // All histograms implemented in InitRaws are used in AMORE. Any change here should be propagated to the amoreHMP-QA as well!!! (clm)
 //  
   
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t saveCorr = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
   const Int_t kNerr = (Int_t)AliHMPIDRawStream::kSumErr+1;
   TH1F *hSumErr[14];
   TH2F *hDilo[14];
   TH2I *hPadMap[42]; //AMORE monitoring
   TH1I *hPadQ[42]; //AMORE monitoring
+   
+  
   for(Int_t iddl =0; iddl<AliHMPIDRawStream::kNDDL; iddl++) {
     
-    hSumErr[iddl] = new TH1F(Form("hSumErrDDL%i",iddl), Form("Error summary for DDL %i",iddl), 2*kNerr,0,2*kNerr);
+    hSumErr[iddl] = new TH1F(Form("hSumErrDDL%i",iddl), Form("Error summary for DDL %i;??;??",iddl), 2*kNerr,0,2*kNerr);
     for(Int_t ilabel=0; ilabel< kNerr; ilabel++) {
       hSumErr[iddl]->GetXaxis()->CenterLabels(kTRUE);
       hSumErr[iddl]->GetXaxis()->SetBinLabel((2*ilabel+1),Form("%i  %s",ilabel+1,AliHMPIDRawStream::GetErrName(ilabel)));
-      }
-      
-    Add2RawsList(hSumErr[iddl],iddl);
+    }
+    
+   Add2RawsList(hSumErr[iddl],iddl,expert,!image, !saveCorr);
     
     hDilo[iddl] = new TH2F(Form("hDiloDDL%i",iddl),Form("Dilogic response at DDL;Row # ;Dilogic #",iddl),24,1,25,10,1,11);
-    Add2RawsList(hDilo[iddl],14+iddl);
+    Add2RawsList(hDilo[iddl],14+iddl,expert,!image, !saveCorr);
   }//DDL loop
- for(Int_t iCh = AliHMPIDParam::kMinCh; iCh <=AliHMPIDParam::kMaxCh ;iCh++) {
-   for(Int_t iPc = AliHMPIDParam::kMinPc; iPc <= AliHMPIDParam::kMaxPc ;iPc++) {
 for(Int_t iCh = AliHMPIDParam::kMinCh; iCh <=AliHMPIDParam::kMaxCh ;iCh++) {
+    for(Int_t iPc = AliHMPIDParam::kMinPc; iPc <= AliHMPIDParam::kMaxPc ;iPc++) {
       hPadMap[iPc+6*iCh] = new TH2I(Form("hPadMap_Ch_%i_Pc%i",iCh,iPc),Form("Pad Map of Ch: %i Pc: %i;Pad X;Pad Y;",iCh,iPc),80,0,80,48,0,48);
-      Add2RawsList(hPadMap[iPc+6*iCh],28+iPc+6*iCh); 
+     Add2RawsList(hPadMap[iPc+6*iCh],28+iPc+6*iCh,expert,!image, !saveCorr); 
       hPadQ[iPc+6*iCh]   = new TH1I(Form("hPadQ_Ch_%i_Pc%i",iCh,iPc),Form("Pad Charge of Ch: %i Pc: %i;Pad Q;Entries;",iCh,iPc),4100,0,4100);
-      Add2RawsList(hPadQ[iPc+6*iCh],70+iPc+6*iCh); 
+      Add2RawsList(hPadQ[iPc+6*iCh],70+iPc+6*iCh,expert,!image, !saveCorr); 
     }//PC loop
   }//Ch loop  
   
+  TH2I *hGeneralErrorSummary = new TH2I("GeneralErrorSummary"," DDL index vs Error type plot", 2*kNerr, 0, 2*kNerr, 2*AliHMPIDRawStream::kNDDL,0,2*AliHMPIDRawStream::kNDDL);
+  for(Int_t igenlabel =0 ; igenlabel< kNerr; igenlabel++) hGeneralErrorSummary->GetXaxis()->SetBinLabel((2*igenlabel+1),Form("%i  %s",igenlabel+1,AliHMPIDRawStream::GetErrName(igenlabel)));
+  Add2RawsList(hGeneralErrorSummary,14+14+42+42, expert, image, !saveCorr);
+  
+  //for DQM shifter
+  TH2F *hHmpPadMapRaws = new TH2F("hHmpPadMapRaws","HMP Pad Map;pad x;pad y;Q (ADC)",480,0,480,432,0,432);
+  Add2RawsList(hHmpPadMapRaws,14+14+42+42+1,!expert,image,!saveCorr);
+  
+  TProfile *fHmpPadOcc = new TProfile("fHmpPadOcc","HMP Average pad occupancy per DDL;;Pad occupancy (%)",14,0.5,14.5);
+  fHmpPadOcc->SetFillColor(5);
+  for(Int_t iddl=0;iddl<14;iddl++)  fHmpPadOcc->GetXaxis()->SetBinLabel(iddl+1,Form("DDL_%d",iddl+1));
+  Add2RawsList(fHmpPadOcc,14+14+42+42+2,!expert,image,!saveCorr);  
+  TH1F *hHmpPadQ = new TH1F("hHmpPadQ","HMP Pad charge distribution;pad Q (ADC);Entries",4100,0,4100);
+  hHmpPadQ->Sumw2();
+  Add2RawsList(hHmpPadQ,14+14+42+42+3,!expert,image,!saveCorr);  
+  
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDQADataMakerRec::InitESDs()
 {
   //
   //Booking ESDs histograms
-   TH2F*  hCkovP  = new TH2F("CkovP" , "#theta_{c}, [rad];P, [GeV]"   , 150,      0,  7  ,100, 0, 1)   ;
-   TH2F*  hSigP   = new TH2F("SigP"  ,"#sigma_{#theta_c} [mrad];[GeV]", 150,      0,  7  ,100, 0, 1)   ;
-   TH2F*  hDifXY  = new TH2F("DifXY" ,"diff"                          , 200,    -10, 10  ,200,-10,10)  ;
-   TH2F*  hMvsP = new TH2F("MvsP","Reconstructed Mass vs P",60,0,6,1000,0,1) ;
-   TH1F*  hPid[5];
-   hPid[0] = new TH1F("PidE" ,"electron response"              , 101, -0.005,1.005)             ;
-   hPid[1] = new TH1F("PidMu","#mu response"                   , 101, -0.005,1.005)             ;
-   hPid[2] = new TH1F("PidPi","#pi response"                   , 101, -0.005,1.005)             ;
-   hPid[3] = new TH1F("PidK" ,"K response"                     , 101, -0.005,1.005)             ;
-   hPid[4] = new TH1F("PidP" ,"p response"                     , 101, -0.005,1.005)             ;
-
-   Add2ESDsList(hCkovP,0);
-   Add2ESDsList(hSigP ,1);
-   Add2ESDsList(hDifXY,2);
-   Add2ESDsList(hMvsP,3);
-   for(Int_t i=0; i< 5; i++) Add2ESDsList(hPid[i],i+4);
-
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
 
+  TH2F*  hCkovP  = new TH2F("CkovP" , "#theta_{c}, [rad];P, [GeV]"   , 150,      0,  7  ,100, 0, 1)   ;
+  TH2F*  hSigP   = new TH2F("SigP"  ,"#sigma_{#theta_c} [mrad];[GeV]", 150,      0,  7  ,100, 0, 1)   ;
+  TH2F*  hDifXY  = new TH2F("DifXY" ,"diff"                          , 200,    -10, 10  ,200,-10,10)  ;
+  TH2F*  hMvsP = new TH2F("MvsP","Reconstructed Mass vs P",60,0,6,1000,0,1) ;
+  TH1F*  hPid[5];
+  hPid[0] = new TH1F("PidE" ,"electron response"              , 101, -0.005,1.005)             ;
+  hPid[1] = new TH1F("PidMu","#mu response"                   , 101, -0.005,1.005)             ;
+  hPid[2] = new TH1F("PidPi","#pi response"                   , 101, -0.005,1.005)             ;
+  hPid[3] = new TH1F("PidK" ,"K response"                     , 101, -0.005,1.005)             ;
+  hPid[4] = new TH1F("PidP" ,"p response"                     , 101, -0.005,1.005)             ;
+  
+  Add2ESDsList(hCkovP,0, !expert, image);
+  Add2ESDsList(hSigP ,1, expert, !image);
+  Add2ESDsList(hDifXY,2, !expert, image);
+  Add2ESDsList(hMvsP,3, expert, !image);
+  for(Int_t i=0; i< 5; i++) Add2ESDsList(hPid[i],i+4, expert, !image);
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDQADataMakerRec::MakeRaws(AliRawReader *rawReader)
@@ -171,29 +221,88 @@ void AliHMPIDQADataMakerRec::MakeRaws(AliRawReader *rawReader)
 //
 // Filling Raws QA histos
 //
+    rawReader->Reset() ; 
     AliHMPIDRawStream stream(rawReader);
-
+    Int_t shiftX[7]={320,160,320,160,0,160,0};
+    Int_t shiftY[7]={0,0,144,144,144,288,288};
+    Int_t ddlOcc[14]={0};  
+    Bool_t isHMPin=kFALSE;
     fEvtRaw++;
-
     while(stream.Next())
      {
        UInt_t ddl=stream.GetDDLNumber(); //returns 0,1,2 ... 13
+       isHMPin=kFALSE;
        if(ddl > 13) continue;
        for(Int_t iErr =1; iErr<(Int_t)AliHMPIDRawStream::kSumErr; iErr++){
-         Int_t numOfErr = stream.GetErrors(ddl,iErr);
-         GetRawsData(ddl)->Fill(iErr,numOfErr);
+       Int_t numOfErr = stream.GetErrors(ddl,iErr);
+       GetRawsData(ddl)->Fill(iErr,numOfErr);
+       ((TH2I*)GetRawsData(14+14+42+42))->Fill(iErr,ddl,iErr); //
        }
        UInt_t word; Int_t Nddl, r, d, a;//pc,pcX,pcY;      
        for(Int_t iPad=0;iPad<stream.GetNPads();iPad++) {
-       AliHMPIDDigit dig(stream.GetPadArray()[iPad],stream.GetChargeArray()[iPad]);dig.Raw(word,Nddl,r,d,a);
+       isHMPin=kTRUE;
+        AliHMPIDDigit dig(stream.GetPadArray()[iPad],stream.GetChargeArray()[iPad]);dig.Raw(word,Nddl,r,d,a);    
+       //for DQM shifter 
+       ((TH2F*)GetRawsData(14+14+42+42+1))->Fill(shiftX[(Int_t)(dig.Ch())]+dig.PadChX(),shiftY[(Int_t)(dig.Ch())]+dig.PadChY(),dig.Q());
+       GetRawsData(14+14+42+42+3)->Fill(dig.Q());
+       ddlOcc[ddl]++;
+       
        GetRawsData(ddl+14)->Fill(r,d);
        GetRawsData(28+stream.Pc(Nddl,r,d,a)+6*AliHMPIDParam::DDL2C(ddl))->Fill(stream.PadPcX(Nddl,r,d,a),stream.PadPcY(Nddl,r,d,a));
        GetRawsData(70+stream.Pc(Nddl,r,d,a)+6*AliHMPIDParam::DDL2C(ddl))->Fill(stream.GetChargeArray()[iPad]);
-       }      
+       }
+       if(isHMPin==kTRUE) {
+    for(Int_t iddl=0;iddl<14;iddl++){
+    GetRawsData(14+14+42+42+2)->Fill(iddl+1,ddlOcc[iddl]*100.0/(6.0*24.0*80));
+   }     
+       }       
      }
-   stream.Delete();
+
+    //   stream.Delete();
+     
+    
    
 }
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDQADataMakerRec::MakeDigits()
+{
+  //
+  //filling QA histos for Digits
+  //
+
+  Int_t i = fChannel ; 
+  GetDigitsData(0)->Fill(i,fDigitsArray->GetEntriesFast()/(48.*80.*6.));
+  TIter next(fDigitsArray); 
+  AliHMPIDDigit * digit; 
+  while ( (digit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
+    GetDigitsData(1)->Fill(10.*i+digit->Pc(),1./(48.*80.));
+    GetDigitsData(2+i)->Fill(digit->PadChX(),digit->PadChY());
+    GetDigitsData(9+i*6+digit->Pc())->Fill(digit->Q());
+  }  
+}  
+  
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDQADataMakerRec::MakeDigits(TTree * data)
+{
+  //
+  //Opening the Digit Tree
+  //
+
+  if(fDigitsArray) 
+    fDigitsArray->Clear() ; 
+  else
+    fDigitsArray=new TClonesArray("AliHMPIDDigit");
+  
+  for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){
+    fChannel = iCh ; 
+    fDigitsArray->Clear() ; 
+    data->SetBranchAddress(Form("HMPID%i",iCh),&fDigitsArray);
+    data->GetEntry(0);
+    MakeDigits();
+  }
+}
+
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
 {
@@ -201,16 +310,18 @@ void AliHMPIDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
   //filling QA histos for clusters
   //
   AliHMPIDParam *pPar =AliHMPIDParam::Instance();
-  
-  static TClonesArray *clusters;
-  if(!clusters) clusters = new TClonesArray("AliHMPIDCluster");
+  if (fRecPointsArray) 
+    fRecPointsArray->Clear() ; 
+  else 
+    fRecPointsArray = new TClonesArray("AliHMPIDCluster");
   
   for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){
     TBranch *branch = clustersTree->GetBranch(Form("HMPID%d",iCh));
-    branch->SetAddress(&clusters);
+    branch->SetAddress(&fRecPointsArray);
     branch->GetEntry(0);
-    GetRecPointsData(0)->Fill(iCh,clusters->GetEntries());
-    TIter next(clusters);
+    GetRecPointsData(0)->Fill(iCh,fRecPointsArray->GetEntries());
+    TIter next(fRecPointsArray);
     AliHMPIDCluster *clu;
     while ( (clu = dynamic_cast<AliHMPIDCluster *>(next())) ) {
       GetRecPointsData(1)->Fill(clu->Status(),iCh);
@@ -218,14 +329,11 @@ void AliHMPIDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
       if(clu->Q()>100) GetRecPointsData(2+iCh)->Fill(clu->Size());
       else {
         GetRecPointsData(2+7+iCh)->Fill(clu->Size());
-       GetRecPointsData(2+14+iCh*6+sect)->Fill(clu->Q());
+        GetRecPointsData(2+14+iCh*6+sect)->Fill(clu->Q());
       }    
       GetRecPointsData(2+14+42+iCh*6+sect)->Fill(clu->Q());
     }
   }
-
-  clusters->Clear();
-  
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDQADataMakerRec::MakeESDs(AliESDEvent * esd)
@@ -233,7 +341,7 @@ void AliHMPIDQADataMakerRec::MakeESDs(AliESDEvent * esd)
   //
   //fills QA histos for ESD
   //
-
   for(Int_t iTrk = 0 ; iTrk < esd->GetNumberOfTracks() ; iTrk++){
     AliESDtrack *pTrk = esd->GetTrack(iTrk) ;
     GetESDsData(0)->Fill(pTrk->GetP(),pTrk->GetHMPIDsignal());
@@ -264,17 +372,21 @@ void AliHMPIDQADataMakerRec::StartOfDetectorCycle()
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-void AliHMPIDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray *histos)
+void AliHMPIDQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray **histos)
 {
   //Detector specific actions at end of cycle
   // do the QA checking
- //  AliQAChecker::Instance()->Run(AliQA::kHMPID, task, obj);
-
-  if(task==AliQA::kRAWS) {
-    for(Int_t iddl=0;iddl<14;iddl++) {
-     TH1F *h = (TH1F*)histos->At(14+iddl); //ddl histos scaled by the number of events 
-     h->Scale(1./(Float_t)fEvtRaw);
-    }
+  
+  if(task==AliQAv1::kRAWS) {
+    for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+      if (! IsValidEventSpecie(specie, histos) )
+        continue ;
+      for(Int_t iddl=0;iddl<14;iddl++) {
+        TH1F *h = (TH1F*)histos[specie]->At(14+iddl); //ddl histos scaled by the number of events 
+        h->Scale(1./(Float_t)fEvtRaw);
+      }
+     }
   }
+   AliQAChecker::Instance()->Run(AliQAv1::kHMPID, task, histos);
 }