// Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
// Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
// Arturo Fernandez <afernan@mail.cern.ch> (FCFM-BUAP)
+// Last update: Nov. 14t 2009 --> MRC <mrodrigu@mail.cern.ch> (FCFM-BUAP)
//...
// --- ROOT system ---
// --- AliRoot header files ---
#include "AliLog.h"
-#include "AliQA.h"
+#include "AliQAv1.h"
#include "AliQAChecker.h"
#include "AliACORDEQAChecker.h"
+#include "AliCDBEntry.h"
+#include "AliQAManager.h"
ClassImp(AliACORDEQAChecker)
//____________________________________________________________________________
-Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/)
+Double_t * AliACORDEQAChecker::Check(AliQAv1::ALITASK_t /*index*/)
{
Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ;
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
rv[specie] = 0.0 ;
return rv ;
}
-
-//__________________________________________________________________
-Double_t * AliACORDEQAChecker::Check(AliQA::ALITASK_t /*index*/, TObjArray ** list)
+//____________________________________________________________________________
+Double_t * AliACORDEQAChecker::Check(AliQAv1::ALITASK_t /*index*/, TObjArray ** list, const AliDetectorRecoParam * /*recoParam*/)
{
+// Close version to the final one for the ACORDE QA Checker
-// Super-basic check on the QA histograms on the input list:
- // look whether they are empty!
- Double_t * test = new Double_t[AliRecoParam::kNSpecies] ;
- Int_t * count = new Int_t[AliRecoParam::kNSpecies] ;
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
- test[specie] = 0.0 ;
- count[specie] = 0 ;
- }
+ Double_t * test = new Double_t[AliRecoParam::kNSpecies] ;
+ Double_t * acoTest = new Double_t[AliRecoParam::kNSpecies] ;
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
- if (list[specie]->GetEntries() == 0){
- test[specie] = 1. ; // nothing to check
- }
- else {
- TIter next(list[specie]) ;
- TH1 * hdata ;
- while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
- if (hdata) {
- Double_t rv = 0.0 ;
- if(hdata->GetEntries()>0)rv=1;
- AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
- count[specie]++ ;
- test[specie] += rv ;
- }
- else{
- AliError("Data type cannot be processed") ;
- }
- }
- if (count[specie] != 0) {
- if (test[specie]==0) {
- AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
- test[specie] = 0.5; //upper limit value to set kWARNING flag for a task
- }
- else {
- test[specie] /= count[specie] ;
- }
- }
- }
- AliInfo(Form("Test Result = %f", test[specie])) ;
+// Loop over the run species (for specie!= cosmic by now we set QA to INFO)
+
+ for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
+ {
+ if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) continue ;
+ if (list[specie]->GetEntries() == 0) acoTest[specie] = 1.; // Nothing to check
+ else
+ {
+ TIter next(list[specie]) ;
+ TH1 * hdata ; // Data created by the AliACORDEQADataMakerXXX (Sim/Rec)
+ while ( (hdata = dynamic_cast<TH1 *>(next())) )
+ {
+ if (hdata)
+ {
+ Double_t rv = 0.0 ;
+ if(hdata->GetEntries()>0) rv=1;
+ AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)) ;
+ TString hdataName = hdata->GetName();
+
+ // Here we use the QAref ACORDE data from fRefOCDBSubDir
+
+ if ( (fRefOCDBSubDir[specie]) && (hdataName.Contains("ACORDEBitPattern")) )
+ {
+ TH1 * href = NULL;
+ if (fRefSubDir) href = static_cast<TH1*>(fRefSubDir->Get(hdata->GetName()));
+ else if (fRefOCDBSubDir[specie]) href = static_cast<TH1*>(fRefOCDBSubDir[specie]->FindObject(hdata->GetName()));
+ acoTest[specie] = CheckAcordeRefHits(href,hdata);
+ }else if (hdataName.Contains("ACORDEBitPattern"))
+ // Here we use an inner QA Checher without the QAref data
+ {
+ Float_t acoDataMax = hdata->GetMaximum();
+ Int_t flagAcoQA = 0;
+ if (acoDataMax!=0)
+ {
+ for(Int_t i=0;i<60;i++)
+ {
+ if ((hdata->GetBinContent(i)/acoDataMax) < 0.75) flagAcoQA++;
+ }
+ }
+ Double_t simpleFlag = 1.-flagAcoQA/60.;
+ if ( (simpleFlag >= 0.90) && (simpleFlag <= 1.0) ) acoTest[specie] = 0.75; // INFO
+ if ( (simpleFlag >= 0.70) && (simpleFlag < 0.90) ) acoTest[specie] = 0.50; // WARNING
+ if ( (simpleFlag >= 0.25) && (simpleFlag < 0.70) ) acoTest[specie] = 0.25; // ERROR
+ if ( (simpleFlag >= 0.0) && (simpleFlag < 0.25) ) acoTest[specie] = -1.0; // FATAL
+ }
+ // Setting Warning message for possible Empty Events with the ACORDE-Trigger
+
+ if (hdataName.Contains("ACORDEMultiplicity") && (hdata->GetBinContent(0)!=0)) AliWarning("Empty event registered with ACORDE Trigger !!!");
+
+
+ }else AliError("Data type cannot be processed") ;
+
+ }
+ }
+ if ( (specie == AliRecoParam::kHighMult) || (specie == AliRecoParam::kLowMult) || (specie == AliRecoParam::kCalib) ) acoTest[specie] = 0.75;
+ test[specie] = acoTest[specie]; // Assign of the acoTest to the test for final QAChecker value
}
- return test ;
+ return test ;
+}
+//____________________________________________________________________________
+Double_t AliACORDEQAChecker::CheckAcordeRefHits(const TH1 * href, const TH1 * hdata) const
+{
+ Double_t acoTest = 0.;
+ Int_t flag=0;
+ for (Int_t i=0;i<60;i++)
+ {
+ if (TMath::Abs(href->GetBinContent(i)-hdata->GetBinContent(i))>10) flag++;
+ }
+ if ((flag>50)&&(flag<=60)) acoTest = -1.;
+ if ((flag>30)&&(flag<=50)) acoTest = 0.25;
+ if ((flag>10)&&(flag<=30)) acoTest = 0.5;
+ if ((flag>0)&&(flag<=10)) acoTest = 0.75;
+ return acoTest;
}
-