LCOV - code coverage report
Current view: top level - EMCAL/EMCALbase - AliEMCALQAChecker.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 58 210 27.6 %
Date: 2016-06-14 17:26:59 Functions: 5 12 41.7 %

          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             : // --- ROOT system ---
      17             : #include <TClass.h>
      18             : #include <TH1.h> 
      19             : #include <TF1.h> 
      20             : #include <TH1I.h> 
      21             : #include <TH2F.h>
      22             : #include <TIterator.h> 
      23             : #include <TKey.h> 
      24             : #include <TFile.h> 
      25             : #include <TLine.h>
      26             : #include <TText.h>
      27             : #include <TPaveText.h>
      28             : #include <TMath.h>
      29             : 
      30             : // --- AliRoot header files ---
      31             : #include "AliLog.h"
      32             : #include "AliCDBManager.h"
      33             : #include "AliCDBEntry.h"
      34             : #include "AliQAv1.h"
      35             : #include "AliQAChecker.h"
      36             : #include "AliQAThresholds.h"
      37             : #include "AliEMCALQAChecker.h"
      38             : 
      39          42 : ClassImp(AliEMCALQAChecker)
      40             : 
      41             : //__________________________________________________________________
      42             : /// Constructor.
      43             : ///
      44             : AliEMCALQAChecker::AliEMCALQAChecker() : 
      45           3 : AliQACheckerBase("EMCAL","EMCAL Quality Assurance Data Maker"),
      46           6 : fTextSM(new TText*[fgknSM]),
      47           9 : fLineCol(new TLine(47.5,-0.5,47.5,207.5)),
      48           9 : fText(new TPaveText(0.2,0.7,0.8,0.9,"NDC"))
      49          15 : {
      50           3 :   fLineCol->SetLineColor(1);
      51           3 :   fLineCol->SetLineWidth(2);
      52             :   
      53         126 :   for(int iSM = 0; iSM < fgknSM; iSM++) 
      54             :   {
      55          60 :     int iside = iSM % 2;
      56          60 :     int isect = iSM / 2;
      57             :     int isectNum = isect;
      58             :     
      59          84 :     if (isectNum > 5) isectNum += 3; // DCal
      60             :     
      61          60 :     if (isectNum < 5)
      62             :     {
      63          30 :       if (iside == 0) 
      64             :       { // A side
      65          60 :         fTextSM[iSM]= new TText(20, 8+24*isect, Form("SM A%d",isectNum) );
      66          15 :       }
      67             :       else 
      68             :       { // C side
      69          60 :         fTextSM[iSM]= new TText(64, 8+24*isect, Form("SM C%d",isectNum) );
      70             :       }
      71             :     }
      72          60 :     else if ( isectNum>4 && isectNum<12)
      73             :     {
      74          54 :       if (iside == 0) 
      75             :       { // A side
      76          36 :         if(isectNum ==5)
      77          12 :           fTextSM[iSM]= new TText(20, 8+24*(isect-1)+8+6, Form("SM A%d",isectNum) );
      78             :         else
      79          36 :           fTextSM[iSM]= new TText(20, 8+24*(isect-1)+8, Form("SM A%d",isectNum) );
      80             :       }
      81             :       else 
      82             :       { // C side
      83          12 :         if(isectNum ==5)
      84          12 :           fTextSM[iSM]= new TText(64, 8+24*(isect-1)+8+6, Form("SM C%d",isectNum) );
      85             :         else
      86          36 :           fTextSM[iSM]= new TText(64, 8+24*(isect-1)+8, Form("SM C%d",isectNum) );
      87             :       }
      88             :     }
      89             :     else
      90             :     {
      91           6 :       if (iside == 0) { // A side
      92          12 :         fTextSM[iSM]= new TText(20, 8+24*(isect-2)+16+6, Form("SM A%d",isectNum) );
      93           3 :       }
      94             :       else { // C side
      95          12 :         fTextSM[iSM]= new TText(64, 8+24*(isect-2)+16+6, Form("SM C%d",isectNum) );
      96             :       }
      97             :     }
      98             :   }
      99             :   
     100          60 :   for(int i = 0; i < fgknSectLines; i++) 
     101             :   {
     102          27 :     if(i<5)
     103             :     {
     104          45 :       fLineRow[i] = new TLine(-0.5,23.5+(24*i),95.5,23.5+(24*i));
     105          15 :       fLineRow[i]->SetLineColor(1);
     106          15 :       fLineRow[i]->SetLineWidth(2);
     107             :     }
     108          12 :     else if(i>4 && i<9){
     109          36 :       fLineRow[i] = new TLine(-0.5,23.5+(24*(i-1))+8,95.5,23.5+(24*(i-1))+8);
     110          12 :       fLineRow[i]->SetLineColor(1);
     111          12 :       fLineRow[i]->SetLineWidth(2);
     112             :     }
     113             :     else{
     114           0 :       fLineRow[i] = new TLine(-0.5,23.5+(24*(i-2))+16,95.5,23.5+(24*(i-2))+16);
     115           0 :       fLineRow[i]->SetLineColor(1);
     116           0 :       fLineRow[i]->SetLineWidth(2);
     117             :     }
     118             :   }
     119             :   
     120          24 :   for(int i = 0; i < 3; i++) {
     121          27 :     fTextL1[i] = new TPaveText(0.2,0.8,0.8,0.9,"NDC");
     122             :   }
     123             :   
     124           6 : }          
     125             : 
     126             : //__________________________________________________________________
     127             : /// Destructor.
     128             : ///
     129             : AliEMCALQAChecker::~AliEMCALQAChecker() 
     130           0 : {
     131           0 :   delete [] fTextSM ;
     132           0 :   delete fLineCol ;
     133           0 :   for (Int_t i=0; i<5; ++i) delete fLineRow[i] ;
     134           0 :   delete fText  ; 
     135           0 : }
     136             : 
     137             : //______________________________________________________________________________
     138             : /// Check objects in list
     139             : ///
     140             : void AliEMCALQAChecker::Check(Double_t * test, AliQAv1::ALITASK_t index, 
     141             :                               TObjArray ** list, const AliDetectorRecoParam * /*recoParam*/)
     142             : {
     143          18 :   if ( index == AliQAv1::kRAW ) 
     144             :   {
     145           0 :     CheckRaws(test, list);
     146             :     //printf ("checkers for task %d \n", index) ;             
     147           0 :   }
     148             :   
     149           9 :   if ( index == AliQAv1::kREC)
     150             :   {
     151           0 :     CheckRecPoints(test, list);
     152           0 :   }
     153             :   
     154           9 :   if ( index == AliQAv1::kESD )
     155             :   {
     156           0 :     CheckESD(test, list);
     157           0 :   }
     158             :   //AliWarning(Form("Checker for task %d not implement for the moment",index));
     159           9 : }
     160             : 
     161             : //______________________________________________________________________________
     162             : /// Get a given histo from the list.
     163             : ///
     164             : TH1* AliEMCALQAChecker::GetHisto(TObjArray* list, const char* hname, Int_t specie) const
     165             : {
     166           0 :   TH1* h = static_cast<TH1*>(list->FindObject(Form("%s_%s",AliRecoParam::GetEventSpecieName(specie),hname)));
     167             :   
     168           0 :   if (!h)
     169             :   {
     170           0 :     AliError(Form("Did not find expected histo %s",hname));
     171           0 :   }
     172             :   
     173           0 :   return h;
     174             : }
     175             : 
     176             : //______________________________________________________________________________
     177             : /// Mark histo as originator of some QA error/warning.
     178             : ///
     179             : Double_t AliEMCALQAChecker::MarkHisto(TH1& histo, Double_t value) const
     180             : {
     181           0 :   if ( value != 1.0 )
     182             :   {
     183           0 :     histo.SetBit(AliQAv1::GetQABit());
     184           0 :   }
     185             :   
     186           0 :   return value;
     187             : }
     188             : 
     189             : //______________________________________________________________________________
     190             : ///  Check RAW QA histograms
     191             : ///  adding new checking method: 25/04/2010, Yaxian Mao
     192             : ///
     193             : ///  Comparing the amplitude from current run to the reference run, if the ratio in the range [0.8, .12], count as a good tower.
     194             : ///  If more than 90% towers are good, EMCAL works fine, otherwise experts should be contacted. 
     195             : ///
     196             : void AliEMCALQAChecker::CheckRaws(Double_t * test, TObjArray ** list)
     197             : {
     198             :   // Setting the thresholds
     199             :   Float_t ratioThresh = 0.9;   // threshold for calibration ratio = good towers/all towers (default 0.9)
     200             :   Float_t threshG     = 0.5;   // threshold for L1 Gamma triggers (default 0.5)
     201             :   Float_t threshJ     = 0.5;   // threshold for L1 Jet triggers (default 0.5)
     202             :   Int_t badLinkThresh = 1;     // threshold for bad links (default 1)
     203             :   
     204           0 :   AliCDBManager* man = AliCDBManager::Instance();
     205           0 :   if(man)
     206             :   {
     207           0 :     AliCDBEntry* entry = man->Get("GRP/Calib/QAThresholds");
     208           0 :     if(entry)
     209             :     {
     210           0 :       TObjArray* branch = (TObjArray*) entry->GetObject();
     211           0 :       if(branch)
     212             :       {
     213           0 :         AliQAThresholds* thresholds = (AliQAThresholds*) branch->FindObject("EMC");
     214           0 :         if(thresholds)
     215             :         {
     216           0 :           TParameter<float>* paramR  = (TParameter<float>*) thresholds->GetThreshold(0);
     217           0 :           TParameter<float>* paramG  = (TParameter<float>*) thresholds->GetThreshold(1);
     218           0 :           TParameter<float>* paramJ  = (TParameter<float>*) thresholds->GetThreshold(2);
     219           0 :           TParameter<int>*   paramL  = (TParameter<int>*)   thresholds->GetThreshold(3);
     220             :           
     221           0 :           if(paramR)
     222           0 :             ratioThresh = paramR->GetVal();
     223           0 :           if(paramG)
     224           0 :             threshG = paramG->GetVal();
     225           0 :           if(paramJ)
     226           0 :             threshJ = paramJ->GetVal();
     227           0 :           if(paramL)
     228           0 :             badLinkThresh = paramL->GetVal();
     229           0 :         }
     230           0 :       }
     231           0 :     }
     232           0 :   }
     233             :   
     234             :   //cols*rows (in module units) * 4 (each module is 2x2 towers)
     235             :   Double_t nTot = AliEMCALTriggerMappingV2::fSTURegionNEta*AliEMCALTriggerMappingV2::fSTURegionNPhi*4;
     236             : 
     237             :   //subtracting towers from 6 TRUs (missing in DCAL) * 96 (modules in TRU) * 4 (each module is 2x2 towers) 
     238             :   nTot -= 6*AliEMCALTriggerMappingV2::fNModulesInTRU*4;
     239             :   
     240             :   TList *lstF = 0;
     241           0 :   Int_t calibSpecieId = (Int_t)TMath::Log2( AliRecoParam::kCalib );
     242           0 :   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) 
     243             :   {
     244           0 :     test[specie] = 0.0 ; 
     245             :     
     246           0 :     if ( !AliQAv1::Instance()->IsEventSpecieSet(specie)) continue ; 
     247             :     
     248           0 :     if (list[specie]->GetEntries() == 0) 
     249             :     {
     250           0 :       test[specie] = 0. ; // nothing to check
     251           0 :     }
     252             :     else 
     253             :     {
     254             :       //get calib histos
     255           0 :       TH2F * hdata  = (TH2F*)list[specie]->At(k2DRatioAmp) ; 
     256           0 :       TH1F * ratio = (TH1F*)list[specie]->At(kRatioDist) ;
     257             :       
     258             :       //get L1 histos
     259           0 :       TH2F *hL1GammaPatch = (TH2F*)list[specie]->At(kGL1);
     260           0 :       TH2F *hL1JetPatch = (TH2F*)list[specie]->At(kJL1);
     261           0 :       TH1I *hFrameR = (TH1I*)list[specie]->At(kSTUTRU);
     262             :       
     263             :       //TH1I *hNTimeSamplesTRU = (TH1I*)list[specie]->At(kNL0TRUSamples);
     264             :       //TH1I *hRMSTimeforTRU = (TH1I*)list[specie]->At(kNL0TRURMS);
     265             :       //  =======================================================================================
     266             :       // calib histo checker first:
     267           0 :       if( hdata && ratio )
     268             :       {
     269             :         //  first clean lines, text (functions)
     270           0 :         lstF = hdata->GetListOfFunctions();
     271           0 :         CleanListOfFunctions(lstF);
     272           0 :         lstF = ratio->GetListOfFunctions();
     273           0 :         CleanListOfFunctions(lstF);
     274             :         
     275           0 :         if(hdata->GetEntries()!=0 && ratio->GetEntries()!=0) 
     276             :         {
     277           0 :           lstF = hdata->GetListOfFunctions();
     278             :           
     279             :           // adding the lines to distinguish different SMs
     280           0 :           lstF->Add(fLineCol->Clone()); 
     281           0 :           for(Int_t iLine = 0; iLine < fgknSectLines; iLine++) 
     282             :           {
     283           0 :             lstF->Add(fLineRow[iLine]->Clone());
     284             :           } 
     285             :           
     286             :           // Now adding the text to for each SM
     287           0 :           for(Int_t iSM = 0 ; iSM < fgknSM ; iSM++)
     288             :           {  // number of SMs loop start
     289           0 :             lstF->Add(fTextSM[iSM]->Clone()); 
     290             :           }                     
     291             :                     
     292             :           // now check the ratio histogram
     293           0 :           lstF = ratio->GetListOfFunctions();
     294             :           
     295             :           Double_t binContent = 0. ;  
     296             :           Int_t nGoodTower = 0 ;
     297             :           Double_t rv = 0. ;
     298           0 :           for(Int_t ix = 1; ix <= hdata->GetNbinsX(); ix++) 
     299             :           {
     300           0 :             for(Int_t iy = 1; iy <= hdata->GetNbinsY(); iy++) 
     301             :             {
     302           0 :               binContent = hdata->GetBinContent(ix, iy) ; 
     303             :               //if (binContent < 1.2 && binContent > 0.8) nGoodTower++ ;
     304             :             }
     305             :           }
     306             :           
     307             :           //rv = nGoodTower/nTot ; 
     308             :           // printf("%2.2f %% towers out of range [0.8, 1.2]\n", (1-rv)*100);
     309             :           /*if(fText){
     310             :            lstF->Add(fText->Clone()) ;
     311             :            fText->Clear() ; 
     312             :            
     313             :            fText->AddText(Form("%2.2f %% towers out of range [0.8, 1.2]", (1-rv)*100));     
     314             :            if (rv < ratioThresh) {
     315             :            test[specie] = ratioThresh;
     316             :            //  2 lines text info for quality         
     317             :            fText->SetFillColor(2) ;
     318             :            fText->AddText(Form("EMCAL = NOK, CALL EXPERTS!!!")); 
     319             :            }
     320             :            else {
     321             :            test[specie] = 1 - ratioThresh;
     322             :            fText->SetFillColor(3) ;
     323             :            fText->AddText(Form("EMCAL = OK, ENJOY...")); 
     324             :            }
     325             :            }// fText*/
     326           0 :         }// calib histo checking done
     327             :       }// histograms NOT NULL
     328             :       
     329             :        //  ========================================================================================
     330             :        // now check L0 (NEW!!!)
     331             :       
     332             :       //lstF = hNTimeSamplesTRU->GetListOfFunctions();
     333             :       //CleanListOfFunctions(lstF);
     334             :       //lstF = hRMSTimeforTRU->GetListOfFunctions();
     335             :       //CleanListOfFunctions(lstF);
     336             :       
     337             :       //  ========================================================================================
     338             :       //  now L1 checks:
     339             :       
     340           0 :       if( hL1GammaPatch )
     341             :       {
     342             :         //  first clean lines, text (functions)
     343           0 :         lstF = hL1GammaPatch->GetListOfFunctions();
     344           0 :         CleanListOfFunctions(lstF);
     345             :         
     346           0 :         if (specie != calibSpecieId) 
     347             :         {
     348             :           // if(hL1GammaPatch->GetEntries() !=0 ) {
     349           0 :           if(hL1GammaPatch->GetEntries() > 10) 
     350             :           { //  need some statistics for hot spot calculation
     351           0 :             lstF = hL1GammaPatch->GetListOfFunctions();
     352             :             
     353             :             //  Checker for L1GammaPatch 
     354             :             // Double_t dL1GmeanTrig    = 1./2961.; 
     355             :             // Double_t dL1GmeanTrigTRU = 1./32.; 
     356             :             // Int_t sigmaG    = 100; //  deviation from mean value (increased to 100)
     357             :             // Int_t sigmaGTRU = 5; //  deviation from mean value for TRUs
     358           0 :             Double_t dL1GEntries = hL1GammaPatch->GetEntries();
     359           0 :             Int_t badL1G[2*AliEMCALTriggerMappingV2::fNPhi][2*AliEMCALTriggerMappingV2::fNEta]   = {{0}} ;
     360           0 :             Int_t badL1GTRU[2][AliEMCALTriggerMappingV2::fNTotalTRU/2] = {{0}} ;
     361             :             Int_t nBadL1G    = 0;
     362             :             Int_t nBadL1GTRU = 0;
     363           0 :             Double_t binContentTRU[2][AliEMCALTriggerMappingV2::fNTotalTRU/2] = {{0.}};
     364           0 :             for(Int_t ix = 1; ix <=  hL1GammaPatch->GetNbinsX(); ix++) 
     365             :             {
     366           0 :               for(Int_t iy = 1; iy <=  hL1GammaPatch->GetNbinsY(); iy++) 
     367             :               {
     368           0 :                 Double_t binContent = hL1GammaPatch->GetBinContent(ix, iy) ; 
     369           0 :                 if (binContent != 0) 
     370             :                 {
     371             :                   //  fill counter for TRUs
     372             :                   // binContentTRU[(Int_t)((ix-1)/24)][(Int_t)((iy-1)/4)] += binContent;// OLD TRU SCHEME
     373           0 :                   binContentTRU[(Int_t)((ix-1)/8)][(Int_t)((iy-1)/12)] += binContent;  // NEW TRU SCHEME
     374             :           
     375             :                   //OLD METHOD (if a patch triggers > sigmaG * mean value (1/#patch positions total) says "hot spot !")
     376             :                   //  if ((double)binContent/(double)dL1GEntries > sigmaG*dL1GmeanTrig) {
     377             :                   //    badL1G[ix-1][iy-1] += 1;
     378             :                   //    nBadL1G += 1;
     379             :                   //  }
     380             :                   
     381             :                   //  NEW METHOD (if Rate > Threshold * ( (Number of towers or TRUs * Average rate) - Rate ) --> "hot spot !")
     382             :                   //  Thresold = how much does the noisy tower/TRU contribute to the rate
     383             :                   //             1.0 --> Rate of noisy tower/TRU = Rate of all other towers/TRUs  
     384           0 :                   if (binContent/dL1GEntries > threshG / ( 1 + threshG )) 
     385             :                   {
     386           0 :                     badL1G[ix-1][iy-1] += 1;
     387           0 :                     nBadL1G += 1;
     388           0 :                   }
     389             :                 }
     390             :               }
     391             :             }
     392             :             
     393             :             //  check TRUs
     394           0 :             for(Int_t ix = 1; ix <=  2; ix++)
     395             :             {
     396           0 :               for(Int_t iy = 1; iy <= AliEMCALTriggerMappingV2::fNTotalTRU/2; iy++) 
     397             :               {
     398           0 :                 if(binContentTRU[ix-1][iy-1]/dL1GEntries >  threshG / ( 1 + threshG )) 
     399             :                 { 
     400           0 :                   badL1GTRU[ix-1][iy-1] += 1;
     401           0 :                   nBadL1GTRU += 1;
     402           0 :                 }
     403             :               }
     404             :             }
     405             :             
     406             :             /* if(fTextL1[0]){
     407             :              lstF->Add(fTextL1[0]->Clone()) ;
     408             :              fTextL1[0]->Clear() ; 
     409             :              
     410             :              if (nBadL1G == 0 && nBadL1GTRU == 0 ) {
     411             :              fTextL1[0]->SetFillColor(3) ;
     412             :              fTextL1[0]->AddText(Form("L1 GAMMA TRIGGER = OK, ENJOY...")); 
     413             :              }
     414             :              else if (nBadL1G == 0){
     415             :              fTextL1[0]->SetFillColor(2) ;
     416             :              fTextL1[0]->AddText(Form("HOT SPOT IN L1 GAMMA TRIGGER (TRU) = CALL EXPERT!!"));
     417             :              
     418             :              }
     419             :              else{
     420             :              fTextL1[0]->SetFillColor(2) ;
     421             :              fTextL1[0]->AddText(Form("HOT SPOT IN L1 GAMMA TRIGGER = CALL EXPERT!!"));
     422             :              
     423             :              for(Int_t ix = 1; ix <=  hL1GammaPatch->GetNbinsX(); ix++) {
     424             :              for(Int_t iy = 1; iy <=  hL1GammaPatch->GetNbinsY(); iy++) {
     425             :              if(badL1G[ix-1][iy-1] != 0) printf("L1 Gamma patch with position x = %d, y = %d is out of range\n",ix,iy);
     426             :              }
     427             :              }
     428             :              */
     429             :             //}
     430             :             //}// fTextL1[0]
     431           0 :           }//  L1 gamma patch checking done
     432             :         }//  if (specie != calibSpecieId) ..
     433             :       }// hL1GammaPatch NOT NULL
     434             :       
     435           0 :       if( hL1JetPatch )
     436             :       {
     437           0 :         lstF = hL1JetPatch->GetListOfFunctions();
     438           0 :         CleanListOfFunctions(lstF);
     439             :         
     440           0 :         if (specie != calibSpecieId) 
     441             :         {
     442             :           // if(hL1JetPatch->GetEntries() !=0) {
     443           0 :           if(hL1JetPatch->GetEntries() > 10) 
     444             :           { //  need some statistics for hot spot calculation
     445           0 :             lstF = hL1JetPatch->GetListOfFunctions();
     446             :             
     447             :             //  Checker for L1JetPatch
     448             :             // Double_t dL1JmeanTrig = 1/126.;
     449             :             // Int_t sigmaJ = 5; //  deviation from  mean value
     450           0 :             Double_t dL1JEntries = hL1JetPatch->GetEntries();
     451           0 :             Int_t badL1J[12][16] = {{0}} ;// NEED TO CHECK THIS FOR JETs !!!!!!!
     452             :             Int_t nBadL1J = 0;
     453           0 :             for(Int_t ix = 1; ix <=  hL1JetPatch->GetNbinsX(); ix++) 
     454             :             {
     455           0 :               for(Int_t iy = 1; iy <=  hL1JetPatch->GetNbinsY(); iy++) 
     456             :               {
     457           0 :                 Double_t binContent = hL1JetPatch->GetBinContent(ix, iy) ; 
     458           0 :                 if (binContent != 0) 
     459             :                 {
     460             :                   //  OLD METHOD  (if a patch triggers > sigmaJ * mean value (1/#patch positions total) says "hot spot !")
     461             :                   //  if ((double)binContent/(double)dL1JEntries > sigmaJ*dL1JmeanTrig) {
     462             :                   //    badL1J[ix-1][iy-1] += 1 ;
     463             :                   //    nBadL1J += 1;
     464             :                   //  }
     465             :                   
     466             :                   //  NEW METHOD (if Rate > Threshold * ( (Number of towers or TRUs * Average rate) - Rate ) --> "hot spot !")
     467             :                   //  Threshold: same definitionas for Gamma
     468           0 :                   if ((double)binContent/(double)dL1JEntries > threshJ / ( 1 + threshJ )) 
     469             :                   {
     470           0 :                     badL1J[ix-1][iy-1] += 1 ;
     471           0 :                     nBadL1J += 1;
     472           0 :                   }
     473             :                 }
     474             :               }
     475             :             }
     476             :             
     477             :             /*
     478             :              if(fTextL1[1]){
     479             :              lstF->Add(fTextL1[1]->Clone()) ;
     480             :              fTextL1[1]->Clear() ; 
     481             :              
     482             :              if (nBadL1J == 0) {
     483             :              fTextL1[1]->SetFillColor(3) ;
     484             :              fTextL1[1]->AddText(Form("L1 JET TRIGGER = OK, ENJOY...")); 
     485             :              }
     486             :              else {
     487             :              fTextL1[1]->SetFillColor(2) ;
     488             :              fTextL1[1]->AddText(Form("HOT SPOT IN L1 JET TRIGGER = CALL EXPERT!!")); 
     489             :              
     490             :              for(Int_t ix = 1; ix <=  hL1JetPatch->GetNbinsX(); ix++) {
     491             :              for(Int_t iy = 1; iy <=  hL1JetPatch->GetNbinsY(); iy++) {
     492             :              if(badL1J[ix-1][iy-1] != 0) printf("L1 Jet patch with position x = %d, y = %d is out of range\n",(4*ix-4),(4*iy-4));
     493             :              }
     494             :              }
     495             :              */
     496             :             
     497             :             //}
     498             :             //}// fTextL1[1]
     499           0 :           } //  L1 Jet patch checking done
     500             :         } //  if (specie != calibSpecieId) ..
     501             :       }//  hL1JetPatch NOT NULL
     502             :       
     503           0 :       if(hFrameR)
     504             :       {
     505           0 :         lstF = hFrameR->GetListOfFunctions();
     506           0 :         CleanListOfFunctions(lstF);
     507             :         
     508           0 :         if(hFrameR->GetEntries() !=0) 
     509             :         {
     510           0 :           lstF = hFrameR->GetListOfFunctions();
     511             :           
     512           0 :           Int_t badLink[AliEMCALTriggerMappingV2::fNTotalTRU] = {0};
     513             :           Int_t nBadLink = 0;
     514           0 :           for(Int_t ix = 1; ix <= hFrameR->GetNbinsX(); ix++) 
     515             :           {
     516           0 :             Double_t binContent = hFrameR->GetBinContent(ix) ; 
     517           0 :             if (binContent == 0) {
     518           0 :               badLink[ix-1] += 1;
     519           0 :               nBadLink += 1;
     520           0 :             }
     521             :           }
     522             :           
     523           0 :           if(fTextL1[2])
     524             :           {
     525           0 :             lstF->Add(fTextL1[2]->Clone()) ;
     526           0 :             fTextL1[2]->Clear() ; 
     527             :             
     528           0 :             if (nBadLink < badLinkThresh)
     529             :             {
     530           0 :               fTextL1[2]->SetFillColor(3) ;
     531           0 :               fTextL1[2]->AddText(Form("LINK TRU-STU = OK, ENJOY...")); 
     532           0 :             }
     533             :             else 
     534             :             {
     535           0 :               fTextL1[2]->SetFillColor(2) ;
     536           0 :               fTextL1[2]->AddText(Form("PROBLEM WITH TRU-STU LINK = CALL EXPERT!!"));
     537             :               /*
     538             :                for(Int_t ix = 0; ix <= hFrameR->GetNbinsX(); ix++) {
     539             :                if(badLink[ix] != 0) printf("STU link with TRU %d is out\n",ix);
     540             :                }
     541             :                */
     542             :             }   
     543             :           }// fTextL1[2]
     544           0 :         } //  Checker for link TRU-STU done
     545             :       } // hFrameR NOT NULL
     546             :     } //  species processed             
     547             :   } //  specie
     548           0 : }
     549             : 
     550             : //______________________________________________________________________________
     551             : ///
     552             : /// Initialises QA and QA checker settings.
     553             : ///
     554             : void AliEMCALQAChecker::Init(const AliQAv1::DETECTORINDEX_t det) 
     555             : {
     556          18 :   AliQAv1::Instance(det) ; 
     557           9 :   Float_t hiValue[AliQAv1::kNBIT] ; 
     558           9 :   Float_t lowValue[AliQAv1::kNBIT] ;
     559           9 :   lowValue[AliQAv1::kINFO]      = 0.0   ; 
     560           9 :   hiValue[AliQAv1::kINFO]       = 0.1 ; 
     561           9 :   lowValue[AliQAv1::kWARNING]   = 0.1 ; 
     562           9 :   hiValue[AliQAv1::kWARNING]    = 0.5 ; 
     563           9 :   lowValue[AliQAv1::kERROR]     = 0.5   ; 
     564           9 :   hiValue[AliQAv1::kERROR]      = 0.8 ; 
     565           9 :   lowValue[AliQAv1::kFATAL]     = 0.8   ; 
     566           9 :   hiValue[AliQAv1::kFATAL]      = 1.0 ; 
     567           9 :   SetHiLo(&hiValue[0], &lowValue[0]) ; 
     568           9 : }
     569             : 
     570             : //______________________________________________________________________________
     571             : ///
     572             : ///  Clean up.
     573             : ///
     574             : void AliEMCALQAChecker::CleanListOfFunctions(TList *list)
     575             : { 
     576           0 :   if (list) 
     577             :   {
     578           0 :     TObject *stats = list->FindObject("stats"); list->Remove(stats);
     579             :     
     580             :     TObject *obj;
     581           0 :     while ( (obj = list->First()) ) 
     582             :     {
     583           0 :       while(list->Remove(obj)) { } delete obj; 
     584             :     }
     585             :     
     586           0 :     if (stats) list->Add(stats);
     587           0 :   }
     588             :   else 
     589             :   {
     590           0 :     AliWarning(Form("Checker : empty list of data functions; returning"));
     591           0 :     return;
     592             :   }
     593           0 : }
     594             : 
     595             : 

Generated by: LCOV version 1.11