]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
QA update from Yaxian
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 2 May 2010 19:31:05 +0000 (19:31 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 2 May 2010 19:31:05 +0000 (19:31 +0000)
EMCAL/AliEMCALQAChecker.cxx
EMCAL/AliEMCALQADataMakerRec.cxx

index 8d50db14f71c8db3f4d75b7f2b4ffa23a3886eec..c871a149bdf707e95b0b4477a64aa04fb4a18ce7 100644 (file)
@@ -57,7 +57,7 @@ AliQACheckerBase("EMCAL","EMCAL Quality Assurance Data Maker"),
 fTextSM(new TText*[fknSM]),
 fLineCol(new TLine(48.0,0.,48.0,47.0)),
 fLineRow(new TLine(0.,24.,96.,24.)),
-fText(new TPaveText(0.4,10,0.7,20.))
+fText(new TPaveText(0.2,40.,1.6,90.,"br"))
 {
   // ctor
   fLineCol->SetLineColor(1);
@@ -87,7 +87,7 @@ AliQACheckerBase(qac.GetName(), qac.GetTitle()),
 fTextSM(new TText*[fknSM]) ,
 fLineCol(static_cast<TLine*>(qac.fLineCol->Clone())) , 
 fLineRow(static_cast<TLine*>(qac.fLineRow->Clone())) , 
-fText(new TPaveText(0.4,10,0.7,20.))
+fText(new TPaveText(0.2,40.,1.6,90.,"br"))
 {
    // copy ctor 
   for (Int_t sm = 0 ; sm < fknSM ; sm++){
@@ -101,7 +101,7 @@ AliEMCALQAChecker& AliEMCALQAChecker::operator = (const AliEMCALQAChecker &qac)
   fTextSM  = new TText*[fknSM] ;
   fLineCol = static_cast<TLine*>(qac.fLineCol->Clone()) ; 
   fLineRow = static_cast<TLine*>(qac.fLineRow->Clone()) ; 
-  fText    = new TPaveText(0.4,10,0.7,20.) ;
+  fText    = new TPaveText(0.2,40.,1.6,90.,"br") ;
   for (Int_t sm = 0 ; sm < fknSM ; sm++){
     fTextSM[sm] = static_cast<TText *>(qac.fTextSM[sm]->Clone()) ;
   }
@@ -162,21 +162,16 @@ AliEMCALQAChecker::MarkHisto(TH1& histo, Double_t value) const
 //______________________________________________________________________________
 void AliEMCALQAChecker::CheckRaws(Double_t * test, TObjArray ** list)
 {
-//  Check RAW QA histograms    
-//  We count the times of the response for each tower, the propability for all towers should be the same (average is given value).
-//  We skip the first few cycles since the statistics is not enough, the average should be always larger than 1 at least.
-//  By calculating the difference between the counts for each tower and the average, we decide whether we should recalculate 
-//  the average depending the the gaus fitting on the divation distribution. 
-//  During the recalutation of the average, we count how many towers are used for the calculation.
-//  From the fraction of towers used, we decide whether each SM works fine or not
-//  From the divation of average, we set the QA flag for the full detetcor as INFO, WARNING, ERROR or FATAL.
+  //  Check RAW QA histograms  
+  //  -- Yaxian Mao, CCNU/CERN/LPSC
+  //adding new checking method: 25/04/2010, Yaxian Mao
+  //Comparing the amplitude from current run to the reference run, if the ratio in the range [0.8, .12], count as a good tower.
+  //If more than 90% towers are good, EMCAL works fine, otherwise experts should be contacted. 
   
-//  -- Yaxian Mao, CCNU/CERN/LPSC
                                
   //Float_t kThreshold = 80. ; 
   Int_t nTowersPerSM = 24*48; // number of towers in a SuperModule; 24x48
   Double_t nTot = fknSM * nTowersPerSM ;
-  Double_t rv = 0. ;
   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
     test[specie] = 0.0 ; 
     if ( !AliQAv1::Instance()->IsEventSpecieSet(specie)) 
@@ -197,13 +192,14 @@ void AliEMCALQAChecker::CheckRaws(Double_t * test, TObjArray ** list)
           hdata->GetListOfFunctions()->Add(fTextSM[iSM]); 
        }
       }   
-//      if ( ratio->GetListOfFunctions()->GetEntries() == 0 ){
-//        ratio->GetListOfFunctions()->Add(fText) ;
-//      }
+      if ( ratio->GetListOfFunctions()->GetEntries() == 0 ){
+        ratio->GetListOfFunctions()->Add(fText) ;
+      }
 
       //now check the ratio histogram
       Double_t binContent = 0. ;  
       Int_t NGoodTower = 0 ;
+      Double_t rv = 0. ;
       for(Int_t ix = 1; ix <= hdata->GetNbinsX(); ix++) {
         for(Int_t iy = 1; iy <= hdata->GetNbinsY(); iy++) {
           binContent = hdata->GetBinContent(ix, iy) ; 
@@ -212,21 +208,23 @@ void AliEMCALQAChecker::CheckRaws(Double_t * test, TObjArray ** list)
         }
       }
       rv = NGoodTower/nTot ; 
-      
-      
-//      if (rv < 0.9) {
-//        test[specie] = 0.9 ;
-//        // 2 lines text info for quality 
-//        fText->Clear() ; 
-//        fText->AddText(Form("%2.2f %% towers out of range [0.8, 1.2]", (1-rv)*100)); 
-//        fText->AddText(Form("EMCAL = NOK, CALL EXPERTS!!!")); 
-//      }
-//      else {
-//        test[specie] = 0.1 ;
-//        fText->Clear() ; 
-//        fText->AddText(Form("%2.2f %% towers out of range [0.8, 1.2]", (1-rv)*100)); 
-//        fText->AddText(Form("EMCAL = OK")); 
-//      }
+      printf("%2.2f %% towers out of range [0.8, 1.2]\n", (1-rv)*100);
+      if(fText){
+        fText->DeleteText() ;
+        fText->Clear() ; 
+      }      
+      fText->AddText(Form("%2.2f %% towers out of range [0.8, 1.2]", (1-rv)*100));     
+      if (rv < 0.9) {
+        test[specie] = 0.9 ;
+        // 2 lines text info for quality         
+        fText->SetFillColor(2) ;
+        fText->AddText(Form("EMCAL = NOK, CALL EXPERTS!!!")); 
+      }
+      else {
+        test[specie] = 0.1 ;
+        fText->SetFillColor(3) ;
+        fText->AddText(Form("EMCAL = OK, ENJOY...")); 
+      }
      } 
     } //finish the checking
 }
