]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSQASDDChecker.cxx
fix in calling of gaussian spread function
[u/mrichter/AliRoot.git] / ITS / AliITSQASDDChecker.cxx
index 4424cb84d964266ce977f8a96f1e83e20df30df3..0f1bdc1b944ccb68a2e36734bf5fecc46f089f74 100644 (file)
@@ -72,10 +72,6 @@ fImage(NULL),
            fHighSDDValue[ibit]=0.;
          }
        for(Int_t i=0;i<AliRecoParam::kNSpecies;i++) fPaveText[i] = NULL;
-       for(Int_t i=0;i<2; i++) {
-               fPaveTextRaw[i] = NULL;
-               fPaveTextRec[i] = NULL;
-       }
 }          // ctor
 
 
@@ -116,18 +112,6 @@ AliITSQASDDChecker::~AliITSQASDDChecker()
                        fPaveText[i]=NULL;
                }
        }
-       for(Int_t i=0;i<2;i++) {
-               if(fPaveTextRaw[i])
-               {
-                       delete fPaveTextRaw[i]; 
-                       fPaveTextRaw[i]=NULL;
-               }
-               if(fPaveTextRec[i])
-               {
-                       delete fPaveTextRec[i]; 
-                       fPaveTextRec[i]=NULL;
-               }
-       }
 } // dtor
 
 //__________________________________________________________________
@@ -170,7 +154,8 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
   TIter next(list);
   TString results1;
   TString results2;
-  Int_t color=1;
+       Int_t color=kBlack;
+       Int_t textcolor=kBlack;
 
   switch(index) {
     case AliQAv1::kRAW:{
@@ -306,20 +291,21 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
              Int_t layer1=0;
              if(hname.Contains("3"))layer1=0;
              else  if(hname.Contains("4"))layer1=1;
-             if(dynamic_cast<TH2*>(hdata)){
-               hlayer[layer1]=(TH2*)((dynamic_cast<TH2*>(hdata))->Clone());
-               hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
-               int modmay=hlayer[layer1]->GetNbinsY();
-               TH1D* hproj= hlayer[layer1]->ProjectionY();
-               Double_t ladcontent=0;
-               for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
-                 ladcontent=hproj->GetBinContent(i);
-                 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
-                 else filledladders[layer1]++;}//end for
-               AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
-               delete hproj;
-               hproj=NULL;
-             }//end if htemp
+                       TH2* htemp=dynamic_cast<TH2*>(hdata);
+                       if(htemp){
+                         hlayer[layer1]=(TH2*)htemp->Clone();
+                               hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
+                               int modmay=hlayer[layer1]->GetNbinsY();
+                               TH1D* hproj= hlayer[layer1]->ProjectionY();
+                               Double_t ladcontent=0;
+                               for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
+                                       ladcontent=hproj->GetBinContent(i);
+                                       if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
+                                       else filledladders[layer1]++;}//end for
+                                       AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
+                                       delete hproj;
+                                       hproj=NULL;
+                       }//end if htemp
            }//end else entries !=0
          }//end check on phiz        
                
@@ -457,18 +443,17 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
          if(AliRecoParam::ConvertIndex(GetEventSpecieForCheck())!=AliRecoParam::kCosmic){     
            
            results1.Form("%i good module(s) and %i good drift regions didn't take data!",emptydiff,emptydrdiff);
-           if(neventsraw<numlimit)
-             {
-               results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsraw);
-               color=5;
-               sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
-             }
-           else
-             {
-               results2.Form(" Events %d. If PHYSICS, follow the TWiki instruction and call the Expert ",neventsraw);
-               color=2;
-               sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
-             }
+           if(neventsraw<numlimit) {
+                       results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsraw);
+                       color=kYellow;
+                       textcolor=kBlack;
+                       sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
+               } else {
+                       results2.Form(" Events %d. If PHYSICS, follow the TWiki instruction and call the Expert ",neventsraw);
+                       color=kRed;
+                       textcolor=kWhite;
+                       sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
+               }
          }
          else
            //      if((AliQAv1::Instance(AliQAv1::GetDetIndex("ITS")))->IsEventSpecieSet(AliRecoParam::kCosmic)==kTRUE)
@@ -480,14 +465,16 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
                    AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
                    results1.Form("OK. This is a cosmic run. you need a lot of events. Events %i",neventsraw);
                    results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
