Additiona fixes for report #72515: ITS QA porting request (Annalisa)ITS
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Sep 2010 12:54:35 +0000 (12:54 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Sep 2010 12:54:35 +0000 (12:54 +0000)
FASTSIM/AliQuenchingWeights.cxx
ITS/AliITSQASPDChecker.cxx
ITS/AliITSQASPDChecker.h

index bbb2820..1157ec2 100644 (file)
@@ -40,6 +40,7 @@
 #include <TGraph.h>
 #include <TROOT.h>
 #include <TSystem.h>
+#include <TString.h>
 #include <TLegend.h>
 #include "AliQuenchingWeights.h"
 
@@ -74,9 +75,7 @@ AliQuenchingWeights::AliQuenchingWeights()
       fTablesLoaded(kFALSE)
 {
   //default constructor 
-  Char_t name[100];
-  sprintf(name,"hhistoqw_%d",fInstanceNumber);
-  fHisto = new TH1F(name,"",fgkBins,0.,fgkMaxBin);
+  fHisto = new TH1F(Form("hhistoqw_%d",fInstanceNumber),"",fgkBins,0.,fgkMaxBin);
   for(Int_t bin=1;bin<=fgkBins;bin++) 
     fHisto->SetBinContent(bin,0.);
 }
@@ -107,9 +106,7 @@ AliQuenchingWeights::AliQuenchingWeights(const AliQuenchingWeights& a)
   fECMethod=(kECMethod)a.GetECMethod();
   fLengthMax=a.GetLengthMax();
   fInstanceNumber=fgCounter++;
-  Char_t name[100];
-  sprintf(name,"hhistoqw_%d",fInstanceNumber);
-  fHisto = new TH1F(name,"",fgkBins,0.,fgkMaxBin);
+  fHisto = new TH1F(Form("hhistoqw_%d",fInstanceNumber),"",fgkBins,0.,fgkMaxBin);
   for(Int_t bin=1;bin<=fgkBins;bin++) 
       fHisto->SetBinContent(bin,0.);
 
@@ -157,10 +154,8 @@ Int_t AliQuenchingWeights::InitMult(const Char_t *contall,const Char_t *discall)
   fTablesLoaded = kFALSE;
   fMultSoft=kTRUE;
   
-  Char_t fname[1024];
-  sprintf(fname,"%s",gSystem->ExpandPathName(contall));
   //PH  ifstream fincont(fname);
-  fstream fincont(fname,ios::in);
+  fstream fincont(Form("%s",gSystem->ExpandPathName(contall)),ios::in);
 #if defined(__HP_aCC) || defined(__DECCXX)
   if(!fincont.rdbuf()->is_open()) return -1;
 #else
@@ -194,9 +189,8 @@ Int_t AliQuenchingWeights::InitMult(const Char_t *contall,const Char_t *discall)
   }
   fincont.close();
 
-  sprintf(fname,"%s",gSystem->ExpandPathName(discall));
   //PH  ifstream findisc(fname); 
-  fstream findisc(fname,ios::in); 
+  fstream findisc(Form("%s",gSystem->ExpandPathName(discall)),ios::in); 
 #if defined(__HP_aCC) || defined(__DECCXX)
   if(!findisc.rdbuf()->is_open()) return -1;
 #else
@@ -503,10 +497,8 @@ Int_t AliQuenchingWeights::InitSingleHard(const Char_t *contall,const Char_t *di
   fTablesLoaded = kFALSE;
   fMultSoft=kFALSE;
   
-  Char_t fname[1024];
-  sprintf(fname,"%s",gSystem->ExpandPathName(contall));
   //PH  ifstream fincont(fname);
-  fstream fincont(fname,ios::in);
+  fstream fincont(Form("%s",gSystem->ExpandPathName(contall)),ios::in);
 #if defined(__HP_aCC) || defined(__DECCXX)
   if(!fincont.rdbuf()->is_open()) return -1;
 #else
@@ -547,9 +539,8 @@ Int_t AliQuenchingWeights::InitSingleHard(const Char_t *contall,const Char_t *di
   }
   fincont.close();
 
-  sprintf(fname,"%s",gSystem->ExpandPathName(discall));
   //PH  ifstream findisc(fname); 
-  fstream findisc(fname,ios::in); 
+  fstream findisc(Form("%s",gSystem->ExpandPathName(discall)),ios::in); 
 #if defined(__HP_aCC) || defined(__DECCXX)
   if(!findisc.rdbuf()->is_open()) return -1;
 #else
index 72b0e14..82c7cf7 100644 (file)
@@ -42,11 +42,6 @@ AliITSQASPDChecker::AliITSQASPDChecker() :
  fHighSPDValue(NULL),
  fImage(NULL) 
  {
- for(Int_t i=0; i<6 ; i++) { 
-  fDisplayStatus[i] = new TPaveText(0.2,0.23,0.7,0.5,"NDC");
-  fDisplayStatus[i]->SetFillColor(kGreen);
-  fDisplayStatus[i]->AddText("OK");
-  } 
  }
 //__________________________________________________________________
 AliITSQASPDChecker& AliITSQASPDChecker::operator = (const AliITSQASPDChecker& qac ) 
@@ -62,9 +57,6 @@ if(fStepBitSPD) delete[] fStepBitSPD ;
 if(fLowSPDValue)delete[]fLowSPDValue;
 if(fHighSPDValue) delete[]fHighSPDValue;
 if(fImage) delete[]fImage;
-for(Int_t i=0; i<6; i++){
-delete fDisplayStatus[i];
-}
 } 
 
 //__________________________________________________________________
