]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/AliZDCQADataMakerSim.cxx
Worng indexes fixed
[u/mrichter/AliRoot.git] / ZDC / AliZDCQADataMakerSim.cxx
index 11c712ea97137f328e6bad35dade644eaefc0a64..949fbcc2f1e128b73197c961c93abe7ffc42e706 100644 (file)
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-// --- Standard library ---
-#include <Riostream.h>
-// --- ROOT system ---
-#include <TClonesArray.h>
-#include <TFile.h> 
-#include <TH1F.h> 
-#include <TH2F.h>
-#include <TBranch.h>
-#include <TTree.h>
-// --- AliRoot header files ---
-#include "AliLog.h"
-#include "AliQAChecker.h"
-#include "AliZDCQADataMakerSim.h"
-#include "AliZDCHit.h"
-#include "AliZDCDigit.h"
-#include "AliZDCRawStream.h"
-
-ClassImp(AliZDCQADataMakerSim)
-           
-//____________________________________________________________________________ 
-  AliZDCQADataMakerSim::AliZDCQADataMakerSim() : 
-  AliQADataMakerSim(AliQA::GetDetName(AliQA::kZDC), "ZDC Quality Assurance Data Maker")
-{
-  // ctor
-}
-
-//____________________________________________________________________________ 
-AliZDCQADataMakerSim::AliZDCQADataMakerSim(const AliZDCQADataMakerSim& qadm) :
-  AliQADataMakerSim() 
-{
-  //copy ctor 
-  SetName((const char*)qadm.GetName()); 
-  SetTitle((const char*)qadm.GetTitle()); 
-}
-
-//__________________________________________________________________
-AliZDCQADataMakerSim& AliZDCQADataMakerSim::operator = (const AliZDCQADataMakerSim& qadm )
-{
-  // Equal operator.
-  this->~AliZDCQADataMakerSim();
-  new(this) AliZDCQADataMakerSim(qadm);
-  return *this;
-}
-//____________________________________________________________________________ 
-void AliZDCQADataMakerSim::InitHits()
-{
-  // create Hits histograms in Hits subdir
-  //
-  TH2F * hZNCh  = new TH2F("hZNCh", "Hits centroid in ZNC", 100, -5.,5.,100,-5.,5.);
-  TH2F * hZNAh  = new TH2F("hZNAh", "Hits centroid in ZNA", 100, -5.,5.,100,-5.,5.);
-  TH2F * hZPCh  = new TH2F("hZPCh", "Hits centroid in ZPC", 100,-12.,12.,100,-12.,12.); 
-  TH2F * hZPAh  = new TH2F("hZPAh", "Hits centroid in ZPA", 100,-12.,12.,100,-12.,12.); 
-  Add2HitsList(hZNCh, 0);
-  Add2HitsList(hZPCh, 1);
-  Add2HitsList(hZNAh, 2);
-  Add2HitsList(hZPAh, 3);
-}
-
-
-//____________________________________________________________________________ 
-void AliZDCQADataMakerSim::InitDigits()
-{
-  // create Digits histograms in Digits subdir
-  //
-  TH1F * hDigZNCTot = new TH1F("hDigZNCTot", "Digit signal in ZNC", 100, 0., 6000.);
-  TH1F * hDigZNATot = new TH1F("hDigZNATot", "Digit signal in ZNA", 100, 0., 6000.);
-  TH1F * hDigZPCTot = new TH1F("hDigZPCTot", "Digit signal in ZPC", 100, 0., 10000.);
-  TH1F * hDigZPATot = new TH1F("hDigZPATot", "Digit signal in ZPA", 100, 0., 10000.);
-  Add2DigitsList(hDigZNCTot, 0);
-  Add2DigitsList(hDigZPCTot, 1);
-  Add2DigitsList(hDigZNATot, 2);
-  Add2DigitsList(hDigZPATot, 3);
-  //
-  TH1F * hDigSumQZNC = new TH1F("hDigSumQZNC", "Signal in 4 ZNC PMQ[i]",100, 0., 4000.);
-  TH1F * hDigSumQZPC = new TH1F("hDigSumQZPC", "Signal in 4 ZPC PMQ[i]",100, 0., 4000.);
-  TH1F * hDigSumQZNA = new TH1F("hDigSumQZNA", "Signal in 4 ZNA PMQ[i]",100, 0., 4000.);
-  TH1F * hDigSumQZPA = new TH1F("hDigSumQZPA", "Signal in 4 ZPA PMQ[i]",100, 0., 4000.);
-  Add2DigitsList(hDigSumQZNC, 4);
-  Add2DigitsList(hDigSumQZPC, 5);
-  Add2DigitsList(hDigSumQZNA, 6);
-  Add2DigitsList(hDigSumQZPA, 7);
-  //
-  TH1F * hDigPMCZNC = new TH1F("hDigPMCZNC", "Signal in 4 ZNC PMQ[i]",100, 0., 4000.);
-  TH1F * hDigPMCZPC = new TH1F("hDigPMCZPC", "Signal in 4 ZPC PMQ[i]",100, 0., 4000.);
-  TH1F * hDigPMCZNA = new TH1F("hDigPMCZNA", "Signal in 4 ZNA PMQ[i]",100, 0., 4000.);
-  TH1F * hDigPMCZPA = new TH1F("hDigPMCZPA", "Signal in 4 ZPA PMQ[i]",100, 0., 4000.);
-  Add2DigitsList(hDigPMCZNC, 8);
-  Add2DigitsList(hDigPMCZPC, 9);
-  Add2DigitsList(hDigPMCZNA, 10);
-  Add2DigitsList(hDigPMCZPA, 11);
-  // 
-  // ------------------- LOW GAIN CHAIN ---------------------------
-  TH1F * hDigZNCTotlg = new TH1F("hDigZNCTotlg", "Digit lg signal in ZNC", 100, 0., 6000.);
-  TH1F * hDigZNATotlg = new TH1F("hDigZNATotlg", "Digit lg signal in ZNA", 100, 0., 6000.);
-  TH1F * hDigZPCTotlg = new TH1F("hDigZPCTotlg", "Digit lg signal in ZPC", 100, 0., 10000.);
-  TH1F * hDigZPATotlg = new TH1F("hDigZPATotlg", "Digit lg signal in ZPA", 100, 0., 10000.);
-  Add2DigitsList(hDigZNCTotlg, 12);
-  Add2DigitsList(hDigZPCTotlg, 13);
-  Add2DigitsList(hDigZNATotlg, 14);
-  Add2DigitsList(hDigZPATotlg, 15);
-  //
-  TH1F * hDigSumQZNClg = new TH1F("hDigSumQZNClg", "Signal in 4 ZNC PMQlg[i]",100, 0., 4000.);
-  TH1F * hDigSumQZPClg = new TH1F("hDigSumQZPClg", "Signal in 4 ZPC PMQlg[i]",100, 0., 4000.);
-  TH1F * hDigSumQZNAlg = new TH1F("hDigSumQZNAlg", "Signal in 4 ZNA PMQlg[i]",100, 0., 4000.);
-  TH1F * hDigSumQZPAlg = new TH1F("hDigSumQZPAlg", "Signal in 4 ZPA PMQlg[i]",100, 0., 4000.);
-  Add2DigitsList(hDigSumQZNClg, 16);
-  Add2DigitsList(hDigSumQZPClg, 17);
-  Add2DigitsList(hDigSumQZNAlg, 18);
-  Add2DigitsList(hDigSumQZPAlg, 19);
-  //
-  TH1F * hDigPMCZNClg = new TH1F("hDigPMCZNClg", "Signal in 4 ZNC PMQlg[i]",100, 0., 4000.);
-  TH1F * hDigPMCZPClg = new TH1F("hDigPMCZPClg", "Signal in 4 ZPC PMQlg[i]",100, 0., 4000.);
-  TH1F * hDigPMCZNAlg = new TH1F("hDigPMCZNAlg", "Signal in 4 ZNA PMQlg[i]",100, 0., 4000.);
-  TH1F * hDigPMCZPAlg = new TH1F("hDigPMCZPAlg", "Signal in 4 ZPA PMQlg[i]",100, 0., 4000.);
-  Add2DigitsList(hDigPMCZNClg, 20);
-  Add2DigitsList(hDigPMCZPClg, 21);
-  Add2DigitsList(hDigPMCZNAlg, 22);
-  Add2DigitsList(hDigPMCZPAlg, 23);
-}
-
-//____________________________________________________________________________
-void AliZDCQADataMakerSim::MakeHits(TClonesArray * data)
-{
-  //filling QA histos for Hits
-  //
-  TClonesArray * hits = dynamic_cast<TClonesArray *>(data); 
-  if(!hits){
-    AliError("Wrong type of hits container"); 
-  } 
-  else {
-    TIter next(hits); 
-    AliZDCHit * hit; 
-    while((hit = dynamic_cast<AliZDCHit *>(next()))){
-      if(hit->GetVolume(0)==1) GetHitsData(0)->Fill(hit->GetXImpact(),hit->GetYImpact());
-      else if(hit->GetVolume(0)==2) GetHitsData(1)->Fill(hit->GetXImpact(), hit->GetYImpact());
-      else if(hit->GetVolume(0)==4) GetHitsData(2)->Fill(hit->GetXImpact(), hit->GetYImpact());
-      else if(hit->GetVolume(0)==5) GetHitsData(3)->Fill(hit->GetXImpact(), hit->GetYImpact());
-    }
-  } 
-
-}
-
-//___________________________________________________________________________
-void AliZDCQADataMakerSim::MakeHits(TTree * hitTree)
-{
-  // make QA data from Hit Tree
-  //
-  if(!hitTree){
-    AliError("Hit Tree not found!"); 
-    return;
-  }
-  //
-  TBranch * branch = hitTree->GetBranch("ZDC") ;
-  if(!branch){
-    AliError("ZDC branch in Hit Tree not found!"); 
-    return;
-  }
-  else{
-    //
-    TClonesArray * hits = new TClonesArray("AliZDCHit", 1000);
-    //
-    Int_t ntracks = (Int_t) hitTree->GetEntries();
-    if (ntracks<=0) return;
-    //
-    for(Int_t itrack=0; itrack<ntracks; itrack++){
-      branch->SetAddress(&hits) ;
-      branch->GetEntry(itrack);
-      //
-      MakeHits(hits); 
-    }    
-  }
-}
-
-//____________________________________________________________________________
-void AliZDCQADataMakerSim::MakeDigits(TClonesArray * digits)
-{
-  // makes data from Digits
-  //
-  TIter next(digits) ; 
-  AliZDCDigit * digit ; 
-  //
-  Float_t ADCSum_ZNC=0., ADCSum_ZNA=0., ADCSum_ZPC=0., ADCSum_ZPA=0.;
-  Float_t ADCSumQ_ZNC=0., ADCSumQ_ZNA=0., ADCSumQ_ZPC=0., ADCSumQ_ZPA=0.;
-  Float_t ADCSum_ZNC_lg=0., ADCSum_ZNA_lg=0., ADCSum_ZPC_lg=0., ADCSum_ZPA_lg=0.;
-  Float_t ADCSumQ_ZNC_lg=0., ADCSumQ_ZNA_lg=0., ADCSumQ_ZPC_lg=0., ADCSumQ_ZPA_lg=0.;
-  //
-  while((digit = dynamic_cast<AliZDCDigit *>(next()))){
-    if(digit->GetSector(0)==1){
-      ADCSum_ZNC += digit->GetADCValue(0);
-      ADCSum_ZNC_lg += digit->GetADCValue(1);
-      //
-      if(digit->GetSector(1)!=0){
-        ADCSumQ_ZNC += digit->GetADCValue(0);
-        ADCSumQ_ZNC_lg+= digit->GetADCValue(1);
-      }
-      else{
-        GetDigitsData(8)->Fill(digit->GetADCValue(0));
-        GetDigitsData(20)->Fill(digit->GetADCValue(1));
-      }
-    }
-    else if(digit->GetSector(0)==2){
-      ADCSum_ZPC += digit->GetADCValue(0);
-      ADCSum_ZPC_lg += digit->GetADCValue(1);
-      //
-      if(digit->GetSector(1)!=0){
-        ADCSumQ_ZPC += digit->GetADCValue(0);
-        ADCSumQ_ZPC_lg+= digit->GetADCValue(1);
-      }
-      else{
-        GetDigitsData(9)->Fill(digit->GetADCValue(0));
-        GetDigitsData(21)->Fill(digit->GetADCValue(1));
-      }
-    }
-    else if(digit->GetSector(0)==4){
-      ADCSum_ZNA += digit->GetADCValue(0);
-      ADCSum_ZNA_lg += digit->GetADCValue(1);
-      //
-      if(digit->GetSector(1)!=0){
-        ADCSumQ_ZNA += digit->GetADCValue(0);
-        ADCSumQ_ZNA_lg+= digit->GetADCValue(1);
-      }
-      else{
-        GetDigitsData(10)->Fill(digit->GetADCValue(0));
-        GetDigitsData(22)->Fill(digit->GetADCValue(1));
-      }
-    }
-    else if(digit->GetSector(0)==5){
-      ADCSum_ZPA += digit->GetADCValue(0);
-      ADCSum_ZPA_lg += digit->GetADCValue(1);
-      //
-      if(digit->GetSector(1)!=0){
-        ADCSumQ_ZPA += digit->GetADCValue(0);
-        ADCSumQ_ZPA_lg+= digit->GetADCValue(1);
-      }
-      else{
-        GetDigitsData(11)->Fill(digit->GetADCValue(0));
-        GetDigitsData(23)->Fill(digit->GetADCValue(1));
-      }
-    }
-  }
-  //
-  GetDigitsData(0)->Fill(ADCSum_ZNC);
-  GetDigitsData(1)->Fill(ADCSum_ZPC);
-  GetDigitsData(2)->Fill(ADCSum_ZNA);
-  GetDigitsData(3)->Fill(ADCSum_ZPA);
-  //
-  GetDigitsData(4)->Fill(ADCSumQ_ZNC);
-  GetDigitsData(5)->Fill(ADCSumQ_ZPC);
-  GetDigitsData(6)->Fill(ADCSumQ_ZNA);
-  GetDigitsData(7)->Fill(ADCSumQ_ZPA);
-  //
-  GetDigitsData(12)->Fill(ADCSum_ZNC_lg);
-  GetDigitsData(13)->Fill(ADCSum_ZPC_lg);
-  GetDigitsData(14)->Fill(ADCSum_ZNA_lg);
-  GetDigitsData(15)->Fill(ADCSum_ZPA_lg);
-  //
-  GetDigitsData(16)->Fill(ADCSumQ_ZNC_lg);
-  GetDigitsData(17)->Fill(ADCSumQ_ZPC_lg);
-  GetDigitsData(18)->Fill(ADCSumQ_ZNA_lg);
-  GetDigitsData(19)->Fill(ADCSumQ_ZPA_lg);
-   
-}
-//___________________________________________________________________________
-void AliZDCQADataMakerSim::MakeDigits(TTree *digitTree )
-{
-   // makes data from Digit Tree
-   TClonesArray * digits = new TClonesArray("AliZDCDigit", 1000); 
-   //
-   TBranch * branch = digitTree->GetBranch("ZDC");
-   if(!branch){
-      AliError("ZDC branch in Digit Tree not found"); 
-      return;
-   } 
-   branch->SetAddress(&digits) ;
-   branch->GetEntry(0) ; 
-   MakeDigits(digits) ; 
-}
-
-//____________________________________________________________________________
-void AliZDCQADataMakerSim::StartOfDetectorCycle()
-{
-  //Detector specific actions at start of cycle
-  
-}
-
-//____________________________________________________________________________ 
-void AliZDCQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
-{
-  //Detector specific actions at end of cycle
-  // do the QA checking
-  AliQAChecker::Instance()->Run(AliQA::kZDC, task, list);  
-}
+/**************************************************************************\r
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ *                                                                        *\r
+ * Author: The ALICE Off-line Project.                                    *\r
+ * Contributors are mentioned in the code where appropriate.              *\r
+ *                                                                        *\r
+ * Permission to use, copy, modify and distribute this software and its   *\r
+ * documentation strictly for non-commercial purposes is hereby granted   *\r
+ * without fee, provided that the above copyright notice appears in all   *\r
+ * copies and that both the copyright notice and this permission notice   *\r
+ * appear in the supporting documentation. The authors make no claims     *\r
+ * about the suitability of this software for any purpose. It is          *\r
+ * provided "as is" without express or implied warranty.                  *\r
+ **************************************************************************/\r
+\r
+// --- Standard library ---\r
+#include <Riostream.h>\r
+// --- ROOT system ---\r
+#include <TClonesArray.h>\r
+#include <TFile.h>     \r
+#include <TH1F.h> \r
+#include <TH2F.h>\r
+#include <TBranch.h>\r
+#include <TTree.h>\r
+// --- AliRoot header files ---\r
+#include "AliLog.h"\r
+#include "AliQAChecker.h"\r
+#include "AliZDCQADataMakerSim.h"\r
+#include "AliZDCHit.h"\r
+#include "AliZDCDigit.h"\r
+\r
+ClassImp(AliZDCQADataMakerSim)\r
+           \r
+//____________________________________________________________________________ \r
+  AliZDCQADataMakerSim::AliZDCQADataMakerSim() : \r
+      AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kZDC), "ZDC Quality Assurance Data Maker")\r
+{\r
+  // ctor\r
+}\r
+\r
+//____________________________________________________________________________ \r
+AliZDCQADataMakerSim::AliZDCQADataMakerSim(const AliZDCQADataMakerSim& qadm) :\r
+    AliQADataMakerSim()\r
+{\r
+  //copy ctor \r
+  SetName((const char*)qadm.GetName()); \r
+  SetTitle((const char*)qadm.GetTitle()); \r
+}\r
+\r
+//__________________________________________________________________\r
+AliZDCQADataMakerSim& AliZDCQADataMakerSim::operator = (const AliZDCQADataMakerSim& qadm )\r
+{\r
+  // Equal operator.\r
+  this->~AliZDCQADataMakerSim();\r
+  new(this) AliZDCQADataMakerSim(qadm);\r
+  return *this;\r
+}\r
\r
+//____________________________________________________________________________ \r
+void AliZDCQADataMakerSim::InitHits()\r
+{\r
+  // create Hits histograms in Hits subdir\r
+  //\r
+  const Bool_t expert   = kTRUE ; \r
+  const Bool_t image    = kTRUE ; \r
+\r
+  TH1F * hHitsZNCTot = new TH1F("hHitsZNCTot", "Signal in ZNC; N_{phe}", 100, 0., 6000.);\r
+  TH1F * hHitsZNATot = new TH1F("hHitsZNATot", "Signal in ZNA; N_{phe}", 100, 0., 6000.);\r
+  TH1F * hHitsZPCTot = new TH1F("hHitsZPCTot", "Signal in ZPC; N_{phe}", 100, 0., 6000.);\r
+  TH1F * hHitsZPATot = new TH1F("hHitsZPATot", "Signal in ZPA; N_{phe}", 100, 0., 6000.);\r
+  Add2HitsList(hHitsZNCTot, 0, !expert, image);\r
+  Add2HitsList(hHitsZNATot, 1, !expert, image);\r
+  Add2HitsList(hHitsZPCTot, 2, !expert, image);\r
+  Add2HitsList(hHitsZPATot, 3, !expert, image);\r
+  //\r
+  TH1F * hHitsSumQZNC = new TH1F("hHitsSumQZNC", "Signal in 4 ZNC PMQ; N_{phe}",100, 0., 4000.);\r
+  TH1F * hHitsSumQZNA = new TH1F("hHitsSumQZNA", "Signal in 4 ZNA PMQ; N_{phe}",100, 0., 4000.);\r
+  TH1F * hHitsSumQZPC = new TH1F("hHitsSumQZPC", "Signal in 4 ZPC PMQ; N_{phe}",100, 0., 4000.);\r
+  TH1F * hHitsSumQZPA = new TH1F("hHitsSumQZPA", "Signal in 4 ZPA PMQ; N_{phe}",100, 0., 4000.);\r
+  Add2HitsList(hHitsSumQZNC, 4, expert, !image);\r
+  Add2HitsList(hHitsSumQZNA, 5, expert, !image);\r
+  Add2HitsList(hHitsSumQZPC, 6, expert, !image);\r
+  Add2HitsList(hHitsSumQZPA, 7, expert, !image);\r
+  //\r
+  TH1F * hHitsPMCZNC = new TH1F("hHitsPMCZNC", "Signal in ZNC PMC; N_{phe}",100, 0., 4000.);\r
+  TH1F * hHitsPMCZNA = new TH1F("hHitsPMCZNA", "Signal in ZNA PMC; N_{phe}",100, 0., 4000.);\r
+  TH1F * hHitsPMCZPC = new TH1F("hHitsPMCZPC", "Signal in ZPC PMC; N_{phe}",100, 0., 4000.);\r
+  TH1F * hHitsPMCZPA = new TH1F("hHitsPMCZPA", "Signal in ZPA PMC; N_{phe}",100, 0., 4000.);\r
+  Add2HitsList(hHitsPMCZNC, 8, expert, !image);\r
+  Add2HitsList(hHitsPMCZNA, 9, expert, !image);\r
+  Add2HitsList(hHitsPMCZPC, 10, expert, !image);\r
+  Add2HitsList(hHitsPMCZPA, 11, expert, !image);\r
+  \r
+  ClonePerTrigClass(AliQAv1::kHITS); // this should be the last line\r
+}\r
+\r
+\r
+//____________________________________________________________________________ \r
+void AliZDCQADataMakerSim::InitDigits()\r
+{\r
+  // create Digits histograms in Digits subdir\r
+  //\r
+  const Bool_t expert   = kTRUE ; \r
+  const Bool_t image    = kTRUE ; \r
+  \r
+  // ------------------- HIGH GAIN CHAIN ---------------------------\r
+  TH1F * hDigZNCTot = new TH1F("hDigZNCTot", "Signal in ZNC;Amplitude [ADC counts];Counts", 100, 0., 6000.);\r
+  TH1F * hDigZNATot = new TH1F("hDigZNATot", "Signal in ZNA;Amplitude [ADC counts];Counts", 100, 0., 6000.);\r
+  TH1F * hDigZPCTot = new TH1F("hDigZPCTot", "Signal in ZPC;Amplitude [ADC counts];Counts", 100, 0., 6000.);\r
+  TH1F * hDigZPATot = new TH1F("hDigZPATot", "Signal in ZPA;Amplitude [ADC counts];Counts", 100, 0., 6000.);\r
+  Add2DigitsList(hDigZNCTot, 0, !expert, image);\r
+  Add2DigitsList(hDigZNATot, 1, !expert, image);\r
+  Add2DigitsList(hDigZPCTot, 2, !expert, image);\r
+  Add2DigitsList(hDigZPATot, 3, !expert, image);\r
+  //\r
+  TH1F * hDigSumQZNC = new TH1F("hDigSumQZNC", "Signal in 4 ZNC PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.);\r
+  TH1F * hDigSumQZNA = new TH1F("hDigSumQZNA", "Signal in 4 ZNA PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.);\r
+  TH1F * hDigSumQZPC = new TH1F("hDigSumQZPC", "Signal in 4 ZPC PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.);\r
+  TH1F * hDigSumQZPA = new TH1F("hDigSumQZPA", "Signal in 4 ZPA PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.);\r
+  Add2DigitsList(hDigSumQZNC, 4, expert, !image);\r
+  Add2DigitsList(hDigSumQZNA, 5, expert, !image);\r
+  Add2DigitsList(hDigSumQZPC, 6, expert, !image);\r
+  Add2DigitsList(hDigSumQZPA, 7, expert, !image);\r
+  //\r
+  TH1F * hDigPMCZNC = new TH1F("hDigPMCZNC", "Signal in ZNC PMC;Amplitude [ADC counts];Counts",100, 0., 4000.);\r
+  TH1F * hDigPMCZNA = new TH1F("hDigPMCZNA", "Signal in ZNA PMC;Amplitude [ADC counts];Counts",100, 0., 4000.);\r
+  TH1F * hDigPMCZPC = new TH1F("hDigPMCZPC", "Signal in ZPC PMC;Amplitude [ADC counts];Counts",100, 0., 4000.);\r
+  TH1F * hDigPMCZPA = new TH1F("hDigPMCZPA", "Signal in ZPA PMC;Amplitude [ADC counts];Counts",100, 0., 4000.);\r
+  Add2DigitsList(hDigPMCZNC, 8, expert, !image);\r
+  Add2DigitsList(hDigPMCZNA, 9, expert, !image);\r
+  Add2DigitsList(hDigPMCZPC, 10, expert, !image);\r
+  Add2DigitsList(hDigPMCZPA, 11, expert, !image);\r
+  // \r
+  //\r
+  ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line\r
+}\r
+\r
+//____________________________________________________________________________\r
+void AliZDCQADataMakerSim::MakeHits()\r
+{\r
+  //filling QA histos for Hits\r
+\r
+  // Check id histograms already created for this Event Specie\r
+  if( !GetHitsData(0) ) InitHits();\r
+  \r
+  TIter next(fHitsArray); \r
+  AliZDCHit * hit; \r
+  Float_t adcSum_ZNC=0., adcSum_ZNA=0., adcSum_ZPC=0., adcSum_ZPA=0.;\r
+  Float_t adcSumQ_ZNC=0., adcSumQ_ZNA=0., adcSumQ_ZPC=0., adcSumQ_ZPA=0.;\r
+  while((hit = dynamic_cast<AliZDCHit *>(next()))){\r
+    if(hit->GetVolume(0)==1){\r
+       adcSumQ_ZNC += hit->GetLightPMQ();\r
+       adcSum_ZNC  += hit->GetLightPMC() + hit->GetLightPMQ();\r
+       //\r
+       FillHitsData(8,hit->GetLightPMC());\r
+    }\r
+    else if(hit->GetVolume(0)==4){\r
+       adcSumQ_ZNA += hit->GetLightPMQ();\r
+       adcSum_ZNA  += hit->GetLightPMC() + hit->GetLightPMQ();\r
+       //\r
+       FillHitsData(9,hit->GetLightPMC());\r
+    }\r
+    else if(hit->GetVolume(0)==2){\r
+       adcSumQ_ZNC += hit->GetLightPMQ();\r
+       adcSum_ZNC  += hit->GetLightPMC() + hit->GetLightPMQ();\r
+       //\r
+       FillHitsData(10,hit->GetLightPMC());\r
+    }\r
+    else if(hit->GetVolume(0)==5){\r
+       adcSumQ_ZNC += hit->GetLightPMQ();\r
+       adcSum_ZNC  += hit->GetLightPMC() + hit->GetLightPMQ();\r
+       //\r
+       FillHitsData(11,hit->GetLightPMC());\r
+    }\r
+    //\r
+    FillHitsData(0,adcSum_ZNC);\r
+    FillHitsData(1,adcSum_ZNA);\r
+    FillHitsData(2,adcSum_ZPC);\r
+    FillHitsData(3,adcSum_ZPA);\r
+    //\r
+    FillHitsData(4,adcSumQ_ZNC);\r
+    FillHitsData(5,adcSumQ_ZNA);\r
+    FillHitsData(6,adcSumQ_ZPC);\r
+    FillHitsData(7,adcSumQ_ZPA);\r
+  }\r
+}\r
+\r
+//___________________________________________________________________________\r
+void AliZDCQADataMakerSim::MakeHits(TTree * hitTree)\r
+{\r
+  // make QA data from Hit Tree\r
+  if(!hitTree){\r
+    AliError("Can't get ZDC hit tree!!");\r
+    return; \r
+  }    \r
+\r
+  TBranch * branch = hitTree->GetBranch("ZDC") ;\r
+\r
+  if(!branch){\r
+    AliError("ZDC branch in Hit Tree not found!"); \r
+    return;\r
+  } \r
+  \r
+  if(fHitsArray) fHitsArray->Clear() ; \r
+  else fHitsArray = new TClonesArray("AliZDCHit", 1000);\r
\r
+  branch->SetAddress(&fHitsArray) ;\r
+  for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {\r
+    branch->GetEntry(ientry) ;\r
+    MakeHits() ; \r
+    fHitsArray->Clear() ; \r
+  }   \r
+  //\r
+  IncEvCountCycleHits();\r
+  IncEvCountTotalHits();\r
+  //\r
+}\r
+\r
+//___________________________________________________________________________\r
+void AliZDCQADataMakerSim::MakeDigits(TTree *digitTree)\r
+{\r
+  // makes data from Digit Tree\r
+  if( !GetDigitsData(0) ) InitDigits();\r
+\r
+  if(!digitTree){\r
+    AliError("Can't get ZDC digit tree!!");\r
+    return; \r
+  }    \r
+   \r
+  TBranch * branch = digitTree->GetBranch("ZDC");\r
+  if(!branch){\r
+    AliError("ZDC branch in digit tree not found"); \r
+    return;\r
+  } \r
+    \r
+  AliZDCDigit *digit = 0x0;\r
+  branch->SetAddress(&digit);\r
+     \r
+  Float_t adcSum_ZNC=0., adcSum_ZNA=0., adcSum_ZPC=0., adcSum_ZPA=0.;\r
+  Float_t adcSumQ_ZNC=0., adcSumQ_ZNA=0., adcSumQ_ZPC=0., adcSumQ_ZPA=0.;\r
+  //  Float_t adcSum_ZNC_lg=0., adcSum_ZNA_lg=0., adcSum_ZPC_lg=0., adcSum_ZPA_lg=0.;\r
+  //  Float_t adcSumQ_ZNC_lg=0., adcSumQ_ZNA_lg=0., adcSumQ_ZPC_lg=0., adcSumQ_ZPA_lg=0.;\r
+  \r
+  Int_t ndig = digitTree->GetEntries();\r
+  for(Int_t i=0; i<ndig; i++){\r
+      branch->GetEntry(i);\r
+      \r
+      if(digit->GetSector(0)==1 && digit->GetSector(1)!=5){\r
+         adcSum_ZNC += digit->GetADCValue(0);\r
+         //adcSum_ZNC_lg += digit->GetADCValue(1);\r
+         //\r
+         if(digit->GetSector(1)!=0){\r
+             adcSumQ_ZNC += digit->GetADCValue(0);\r
+             //adcSumQ_ZNC_lg+= digit->GetADCValue(1);\r
+         }\r
+         else{\r
+             FillDigitsData(8,digit->GetADCValue(0));\r
+             //FillDigitsData(20,digit->GetADCValue(1));\r
+         }\r
+      }\r
+      else if(digit->GetSector(0)==2){\r
+         adcSum_ZPC += digit->GetADCValue(0);\r
+         //adcSum_ZPC_lg += digit->GetADCValue(1);\r
+         //\r
+         if(digit->GetSector(1)!=0){\r
+             adcSumQ_ZPC += digit->GetADCValue(0);\r
+             //adcSumQ_ZPC_lg+= digit->GetADCValue(1);\r
+         }\r
+         else{\r
+             FillDigitsData(10,digit->GetADCValue(0));\r
+             //FillDigitsData(22,digit->GetADCValue(1));\r
+         }\r
+      }\r
+      else if(digit->GetSector(0)==4 && digit->GetSector(1)!=5){\r
+         adcSum_ZNA += digit->GetADCValue(0);\r
+         //adcSum_ZNA_lg += digit->GetADCValue(1);\r
+         //\r
+         if(digit->GetSector(1)!=0){\r
+             adcSumQ_ZNA += digit->GetADCValue(0);\r
+             //adcSumQ_ZNA_lg+= digit->GetADCValue(1);\r
+         }\r
+         else{\r
+             FillDigitsData(9,digit->GetADCValue(0));\r
+             //FillDigitsData(21,digit->GetADCValue(1));\r
+         }\r
+      }\r
+      else if(digit->GetSector(0)==5){\r
+         adcSum_ZPA += digit->GetADCValue(0);\r
+         //adcSum_ZPA_lg += digit->GetADCValue(1);\r
+         //\r
+         if(digit->GetSector(1)!=0){\r
+             adcSumQ_ZPA += digit->GetADCValue(0);\r
+             //adcSumQ_ZPA_lg+= digit->GetADCValue(1);\r
+         }\r
+         else{\r
+             FillDigitsData(11,digit->GetADCValue(0));\r
+             //FillDigitsData(23,digit->GetADCValue(1));\r
+         }\r
+      }\r
+  }\r
+  //\r
+  FillDigitsData(0,adcSum_ZNC);\r
+  FillDigitsData(1,adcSum_ZNA);\r
+  FillDigitsData(2,adcSum_ZPC);\r
+  FillDigitsData(3,adcSum_ZPA);\r
+  //\r
+  FillDigitsData(4,adcSumQ_ZNC);\r
+  FillDigitsData(5,adcSumQ_ZNA);\r
+  FillDigitsData(6,adcSumQ_ZPC);\r
+  FillDigitsData(7,adcSumQ_ZPA);\r
+  //\r
+  IncEvCountCycleDigits();\r
+  IncEvCountTotalDigits();\r
+  //\r
+}\r
+\r
+//____________________________________________________________________________\r
+void AliZDCQADataMakerSim::StartOfDetectorCycle()\r
+{\r
+  //Detector specific actions at start of cycle\r
+  \r
+}\r
+\r
+//____________________________________________________________________________ \r
+void AliZDCQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)\r
+{\r
+  // Detector specific actions at end of cycle\r
+  // do the QA checking\r
+  ResetEventTrigClasses();\r
+  AliQAChecker::Instance()->Run(AliQAv1::kZDC, task, list);  \r
+}\r