Double_t * AliACORDEQAChecker::Check(AliQAv1::ALITASK_t /*index*/, TObjArray ** list)
{
- // We added one check to the ACORDE's QA histograms:
- // 1.- We check if they are empty
- // we check for the reference histogram to start the QAChecker. If not QAref object
- // is found, we check that the number of hits per channel is not so far from
- // the maximum number of hits.
- Double_t * test = new Double_t[AliRecoParam::kNSpecies] ;
- Int_t * count = new Int_t[AliRecoParam::kNSpecies] ;
- Double_t * acoTest = new Double_t[AliRecoParam::kNSpecies];
- // Double_t acoHitsNorm = 0;
- Double_t * acoRefTest = new Double_t[AliRecoParam::kNSpecies];
+ Double_t * test = new Double_t[AliRecoParam::kNSpecies] ;
+ Int_t * count = new Int_t[AliRecoParam::kNSpecies] ;
+ Double_t * acoTest = new Double_t[AliRecoParam::kNSpecies];
+
// Look at the QAref data for ACORDE
char * acoOCDBDir = Form("ACORDE/%s/%s",AliQAv1::GetRefOCDBDirName(),AliQAv1::GetRefDataDirName());
AliCDBEntry *acoQARefDir = AliQAManager::QAManager()->Get(acoOCDBDir);
+ // Check variables set to 0
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
- test[specie] = 0.0 ;
- count[specie] = 0 ;
- acoTest[specie] = 0.0;
- }
+ for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
+ {
+ test[specie] = 0.0 ;
+ count[specie] = 0 ;
+ acoTest[specie] = 0.0;
+ }
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
- if (list[specie]->GetEntries() == 0){
- test[specie] = 1. ; // nothing to check
- acoTest[specie] = 1.;
- }
- 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;
- AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)) ;
- count[specie]++ ;
- test[specie] += rv ;
-
- // here we implement the second version for ACORDEQAChecker
- // by the moment we only compare that the hits in every ACORDE's channel
- // are close and > 0
- Double_t acoHitsNorm = hdata->GetMaximum();
- if (acoQARefDir)
+ for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
+ {
+ if (list[specie]->GetEntries() == 0)
+ {
+ test[specie] = 1. ; // nothing to check
+ acoTest[specie] = 1.;
+ }
+ else
{
- // AliWarning("Using the QA Reference data for ACORDE !!!");
- test[specie] = CheckAcordeRefHits(list[specie],(TObjArray *)acoQARefDir->GetObject());
- if ((test[specie] = 0.86) || (acoHitsNorm>0.50))
+ TIter next(list[specie]) ;
+ TH1 * hdata ;
+ while ( (hdata = dynamic_cast<TH1 *>(next())) )
{
- acoRefTest[specie]=0.78;//printf("testMario: %f\n",acoRefTest[specie]);printf("histo:%f\n",hdata->GetMaximum());
- }
- }else{
- // AliWarning("Using the inner ACORDE QA Checker !!!");
- if ( (acoHitsNorm>0.40) && (acoHitsNorm<=1) ) acoTest[specie] = 0.75;
- if ( (acoHitsNorm>0.0020) && (acoHitsNorm<=0.40) ) acoTest[specie] = 0.251;
- if ( (acoHitsNorm>0.0) && (acoHitsNorm<=0.0020) ) acoTest[specie] = 0.0010;
- if ( (acoHitsNorm>-1.0) && (acoHitsNorm<=0.0) ) acoTest[specie] = -0.5;
- }
- }
- 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 {
- if (acoQARefDir) test[specie] = acoRefTest[specie];
- else{
- test[specie] = acoTest[specie];//printf("testDyMa: %f\n",test[specie]);
- }
- }
- }
- }
- // AliDebug(AliQAv1::GetQADebugLevel(), Form("Test Result = %f", test[specie])) ;
- }
- return test ;
+ if (hdata)
+ {
+ Double_t rv = 0.0 ;
+ if(hdata->GetEntries()>0) rv=1;
+ AliDebug(AliQAv1::GetQADebugLevel(), Form("%s -> %f", hdata->GetName(), rv)) ;
+ count[specie]++ ;
+ test[specie] += rv ;
+ Double_t acoHitsNorm;
+ if (hdata->GetMaximum()==1) acoHitsNorm = 1;
+ else acoHitsNorm = (hdata->GetMaximum() - 0.50)/hdata->GetMaximum();
+ // here we implement the second version for ACORDEQAChecker
+ // by the moment we only compare the Mean between the QA histograms and the Reference data
+ if (acoQARefDir)
+ {
+ //AliWarning("Using the QA Reference data for ACORDE !!!");
+ Double_t acoHistChecked = CheckAcordeRefHits(list[specie],(TObjArray *)acoQARefDir->GetObject());
+ if ( (acoHistChecked>0.75) && (acoHistChecked<=1) ) acoTest[specie] = 0.86;
+ if ( (acoHistChecked>0.0020) && (acoHistChecked<=0.75) ) acoTest[specie] = 0.251;
+ if ( (acoHistChecked>0.0) && (acoHistChecked<=0.0020) ) acoTest[specie] = 0.0010;
+ if ( (acoHistChecked>-1.0) && (acoHistChecked<=0.0) ) acoTest[specie] = -0.5;
+
+ }else
+ {
+ //AliWarning("Using the inner ACORDE QA Checker !!!");
+ if ( (acoHitsNorm>0.40) && (acoHitsNorm<=1) ) acoTest[specie] = 0.86;
+ if ( (acoHitsNorm>0.0020) && (acoHitsNorm<=0.40) ) acoTest[specie] = 0.251;
+ if ( (acoHitsNorm>0.0) && (acoHitsNorm<=0.0020) ) acoTest[specie] = 0.0010;
+ if ( (acoHitsNorm>-1.0) && (acoHitsNorm<=0.0) ) acoTest[specie] = -0.5;
+ }
+ }
+ else
+ {
+ AliError("Data type cannot be processed") ;
+ }
+ }
+ if (count[specie] != 0)
+ {
+ if (test[specie]==0)
+ {
+ test[specie] = 0.5; //upper limit value to set kWARNING flag for a task
+ }
+ else
+ {
+ if (acoQARefDir) test[specie] = acoTest[specie];
+ else
+ {
+ test[specie] = acoTest[specie];
+ }
+ }
+ }
+ }
+ }
+ return test ;
}
-Double_t AliACORDEQAChecker::CheckAcordeRefHits(TObjArray *AcordeList, TObjArray * /*AcordeRef */) const
+Double_t AliACORDEQAChecker::CheckAcordeRefHits(TObjArray *HistAcordeList, TObjArray *AcordeRef) const
{
- Double_t acoTest = 0;
- TIter next(AcordeList);
- TH1 *histo;
- for (Int_t i=0;i<60;i++)
+ Double_t acordeTest = 0;
+ TIter next(AcordeRef);
+ TIter next1(HistAcordeList);
+ TH1 *histoAcordeRef;
+ TH1 *histoAcorde;
+ Float_t acordeHistoQAMaker=0;
+ Float_t meanACOQAReference=0;
+ Float_t meanACOQAMaker=0;
+ Float_t test1ACORDE = 0;
+ while((histoAcordeRef=(TH1*)next()) && (histoAcorde=(TH1*)next1()))
{
- while ( (histo = dynamic_cast<TH1 *>(next())) )
- {
- if (histo->GetMaximum() && ((histo->GetBinContent(i)/histo->GetMaximum())<1.0) ) acoTest = 0.86;
-// if( histo->KolmogorovTest((TH1F *)AcordeRef->At(0))<0.8) acoTest = 0.86;
- //printf("href:%f\n",histo->GetMaximum());
- }
- }
- return acoTest;
+ for(Int_t i=0;i<60;i++) acordeHistoQAMaker=acordeHistoQAMaker + histoAcorde->GetBinContent(i)/histoAcorde->GetMaximum();
+ meanACOQAReference = histoAcordeRef->GetMean();
+ meanACOQAMaker = acordeHistoQAMaker/60;
+ test1ACORDE = TMath::Abs(meanACOQAReference-meanACOQAMaker);
+ if (test1ACORDE<0.45) acordeTest = 0.86;
+ if (test1ACORDE > 0.45) acordeTest = 0.50;
+ if (test1ACORDE > 0.70) acordeTest = 0.25;
+ }
+ return acordeTest;
}