LCOV - code coverage report
Current view: top level - T0/T0rec - AliT0QADataMakerRec.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 13 648 2.0 %
Date: 2016-06-14 17:26:59 Functions: 3 21 14.3 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : 
      17             : /* $Id$ */
      18             : 
      19             : //---
      20             : //  Produces the data needed to calculate the quality assurance. 
      21             : //  Alla.Maevskaya@cern.ch
      22             : //---
      23             : 
      24             : // --- ROOT system ---
      25             : #include <TClonesArray.h>
      26             : #include <TFile.h> 
      27             : #include <TH1F.h> 
      28             : #include <TH2F.h> 
      29             : #include <TDirectory.h>
      30             : #include <TMath.h>
      31             : // --- Standard library ---
      32             : 
      33             : // --- AliRoot header files ---
      34             : 
      35             : #include "AliESDEvent.h"
      36             : #include "AliLog.h"
      37             : #include "AliT0digit.h" 
      38             : #include "AliT0hit.h"
      39             : #include "AliT0RecPoint.h"
      40             : #include "AliT0QADataMakerRec.h"
      41             : #include "AliQAChecker.h"
      42             : #include "AliT0RawReader.h"
      43             : #include "AliT0RecoParam.h"
      44             : #include "AliQAThresholds.h"
      45             : #include "AliDAQ.h"
      46             : #include "AliCDBEntry.h"
      47             : #include "AliQAManager.h"
      48             : #include "THnSparse.h"
      49             : 
      50             : #include "TFitResultPtr.h"
      51             : 
      52             : #include "Riostream.h"
      53          20 : ClassImp(AliT0QADataMakerRec)
      54             :            
      55             : //____________________________________________________________________________ 
      56             :   AliT0QADataMakerRec::AliT0QADataMakerRec() : 
      57           6 : AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kT0), 
      58             :                   "T0 Quality Assurance Data Maker"),
      59           2 :     fMeanRawVertexParam(0),
      60           2 :     fMeanORAParam(0),
      61           2 :     fMeanORCParam(0),
      62           2 :     fCFDEffSubRangeLowParam(0),
      63           2 :     fCFDEffSubRangeHighParam(3000),
      64           2 :     fLEDEffSubRangeLowParam(0),
      65           2 :     fLEDEffSubRangeHighParam(3000)
      66             : //  fnEventCal(0),
      67             : //  fnEventPhys(0)
      68          10 : {
      69             :   // ctor
      70             :   // RS: There is some inconsistency here: the separation of physics and calib. events/histos is done by
      71             :   // fEventSpecie. Why do we book separate histos on different slots for calib and physics ? 
      72             :   // I am changing this in such way that we don't need local counters like fNumTriggers (the corresponding
      73             :   // histos now incremented in the MakeRaws, and for the normalization I will use the framework's counters
      74             :   // AliQADataMaker::GetEvCountCycle(...), AliQADataMaker::GetEvCountTotal(...)
      75             :   // All these fTrEff.. feff.. will by directly filled in corresponding histos
      76             : 
      77         100 :   for(Int_t i=0; i<24; i++){
      78          48 :     fMeanCFDFromGoodRunParam[i]=0; 
      79             :   }
      80           4 : }
      81             : 
      82             : 
      83             : //____________________________________________________________________________ 
      84             : AliT0QADataMakerRec::AliT0QADataMakerRec(const AliT0QADataMakerRec& qadm) :
      85           0 :   AliQADataMakerRec(),
      86           0 :   fMeanRawVertexParam(qadm.fMeanRawVertexParam),
      87           0 :   fMeanORAParam(qadm.fMeanORAParam),
      88           0 :   fMeanORCParam(qadm.fMeanORCParam),
      89           0 :   fCFDEffSubRangeLowParam(qadm.fCFDEffSubRangeLowParam),
      90           0 :   fCFDEffSubRangeHighParam(qadm.fCFDEffSubRangeHighParam),
      91           0 :   fLEDEffSubRangeLowParam(qadm.fLEDEffSubRangeLowParam),
      92           0 :   fLEDEffSubRangeHighParam(qadm.fLEDEffSubRangeHighParam)
      93           0 : {
      94             :   //copy ctor 
      95           0 :   SetName((const char*)qadm.GetName()) ; 
      96           0 :   SetTitle((const char*)qadm.GetTitle());
      97           0 :   for(Int_t i=0; i<24; i++){
      98           0 :     fMeanCFDFromGoodRunParam[i]=qadm.fMeanCFDFromGoodRunParam[i]; 
      99             :   }
     100           0 : }
     101             : 
     102             : //__________________________________________________________________
     103             : AliT0QADataMakerRec& AliT0QADataMakerRec::operator = (const AliT0QADataMakerRec& qadm )
     104             : {
     105             :   // Equal operator.
     106           0 :   this->~AliT0QADataMakerRec();
     107           0 :   new(this) AliT0QADataMakerRec(qadm);
     108           0 :   return *this;
     109           0 : }
     110             : //__________________________________________________________________
     111             : AliT0QADataMakerRec::~AliT0QADataMakerRec()
     112           0 : {
     113             :   //destructor
     114           0 : }
     115             : //____________________________________________________________________________
     116             : void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
     117             : {
     118             :   //Detector specific actions at end of cycle
     119             :   // do the QA checking
     120           0 :   AliInfo(Form("Task: %d",task));
     121           0 :   ResetEventTrigClasses();
     122             :   
     123             :   TH1* hcounter = 0;
     124             :   TH1* heff = 0;
     125             :   TH1* htmp = 0;
     126             :   TH1F* hEventCounter=NULL;
     127           0 :   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
     128             :     //
     129             :     // RS: There is some inconsistency here: the separation of physics and calib. events/histos is done by
     130             :     // fEventSpecie. Why do we book separate histos on different slots for calib and physics ? 
     131             :     // I am changing this in such way that we don't need local counters like fNumTriggers (the corresponding
     132             :     // histos now incremented in the MakeRaws, and for the normalization I will use the framework's counters
     133             :     // AliQADataMaker::GetEvCountCycle(...), AliQADataMaker::GetEvCountTotal(...)
     134             :     //
     135             :     // I think the histos xx+250 should be suppressed (the xx calib histos of specie==calibration will be 
     136             :     // used automatically)
     137             :     //
     138           0 :     if (! IsValidEventSpecie(specie, list)) continue;
     139           0 :     SetEventSpecie(AliRecoParam::ConvertIndex(specie));
     140             :     //
     141           0 :     for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over eventual clones per trigger class
     142             :       // 
     143           0 :       if ( task == AliQAv1::kRAWS ) {
     144             :         //
     145           0 :         float nEvent = GetEvCountCycleRaws(itc);   // counted events for given trigger class
     146           0 :         if(nEvent>0) { 
     147             :           Float_t numberOfEventsAllCycles = 0.0;
     148           0 :           if((hEventCounter=(TH1F*) GetRawsData(240,itc))){
     149           0 :             numberOfEventsAllCycles = hEventCounter->Integral() + nEvent;// count all events upto now
     150           0 :             hEventCounter->SetBinContent(1,numberOfEventsAllCycles); // increase counter 
     151           0 :           } 
     152             : 
     153           0 :           SetEfficiency(169, 241, itc, numberOfEventsAllCycles);
     154           0 :           SetEfficiency(207, 242, itc, numberOfEventsAllCycles);
     155           0 :           SetEfficiency(208, 243, itc, numberOfEventsAllCycles);
     156           0 :           SetEfficiency(237, 244, itc, numberOfEventsAllCycles);
     157           0 :           SetEfficiency(238, 245, itc, numberOfEventsAllCycles);
     158             : 
     159             : 
     160             :           //fk// orA and orC for given specie and trigger class
     161             :           Float_t  numberOfORAEndOfCycle = 0.0;
     162             :           Float_t  numberOfORCEndOfCycle = 0.0;
     163           0 :           if((htmp=GetRawsData(172,itc))) numberOfORAEndOfCycle = htmp->Integral(); //ORA     
     164           0 :           if((htmp=GetRawsData(173,itc))) numberOfORCEndOfCycle = htmp->Integral(); //ORC     
     165             :           
     166           0 :           if((heff=GetRawsData(209,itc))){ //QTC efficiency
     167           0 :             if((hcounter=GetRawsData(246,itc))){ //QTC counter
     168           0 :               if(numberOfORCEndOfCycle>0){
     169           0 :                 for(int ipmt=0; ipmt<12; ipmt++){
     170           0 :                   Float_t val = hcounter->GetBinContent(ipmt+1); //first bin has consequtive number 1 
     171           0 :                   heff->SetBinContent(ipmt+1,val/numberOfORCEndOfCycle);
     172             :                                  
     173             :                }
     174           0 :               }else{
     175           0 :                 for(int ipmt=0;ipmt<12; ipmt++)
     176           0 :                    heff->SetBinContent(ipmt+1,0);
     177             :               }
     178           0 :               if(numberOfORAEndOfCycle>0){
     179           0 :                 for(int ipmt=12;ipmt<24; ipmt++){
     180           0 :                   Float_t val = hcounter->GetBinContent(ipmt+1);
     181           0 :                   heff->SetBinContent(ipmt+1,val/numberOfORAEndOfCycle);
     182             :                 }
     183           0 :               }else{
     184           0 :                 for(int ipmt=0;ipmt<12; ipmt++)
     185           0 :                   heff->SetBinContent(ipmt+1,0);
     186             :               }
     187             :             }
     188             :           }
     189           0 :         }//Evt >0
     190           0 :       } // kRAWS
     191             :     } // RS: loop over eventual clones per trigger class
     192           0 :   } // loop over species
     193             :   //
     194           0 :   AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list); //FK
     195           0 : }
     196             : 
     197             : 
     198             : //____________________________________________________________________________
     199             : void AliT0QADataMakerRec::StartOfDetectorCycle()
     200             : {
     201             :   //Detector specific actions at start of cycle
     202           0 :   AliCDBManager* man = AliCDBManager::Instance();
     203             :   //man->SetDefaultStorage(gSystem->Getenv("AMORE_CDB_URI"));
     204           0 :   if(!man) return; 
     205           0 :   AliCDBEntry* entry = man->Get("GRP/Calib/QAThresholds");
     206           0 :   if(!entry) return;
     207           0 :   TObjArray* t0branch = (TObjArray*) entry->GetObject();
     208           0 :   AliQAThresholds*  thresholds = (AliQAThresholds*) t0branch->FindObject("T00");
     209             :   // here you should test that you got a non-null pointer
     210             : 
     211             : 
     212           0 : if(!thresholds) return;
     213           0 :   if(AliDAQ::DetectorID("T0")!= thresholds->GetDetectorId()){
     214           0 :     AliInfo(Form("DETECTOR ID %d DOES NOT MATCH TO TZERO",thresholds->GetDetectorId()));
     215           0 :     return;
     216             :   }
     217             :   
     218             :   int iparam = 0; 
     219           0 :   if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex 
     220           0 :     fMeanRawVertexParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
     221           0 :   }
     222             : 
     223             :   iparam = 76; 
     224           0 :   if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex 
     225           0 :     fMeanORAParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
     226           0 :   } 
     227             :  
     228             :   iparam = 77; 
     229           0 :   if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex 
     230           0 :     fMeanORCParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
     231           0 :   } 
     232             :  
     233             :   iparam = 78; 
     234           0 :   if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex 
     235           0 :     fCFDEffSubRangeLowParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
     236           0 :   } 
     237             :  
     238             :   iparam = 79; 
     239           0 :   if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex 
     240           0 :     fCFDEffSubRangeHighParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
     241           0 :   } 
     242             :     
     243             :   iparam = 80; 
     244           0 :   if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex 
     245           0 :     fLEDEffSubRangeLowParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
     246           0 :   } 
     247             :     
     248             :   iparam = 81; 
     249           0 :   if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex 
     250           0 :     fLEDEffSubRangeHighParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
     251           0 :   } 
     252             : 
     253           0 :   for(int ipmt=0; ipmt<24;ipmt++){ 
     254           0 :     iparam = ipmt + 1; //current consecutive number of parameter
     255           0 :     if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean CFD from a good run 
     256           0 :       fMeanCFDFromGoodRunParam[ipmt] = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
     257           0 :     }
     258             :   }
     259           0 : }
     260             :  
     261             : //____________________________________________________________________________ 
     262             : void AliT0QADataMakerRec::InitRaws()
     263             : {
     264             : 
     265             :   // create Raw histograms in Raw subdir
     266             :   const Bool_t expert   = kTRUE ; 
     267             :   const Bool_t saveCorr = kTRUE ; 
     268             :   const Bool_t image    = kTRUE ; 
     269           0 :   Float_t low[500];
     270           0 :   Float_t high[500];
     271             :   //triggers
     272           0 :   const Char_t *triggers[6] = {"T0 OR", "vertex","ORA","ORC","central","semi-central"};
     273             :    
     274             :   
     275           0 :   for (Int_t i=0; i<500; i++){
     276           0 :     low[i] = 0;
     277           0 :     high[i] = 30000;
     278             : 
     279             :   }
     280             : 
     281           0 :   TString timename, ampname, qtcname, ledname;
     282           0 :   TString timeCalname, ampCalname, ledCalname, qtcCalname;
     283           0 :   TString qt1name, qt0name, qt1Calname, qt0Calname;
     284           0 :   TString nhits;
     285             : 
     286           0 :   TH1F* hRefPoint = new TH1F("hRefPoint","Ref Point", 10000, 0 ,50000);
     287           0 :   hRefPoint->SetLabelSize(0.02);
     288           0 :   Add2RawsList( hRefPoint,0, expert, !image, !saveCorr);
     289             : 
     290           0 :   TH1F *hRefPointcal = new TH1F("hRefPointcal","Ref Point laser", 5000, 0 ,20000);
     291           0 :   Add2RawsList( hRefPointcal,249, expert, !image, !saveCorr);
     292             : 
     293           0 :   TH1F *hRawCFD[24]; 
     294           0 :   TH1F *hRawLEDamp[24];
     295           0 :   TH1F *hRawQTC[24]; TH1F *hRawLED[24];
     296           0 :   TH1F *hRawQT1[24]; TH1F *hRawQT0[24];
     297           0 :   TH1F* hRawNhits[24];
     298           0 :   for(Int_t i=0; i<24; i++){
     299           0 :       timename ="CFD/hRawCFD";
     300           0 :       ledname = "LED/hRawLED";
     301           0 :       qtcname = "QTC/hRawQTC";
     302           0 :       qt0name = "QTC/start/hRawQT0_";
     303           0 :       qt1name = "QTC/stop/hRawQT1_";
     304           0 :       ampname = "LEDminCFD/hRawLEDminCFD";
     305           0 :       nhits = "Hits/hRawNhits";
     306           0 :       timename += i+1;
     307           0 :       ampname += i+1;
     308           0 :       qtcname += i+1;
     309           0 :       qt0name += i+1;
     310           0 :       qt1name += i+1;
     311           0 :       ledname += i+1;
     312           0 :       nhits   += i+1;
     313             :       
     314           0 :       hRawCFD[i] = new TH1F(timename.Data(), Form("%s;CFD [#channels]; Counts", timename.Data()),Int_t((high[i+1]-low[i+1])/4),low[i+1],high[i+1]);
     315             :       //      ForbidCloning(hRawCFD[i]);       //RS I don't know how histos 1-24 should be processed in MakeRaws, for the moment forbidding the cloning
     316           0 :       Add2RawsList( hRawCFD[i],i+1, expert, !image, !saveCorr);
     317           0 :       hRawLED[i] = new TH1F(ledname.Data(),  Form("%s;LED [#channels]; Counts", ledname.Data()),Int_t((high[i+25]-low[i+25])/4),low[i+25],high[i+25]);
     318           0 :       Add2RawsList( hRawLED[i],i+25, expert, !image, !saveCorr);
     319           0 :       hRawLEDamp[i] = new TH1F(ampname.Data(),  Form("%s;LED-CFD [#channels]; Counts", ampname.Data()),1000,0,1000);
     320           0 :       Add2RawsList( hRawLEDamp[i],i+49, expert, !image, !saveCorr);
     321           0 :       hRawQTC[i] = new TH1F(qtcname.Data(),  Form("%s;QTC[#channels]; Counts", qtcname.Data()), 2500,0,10000); //fk
     322             :       //QT0
     323           0 :       Add2RawsList( hRawQTC[i],i+73, expert, !image, !saveCorr);
     324           0 :       hRawQT0[i] = new TH1F(qt0name.Data(),  Form("%s; QT0 [#channels]; Counts", qt0name.Data()),Int_t((high[97+i]-low[97+i])/4),low[97+i],high[97+i]);
     325           0 :       Add2RawsList( hRawQT0[i],97+i, expert, !image, !saveCorr);
     326             :       //QT1
     327           0 :       hRawQT1[i] = new TH1F(qt1name.Data(),  Form("%s; QT1 [#channels]; Counts", qt1name.Data()),Int_t((high[121+i]-low[121+i])/4),low[121+i],high[121+i]);
     328           0 :       Add2RawsList( hRawQT1[i],121+i, expert, !image, !saveCorr);
     329             :       
     330           0 :       hRawNhits[i] = new TH1F(nhits.Data(),  Form("%s;#Hits;Events", nhits.Data()),20, 0, 20);
     331           0 :       Add2RawsList( hRawNhits[i],176+i, expert, !image, !saveCorr);
     332             :     }
     333             :       //new QTC
     334             :   Int_t ihist=0;
     335           0 :   TH1F* hallhist[220];
     336           0 :   TString namech[4]=   {"00", "01", "10", "11"};
     337           0 :   TString namehist;
     338           0 :   for (Int_t i=0; i<12; i++)
     339             :     {      
     340           0 :       for (Int_t ih=0; ih<4; ih++) {
     341           0 :          namehist = Form("newQT/StartStop/hnewRawQT%s_C%i",namech[ih].Data(),i+1);
     342           0 :          hallhist[ihist]=new TH1F(namehist.Data(),  Form("%s; #channels;Events",namehist.Data()),1000, 0, 30000);
     343           0 :          Add2RawsList(hallhist[ihist],250+ihist, expert, !image, !saveCorr);
     344           0 :          ihist++;
     345             :        }
     346             :     }    
     347           0 :   for (Int_t i=12; i<24; i++)
     348             :     {      
     349           0 :       for (Int_t ih=0; ih<4; ih++) {
     350           0 :         namehist = Form("newQT/StartStop/hnewRawQT%s_A%i",namech[ih].Data(),i+1-12);
     351           0 :          hallhist[ihist]=new TH1F(namehist.Data(),  Form("%s; #channels;Events",namehist.Data()),1000, 0, 30000);
     352           0 :          Add2RawsList(hallhist[ihist],250+ihist, expert, !image, !saveCorr);
     353           0 :          ihist++;
     354             :       }
     355             :     }    
     356             : 
     357           0 :   for (Int_t i=0; i<24; i++)
     358             :     {      
     359           0 :       hallhist[ihist] = new TH1F(Form("newQT/hnewRawQTC0_%i_diff",i+1),  Form("hRawQTC new %s - %s ch %i ;#channels;Events",namech[0].Data(), namech[1].Data(),i+1),1200, -100, 1100);
     360           0 :         Add2RawsList(hallhist[ihist],250+ihist, expert, !image, !saveCorr);
     361           0 :         ihist++;
     362             :     }
     363           0 :   for (Int_t i=0; i<24; i++)
     364             :     {      
     365           0 :         hallhist[ihist] = new TH1F(Form("newQT/hnewRawQTC1_%i_diff",i+1),  Form("hRawQTC new %s - %s ch  %i ;#channels;Events",namech[2].Data(), namech[3].Data(),i+1),1200, -100, 1100);
     366           0 :         Add2RawsList(hallhist[ihist],250+ihist, expert, !image, !saveCorr);
     367           0 :         ihist++;
     368             :     }
     369             :   
     370             :   // new mult QTC
     371           0 :   TString namediff[4] = {"C_00min01","C_10min11", "A_00min01", "A_10min11"};  
     372           0 :   for (Int_t i=0; i<4; i++) {
     373           0 :     hallhist[ihist]  = new TH1F(Form("newMPD/hnewRawMultC_%s",namech[i].Data()),  Form("new C sum mult %s; #channels;Events",namech[i].Data()), 1000, 0, 30000);
     374           0 :     Add2RawsList(hallhist[ihist],250+ihist, expert, !image, !saveCorr);
     375           0 :     ihist++;
     376             :   }
     377           0 :   for (Int_t i=0; i<4; i++) {
     378           0 :     hallhist[ihist] = new TH1F(Form("newMPD/hnewRawMultA_%s",namech[i].Data()), Form("new A sum mult %s; #channels;Events",namech[i].Data()), 1000, 0, 30000);
     379           0 :     Add2RawsList(hallhist[ihist],250+ihist, expert, !image, !saveCorr);
     380           0 :     ihist++;
     381             :   }
     382             :   
     383           0 :   for (Int_t i=0; i<4; i++) {
     384           0 :     TString namempd=Form("newMPD/hnewRawMPD_%s_diff",namediff[i].Data());
     385           0 :     hallhist[ihist] =  new TH1F ( namempd.Data(),  namempd.Data(),
     386             :                                   1200, -100, 1100) ; 
     387           0 :     Add2RawsList(hallhist[ihist],250+ihist, expert, !image, !saveCorr);
     388           0 :     ihist++;
     389           0 :   }
     390             :   // end new QTC
     391             :  
     392           0 :   TH1F* hRawTrigger = new TH1F("hRawTrigger"," triggers;Trigger ;Counts",6,0,6);
     393           0 :   for (Int_t itr=0; itr<6; itr++) hRawTrigger->Fill(triggers[itr], 0); // RS Modified to allow cloning (no fNumTriggers member anymore)
     394           0 :   Add2RawsList(hRawTrigger ,169, !expert, image, !saveCorr);
     395           0 :   TH1F* hRawMean = new TH1F("Triggers/hRawMean","online timer mean signal, physics event;",Int_t((high[170]-low[170])/4),low[170],high[170]);
     396           0 :   Add2RawsList( hRawMean,170, expert, !image, !saveCorr);
     397             : 
     398           0 :   TH1F* hRawVertex = new TH1F("Triggers/hRawVertex","online 0TVX vertex signal; counts",Int_t((high[171]-low[171])/4),low[171],high[171]);
     399           0 :   Add2RawsList( hRawVertex,171, expert, !image, !saveCorr);//FK
     400             : 
     401           0 :   TH1F* hRawORA = new TH1F("Triggers/hRawORA","online OR A; counts",Int_t((high[172]-low[172])/4),low[172],high[172]);
     402           0 :   Add2RawsList( hRawORA,172, expert, !image, !saveCorr);
     403           0 :   TH1F* hRawORC = new TH1F("Triggers/hRawORC","online OR C;counts",Int_t(( high[173]-low[173])/4),low[173],high[173]);
     404           0 :   Add2RawsList( hRawORC,173, expert, !image, !saveCorr);
     405           0 :   TH1F* hMultCentr = new TH1F("Triggers/hMultCentr","online trigger Central;counts ",Int_t(( high[174]-low[174])/4),low[174],high[174]);
     406           0 :   Add2RawsList( hMultCentr,174, expert, !image, !saveCorr);
     407           0 :   TH1F* hMultSeCentr = new TH1F("Triggers/hMultSemiCentr","online trigger SemiCentral;counts ",Int_t(( high[175]-low[175])/4),low[175],high[175]);
     408           0 :   Add2RawsList( hMultSeCentr,175, expert, !image, !saveCorr);
     409             : 
     410           0 :   TH1F* hMultA = new TH1F("Triggers/hMultA","full mulltiplicity A side;Multiplicity;Entries", Int_t((high[201]-low[201])/4) ,low[201],high[201]);
     411           0 :   Add2RawsList( hMultA,201, expert, !image, !saveCorr );//FK
     412             :   
     413           0 :   TH1F* hMultAS = new TH1F("Triggers/hMultASemi","full multiplicity with semi-central trigger A side ;Multiplicity;Entries",
     414           0 :                             Int_t((high[202]-low[202])/4),low[202],high[202] );
     415           0 :   Add2RawsList( hMultAS, 202, expert, !image, !saveCorr);
     416           0 :   TH1F* hMultAC = new TH1F("Triggers/hMultACentr","full multiplicity with central trigger;Multiplicity;Entries", 
     417           0 :                             Int_t((high[203]-low[203])/4),low[203],high[203]);
     418           0 :   Add2RawsList( hMultAC, 203, expert, !image, !saveCorr);
     419             :   
     420             :   
     421             :   //side C
     422           0 :    TH1F* hMultC = new TH1F("Triggers/hMultC","full mulltiplicity C side;Multiplicity;Entries", Int_t(high[204]-low[204]/4) ,low[204],high[204]);
     423           0 :   Add2RawsList( hMultC,204, expert, !image, !saveCorr );//FK
     424           0 :   TH1F* hMultCS = new TH1F("Triggers/hMultCSemi","full multiplicity with semi-central trigger C side;Multiplicity;Entries",
     425           0 :                             Int_t((high[205]-low[205])/4),low[205],high[205] );
     426           0 :   Add2RawsList( hMultCS,205, expert, !image, !saveCorr);
     427           0 :   TH1F* hMultCC = new TH1F("Triggers/hMultCCentr","full multiplicity with central trigger C side;Multiplicity;Entries", 
     428           0 :                             Int_t((high[206]-low[206])/4),low[206],high[206]);
     429           0 :   Add2RawsList( hMultCC,206, expert, !image, !saveCorr);
     430             :   
     431             :   
     432             :   //efficiency
     433           0 :   TH1F* hCFDeff= new TH1F("hCFDeff"," CFD efficiency; #PMT; #CFD counts/nEvents",24, 0 ,24);  
     434           0 :   hCFDeff->SetMinimum(0);
     435           0 :   hCFDeff->SetMaximum(2);
     436           0 :   hCFDeff->SetMarkerStyle(20);//fk
     437           0 :   hCFDeff->SetMarkerColor(2);//fk
     438           0 :   hCFDeff->SetOption("p");//fk
     439           0 :   Add2RawsList( hCFDeff, 207, expert, image, !saveCorr);//FK   
     440           0 :   TH1F* hEffLED = new TH1F("hEffLED","LED efficiency; #PMT; #LED counts/nEvent",24, 0 ,24);
     441           0 :   hEffLED ->SetMinimum(0);
     442           0 :   hEffLED->SetMaximum(2);
     443           0 :   hEffLED->SetMarkerStyle(28);//fk
     444           0 :   hEffLED->SetMarkerColor(1);//fk
     445           0 :   hEffLED->SetOption("p,same");//fk
     446           0 :   Add2RawsList( hEffLED, 208, expert, !image, !saveCorr);//FK is published attahced to the CFD efficiency 
     447             :   
     448           0 :   TH1F* hEffQTC = new TH1F("hEffQTC","QTC efficiency; #PMT; QTC efficiency%s;",24, 0 ,24);
     449           0 :   hEffQTC->SetMinimum(0);
     450           0 :   hEffQTC->SetMaximum(2);
     451           0 :   Add2RawsList( hEffQTC,209, !expert, image, !saveCorr);
     452             :    
     453           0 :   TH2F* hCFD = new TH2F("hCFD","CFD ; #PMT; CFD {#channnels}", 24, 0 , 24,Int_t((high[210]-low[210])/4),low[210],high[210]);
     454           0 :   hCFD->SetOption("COLZ");
     455           0 :   Add2RawsList( hCFD,210, expert, !image, !saveCorr);//fk
     456             :     
     457           0 :   TH2F* hLED = new TH2F("hLED","LED ; #PMT; LED [#channnels]", 24, 0 , 24,Int_t((high[211]-low[211])/4),low[211],high[211]);
     458           0 :   hLED->SetOption("COLZ");
     459           0 :   Add2RawsList( hLED,211, expert, !image, !saveCorr);//fk
     460             : 
     461           0 :   TH2F* hQTC = new TH2F("hQTC","QTC ; #PMT; QTC [#channnels]", 24, 0, 24,Int_t( (high[212]-low[212])/4),low[212],high[212]);
     462           0 :   hQTC->SetOption("COLZ");
     463           0 :   Add2RawsList( hQTC,212, expert, !image, !saveCorr);//fk
     464             :   
     465           0 :   TH1F* hNumPMTA= new TH1F("hNumPMTA","number of PMT hitted per event A side",13, 0 ,13);
     466           0 :   Add2RawsList(hNumPMTA ,213, expert, image, !saveCorr);
     467             :   
     468           0 :   TH1F* hNumPMTC= new TH1F("hNumPMTC","number of PMT hitted per event C side",13, 0 ,13);
     469           0 :   Add2RawsList(hNumPMTC ,214, expert, image, !saveCorr);
     470             :   
     471           0 :   TH1F* hHitsOrA= new TH1F("hHitsOrA","T0_OR A hit multiplicity",20, 0 ,20);
     472           0 :   Add2RawsList( hHitsOrA,215, expert, !image, !saveCorr);
     473             :   
     474           0 :   TH1F* hHitsOrC= new TH1F("hHitsOrC","T0_OR C hit multiplicity",20, 0 ,20);
     475           0 :   Add2RawsList(hHitsOrC ,216, expert, !image, !saveCorr);
     476             :   
     477             :   
     478           0 :   TH1F* hOrCminOrA= new TH1F("Beam/hOrCminOrA","T0_OR C - T0_OR A [cm]",10000,-5000,5000);
     479           0 :   Add2RawsList( hOrCminOrA,219, expert, !image, !saveCorr); //FK
     480             : 
     481           0 :   TH1F* hOrCminOrATvdcOn= new TH1F("Beam/hOrCminOrATvdcOn","T0_OR C - T0_OR A TVDC on [cm]",10000,-5000,5000);
     482           0 :   Add2RawsList( hOrCminOrATvdcOn,217, expert, !image, !saveCorr);//FK
     483             :   
     484             : 
     485           0 :   TH1F* hOrCminOrATvdcOff= new TH1F("Beam/hOrCminOrATvdcOff","T0_OR C - T0_OR A TVDC off [cm]",10000,-5000,5000);
     486           0 :   Add2RawsList( hOrCminOrATvdcOff,218, expert, !image, !saveCorr);//FK
     487             : 
     488             :    //satellite  & beam background
     489           0 :   TH2F* hBeam = new TH2F("Beam/hBeam", "Mean vs Vertex from 1st hit", 120, -30, 30, 120, -30, 30);
     490           0 :   hBeam->SetOption("COLZ");
     491           0 :   hBeam->GetXaxis()->SetTitle("(T0C-T0A)/2, ns from 1st"); //vtx
     492           0 :   hBeam->GetYaxis()->SetTitle("(T0C+T0A)/2, ns"); //time
     493           0 :   Add2RawsList( hBeam,220, !expert, image, !saveCorr);
     494             : 
     495           0 :   TH2F* hBeamTVDCon = new TH2F("Beam/hBeamTVDCon", "Mean vs Vertex TVDC on from 1st hit",50, -5, 5, 50, -5, 5);//FK
     496           0 :   hBeamTVDCon->SetOption("COLZ");
     497           0 :   hBeamTVDCon->GetXaxis()->SetTitle("(T0C-T0A)/2, ns from 1st hit");
     498           0 :   hBeamTVDCon->GetYaxis()->SetTitle("(T0C+T0A)/2, ns");
     499           0 :   Add2RawsList( hBeamTVDCon,221, expert, image, !saveCorr);
     500             : 
     501           0 :   TH2F* hBeamTVDCoff = new TH2F("Beam/hBeamTVDCoff", "Mean vs Vertex TVDC off from 1st hit", 120, -30, 30, 120, -30, 30);
     502           0 :   hBeamTVDCoff->GetXaxis()->SetTitle("(T0C-T0A)/2, ns from 1st hit");
     503           0 :   hBeamTVDCoff->GetYaxis()->SetTitle("(T0C+T0A)/2, ns");
     504           0 :   hBeamTVDCoff->SetOption("COLZ");
     505           0 :   Add2RawsList( hBeamTVDCoff,222, expert, image, !saveCorr);
     506             : 
     507             :   //vertex 1st
     508             :   // TH1F* hVertex1stTVDCon = new TH1F("Beam/hVertex1stTVDCon", "(T0A-T0C)/2, ps, from 1st hit TVDC on", 200, -2000, 2000); //FK
     509           0 :   TH1F* hVertex1stTVDCon = new TH1F("Beam/hVertex1stTVDCon", "(T0A-T0C)/2, cm, from 1st hit TVDC on", 200, -100, 100); //alla
     510           0 :    Add2RawsList(hVertex1stTVDCon ,223, !expert, image, !saveCorr);
     511             :    //  TH1F* hVertex1stTVDCoff = new TH1F("Beam/hVertex1stTVDCoff", "(T0A-T0C)/2, ps, from 1st hit TVDC off", 500, -2000, 2000);//FK
     512           0 :   TH1F* hVertex1stTVDCoff = new TH1F("Beam/hVertex1stTVDCoff", "(T0A-T0C)/2, cm, from 1st hit TVDC off", 500, -100, 100);//alla
     513           0 :   Add2RawsList( hVertex1stTVDCoff,225, !expert, image, !saveCorr);
     514           0 :   TH1F* hMean1stTVDCon  = new TH1F("Beam/hMean1stTVDCon", "(T0A+T0C)/2, ps, from 1st hit TVDC on", 200, -2000, 2000);//FK
     515           0 :   Add2RawsList( hMean1stTVDCon,  226, !expert, image, !saveCorr);
     516           0 :   TH1F* hMean1stTVDCoff = new TH1F("Beam/hMean1stTVDCoff", "(T0A+T0C)/2, ps, from 1st hit TVDC off", 200, -2000, 2000);//FK
     517           0 :   Add2RawsList( hMean1stTVDCoff, 227, !expert, image, !saveCorr);
     518             : 
     519             :    
     520             :   //FK histograms start from 230
     521           0 :   TH1F* hRawVertexMinMean = new TH1F("hRawVertexMinMean","online 0TVX vertex signal minus mean; channels",200,-200,200);
     522           0 :   Add2RawsList(hRawVertexMinMean,230, expert, image, !saveCorr);//FK
     523             : 
     524           0 :   TH1F* hCFDSubtrMean = new TH1F("hCFDSubtrMean","CFD minus mean; #PMT; CFD - mean {#channnels}", 24, 0, 24);
     525           0 :   hCFDSubtrMean->SetMarkerStyle(20);
     526           0 :   hCFDSubtrMean->SetOption("p");
     527           0 :   Add2RawsList( hCFDSubtrMean,231, !expert, image, !saveCorr);//fk filled in Checker
     528             :     
     529           0 :   TH1F* hLEDSubtrMean = new TH1F("hLEDSubtrMean","LED minus mean; #PMT; LED - mean [#channnels]", 24, 0, 24);
     530           0 :   hLEDSubtrMean->SetMarkerStyle(20);
     531           0 :   hLEDSubtrMean->SetOption("p");
     532           0 :   Add2RawsList( hLEDSubtrMean,232, expert, image, !saveCorr);//fk filled in Checker
     533             : 
     534           0 :   TH1F* hQTCSubtrMean = new TH1F("hQTCSubtrMean","QTC minus mean; #PMT; QTC - mean [#channnels]", 24, 0, 24);
     535           0 :   hQTCSubtrMean->SetMarkerStyle(20);
     536           0 :   hQTCSubtrMean->SetOption("p");
     537           0 :   Add2RawsList( hQTCSubtrMean,233, expert, image, !saveCorr);//fk filled in Checker
     538             :  
     539           0 :   TH2F* hDiffOrCVersusDiffOrATvdcOn= new TH2F("Beam/hDiffOrCVersusDiffOrATvdcOn","ORC-meanORC versus ORA-meanORA (TVDC on)",50,-200,200,50,-200,200);
     540           0 :   hDiffOrCVersusDiffOrATvdcOn->SetOption("COLZ");
     541           0 :   hDiffOrCVersusDiffOrATvdcOn->GetXaxis()->SetTitle("ORA - mean ORA [channel]");
     542           0 :   hDiffOrCVersusDiffOrATvdcOn->GetYaxis()->SetTitle("ORC - mean ORC [channel]");
     543           0 :   Add2RawsList(hDiffOrCVersusDiffOrATvdcOn, 234, expert, image, !saveCorr);//FK
     544             :   
     545           0 :   TH2F* hDiffOrCVersusDiffOrATvdcOff= new TH2F("Beam/hDiffOrCVersusDiffOrATvdcOff","ORC-meanORC vetsus ORA-meanORA (TVDC off)",50,-200,200,50,-200,200);
     546           0 :   hDiffOrCVersusDiffOrATvdcOff->SetOption("COLZ");
     547           0 :   hDiffOrCVersusDiffOrATvdcOff->GetXaxis()->SetTitle("ORA - mean ORA [channel]");
     548           0 :   hDiffOrCVersusDiffOrATvdcOff->GetYaxis()->SetTitle("ORC - mean ORC [channel]");
     549           0 :   Add2RawsList(hDiffOrCVersusDiffOrATvdcOff, 235, expert, image, !saveCorr);//FK
     550             :  
     551           0 :   TH2F* hBCID = new TH2F("hBCID", "header BCID vs TRM BC ID ", 500, 0, 5000, 500, 0, 5000);
     552           0 :   hBCID->SetOption("COLZ");
     553           0 :   hBCID->GetXaxis()->SetTitle("TRM BC ID");
     554           0 :   hBCID->GetYaxis()->SetTitle("event header BC ID");
     555           0 :   Add2RawsList(hBCID ,236, !expert, image, !saveCorr);
     556             : 
     557             :   //CFD and LED efficiency in range ~2000- ~3000 
     558           0 :   TH1F* hCFDeffSubRange = new TH1F("hCFDeffSubRange"," CFD eff in subrange; #PMT; #CFD counts/nEvents",24, 0 ,24);  
     559           0 :   Add2RawsList( hCFDeffSubRange, 237, expert, !image, !saveCorr);//FK  
     560             : 
     561             :  
     562           0 :   TH1F* hEffLEDSubRange = new TH1F("hEffLEDSubRange","LED eff in subrange; #PMT; #LED counts/nEvent",24, 0 ,24);
     563           0 :   Add2RawsList( hEffLEDSubRange,238, expert, !image, !saveCorr);//FK
     564             :   // ratio CDF eff /LEF eff in subragne 
     565           0 :   TH1F* hRatioCFDLEDeff = new TH1F("hRatioCFDLEDeff","Ratio CFD/LED eff in subrange; #PMT; ratio CDF/LED eff",24, 0 ,24);  
     566           0 :   hRatioCFDLEDeff->SetMinimum(0);
     567           0 :   hRatioCFDLEDeff->SetMaximum(2);
     568           0 :   Add2RawsList( hRatioCFDLEDeff, 239, expert, image, !saveCorr);//FK   
     569             :  
     570           0 :   TH1F* hEventCounter = new TH1F("hEventCounter","Event counter for eff histos; X; number of events",1, 0 ,1);  
     571           0 :   Add2RawsList( hEventCounter, 240, expert, !image, !saveCorr);//FK   
     572             : 
     573             :   //counters 
     574           0 :   TH1F* hRawTriggerCounter = new TH1F("hRawTriggerCounter"," triggers;Trigger ;Counts",6,0,6);
     575           0 :   for (Int_t itr=0; itr<6; itr++) hRawTriggerCounter->Fill(triggers[itr], 0);
     576           0 :   Add2RawsList(hRawTriggerCounter ,241, expert, !image, !saveCorr);
     577             :  
     578           0 :   TH1F* hCFDCounter= new TH1F("hCFDCounter"," CFD counter #PMT; #CFD counts",24, 0 ,24);  
     579           0 :   Add2RawsList( hCFDCounter, 242, expert, !image, !saveCorr);//FK   
     580           0 :   TH1F* hLEDCounter = new TH1F("hLEDCounter","LED counter; #PMT; #LED counts",24, 0 ,24);
     581           0 :   Add2RawsList( hLEDCounter, 243, expert, !image, !saveCorr);//FK
     582             :  
     583           0 :   TH1F* hCFDeffSubRangeCounter = new TH1F("hCFDeffSubRangeCounter"," CFD eff in subrange counter; #PMT; #CFD counts",24, 0 ,24);  
     584           0 :   Add2RawsList( hCFDeffSubRangeCounter, 244, expert, !image, !saveCorr);//FK  
     585           0 :   TH1F* hEffLEDSubRangeCounter = new TH1F("hEffLEDSubRangeCounter","LED eff in subrange counter; #PMT; #LED counts",24, 0 ,24);
     586           0 :   Add2RawsList( hEffLEDSubRangeCounter,245, expert, !image, !saveCorr);//FK
     587             :  
     588           0 :   TH1F* hQTCCounter = new TH1F("hQTCCounter","QTC counter; #PMT; QTC counts;",24, 0 ,24);
     589           0 :   Add2RawsList( hQTCCounter,246, expert, !image, !saveCorr);
     590             :  
     591           0 :   ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
     592           0 : }
     593             :   
     594             : //____________________________________________________________________________ 
     595             : void AliT0QADataMakerRec::InitDigits()
     596             : {
     597             :   // create Digits histograms in Digits subdir
     598             :   const Bool_t expert   = kTRUE ; 
     599             :   const Bool_t image    = kTRUE ; 
     600             :   
     601           0 :   TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits; #PMT; CFD digits[#channels]",25,-0.5,24.5,100,0,1000);
     602           0 :   fhDigCFD->SetOption("COLZ");
     603           0 :   Add2DigitsList( fhDigCFD,0, !expert, image);
     604           0 :   TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits; #PMT; LED-CFD amplitude ",25,-0.5,24.5,100,100,1000);
     605           0 :   fhDigLEDamp->SetOption("COLZ");
     606           0 :   Add2DigitsList( fhDigLEDamp,1, !expert, !image);
     607           0 :   TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits; #PMT; QTC amplitude",25,-0.5,24.5,100,100,10000);
     608           0 :   fhDigQTC->SetOption("COLZ");
     609           0 :   Add2DigitsList( fhDigQTC,2, !expert, !image);
     610             :   //
     611           0 :   ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
     612           0 : }
     613             : 
     614             : //____________________________________________________________________________ 
     615             : 
     616             : void AliT0QADataMakerRec::InitRecPoints()
     617             : {
     618             :   // create cluster histograms in RecPoint subdir
     619             :   const Bool_t expert   = kTRUE ; 
     620             :   const Bool_t image    = kTRUE ; 
     621             : 
     622           0 :   TH2F* fhRecCFD = new TH2F("hRecCFD"," CFD time;#PMT; CFD Time [ns];",24, 0 ,24, 
     623             :                               100,-50,50);
     624           0 :   fhRecCFD->SetOption("COLZ");
     625           0 :   Add2RecPointsList ( fhRecCFD,0, !expert, image);
     626             : 
     627           0 :   TH2F* fhRecAmpDiff = new TH2F("hRecAmpDiff"," LED-CFD  min QTC amplitude;#PMT; difference [MIPs];",
     628             :                                 24, 0 ,24, 200,-10,10);
     629           0 :   fhRecAmpDiff->SetOption("COLZ");
     630           0 :   Add2RecPointsList (fhRecAmpDiff, 1, !expert, image);
     631             :   
     632           0 :   TH1F *fhMean = new TH1F("hMean","online - rec mean;online - rec mean[#channels];",2000, -1000, 1000);
     633           0 :   Add2RecPointsList ( fhMean,2, !expert, image);
     634             :   //
     635           0 :   ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
     636           0 : }
     637             : 
     638             : //____________________________________________________________________________
     639             : void AliT0QADataMakerRec::InitESDs()
     640             : {
     641             :   //create ESDs histograms in ESDs subdir
     642             :   const Bool_t expert   = kTRUE ; 
     643             :   const Bool_t image    = kTRUE ; 
     644             :   
     645           0 :   TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean; mean time[%channels]",1000, -5, 5);
     646           0 :   Add2ESDsList(fhESDMean, 0, expert, !image) ;
     647           0 :   TH1F * fhESDVertex = new TH1F("hESDvertex","ESDvertex; vertex[cm];",82,-30,30);
     648           0 :   Add2ESDsList(fhESDVertex, 1, expert, !image) ;
     649             :   
     650           0 :   TH1F * fhESDResolution = new TH1F("hESDResolution","(T0A-T0C)/2 corrected by SPD vertex; ns",800,-2,2);
     651           0 :   Add2ESDsList(fhESDResolution, 2, !expert, image) ;
     652             :   //
     653           0 :   ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
     654           0 : }
     655             : 
     656             : //____________________________________________________________________________
     657             : void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
     658             : {
     659             :   //indices in lookup table lookUpTable_tanay.txt 
     660             :   enum { kTZeroRefPoint=0, kTZeroFirstCfdC=1, kTZeroFirstLedC=13, kTZeroFirstQT0C=25,kTZeroFirstQT1C=26,
     661             :          kTZeroVertex=50, kTZeroOrA=51, kTZeroOrC=52, kT0multAQ0=53, kT0multAQ1=54, kTZeroMultCent=55, kTZeroMultSemi=56,
     662             :          kTZeroFirstCfdA=57, kTZeroFirstLedA=69, kTZeroFirstQT0A=81,kTZeroFirstQT1A=82,
     663             :          kT0multCQ0=105, kT0multCQ1=106, kT0meaner=49 
     664             :   }; 
     665             : 
     666           0 :   Int_t  time[24] ;
     667           0 :   for(Int_t i=0; i<24; i++) time[i] = 0;       
     668           0 :   rawReader->Reset() ; 
     669             :   //fills QA histos for RAW
     670             :   //Int_t shift=0;
     671             :   // Int_t refPointParam = GetRecoParam()->GetRefPoint();
     672             :   Int_t refpoint = 0;
     673             :   Int_t refPointParam = 0;
     674             :   
     675           0 :   AliT0RawReader *start = new AliT0RawReader(rawReader);
     676             :   
     677           0 :   if (! start->Next()) {
     678           0 :     AliDebug(AliQAv1::GetQADebugLevel(),Form(" no raw data found!!"));
     679           0 :     delete start;
     680           0 :     return;
     681             :   }
     682           0 :   UInt_t type =rawReader->GetType();
     683           0 :   if (GetEventSpecie()==AliRecoParam::kCalib && type!=8) {
     684           0 :      delete start;
     685           0 :     return;
     686             :   }
     687             :   //
     688             :   // RS: Don't use custom counters, they create problems with trigger cloning
     689             :   //     Use instead framework counters, incremented in the end of this routine
     690             :   // RS: There is some inconsistency here: the separation of physics and calib. events/histos is done by
     691             :   // fEventSpecie. Why do we book separate histos on different slots for calib and physics ? 
     692             :   // I am changing this in such way that we don't need local counters like fNumTriggers (the corresponding
     693             :   // histos now incremented in the MakeRaws, and for the normalization I will use the framework's counters
     694             :   // AliQADataMaker::GetEvCountCycle(...), AliQADataMaker::GetEvCountTotal(...)
     695             :   //
     696             :   // I think the histos xx+250 should be suppressed (the xx calib histos of specie==calibration will be 
     697             :   // used automatically)
     698             :       
     699             :  //
     700             :   //BC ID
     701             :   //  if (type == 7){
     702           0 :   UInt_t bcid = rawReader->GetBCID();
     703           0 :   UInt_t        trmbcid = start->GetTRMBunchID();
     704             :   
     705           0 :   FillRawsData(236,trmbcid, bcid);
     706             :   //FillRawsData(236,100, bcid); fake error for testing
     707             :  
     708             :  //  }    
     709             :   //    if (type == 7){ shift=1;   fnEventPhys++;}
     710           0 :   Int_t allData[220][5];
     711           0 :   for(Int_t i0=0; i0<220; i0++){
     712           0 :     for(Int_t j0=0; j0<5; j0++){
     713           0 :       allData[i0][j0]=0;
     714             :     } 
     715             :   }
     716             : 
     717           0 :   for(Int_t i=0; i<=211; i++){ 
     718           0 :     for(Int_t iHit=0; iHit<5; iHit++){
     719           0 :       allData[i][iHit]= start->GetData(i,iHit);
     720             :     }
     721             :   }
     722             : 
     723           0 :   if( allData[kTZeroRefPoint][0] > 0  /*&& (type == 7)*/){
     724           0 :     FillRawsData(0, allData[kTZeroRefPoint][0]); //Reference point
     725           0 :   }
     726           0 :   refpoint = allData[refPointParam][0];
     727             :   if(refPointParam <  0 ) refpoint=0; 
     728           0 :   if(refPointParam == 0 ) refpoint = allData[kTZeroRefPoint][0] - 5000;
     729             :   
     730             :   Int_t offsetCDF, offsetLED, offsetQT0, offsetQT1;
     731             :   Int_t numPmtC=0;    
     732             :   Int_t numPmtA=0;   
     733             :  
     734           0 :   for(Int_t ik = 0; ik<24; ik++){
     735             :     Int_t ipmt = ik; //C side
     736           0 :     if(ik<12) {
     737             :       offsetCDF = kTZeroFirstCfdC;
     738             :       offsetLED = kTZeroFirstLedC;
     739             :       offsetQT0 = kTZeroFirstQT0C;
     740             :       offsetQT1 = kTZeroFirstQT1C;
     741           0 :       if(allData[ipmt+offsetCDF][0]>0 /*&& type == 7 */ )  numPmtC++;
     742             :     }else{
     743           0 :       ipmt = ik - 12; //A side 
     744             :       offsetCDF = kTZeroFirstCfdA;
     745             :       offsetLED = kTZeroFirstLedA;
     746             :       offsetQT0 = kTZeroFirstQT0A;
     747             :       offsetQT1 = kTZeroFirstQT1A;
     748           0 :       if(allData[ipmt + offsetCDF][0]>0 /*&& type == 7 */) numPmtA++;
     749             :     }
     750             :     Int_t nhitsPMT=0; //count hits for this pmt
     751             : 
     752           0 :     for (Int_t iHt=0; iHt<5; iHt++) {
     753             :       //cfd
     754           0 :       if(allData[ipmt+offsetCDF][iHt]>0){
     755           0 :         FillRawsData(ik+1, allData[ipmt+offsetCDF][iHt]);  //CFD for each PMT
     756           0 :         FillRawsData(210, ik, allData[ipmt+offsetCDF][iHt]); //CFD vs PMT
     757           0 :         FillRawsData(242,ik,1.); // CFD counter for efficiency  
     758           0 :         if( fCFDEffSubRangeLowParam<allData[ipmt+offsetCDF][iHt] && allData[ipmt+offsetCDF][iHt]<fCFDEffSubRangeHighParam){
     759           0 :           FillRawsData(244,ik,1.); //count CDF entries in given subrange  for   CDF/LED eff ratio
     760           0 :         }
     761           0 :         AliDebug(50,Form("%i CFD %i  data %s",ik, ipmt+offsetCDF,  GetRawsData(ik+1)->GetName()));
     762           0 :         nhitsPMT++;
     763           0 :       }
     764             :       //led
     765           0 :       if(allData[ipmt+offsetLED][iHt] > 0){ 
     766           0 :         FillRawsData(ik+25,allData[ipmt+offsetLED][iHt]);
     767           0 :         FillRawsData(211,ik, allData[ipmt+offsetLED][iHt]);
     768           0 :         FillRawsData(243,ik,1.); //LED counter for LED efficiency 
     769           0 :         if(fLEDEffSubRangeLowParam < allData[ipmt+offsetLED][iHt] && allData[ipmt+offsetLED][iHt]<fLEDEffSubRangeHighParam){
     770           0 :           FillRawsData(245,ik,1.); //count LED entries in given subrange for   CDF/LED eff ratio
     771           0 :         } 
     772           0 :         AliDebug(50,Form("%i LED %i  data %s",ik, ipmt+offsetLED,  GetRawsData(ik+25)->GetName()));
     773             :       }
     774             : 
     775             :       //led -cfd
     776           0 :       if(allData[ipmt+offsetLED][iHt] > 0 && allData[ipmt+offsetCDF][iHt] > 0 )
     777           0 :         FillRawsData(ik+49, allData[ipmt+offsetLED][iHt]-allData[ipmt+offsetCDF][iHt]);
     778             :       
     779             :       //qtc
     780           0 :       if(allData[2*ipmt+offsetQT0][iHt] > 0 &&
     781           0 :          allData[2*ipmt+offsetQT1][iHt] > 0 ) {
     782             :         
     783           0 :         FillRawsData(ik+73, allData[2*ipmt+offsetQT0][iHt]-allData[2*ipmt+offsetQT1][iHt]); //QTC = QT0 - QT1 for each channel
     784           0 :         FillRawsData(212,ik, allData[2*ipmt+offsetQT0][iHt]-allData[2*ipmt+offsetQT1][iHt]); //QTC vs pmt
     785             : 
     786           0 :         FillRawsData(246,ik,1.); // QTC counter for QTC efficiency
     787             : 
     788           0 :         AliDebug(50,Form("%i QTC %i  data %s",ik, 2*ipmt+offsetQT0, GetRawsData(ik+73)->GetName()));
     789             :         
     790             :       }
     791           0 :       if(allData[2*ipmt+offsetQT0][iHt] > 0) { //QT0
     792           0 :         AliDebug(50,Form("%i QT0 %i  data %s",ik, 2*ipmt+offsetQT0, GetRawsData(ik+97)->GetName()));
     793           0 :         FillRawsData(ik+97,allData[2*ipmt+offsetQT0][iHt]);
     794           0 :       }
     795           0 :       if(allData[2*ipmt+offsetQT1][iHt] > 0) {//QT1
     796           0 :         AliDebug(50,Form("%i QT1 %i  data %s",ik, 2*ipmt+offsetQT1, GetRawsData(ik+121)->GetName()));
     797           0 :         FillRawsData(ik+121,allData[2*ipmt+offsetQT1][iHt]);
     798           0 :       }
     799             :     }
     800             :       
     801           0 :     FillRawsData(ik+176, nhitsPMT);
     802             :   }
     803           0 :   FillRawsData(213, numPmtA);
     804           0 :   FillRawsData(214, numPmtC);
     805             :      
     806             :  
     807           0 :   Int_t trChannel[6] = {kT0meaner, kTZeroVertex, kTZeroOrA, kTZeroOrC, kTZeroMultCent, kTZeroMultSemi};
     808             :   Float_t ch2cm = 24.4*0.029979;     
     809             :   Int_t nhitsOrA=0;
     810             :   Int_t nhitsOrC=0;
     811             : 
     812           0 :   for (Int_t iHt=0; iHt<5; iHt++) {
     813             :     //orA-orC phys tvdc 1 
     814           0 :     if((allData[kTZeroOrA][iHt]>0 && allData[kTZeroOrC][iHt]>0) && allData[kTZeroVertex][iHt]>0) {
     815           0 :       AliDebug(10,Form("orA-orC phys tvdc 1  %i  data %s", 217,  GetRawsData(217)->GetName()));
     816             :       
     817           0 :       FillRawsData(217,(allData[kTZeroOrC][iHt] - allData[kTZeroOrA][iHt])*ch2cm);
     818           0 :     }
     819             :     //orA-orC phys tvdc 0 
     820           0 :     if((allData[kTZeroOrA][iHt]>0 && allData[kTZeroOrC][iHt]>0) && allData[kTZeroVertex][iHt]<=0) {
     821           0 :       AliDebug(10,Form("orA-orC phys tvdc 0  %i  data %s", 218,  GetRawsData(218)->GetName()));
     822             :         
     823           0 :       FillRawsData(218,(allData[kTZeroOrC][iHt] - allData[kTZeroOrA][iHt])*ch2cm);
     824           0 :     }
     825           0 :     if(allData[kTZeroOrA][iHt]>0 && allData[kTZeroOrC][iHt]>0) {
     826           0 :       AliDebug(50,Form("orA-orC phys tvdc all  %i  data %s", 219,  GetRawsData(219)->GetName()));
     827           0 :       FillRawsData(219,(allData[kTZeroOrC][iHt] - allData[kTZeroOrA][iHt])*ch2cm);
     828           0 :     }
     829             : 
     830             : 
     831           0 :     for (Int_t itr=0; itr<6; itr++) {//T0_MEAN,TO_VERTX,ORA,ORC,T0_mult,T0_mult
     832           0 :       if (allData[trChannel[itr]][iHt] >0) {
     833             :         //
     834             :         // RS instead of incremented custom counters, fill directly the specie-specific histos
     835             :         //      FillRawsData(169+shift, 0.5+itr, 1.);  // RS: increment counters
     836             :         // FillRawsData(169+shift, itr, 1.);  //hRawTrigger RS: increment counters
     837           0 :         FillRawsData(241, itr, 1.); // fill trigger counter
     838           0 :         AliDebug(50,Form(" triggers %i  data %s", 170+itr,  GetRawsData(170+itr)->GetName()));
     839             :         
     840           0 :         FillRawsData(170+itr,allData[trChannel[itr]][iHt]);
     841             :     
     842           0 :         if( trChannel[itr] == kTZeroVertex){ //T0_VERTEX minus mean from config files
     843           0 :           FillRawsData(230, allData[kTZeroVertex][iHt] - fMeanRawVertexParam );
     844           0 :         }
     845             :       }
     846             :     }
     847             : 
     848           0 :     if(allData[kTZeroOrA][iHt] > 0  &&  allData[kTZeroOrC][iHt] > 0  ){ //FK// ORC-mean   ORA -mean 
     849           0 :       Float_t  diffORA =  allData[kTZeroOrA][iHt] - fMeanORAParam;
     850           0 :       Float_t  diffORC =  allData[kTZeroOrC][iHt] - fMeanORCParam;
     851           0 :       if(allData[kTZeroVertex][iHt]>0){ //TVDC on
     852           0 :         FillRawsData(234, diffORA, diffORC);     
     853             :          //Estimate mean orA and orC based on these
     854             :        //cout<<"ORA  "<<allData[kTZeroOrA][iHt]<<endl;
     855             :        //cout<<"ORC  "<<allData[kTZeroOrC][iHt]<<endl;
     856             : 
     857           0 :       }else{//TVDC off
     858           0 :         FillRawsData(235, diffORA, diffORC);
     859             :       }
     860           0 :     }
     861             :     
     862           0 :     /*   if(type == 7) */if(allData[kTZeroOrA][iHt] >0){
     863           0 :                              nhitsOrA++;
     864           0 :                          } 
     865           0 :     /* if(type == 7) */if(allData[kTZeroOrC][iHt] >0){
     866           0 :                              nhitsOrC++;
     867           0 :                          }
     868             :     //mult trigger signals phys
     869             :     //A side
     870           0 :     if(allData[kT0multAQ0][iHt]>0 && allData[kT0multAQ1][iHt]>0) {
     871           0 :       AliDebug(50,Form(" mpdA %i  data %s", 201,  GetRawsData(201)->GetName()));
     872             :       
     873           0 :       FillRawsData(201,allData[kT0multAQ0][iHt]-allData[kT0multAQ1][iHt]);
     874           0 :       if(allData[kTZeroMultSemi][iHt]>0) FillRawsData(202,allData[kT0multAQ0][iHt]-allData[kT0multAQ1][iHt]);
     875           0 :       if(allData[kTZeroMultCent][iHt]>0) FillRawsData(203,allData[kT0multAQ0][iHt]-allData[kT0multAQ1][iHt]);
     876             :     }
     877             :     
     878             :     //C side 
     879           0 :     if(allData[kT0multCQ0][iHt]>0 && allData[kT0multCQ1][iHt]>0) {
     880           0 :       AliDebug(50,Form(" mpdC %i  data %s", 204,  GetRawsData(204)->GetName()));
     881             :         
     882           0 :       FillRawsData(204,allData[kT0multCQ0][iHt]-allData[kT0multCQ1][iHt]);
     883           0 :       if(allData[kTZeroMultSemi][iHt]>0) FillRawsData(205,allData[kT0multCQ0][iHt]-allData[kT0multCQ1][iHt]);
     884           0 :       if(allData[kTZeroMultCent][iHt]>0) FillRawsData(206,allData[kT0multCQ0][iHt]-allData[kT0multCQ1][iHt]);
     885             :     }
     886             :   }
     887             :     
     888           0 :   FillRawsData(215,nhitsOrA);
     889           0 :   FillRawsData(216,nhitsOrC);
     890             : 
     891             :   // new QTC 
     892           0 :   Float_t diff[4];
     893             :   Int_t pmt;
     894           0 :   for(Int_t iHt = 0; iHt<5; iHt++) {
     895           0 :     for(int id=0; id<4; id++) diff[id] = 0;
     896             :     //new QTC C side
     897           0 :     for (Int_t  ik=0; ik<56; ik++)
     898             :       {
     899           0 :         if(ik<48) {
     900             :           pmt=ik/4;    
     901           0 :           if  (allData[107+ik][iHt]!=0) 
     902           0 :             FillRawsData(ik+250, allData[107+ik][iHt]);   
     903             :         }
     904             :         else
     905           0 :           if  (allData[107+ik][iHt]!=0) FillRawsData(250+ik+144-48, allData[107+ik][iHt]);
     906             :       }
     907             :     
     908           0 :     for (Int_t ik=0; ik<48; ik+=4)
     909             :       {
     910           0 :         pmt=ik/4;    
     911           0 :         diff[0]=allData[107+pmt*4][iHt] - allData[107+pmt*4+1][iHt];
     912           0 :         diff[1]=allData[107+pmt*4+2][iHt] - allData[107+pmt*4+3][iHt];
     913           0 :         if(diff[0] != 0)   FillRawsData(250+pmt+96, diff[0]);
     914           0 :         if(diff[1] != 0)   FillRawsData(250+pmt+120,  diff[1]); //!!!
     915             :         
     916             :       }
     917             :     //new MPD ch 48+
     918           0 :     diff[0] = allData[107+48][iHt] - allData[107+48+1][iHt];
     919           0 :     diff[1] = allData[107+48+2][iHt] - allData[107+48+3][iHt];
     920           0 :     diff[2] = allData[107+48+4][iHt] - allData[107+48+5][iHt];
     921           0 :     diff[3] = allData[107+48+6][iHt] - allData[107+48+7][iHt];
     922           0 :     for (Int_t  i=0; i<4; i++) 
     923           0 :       if (diff[i] !=0) FillRawsData(250+152+i, diff[i]);
     924             :     
     925             :     //new QTC A
     926           0 :     for (Int_t  ik=56; ik<106; ik++)
     927             :       {
     928           0 :         pmt=(ik-8)/4;
     929           0 :         if  (allData[107+ik][iHt]!=0) {
     930           0 :           FillRawsData(250+ik-8, allData[107+ik][iHt]);   
     931           0 :         }
     932             :       }
     933           0 :     for (Int_t ik=56; ik<106; ik+=4)
     934             :       {
     935           0 :         pmt=(ik-8)/4;
     936           0 :         diff[0]=allData[107+ik][iHt] - allData[107+ik+1][iHt];
     937           0 :         diff[1]=allData[107+ik+2][iHt] - allData[107+ik+3][iHt];
     938           0 :         if(diff[0] != 0 ) {
     939           0 :           FillRawsData(250+pmt+96, diff[0]);
     940           0 :         }
     941           0 :         if(diff[1] != 0 ) {
     942           0 :           FillRawsData(250+pmt+120, diff[1]); //!!!
     943           0 :         }
     944             :       } 
     945             :   } //iHit
     946             :   //end new QTC
     947             :   //draw satellite
     948           0 :   for (int itr=-1;itr<GetNEventTrigClasses();itr++) { //RS loop over all active trigger classes, including the global one
     949           0 :     int itrID = itr==-1 ? -1 : int( GetEventTrigClass(itr)->GetUniqueID());
     950             : 
     951             :     Float_t c = 0.0299792458; // cm/ps
     952           0 :     TH2 *hBeam             = (TH2*)GetRawsData(220,itrID);
     953           0 :     TH2 *hBeamTVDCon       = (TH2*)GetRawsData(221,itrID);
     954           0 :     TH2 *hBeamTVDCoff      = (TH2*)GetRawsData(222,itrID);
     955           0 :     TH1 *hVertex1stTVDCon  = (TH1*)GetRawsData(223,itrID);
     956           0 :     TH1 *hVertex1stTVDCoff = (TH1*)GetRawsData(225,itrID);
     957           0 :     TH1 *hMean1stTVDCon    = (TH1*)GetRawsData(226,itrID);
     958           0 :     TH1 *hMean1stTVDCoff   = (TH1*)GetRawsData(227,itrID);
     959           0 :     if(hBeam || hBeamTVDCon || hBeamTVDCoff || hVertex1stTVDCon || hVertex1stTVDCoff || hMean1stTVDCon || hMean1stTVDCoff){
     960             :      
     961             :       Int_t time1stA=9999999;
     962             :       Int_t time1stC=9999999;
     963           0 :       for(Int_t ipmt=0; ipmt<12; ipmt++){
     964           0 :         if(allData[ipmt+kTZeroFirstCfdC][0] > 1 ) {
     965           0 :           time[ipmt] = allData[ipmt+kTZeroFirstCfdC][0] - (Int_t) fMeanCFDFromGoodRunParam[ipmt]; //fk
     966           0 :           if(time[ipmt] < time1stC)  time1stC=time[ipmt]; //timeC
     967             :         }
     968             :       }
     969           0 :       for( Int_t ipmt=12; ipmt<24; ipmt++){
     970           0 :         if(allData[ipmt-12+kTZeroFirstCfdA][0] > 0) {
     971           0 :           time[ipmt] = allData[ipmt-12+kTZeroFirstCfdA][0] - (Int_t) fMeanCFDFromGoodRunParam[ipmt];//fk
     972           0 :           if(time[ipmt] < time1stA)  time1stA=time[ipmt]; //timeC
     973             :         }
     974             :       }
     975           0 :       if(time1stA<99999 && time1stC< 99999) { //From First
     976           0 :         Float_t t01st  = 24.4 * (Float_t) (( time1stA + time1stC)/2.0);
     977           0 :         Float_t ver1st = 24.4 * (Float_t) (( time1stC - time1stA)/2.0);
     978           0 :         if(hBeam) hBeam->Fill(0.001*ver1st, 0.001*(t01st)); //Mean versus vertex
     979           0 :         if(allData[kTZeroVertex][0] > 0){//TVDC on
     980           0 :           if(hBeamTVDCon)      hBeamTVDCon->Fill(0.001*ver1st, 0.001*(t01st));//Mean versus  TVDC on from first
     981             :           //if(hVertex1stTVDCon) hVertex1stTVDCon->Fill(ver1st);
     982           0 :           if(hVertex1stTVDCon) hVertex1stTVDCon->Fill(c*ver1st);   //alla ps2cm
     983           0 :           if(hMean1stTVDCon)   hMean1stTVDCon->Fill(t01st);
     984             :        }else{//TVDC off
     985           0 :           if(hBeamTVDCoff)      hBeamTVDCoff->Fill(0.001*ver1st, 0.001*(t01st));//FK// TVDC off from first
     986           0 :           if(hVertex1stTVDCoff) hVertex1stTVDCoff->Fill(c*ver1st); //alla ps2cm
     987           0 :           if(hMean1stTVDCoff)   hMean1stTVDCoff->Fill(t01st);
     988             :         }
     989           0 :       }   
     990           0 :     } //
     991             :   } // RS loop over all active trigger classes, including the global one
     992             :     //
     993           0 :     IncEvCountCycleRaws();
     994           0 :     IncEvCountTotalRaws();
     995             :     //
     996           0 :     delete start;
     997           0 : }
     998             :   
     999             : //____________________________________________________________________________
    1000             : void AliT0QADataMakerRec::MakeDigits( TTree *digitsTree)
    1001             : {
    1002             :   //fills QA histos for Digits
    1003             : 
    1004           0 :   TArrayI *digCFD = new TArrayI(24);
    1005           0 :   TArrayI *digLED = new TArrayI(24);
    1006           0 :   TArrayI *digQT0 = new TArrayI(24);
    1007           0 :   TArrayI *digQT1 = new TArrayI(24);
    1008             :   Int_t refpoint=0;
    1009             :   
    1010           0 :   TBranch *brDigits=digitsTree->GetBranch("T0");
    1011           0 :   AliT0digit *fDigits = new AliT0digit() ;
    1012           0 :   if (brDigits) {
    1013           0 :     brDigits->SetAddress(&fDigits);
    1014             :   }else{
    1015           0 :     AliError(Form("EXEC Branch T0 digits not found"));
    1016           0 :     delete digCFD;
    1017           0 :     delete digLED;
    1018           0 :     delete digQT0;
    1019           0 :     delete digQT1;
    1020           0 :     return;
    1021             :   }
    1022           0 :   digitsTree->GetEvent(0);
    1023           0 :   digitsTree->GetEntry(0);
    1024           0 :   brDigits->GetEntry(0);
    1025           0 :   fDigits->GetTimeCFD(*digCFD);
    1026           0 :   fDigits->GetTimeLED(*digLED);
    1027           0 :   fDigits->GetQT0(*digQT0);
    1028           0 :   fDigits->GetQT1(*digQT1);
    1029           0 :   refpoint = fDigits->RefPoint();
    1030           0 :   for (Int_t i=0; i<24; i++) {
    1031           0 :     if (digCFD->At(i)>0) {
    1032           0 :       Int_t cfd=digCFD->At(i)- refpoint;
    1033           0 :       FillDigitsData(0,i,cfd);
    1034           0 :       FillDigitsData(1,i, (digLED->At(i) - digCFD->At(i)));
    1035           0 :       FillDigitsData(2,i, (digQT1->At(i) - digQT0->At(i)));
    1036           0 :     }
    1037             :   }  
    1038             :   
    1039           0 :   delete digCFD;
    1040           0 :   delete digLED;
    1041           0 :   delete digQT0;
    1042           0 :   delete digQT1;
    1043             :   //
    1044           0 :   IncEvCountCycleDigits();
    1045           0 :   IncEvCountTotalDigits(); 
    1046           0 :   delete fDigits;
    1047             :   //  
    1048           0 : }
    1049             : 
    1050             : //____________________________________________________________________________
    1051             : void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
    1052             : {
    1053             :   //fills QA histos for clusters
    1054             : 
    1055           0 :   AliT0RecPoint* frecpoints= new AliT0RecPoint ();
    1056           0 :   if (!frecpoints) {
    1057           0 :     AliError(":MakeRecPoints >> no recpoints found");
    1058           0 :     return;
    1059             :   }
    1060           0 :   TBranch *brRec =clustersTree ->GetBranch("T0");
    1061           0 :   if (brRec) {
    1062           0 :     brRec->SetAddress(&frecpoints);
    1063             :   }else{
    1064           0 :     AliError(Form("EXEC Branch T0 rec not found "));
    1065           0 :     return;
    1066             :   } 
    1067             : 
    1068           0 :   brRec->GetEntry(0);
    1069             :   
    1070           0 :   for ( Int_t i=0; i<24; i++) {
    1071           0 :     if(i<12)
    1072           0 :       FillRecPointsData(0, i, frecpoints -> GetTime(i) - frecpoints -> GetTime(0)); 
    1073           0 :     if(i>11)
    1074           0 :       FillRecPointsData(0, i,  frecpoints -> GetTime(i) - frecpoints -> GetTime(12)); 
    1075           0 :     FillRecPointsData(1, i, frecpoints -> GetAmp(i) - frecpoints->AmpLED(i));
    1076             :   }
    1077           0 :   Double_t mmm=frecpoints->GetOnlineMean()- frecpoints->GetMeanTime();
    1078           0 :   FillRecPointsData(2,mmm);
    1079             :   //
    1080           0 :   IncEvCountCycleRecPoints();
    1081           0 :   IncEvCountTotalRecPoints();
    1082             :   //  
    1083           0 :   delete frecpoints;
    1084           0 : }
    1085             : 
    1086             : //____________________________________________________________________________
    1087             : void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd)
    1088             : {
    1089             :   //fills QA histos for ESD
    1090             :   
    1091             :   const Double32_t  *mean;
    1092           0 :   mean = esd->GetT0TOF();
    1093           0 :   Double32_t t0time= 0.001*mean[0];
    1094           0 :   Double32_t orA= 0.001*mean[1];
    1095           0 :   Double32_t orC=0.001* mean[2];
    1096             : 
    1097           0 :   if (t0time<99)   FillESDsData(0,t0time);
    1098           0 :   if( esd->GetT0zVertex() <99) FillESDsData(1, esd->GetT0zVertex());
    1099           0 :   if( orA<99 && orC<99) FillESDsData(2,(orA-orC)/2.);
    1100             :   //
    1101           0 :   IncEvCountCycleESDs();
    1102           0 :   IncEvCountTotalESDs();
    1103             :   //
    1104           0 : }
    1105             : //____________________________________________________________________________
    1106             : //____________________________________________________________________________
    1107             : void AliT0QADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
    1108             : {
    1109             : 
    1110             :  //reset the detector histograms for a given task
    1111           0 :   AliQADataMakerRec::ResetDetector(task);
    1112             : 
    1113           0 :   for(int ih=0; ih<=250; ih++){
    1114           0 :     for(int itr=-1; itr < GetNEventTrigClasses(); itr++){ 
    1115           0 :       int itrID = itr==-1 ? -1 : int( GetEventTrigClass(itr)->GetUniqueID());
    1116             : 
    1117           0 :       TH1 *htmp = (TH1*) GetRawsData(ih,itrID);
    1118           0 :       if(htmp) htmp->Reset();
    1119             :     } 
    1120             :   }
    1121           0 : }
    1122             : 
    1123             : 
    1124             : /*
    1125             : void AliT0QADataMakerRec::GetMeanAndSigma(TH1F* hist, Float_t &mean, Float_t &sigma) 
    1126             : {
    1127             : 
    1128             :   const double window = 3.;  //fit window 
    1129             :  
    1130             :   double meanEstimate, sigmaEstimate; 
    1131             :   int maxBin;
    1132             :   maxBin        =  hist->GetMaximumBin(); //position of maximum
    1133             :   meanEstimate  =  hist->GetBinCenter( maxBin); // mean of gaussian sitting in maximum
    1134             :   sigmaEstimate = hist->GetRMS();
    1135             :   TF1* fit= new TF1("fit","gaus", meanEstimate - window*sigmaEstimate, meanEstimate + window*sigmaEstimate);
    1136             :   fit->SetParameters(hist->GetBinContent(maxBin), meanEstimate, sigmaEstimate);
    1137             :   hist->Fit("fit","RQ","Q");
    1138             : 
    1139             :   mean  = (Float_t) fit->GetParameter(1);
    1140             :   sigma = (Float_t) fit->GetParameter(2);
    1141             : 
    1142             :   delete fit;
    1143             : }
    1144             : */
    1145             : 
    1146             : void AliT0QADataMakerRec::SetEfficiency(Int_t idxEffHisto, Int_t idxCounterHisto, Int_t trigger, Float_t totNumOfEvts){
    1147             :   //calculate efficiency =  counts/number of events
    1148           0 :   TH1* heff     = GetRawsData(idxEffHisto,trigger);
    1149           0 :   TH1* hcounter = GetRawsData(idxCounterHisto,trigger);
    1150           0 :   if(heff && hcounter && (totNumOfEvts>0.0)){
    1151           0 :     int nb = heff->GetNbinsX();
    1152           0 :     for(int ib=1;ib<=nb;ib++){
    1153           0 :       heff->SetBinContent(ib,((Float_t) hcounter->GetBinContent(ib))/((Float_t) totNumOfEvts));
    1154             :     }
    1155           0 :   }
    1156             :   return;
    1157           0 : }

Generated by: LCOV version 1.11