]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/AliZDCQADataMakerRec.cxx
Updating filling condition for DQM histos
[u/mrichter/AliRoot.git] / ZDC / AliZDCQADataMakerRec.cxx
index 75d3be00e6f21cf59f3b1d7fde0d08cab00da1da..0c696432103be853e09d12b1f322ab3907f9052f 100644 (file)
@@ -147,6 +147,7 @@ void AliZDCQADataMakerRec::InitRaws()
   TH1F * hZPCSpectrum = new TH1F("hZPCSpectrum","ZPC spectrum;Amplitude [ADC counts];Counts",100,0.,1200.);
   TH1F * hZNASpectrum = new TH1F("hZNASpectrum","ZNA spectrum;Amplitude [ADC counts];Counts",100,0.,1200.);
   TH1F * hZPASpectrum = new TH1F("hZPASpectrum","ZPA spectrum;Amplitude [ADC counts];Counts",100,0.,1200.);
+  // Booking from ch. 8 for checked signals to avoid running QA on pedestals!
   TH1F * hZEM1Spectrum = new TH1F("hZEM1Spectrum","ZEM1 spectrum;Amplitude [ADC counts];Counts",100,8., 1208.);
   TH1F * hZEM2Spectrum = new TH1F("hZEM2Spectrum","ZEM2 spectrum;Amplitude [ADC counts];Counts",100,8., 1208.);
   Add2RawsList(hZNCSpectrum, 0, expert, !image);
@@ -173,30 +174,39 @@ void AliZDCQADataMakerRec::InitRaws()
   Add2RawsList(hRawSumQZPC, 12, expert, !image);
   Add2RawsList(hRawSumQZPA, 13, expert, !image);
   
-  TH1F * hRawTDCZEM1 = new TH1F("hRawTDCZEM1", "Raw TDC ZEM1;TDC [ns]",160, -350., -310.);
-  Add2RawsList(hRawTDCZEM1, 14, expert, !image);
-  TH1F * hRawTDCZPC = new TH1F("hRawTDCZPC", "Raw TDC ZPC;TDC [ns]",160, -350., -310.);
+  TH1F * hRawTDCZNC = new TH1F("hRawTDCZNC", "TDC ZNC;TDC [ns]",160, -320., -260.);
+  Add2RawsList(hRawTDCZNC, 14, expert, !image);
+  TH1F * hRawTDCZPC = new TH1F("hRawTDCZPC", "TDC ZPC;TDC [ns]",160, -340., -280.);
   Add2RawsList(hRawTDCZPC, 15, expert, !image);
+  TH1F * hRawTDCZNA = new TH1F("hRawTDCZNA", "TDC ZNA;TDC [ns]",160, -340., -280.);
+  Add2RawsList(hRawTDCZNA, 16, expert, !image);
+  TH1F * hRawTDCZPA = new TH1F("hRawTDCZPA", "TDC ZPA;TDC [ns]",160, -340., -280.);
+  Add2RawsList(hRawTDCZPA, 17, expert, !image);
+  TH1F * hRawTDCZEM1 = new TH1F("hRawTDCZEM1", "TDC ZEM1;TDC [ns]",160, -320., -280.);
+  Add2RawsList(hRawTDCZEM1, 18, expert, !image);
+  TH1F * hRawTDCZEM2 = new TH1F("hRawTDCZEM2", "TDC ZEM2;TDC [ns]",160, -320., -280.);
+  Add2RawsList(hRawTDCZEM2, 19, expert, !image);
   
   TProfile * hRawADCProfs = new TProfile("hRawADCProfs", "ADC profiles;ADC id;Mean ADC values",22,-0.5,21.5,10.,1210.,"");
