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