-                   color=5;
+                         color=kYellow;
+                         textcolor=kBlack;
                    sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
                  }
                else
                  {
                    results1.Form("%i good module(s) and %i good drift region(s) have no data!",emptydiff,emptydrdiff);
                    results2.Form(" Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsraw);
-                   color=2;
+                         color=kRed;
+                         textcolor=kWhite;
                    sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
                  }
              }
@@ -497,7 +484,8 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
          AliInfo(Form("All the active modules (%i) and single drift regions (%i) are in acquisition. The number of excluded modules are %i and the excluded single drift regions are %i\n",active,activedriftregion,excluded,excludeddriftregion));
          results1.Form("OK.");
          results2.Form(" All active modules and drift regions in acquisition");
-         color=3;
+         color=kGreen;
+               textcolor=kBlack;
          sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
        }
        if(exactive!=0||exactivedriftregion!=0){
@@ -506,45 +494,44 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
          AliError(Form("Layer 3: %i modules and %i single  drift regions excluded from the acquisition took data. Active modules%i single drift region %i \n ",exactivemoduleperlayer[1],exactivedrperlayer[1],activemoduleperlayer[1],activedrperlayer[1]));
          results1.Form("%i modules and %i drift region excluded from the acquisition took data",exactive,exactivedriftregion);
          results2.Form("Follow the TWiki instructions and Call the SDD expert ");
-         color=2;      
+               color=kRed;
+               textcolor=kWhite;
          sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
        }
        if(excluded==exactive||excludeddriftregion==exactivedriftregion){
          AliError(Form("All the modules (%d) or single drift regions (%d) excluded from the acquisition  took data!\n  Active modules %i \t Active drfift regions %i\n",excluded,excludeddriftregion,active,activedriftregion));
          results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition took data!",excluded,excludeddriftregion );
          results2.Form("Follow the TWiki instructions and Call the SDD expert ");
-         color=6;
+               color=kRed;
+               textcolor=kWhite;
          sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
        }
        if(active==0||activedriftregion==0){
          AliError(Form("No modules or single drift regions took data: excluded %i \t excluded active %i \n\t\t excluded single drift regions %i \t excluded active drift regions %i \n", excluded, exactive, excludeddriftregion, exactivedriftregion)); 
          results1.Form("No modules or drift region took data: excluded modules %i  excluded drift regions %i ", excluded, excludeddriftregion );
          results2.Form("Follow the TWiki instructions and Call the SDD expert ");
-         color=6;
+               color=kRed;
+               textcolor=kWhite;
          sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
        }
 
        //TPaveText *pave[2]={0,0};
        next.Begin();
 
-                 for(Int_t lay=0;lay<2; lay++)   if(fPaveTextRaw[lay]) { delete fPaveTextRaw[lay]; fPaveTextRaw[lay] = NULL; }
        while( (hdata=dynamic_cast<TH1* >(next())) ) {
            if (hdata){
                        TString hname=hdata->GetName();
                        if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){
                          if(hname.Contains("NORM"))continue;
                          //AliInfo("========================================Found histo 11\n");
-                         Int_t lay=0;
-                         if(hname.Contains("3"))lay=0;
-                         else if(hname.Contains("4"))lay=1;
-                         fPaveTextRaw[lay]=new TPaveText(0.3,0.9,0.9,0.99,"NDC");
-                               //fPaveTextRaw[lay]->AddText(hname.Data());
-                         fPaveTextRaw[lay]->AddText(results1.Data());
-                         fPaveTextRaw[lay]->AddText(results2.Data());
-                         fPaveTextRaw[lay]->SetFillColor(color);
-                         fPaveTextRaw[lay]->SetBorderSize(1);
-                         fPaveTextRaw[lay]->SetLineWidth(1);
-                         //hdata->GetListOfFunctions()->Add(pave[lay]);
+                               TPaveText *ptext = ((TPaveText *)hdata->GetListOfFunctions()->FindObject("TPave"));
+                               if(ptext) {
+                                       ptext->Clear();
+                                       ptext->AddText(results1.Data());
+                                       ptext->AddText(results2.Data());
+                                       ptext->SetFillColor(color);
+                                       ptext->SetTextColor(textcolor);
+                               }
              } else if(hname.Contains("SDDRawDataCheck")) {
                    
                          //AliInfo("========================================Found histo\n");
@@ -588,7 +575,6 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
                          ((TH1F*)hdata)->SetBinContent(42,emptyactivemoduleperlayer[1]);
                          ((TH1F*)hdata)->SetBinContent(43,exactivedrperlayer[1]);
                          ((TH1F*)hdata)->SetBinContent(44,emptyactivedrperlayer[1]);
-                         //hdata->GetListOfFunctions()->Add(pave[0]);
                          //break; 
                        }
                }//if hdata