-  Add2RawsList(hRawADCProfs, 16, expert, !image);
-  TProfile * hRawTDCProfs = new TProfile("hRawTDCProfs", "TDC profiles;TDC id;Mean TDC values",6,0.5,6.5,-340.,-300.,"S");
-  Add2RawsList(hRawTDCProfs, 17, expert, !image);
+  Add2RawsList(hRawADCProfs, 20, expert, !image);
+  TProfile * hRawTDCProfs = new TProfile("hRawTDCProfs", "TDC profiles;TDC id;Mean TDC values",6,0.5,6.5,-340.,-290.,"S");
+  Add2RawsList(hRawTDCProfs, 21, expert, !image);
   
   TH1F * hRawADCs = new TH1F("hRawADCs", "ADCs;ADC id;Mean ADC values",22,-0.5,21.5);
-  Add2RawsList(hRawADCs, 18, !expert, image);
+  Add2RawsList(hRawADCs, 22, !expert, image);
  
   TH1F * hRawTDCs = new TH1F("hRawTDCs", "TDCs;TDC id;Mean TDC values",6,0.5,6.5);
 //  hRawTDCs->SetMaximum(-300); hRawTDCs->SetMinimum(-340);
-  Add2RawsList(hRawTDCs, 19, !expert, image);
+  Add2RawsList(hRawTDCs, 23, !expert, image);
   
-  TH2F *hZNCrawCentr  = new TH2F("hZNCrawCentr", "Centroid in ZNC;X (cm);Y(cm)", 100, -5.,5.,100,-5.,5.);
-  Add2RawsList(hZNCrawCentr, 20, expert, !image);
-  TH2F *hZNArawCentr  = new TH2F("hZNArawCentr", "Centroid in ZNA;X (cm);Y(cm)", 100, -5.,5.,100,-5.,5.);
-  Add2RawsList(hZNArawCentr, 21, expert, !image);
+  TH2F *hTimeZDC = new TH2F("hTimeZDC", "ZDC timing;(ZNC-ZNA) (ns);(ZNC+ZNA) (ns)", 120,-30.,30.,120,-100.,-40.);
+  Add2RawsList(hTimeZDC, 24, !expert, image);
+  
+  TH2F *hZNCrawCentr  = new TH2F("hZNCrawCentr", "ZNC centroid;X (cm);Y(cm)", 100,-3.5,3.5,100,-3.5,3.5);
+  Add2RawsList(hZNCrawCentr, 25, expert, image);
+  TH2F *hZNArawCentr  = new TH2F("hZNArawCentr", "ZNA centroid;X (cm);Y(cm)", 100,-3.5,3.5,100,-3.5,3.5);
+  Add2RawsList(hZNArawCentr, 26, expert, image);
   
-  TH2F *hTimeZDC = new TH2F("fTimeZDC", "ZDC;TDC timing A+C vs C-A; events", 20,-30,30,120,-100,-40);
-  Add2RawsList(hTimeZDC, 22, expert, !image);
   //
   ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
 }
@@ -405,14 +415,8 @@ void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
     Float_t zncpmC=0., znapmC=0., zpcpmC=0., zpapmC=0.;
     Bool_t isZNCFired=kFALSE, isZPCFired=kFALSE, isZNAFired=kFALSE, isZPAFired=kFALSE;
     Int_t  indZNC=0, indZNA=0, indZPC=0, indZPA=0;
-    Float_t zncTDC[10], zpcTDC[10], zem1TDC[10], zem2TDC[10], znaTDC[10], zpaTDC[10];
-    Float_t zncSumTDC[10], znaSumTDC[10];
-    for(Int_t i=0; i<10; i++){
-       zncTDC[i]=zpcTDC[i]=zem1TDC[i]=zem2TDC[i]=znaTDC[i]=zpaTDC[i]=zncSumTDC[i]=znaSumTDC[i]=-999.;
-    }
-    Float_t tdcGate=-999., l0=-999.;
-    Int_t iMultZNCTDC=0, iMultZPCTDC=0, iMultZEM1TDC=0, iMultZEM2TDC=0, iMultZNATDC=0, iMultZPATDC=0;
-    Int_t iMultTDCC=0, iMultTDCA=0;
+    Double_t zncTDC=0., zpcTDC=0., zem1TDC=0., zem2TDC=0., znaTDC=0., zpaTDC=0.;
+    Double_t zncSumTDC=0., znaSumTDC=0., tdcGate=0., l0=0.;
     
     const Float_t x[4] = {-1.75, 1.75, -1.75, 1.75};
     const Float_t y[4] = {-1.75, -1.75, 1.75, 1.75};