@@ -184,81 +176,69 @@ while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
         if(!histName.Contains("SPD")) continue;
         totalHistos++;
         // data format error
-        if(histName.Contains("SPDErrorsAll")){
-       if(hdata->GetListOfFunctions()->GetEntries()<1) hdata->GetListOfFunctions()->Add(fDisplayStatus[0]);
-        if(hdata->Integral(0,hdata->GetNbinsX())>0){
+       if(histName.Contains("SPDErrorsAll")){
+       if(hdata->GetListOfFunctions()->GetEntries()<1) hdata->GetListOfFunctions()->Add(new TPaveText(0.2,0.23,0.7,0.5,"NDC"));
+
           for(Int_t i=0; i<hdata->GetListOfFunctions()->GetEntries(); i++){
           TString funcName = hdata->GetListOfFunctions()->At(i)->ClassName();
           if(funcName.Contains("TPaveText")){
-            TPaveText *p = (TPaveText*)hdata->GetListOfFunctions()->At(i);
+           TPaveText *p = (TPaveText*)hdata->GetListOfFunctions()->At(i);
+             p->Clear();
+
+            if(hdata->Integral(0,hdata->GetNbinsX())>0){
             Bool_t isHighMult = kFALSE;
             for(Int_t ieq=0; ieq<20; ieq++){
              if(hdata->GetBinContent(ieq+1,17+1)>0 && hdata->GetBinContent(ieq+1,20+1)>0) isHighMult = kTRUE;
             }
             if(isHighMult) {
-              p->Clear();
              p->SetFillColor(kOrange);
              p->AddText("High occupancy in a chip detected (-> errors type 17,20 and 0 are present). ");
              p->AddText("ONLY IF OTHER error types are present CALL the expert");
-             }
-            else {
-             p->Clear();
+             } else {
             p->SetFillColor(kRed);
             p->AddText("Data Format NOT OK. Please call the expert!");
             }
-            
-           }
-          }
-           response = fHighSPDValue[AliQAv1::kFATAL];
-          fatalProblem=kTRUE;
-           break;
-         } else {  
-         for(Int_t i=0; i<hdata->GetListOfFunctions()->GetEntries(); i++){
-          TString funcName = hdata->GetListOfFunctions()->At(i)->ClassName();
-          if(funcName.Contains("TPaveText")){
-            TPaveText *p = (TPaveText*)hdata->GetListOfFunctions()->At(i);
-            p->Clear();
-            p->SetFillColor(kGreen);
-            p->AddText("OK");
-          
-          }
-          }
-        }
-        }
+            response = fHighSPDValue[AliQAv1::kFATAL];
+            fatalProblem=kTRUE;
+            continue;
+           } // if errors 
+           else {
+             p->Clear();
+             p->SetFillColor(kGreen);
+             p->AddText("OK");
+            }
+          } // TPaveText
+         } // list entries   
+        } // data format error
+
         // MEB error
         else if(histName.Contains("MEB")){
-       if(hdata->GetListOfFunctions()->GetEntries()<1) hdata->GetListOfFunctions()->Add(fDisplayStatus[1]);
-          if(hdata->GetEntries()>0){
-             for(Int_t i=0; i<hdata->GetListOfFunctions()->GetEntries(); i++){
+         if(hdata->GetListOfFunctions()->GetEntries()<1) hdata->GetListOfFunctions()->Add(new TPaveText(0.2,0.23,0.7,0.5,"NDC"));
+
+          for(Int_t i=0; i<hdata->GetListOfFunctions()->GetEntries(); i++){
           TString funcName = hdata->GetListOfFunctions()->At(i)->ClassName();
           if(funcName.Contains("TPaveText")){
             TPaveText *p = (TPaveText*)hdata->GetListOfFunctions()->At(i);
             p->Clear();
+
+          if(hdata->GetEntries()>0){
             p->SetFillColor(kRed);
             p->AddText("MEB problem could be present. Please check if SPD is in READY state.");
             p->AddText("If SPD is in -READY- state, please notify it to the expert."); 
-           }
-          } 
-         
-         
-           response = fHighSPDValue[AliQAv1::kFATAL];
-          fatalProblem=kTRUE;
-           break;
-          } else {  
-         for(Int_t i=0; i<hdata->GetListOfFunctions()->GetEntries(); i++){
-          TString funcName = hdata->GetListOfFunctions()->At(i)->ClassName();
-          if(funcName.Contains("TPaveText")){
-            TPaveText *p = (TPaveText*)hdata->GetListOfFunctions()->At(i);
-            p->Clear();
+            response = fHighSPDValue[AliQAv1::kFATAL];
+            fatalProblem=kTRUE;
+            continue;
+
+           } else {
             p->SetFillColor(kGreen);
             p->AddText("OK");
-          
-          }
-          }
-        }      
-        }
+              }   
+
+           } // pave text
+          } // list 
+         }
        goodHistos++;
-      }
+        }
      }
     if(!fatalProblem) response = goodHistos/totalHistos;
    // printf("n histos %f - good ones %f ----> ratio %f , fatal response %i\n",totalHistos,goodHistos,goodHistos/totalHistos,(Int_t)fatalProblem);
index e8a39a2..b3341be 100644 (file)
@@ -48,8 +48,6 @@ private:
   Float_t *fHighSPDValue;        // lower limits for QA bit settings
   TCanvas **    fImage;          //[AliRecoParam::kNSpecies]
 
-  TPaveText * fDisplayStatus[6]; //Online Comments for the DQM-shifter histos 
-
   ClassDef(AliITSQASPDChecker,4)  // description 
 
 };