@@ -932,13 +918,15 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
              if(neventsrecpoints<numlimits)
                {
                  results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsrecpoints);
-                 color=5;
+                       color=kYellow;
+                       textcolor=kBlack;
                  sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
                }
              else
                {
                  results2.Form(" Events %d .If PHYSICS, follow the TWiki instruction and call the Expert ",neventsrecpoints);
-                 color=2;
+                       color=kRed;
+                       textcolor=kWhite;
                  sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
                }
            }
@@ -951,14 +939,16 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
                    AliWarning(Form("This is a cosmic run. Some module and drift region are empty but all is OK. "));
                    results1.Form("OK. Thi is a cosmic run. You need a lot of events. Events %i",neventsrecpoints);
                    results2.Form("%i good module(s) and %i good drift are empty! DO NOT CALL THE EXPERT",emptydiff,emptydrdiff);
-                   color=5;
+                         color=kYellow;
+                         textcolor=kBlack;
                    sddQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
                  }
                else
                  {
                    results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
                    results2.Form("Cosmic Events %d .Follow the TWiki instruction and call the Expert ",neventsrecpoints);
-                   color=2;
+                         color=kRed;
+                         textcolor=kWhite;
                    sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
                  }
              }
@@ -970,7 +960,8 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
          AliInfo(Form("All the active modules (%i) and single drift regions (%i) are in acquisition. The number of excluded modules are %i and the excluded single drift regions are %i\n",active,activedriftregion,excluded,excludeddriftregion));
          results1.Form("OK.");
          results2.Form(" All active modules have recpoints");
-         color=3;
+               color=kGreen;
+               textcolor=kBlack;
          sddQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
        }
        if(exactive!=0||exactivedriftregion!=0){
@@ -979,27 +970,29 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
          AliError(Form("Layer 3: %i modules and %i single  drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactivemoduleperlayer[1],exactivedrperlayer[1],activemoduleperlayer[1],activedrperlayer[1]));
          results1.Form("%i modules and %i drift region excluded from the acquisition have recpoints",exactive,exactivedriftregion);
          results2.Form("Follow the TWiki instructions and Call the SDD expert ");
-         color=2;      
+               color=kRed;
+               textcolor=kWhite;
          sddQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
        }
        if(excluded==exactive||excludeddriftregion==exactivedriftregion){
          AliError(Form("All the modules (%d) or single drift regions (%d) excluded from the acquisition have recpoints!\n  Active modules %i \t Active drfift regions %i\n",excluded,excludeddriftregion,active,activedriftregion));
          results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition have recpoints!",excluded,excludeddriftregion );
          results2.Form("Follow the TWiki instructions and Call the SDD expert ");
-         color=6;
+               color=kRed;
+               textcolor=kWhite;
          sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
        }
        if(active==0||activedriftregion==0){
          AliError(Form("No modules or single drift regions have recpoints: excluded %i \t excluded active %i \n\t\t excluded single drift regions %i \t excluded active drift regions %i \n", excluded, exactive, excludeddriftregion, exactivedriftregion)); 
          results1.Form("No modules or drift region have recpoints: excluded modules %i  excluded drift regions %i ", excluded, excludeddriftregion );
          results2.Form("Follow the TWiki instructions and Call the SDD expert ");
-         color=6;
+               color=kRed;
+               textcolor=kWhite;
          sddQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
        }
 
        //TPaveText *pave[2]={0,0};
        next.Begin();
-                 for(Int_t lay=0;lay<2; lay++)   if(fPaveTextRec[lay]) { delete fPaveTextRec[lay]; fPaveTextRec[lay] = NULL; }
 
        while( (hdata=dynamic_cast<TH1* >(next())) )
          {
@@ -1008,17 +1001,15 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
              if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){
                if(hname.Contains("NORM"))continue;
                //AliInfo("========================================Found histo 11\n");
-               Int_t lay=0;
-               if(hname.Contains("3"))lay=0;
-               else if(hname.Contains("4"))lay=1;
-               fPaveTextRec[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
-               fPaveTextRec[lay]->AddText(results1.Data());
-               fPaveTextRec[lay]->AddText(results2.Data());
-               fPaveTextRec[lay]->SetFillColor(color);
-               fPaveTextRec[lay]->SetBorderSize(1);
-               fPaveTextRec[lay]->SetLineWidth(1);
-               //hdata->GetListOfFunctions()->Add(pave[lay]);
-             }
+                         TPaveText *ptext = ((TPaveText *)hdata->GetListOfFunctions()->FindObject("TPave"));
+                         if(ptext) {
+                                 ptext->Clear();
+                                 ptext->AddText(results1.Data());
+                                 ptext->AddText(results2.Data());
+                                 ptext->SetFillColor(color);
+                                 ptext->SetTextColor(textcolor);
+                         }
+                 }
              else
                if(hname.Contains("SDDRecPointCheck"))
                  {
@@ -1291,7 +1282,11 @@ Bool_t  AliITSQASDDChecker::MakeSDDImage( TObjArray ** list, AliQAv1::TASKINDEX_
     }
     break;
     case AliQAv1::kNULLTASKINDEX:; case  AliQAv1::kNTASKINDEX: 
-      {AliWarning(Form("No histograms for this task ( %s ) \n", AliQAv1::GetTaskName(task).Data())); rval=kFALSE;}
+      {
+       Int_t ts=(Int_t)task;
+       AliWarning(Form("No histograms for this task number %d  \n", ts)); 
+       rval=kFALSE;
+      }
       break;
     }
 return rval;  
@@ -1351,28 +1346,14 @@ Bool_t AliITSQASDDChecker::MakeSDDRawsImage(TObjArray ** list, AliQAv1::TASKINDE
                                                gPad->SetRightMargin(0.15);
                                                gPad->SetLeftMargin(0.05);
                                                hist->SetStats(0);
-                                               hist->SetOption("box") ;
+                                               hist->SetOption("colz") ;
 
                                                ////hist->GetListOfFunctions()->FindObject("palette")->SetLabelSize(0.025);
                                                //gPad->Update();
                                        }
-                                       if(hname.Contains("SDDphizL3")) hist->GetListOfFunctions()->Add(fPaveTextRaw[0]);
-                                       if(hname.Contains("SDDphizL4")) hist->GetListOfFunctions()->Add(fPaveTextRaw[1]);
                                        hist->DrawCopy(); 
                                        fImage[esIndex]->cd(++npad) ; 
                                        fImage[esIndex]->cd(npad)->SetBorderMode(0) ; 
-                                       if(hname.Contains("SDDphizL3")) { 
-                                               hist->GetListOfFunctions()->Clear(); 
-                                               hist->GetListOfFunctions()->Delete();
-                                               delete fPaveTextRaw[0];
-                                               fPaveTextRaw[0] = NULL;
-                                       }
-                                       if(hname.Contains("SDDphizL4")) {
-                                               hist->GetListOfFunctions()->Clear(); 
-                                               hist->GetListOfFunctions()->Delete();
-                                               delete fPaveTextRaw[1];
-                                               fPaveTextRaw[1] = NULL;
-                                       }
                                } 
                        }
                        fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ; 