@@ -434,16 +438,17 @@ void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
         
         // Stuff for pedestal subtraction
         if(quad != 5){ // ZDCs (not reference PTMs)
-         Float_t pedSubVal=-99.;
+         Float_t rawVal=-99., pedSubVal=-99.;
          if(det == 1){    
            pedindex = quad;
            if(gain == 0){
-             pedSubVal = (Float_t) (stream.GetADCValue()-meanPed[pedindex]); 
+             rawVal = (Float_t) (stream.GetADCValue());
+             pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); 
              zncSignal  += pedSubVal; 
              isZNCFired = kTRUE;
              if(quad!=0){
                zncSumQ += pedSubVal;
-               if(pedSubVal>0.&& zncpmC>50.){
+               if(pedSubVal>0.&& zncpmC>7.){
                  wZNC = TMath::Power(pedSubVal, alpha);
                  numXZNC += x[quad-1]*wZNC;
                  numYZNC += y[quad-1]*wZNC;
@@ -456,13 +461,14 @@ void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
              }
              indZNC++;
              
-             FillRawsData(16, pedindex, pedSubVal);
+             FillRawsData(20, pedindex, pedSubVal);
            }
          }
          else if(det == 2){ 
            pedindex = quad+5;
            if(gain == 0){
-             pedSubVal = (Float_t) (stream.GetADCValue()-meanPed[pedindex]); 
+             rawVal = (Float_t) (stream.GetADCValue());
+             pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); 
              zpcSignal += pedSubVal; 
              isZPCFired = kTRUE;
              if(quad!=0) zpcSumQ += pedSubVal;
@@ -472,35 +478,38 @@ void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
              }
              indZPC++;
              
-             FillRawsData(16, pedindex, pedSubVal);
+             FillRawsData(20, pedindex, pedSubVal);
            }
          }
          else if(det == 3){ 
            pedindex = quad+9;
            if(quad==1){     
              if(gain == 0){
-               pedSubVal = (Float_t) (stream.GetADCValue()-meanPed[pedindex]); 
+               rawVal = (Float_t) (stream.GetADCValue());
+               pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); 
                FillRawsData(4,pedSubVal);
-               FillRawsData(16,pedindex, pedSubVal);
+               FillRawsData(20,pedindex, pedSubVal);
              }
            }
            else if(quad==2){ 
              if(gain == 0){
-               pedSubVal = (Float_t) (stream.GetADCValue()-meanPed[pedindex]); 
+               rawVal = (Float_t) (stream.GetADCValue());
+               pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); 
                FillRawsData(5,pedSubVal); 
-               FillRawsData(16,pedindex, pedSubVal);
+               FillRawsData(20,pedindex, pedSubVal);
              }
            }
          }
          else if(det == 4){       
            pedindex = quad+12;
            if(gain == 0){
-             pedSubVal = (Float_t) (stream.GetADCValue()-meanPed[pedindex]); 
+             rawVal = (Float_t) (stream.GetADCValue());
+             pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); 
              znaSignal  += pedSubVal; 
              isZNAFired = kTRUE;
              if(quad!=0){
                znaSumQ += pedSubVal;
-               if(pedSubVal>0.&& znapmC>50.) {
+               if(pedSubVal>0.&& znapmC>7.) {
                  wZNA = TMath::Power(pedSubVal, alpha);
                  numXZNA += x[quad-1]*wZNA;
                  numYZNA += y[quad-1]*wZNA;
@@ -513,16 +522,14 @@ void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
              }
              indZNA++;
              
-             FillRawsData(16,pedindex, pedSubVal);
-             // RS: invalid
-             //GetRawsData(22)->SetBinContent(pedindex+1, GetRawsData(20)->GetBinContent(pedindex+1));
-             //GetRawsData(22)->SetBinError(pedindex+1, GetRawsData(20)->GetBinError(pedindex+1));
+             FillRawsData(20,pedindex, pedSubVal);
            }
          }
          else if(det == 5){
            pedindex = quad+17;
            if(gain == 0){
-             pedSubVal = (Float_t) (stream.GetADCValue()-meanPed[pedindex]); 
+             rawVal = (Float_t) (stream.GetADCValue());
+             pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); 
              zpaSignal  += pedSubVal; 
              isZPAFired = kTRUE;
              if(quad!=0) zpaSumQ += pedSubVal;
@@ -532,10 +539,7 @@ void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
              }
              indZPA++;
              
-             FillRawsData(16,pedindex, pedSubVal);
-             // RS: invalid
-             //GetRawsData(22)->SetBinContent(pedindex+1, GetRawsData(20)->GetBinContent(pedindex+1));
-             //GetRawsData(22)->SetBinError(pedindex+1, GetRawsData(20)->GetBinError(pedindex+1));
+             FillRawsData(20,pedindex, pedSubVal);
            }
          }
                         