index 0fb8f1a3b4d648c62197d3e98b452a58c1777137..ea6a78a52e57237791c7e0e8ea4557f9406ea642 100644 (file)
@@ -361,7 +361,7 @@ void AliEMCALQADataMakerRec::InitRaws()
  
   //temp 2D amplitude histogram for the current run
   fHighEmcHistoH2F = new TH2F("h2DHighEC2", "High Gain EMC:Max - Min [ADC counts]", nbinsZ, -0.5 , nbinsZ-0.5, nbinsPhi, -0.5, nbinsPhi-0.5);
-
+   fHighEmcHistoH2F->SetDirectory(0) ; // this histo must be memory resident
   //add ratio histograms: to comapre the current run with the reference data 
   TH2F * h15 = new TH2F("h2DRatioAmp", "High Gain Ratio to Reference:Amplitude_{current run}/Amplitude_{reference run}", nbinsZ, -0.5 , nbinsZ-0.5, 
                         nbinsPhi, -0.5, nbinsPhi-0.5);
@@ -375,10 +375,12 @@ void AliEMCALQADataMakerRec::InitRaws()
     gStyle->SetPalette(3,color);
     h15->GetZaxis()->SetNdivisions(3);
     h15->UseCurrentStyle();
+    h15->SetDirectory(0);
   Add2RawsList(h15, k2DRatioAmp, !expert, image, !saveCorr) ;
 
        TH1F * h16 = new TH1F("hRatioDist", "Amplitude_{current run}/Amplitude_{reference run} ratio distribution", nTot, 0., 2.);
   h16->SetMinimum(1.);
+  h16->SetDirectory(0);
   Add2RawsList(h16, kRatioDist, !expert, image, !saveCorr) ;
  
   // now repeat the same for TRU and LEDMon data
@@ -728,8 +730,10 @@ void AliEMCALQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   Double_t binContent = 0. ;
   //calculate the ratio of the amplitude and fill the histograms, only if the events type is Calib
  if (rawReader->GetType() == AliRawEventHeaderBase::kCalibrationEvent) { 
-  GetRawsData(k2DRatioAmp)->Reset(); 
-  GetRawsData(kRatioDist)->Reset(); 
+  if(GetRawsData(k2DRatioAmp)->GetEntries())
+    GetRawsData(k2DRatioAmp)->Reset("ICE"); 
+  if(GetRawsData(kRatioDist)->GetEntries())
+    GetRawsData(kRatioDist)->Reset("ICE"); 
   for(Int_t ix = 1; ix <= fHighEmcHistoH2F->GetNbinsX(); ix++) {
     for(Int_t iy = 1; iy <= fHighEmcHistoH2F->GetNbinsY(); iy++) {
       if(fCalibRefHistoH2F->GetBinContent(ix, iy))binContent = fHighEmcHistoH2F->GetBinContent(ix, iy)/fCalibRefHistoH2F->GetBinContent(ix, iy) ;
@@ -743,7 +747,7 @@ void AliEMCALQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   GetRawsData(kLEDMonRatio)->Reset();  
   GetRawsData(kLEDMonRatioDist)->Reset();
   
-  Double_t binContent, binError;
+  Double_t binError = 0. ;
   
   for(int ib = 1; ib <= fLEDMonRefHistoPro->GetNbinsX(); ib++) {