@@ -1443,31 +1424,19 @@ Bool_t AliITSQASDDChecker::MakeSDDRecPointsImage(TObjArray ** list, AliQAv1::TAS
              gPad->SetRightMargin(0.15);
              gPad->SetLeftMargin(0.05);
              hist->SetStats(0);
-             hist->SetOption("box") ;
+             hist->SetOption("colz") ;
              ////            TPaletteAxis *paletta =(TPaletteAxis*)hist->GetListOfFunctions()->FindObject("palette");
              //paletta->SetLabelSize(0.025);
              //gPad->Update(); 
            }
-                       if(hname.Contains("SDDModPatternL3RP")) hist->GetListOfFunctions()->Add(fPaveTextRaw[0]);
-                       if(hname.Contains("SDDModPatternL4RP")) hist->GetListOfFunctions()->Add(fPaveTextRaw[1]);
+
                        hist->DrawCopy(); 
                        fImage[esIndex]->cd(++npad) ; 
                        fImage[esIndex]->cd(npad)->SetBorderMode(0) ; 
-                       if(hname.Contains("SDDModPatternL3RP")) { 
-                               hist->GetListOfFunctions()->Clear(); 
-                               hist->GetListOfFunctions()->Delete();
-                               delete fPaveTextRec[0];
-                               fPaveTextRec[0] = NULL;
-                       }
-                       if(hname.Contains("SDDModPatternL4RP")) {
-                               hist->GetListOfFunctions()->Clear(); 
-                               hist->GetListOfFunctions()->Delete();
-                               delete fPaveTextRec[1];
-                               fPaveTextRec[1] = NULL;
-                       }
-       }
+               }
       }
       fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ; 
     }
    return kTRUE;
 }
+