@@ -551,7 +555,7 @@ void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
             yZNC = numYZNC/denZNC;
           } 
           else xZNC = yZNC = 999.;
-          FillRawsData(20,xZNC, yZNC);
+          FillRawsData(25, xZNC, yZNC, zncpmC);
         }
         if(isZPCFired && indZPC==5){
           FillRawsData(2,zpcSignal);
@@ -567,7 +571,7 @@ void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
             yZNA = numYZNA/denZNA;
           } 
           else xZNA = yZNA = 999.;
-          FillRawsData(21,xZNA, yZNA);
+          FillRawsData(26, xZNA, yZNA, znapmC);
          }
          if(isZPAFired && indZPA==5){ 
            FillRawsData(3,zpaSignal);
@@ -593,86 +597,73 @@ void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader)
         
       } //IsADCDataWord && signal ADCs
       else if(stream.IsZDCTDCDatum()){
-        if(stream.GetChannel()==1){
-           zncTDC[iMultZNCTDC] = (0.025*stream.GetZDCTDCDatum());
-           iMultZNCTDC++;
+         Float_t tdcValue = 0.025*stream.GetZDCTDCDatum();
+        if(stream.GetChannel()==1 && tdcValue!=0.){
+           zncTDC = tdcValue;
         }
-        else if(stream.GetChannel()==3){
-           zpcTDC[iMultZPCTDC] = (0.025*stream.GetZDCTDCDatum());
-           iMultZPCTDC++;
+        else if(stream.GetChannel()==3 && tdcValue!=0.){
+           zpcTDC = tdcValue;
         }
-        else if(stream.GetChannel()==5){
-           znaTDC[iMultZNATDC] = (0.025*stream.GetZDCTDCDatum());
-           iMultZNATDC++;
+        else if(stream.GetChannel()==5 && tdcValue!=0.){
+           znaTDC = tdcValue;
         }
-        else if(stream.GetChannel()==7){
-           zpaTDC[iMultZPATDC] = (0.025*stream.GetZDCTDCDatum());
-           iMultZPATDC++;
+        else if(stream.GetChannel()==7 && tdcValue!=0.){
+           zpaTDC = tdcValue;
         }
-        else if(stream.GetChannel()==8){
-           zem1TDC[iMultZEM1TDC] = (0.025*stream.GetZDCTDCDatum());
-           iMultZEM1TDC++;
+        else if(stream.GetChannel()==8 && tdcValue!=0.){
+           zem1TDC = tdcValue;
         }
-        else if(stream.GetChannel()==9){
-           zem2TDC[iMultZEM2TDC] = (0.025*stream.GetZDCTDCDatum());
-           iMultZEM2TDC++;
+        else if(stream.GetChannel()==9 && tdcValue!=0.){
+           zem2TDC = tdcValue;
         }
-        else if(stream.GetChannel()==10){
-           zncSumTDC[iMultZEM2TDC] = (0.025*stream.GetZDCTDCDatum());
-           iMultTDCC++;
+        else if(stream.GetChannel()==10 && tdcValue!=0.){
+           zncSumTDC = tdcValue;
         }
-        else if(stream.GetChannel()==12){
-           znaSumTDC[iMultZEM2TDC] = (0.025*stream.GetZDCTDCDatum());
-           iMultTDCA++;
+        else if(stream.GetChannel()==12 && tdcValue!=0.){
+           znaSumTDC = tdcValue;
         }
-        else if(stream.GetChannel()==14) tdcGate = (0.025*stream.GetZDCTDCDatum());
-        else if(stream.GetChannel()==15) l0 = (0.025*stream.GetZDCTDCDatum());
+        else if(stream.GetChannel()==14 && tdcValue!=0.) tdcGate = tdcValue;
+        else if(stream.GetChannel()==15 && tdcValue!=0.) l0 = tdcValue;
         
-        if(stream.GetChannel()==16 && tdcGate!=-999.){
-          for(Int_t iHit=0; iHit<10; iHit++){
-             if(zncTDC[iHit]!=-999.){
-               if(zncTDC[iHit]-tdcGate>-340. && zncTDC[iHit]-tdcGate<-300.) 
-                  FillRawsData(17,1, zncTDC[iHit]-tdcGate);
+        if(stream.GetChannel()==16 && tdcGate!=0. && l0!=0.){
+             if(zncTDC!=0.){
+               Float_t znc = zncTDC-tdcGate;
+               FillRawsData(14,znc);
+               if(znc>-340. && znc<-290.) FillRawsData(21,1, znc);
              }
-             if(zpcTDC[iHit]!=-999.){
-               Float_t diffZPC = zpcTDC[iHit]-tdcGate;
-               FillRawsData(15,diffZPC);
-               if(diffZPC>-340. && diffZPC<-300.) FillRawsData(17,2, diffZPC);
+             if(zpcTDC!=0.){
+               Float_t zpc = zpcTDC-tdcGate;
+               FillRawsData(15,zpc);
+               if(zpc>-340. && zpc<-290.) FillRawsData(21,2, zpc);
              }
-             if(znaTDC[iHit]!=-999.){
-               if(znaTDC[iHit]-tdcGate>-340. && znaTDC[iHit]-tdcGate<-300.) 
-                 FillRawsData(17,3, znaTDC[iHit]-tdcGate);
+             if(znaTDC!=0.){
+               Float_t zna = znaTDC-tdcGate;
+               FillRawsData(16,zna);
+               if(zna>-340. && zna<-290.) FillRawsData(21,3, zna);
              }
-             if(zpaTDC[iHit]!=-999.){
-               if(zpaTDC[iHit]-tdcGate>-340. && zpaTDC[iHit]-tdcGate<-300.) 
-                 FillRawsData(17,4, zpaTDC[iHit]-tdcGate);
+             if(zpaTDC!=0.){
+               Float_t zpa = zpaTDC-tdcGate;
+               FillRawsData(17,zpa);
+               if(zpa>-340. && zpa<-290.) FillRawsData(21,4, zpa);
              }
-             if(zem1TDC[iHit]!=-999.){
-               Float_t diffZEM1 = zem1TDC[iHit]-tdcGate;
-               FillRawsData(14,diffZEM1);
-               if(diffZEM1>-340. && diffZEM1<-300.) FillRawsData(17,5, diffZEM1);
+             if(zem1TDC!=0.){
+               Float_t zem1 = zem1TDC-tdcGate;
+               FillRawsData(18,zem1);
+               if(zem1>-340. && zem1<-290.) FillRawsData(21,5, zem1);
              }
-             if(zem2TDC[iHit]!=-999.){
-               if(zem2TDC[iHit]-tdcGate>-340. && zem2TDC[iHit]-tdcGate<-300.) 
-                 FillRawsData(17,6, zem2TDC[iHit]-tdcGate);
+             if(zem2TDC!=0.){
+               Float_t zem2 = zem2TDC-tdcGate;
+               FillRawsData(19,zem2);
+               if(zem2TDC>-340. && zem2<-290.) FillRawsData(21,6, zem2);
               }
-             if(zncSumTDC[iHit]!=-999.){
-                Float_t tdcC = zncSumTDC[iHit]-l0;
-                if(znaSumTDC[iHit]!=-999.){
-                   Float_t tdcA = znaSumTDC[iHit]-l0;
-                   //if (((tdcC-tdcA-refDelta)*(tdcC-tdcA-refDelta)/(sigmaDelta*sigmaDelta) +
-                       //(tdcC+tdcA-refSum)*(tdcC+tdcA-refSum)/(sigmaSum*sigmaSum))< 1.0)
-                       FillRawsData(22,tdcC-tdcA,tdcC+tdcA);
-                   
-                }
+             if(znaSumTDC!=0. && zncSumTDC!=0.){
+                Float_t tdcC = zncSumTDC-l0;
+                Float_t tdcA = znaSumTDC-l0;
+                FillRawsData(24, tdcC-tdcA, tdcC+tdcA);
               }
-          }
           //
-          tdcGate = -999.;
-           for(Int_t i=0; i<10; i++){
-              zncTDC[i] = zpcTDC[i] = zem1TDC[i] = zem2TDC[i] = znaTDC[i] = zpaTDC[i] = -999.;
-             zncSumTDC[i] = znaSumTDC[i] = -999.;
-           } 
+          tdcGate = zncTDC = zpcTDC = zem1TDC = zem2TDC = znaTDC = zpaTDC = 0.;
+          zncSumTDC = znaSumTDC = 0.;
         }
       }
     
@@ -837,31 +828,80 @@ void AliZDCQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr
     //
     for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over eventual clones per trigger class
       //
-      if( task == AliQAv1::kRAWS) {
-       TH1* h16 = GetRawsData(16, itc);
-       TH1* h17 = GetRawsData(17, itc);
-       TH1* h18 = GetRawsData(18, itc);
-       TH1* h19 = GetRawsData(19, itc);
-       //      TH1* h20 = GetRawsData(20, itc);
-       //      TH1* h21 = GetRawsData(21, itc);
-       if (!h16 || !h17 || !h18 || !h19) {
-        AliWarning("AliZDCQADataMaker Rec -> Not all histogram for DQM found!"); 
+      if(task == AliQAv1::kRAWS) {
+       TH1F* h14 =  dynamic_cast<TH1F*> (GetRawsData(14, itc));
+       TH1F* h15 =  dynamic_cast<TH1F*> (GetRawsData(15, itc));
+       TH1F* h16 =  dynamic_cast<TH1F*> (GetRawsData(16, itc));
+       TH1F* h17 =  dynamic_cast<TH1F*> (GetRawsData(17, itc));
+       TH1F* h18 =  dynamic_cast<TH1F*> (GetRawsData(18, itc));
+       TH1F* h19 =  dynamic_cast<TH1F*> (GetRawsData(19, itc));
+       TProfile* h20 = dynamic_cast<TProfile*> (GetRawsData(20, itc));
+       //TProfile* h21 =  dynamic_cast<TProfile*> (GetRawsData(21, itc));
+       TH1F* h22 =  dynamic_cast<TH1F*> (GetRawsData(22, itc));
+       TH1F* h23 =  dynamic_cast<TH1F*> (GetRawsData(23, itc));
+       TH2F* h24 =  dynamic_cast<TH2F*> (GetRawsData(24, itc));
+       TH2F* h25 =  dynamic_cast<TH2F*> (GetRawsData(25, itc));
+       TH2F* h26 =  dynamic_cast<TH2F*> (GetRawsData(26, itc));
+       if(!h20){
+        AliWarning("AliZDCQADataMakerRec -> RAW ADC histo not found!"); 
         AliWarning(Form("for specie %s and trigger class %s",
                         AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc)));
        }
        else{
-         h16->Draw("");
-         for(Int_t ibin=1; ibin<=h16->GetNbinsX(); ibin++){
-           h18->SetBinContent(ibin, h16->GetBinContent(ibin)); 
-           h18->SetBinError(ibin, h16->GetBinError(ibin));
+         if(h22){
+
+           for(Int_t ibin=1; ibin<=h20->GetNbinsX(); ibin++){
+             h22->SetBinContent(ibin, h20->GetBinContent(ibin)); 
+             h22->SetBinError(ibin, h20->GetBinError(ibin));
+           }
+           h22->SetLineColor(kBlue+1); h22->SetLineWidth(2);
          }
-         for(Int_t ibin=1; ibin<=h17->GetNbinsX(); ibin++){
-           h19->SetBinContent(ibin, h17->GetBinContent(ibin)); 
-           h19->SetBinError(ibin, h17->GetBinError(ibin));
+         else printf("Warning: Raw ADC QA histo not found \n\n");
+       }
+       if(!h14 || !h15 || !h16 || !h17 || !h18 || !h19){
+       AliWarning("AliZDCQADataMakerRec -> RAW TDC histos not found!"); 
+        AliWarning(Form("for specie %s and trigger class %s",
+                        AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc)));
+       }
+       else{
+         /*for(Int_t ibin=1; ibin<=h21->GetNbinsX(); ibin++){
+           printf("  bin %d  TDC %f\n",ibin,  h21->GetBinContent(ibin));
+           h23->SetBinContent(ibin, h21->GetBinContent(ibin)); 
+           h23->SetBinError(ibin, h21->GetBinError(ibin));
+         }*/
+         if(h23){
+           h23->SetBinContent(1, h14->GetMean());
+           h23->SetBinError(1, h14->GetRMS());
+           h23->SetBinContent(2, h15->GetMean());
+           h23->SetBinError(2, h15->GetRMS());
+           h23->SetBinContent(3, h16->GetMean());
+           h23->SetBinError(3, h16->GetRMS());
+           h23->SetBinContent(4, h17->GetMean());
+           h23->SetBinError(4, h17->GetRMS());
+           h23->SetBinContent(5, h18->GetMean());
+           h23->SetBinError(5, h18->GetRMS());
+           h23->SetBinContent(6, h19->GetMean());
+           h23->SetBinError(6, h19->GetRMS());
+           //
+           h23->SetLineColor(kAzure+6); h22->SetLineWidth(2);
          }
-         h18->SetLineColor(kBlue); h18->SetLineWidth(2);
-         h19->SetLineColor(kAzure-3); h19->SetLineWidth(2);
+         else printf(" Warning: Raw TDC QA histo not found\n\n");
+        }
+       if(!h25 || !h26){
+        AliWarning("AliZDCQADataMakerRec -> RAW centroid histos not found!"); 
+        AliWarning(Form("for specie %s and trigger class %s",
+                        AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc)));
+       }
+       else{
+        h25->SetMarkerColor(kPink-2); 
+        h26->SetMarkerColor(kAzure-2);
+       }
+       if(!h24) {
+        AliWarning("AliZDCQADataMakerRec -> RAW debunching histo not found!"); 
+        AliWarning(Form("for specie %s and trigger class %s",
+                        AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc)));
        }
+       else h24->SetMarkerColor(kAzure);
       }
     } // loop over t
   } //  loop over species