fSPDOffset(0),
fSDDOffset(0),
fSSDOffset(0),
+fSPDHisto(0),
+fSDDHisto(0),
+fSSDHisto(0),
fSPDChecker(0), // SPD Checker
fSDDChecker(0), // SDD Checker
fSSDChecker(0) // SSD Checker
+
{
// Standard constructor
fkOnline = kMode; fDet = subDet; fLDC = ldc;
if(fDet == 0 || fDet == 1) {
- AliDebug(1,"AliITSQAChecker::Create SPD Checker\n");
+ AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQAChecker::Create SPD Checker\n");
+ fSPDChecker = new AliITSQASPDChecker();
}
if(fDet == 0 || fDet == 2) {
- AliDebug(1,"AliITSQAChecker::Create SDD Checker\n");
+ AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQAChecker::Create SDD Checker\n");
+ fSDDChecker = new AliITSQASDDChecker();
}
if(fDet == 0 || fDet == 3) {
- AliDebug(1,"AliITSQAChecker::Create SSD Checker\n");
+ AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQAChecker::Create SSD Checker\n");
+ fSSDChecker = new AliITSQASSDChecker();
}
-
+ InitQACheckerLimits();
}
//____________________________________________________________________________
fSPDOffset(qac.fSPDOffset),
fSDDOffset(qac.fSDDOffset),
fSSDOffset(qac.fSSDOffset),
-fSPDChecker(0),
-fSDDChecker(0),
-fSSDChecker(0) {
+fSPDHisto(qac.fSPDHisto),
+fSDDHisto(qac.fSDDHisto),
+fSSDHisto(qac.fSSDHisto),
+fSPDChecker(qac.fSPDChecker),
+fSDDChecker(qac.fSDDChecker),
+fSSDChecker(qac.fSSDChecker)
+{
// copy constructor
AliError("Copy should not be used with this class\n");
}
}
//____________________________________________________________________________
-Double_t * AliITSQAChecker::Check(AliQA::ALITASK_t /*index*/)
+Double_t * AliITSQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, const AliDetectorRecoParam * recoParam)
{
- Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ;
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
- rv[specie] = 0.5 ;
- return rv ;
-}
-//____________________________________________________________________________
-Double_t * AliITSQAChecker::Check(AliQA::ALITASK_t index, TObjArray ** list)
-{
-
- // Super-basic check on the QA histograms on the input list:
- // look whether they are empty!
- if(index == AliQA::kESD){
+
+ // basic checks on the QA histograms on the input list
+ //for the ITS subdetectorQA (Raws Digits Hits RecPoints SDigits) return the worst value of the three result
+ if(index == AliQAv1::kESD){
+
Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ;
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
rv[specie] = 0.0 ;
- if ( !AliQA::Instance()->IsEventSpecieSet(specie) )
+ if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) )
continue ;
- AliDebug(1,"Checker for ESD");
+ AliDebug(AliQAv1::GetQADebugLevel(),"Checker for ESD");
Int_t tested = 0;
Int_t empty = 0;
// The following flags are set to kTRUE if the corresponding
rv[specie] = 0.; // nothing to check
}
else {
+ Double_t *stepbit=new Double_t[AliQAv1::kNBIT];
+ Double_t histonumb= list[specie]->GetEntries();
+ CreateStepForBit(histonumb,stepbit);
TIter next1(list[specie]);
TH1 * hdata;
Int_t nskipped=0;
Double_t entries = hdata->GetEntries();
++tested;
if(!(entries>0.))++empty;
- AliDebug(1,Form("ESD hist name %s - entries %12.1g",hname.Data(),entries));
+ AliDebug(AliQAv1::GetQADebugLevel(),Form("ESD hist name %s - entries %12.1g",hname.Data(),entries));
if(hname.Contains("hESDClusterMapSA") && entries>0.){
cluMapSA = kTRUE;
- AliDebug(1,Form("Processing histogram %s",hname.Data()));
+ AliDebug(AliQAv1::GetQADebugLevel(),Form("Processing histogram %s",hname.Data()));
// Check if there are layers with anomalously low
// contributing points to SA reconstructed tracks
for(Int_t k=1;k<7;k++){
if(skipped[k-1]) continue;
if(hdata->GetBinContent(k)<0.5*(entries/6.)){
cluMapSA = kFALSE;
- AliInfo(Form("SA tracks have few points on layer %d - look at histogram hESDClustersSA",k));
+ AliDebug(AliQAv1::GetQADebugLevel(),Form("SA tracks have few points on layer %d - look at histogram hESDClustersSA",k));
}
}
}
else if(hname.Contains("hESDClusterMapMI") && entries>0.){
// Check if there are layers with anomalously low
// contributing points to MI reconstructed tracks
- AliDebug(1,Form("Processing histogram %s",hname.Data()));
+ AliDebug(AliQAv1::GetQADebugLevel(),Form("Processing histogram %s",hname.Data()));
cluMapMI = kTRUE;
for(Int_t k=1;k<7;k++){
// check if the layer was skipped
if(skipped[k-1]) continue;
if(hdata->GetBinContent(k)<0.5*(entries/6.)){
cluMapMI = kFALSE;
- AliInfo(Form("MI tracks have few points on layer %d - look at histogram hESDClustersMI",k));
+ AliDebug(AliQAv1::GetQADebugLevel(),Form("MI tracks have few points on layer %d - look at histogram hESDClustersMI",k));
}
}
}
else if(hname.Contains("hESDClustersMI") && entries>0.){
// Check if 6 clusters MI tracks are the majority
- AliDebug(1,Form("Processing histogram %s",hname.Data()));
+ AliDebug(AliQAv1::GetQADebugLevel(),Form("Processing histogram %s",hname.Data()));
cluMI = kTRUE;
Double_t maxlaytracks = hdata->GetBinContent(7-nskipped);
for(Int_t k=2; k<7-nskipped; k++){
if(hdata->GetBinContent(k)>maxlaytracks){
cluMI = kFALSE;
- AliInfo(Form("MI Tracks with %d clusters are more than tracks with %d clusters. Look at histogram hESDClustersMI",k-1,6-nskipped));
+ AliDebug(AliQAv1::GetQADebugLevel(),Form("MI Tracks with %d clusters are more than tracks with %d clusters. Look at histogram hESDClustersMI",k-1,6-nskipped));
}
}
}
else if(hname.Contains("hESDClustersSA") && entries>0.){
// Check if 6 clusters SA tracks are the majority
- AliDebug(1,Form("Processing histogram %s",hname.Data()));
+ AliDebug(AliQAv1::GetQADebugLevel(),Form("Processing histogram %s",hname.Data()));
cluSA = kTRUE;
Double_t maxlaytracks = hdata->GetBinContent(7-nskipped);
for(Int_t k=2; k<7-nskipped; k++){
if(hdata->GetBinContent(k)>maxlaytracks){
cluSA = kFALSE;
- AliInfo(Form("SA Tracks with %d clusters are more than tracks with %d clusters. Look at histogram hESDClustersSA",k-1,6-nskipped));
+ AliDebug(AliQAv1::GetQADebugLevel(), Form("SA Tracks with %d clusters are more than tracks with %d clusters. Look at histogram hESDClustersSA",k-1,6-nskipped));
}
}
}
else if(hname.Contains("hSPDVertexZ") && entries>0.){
// Check if average Z vertex coordinate is -5 < z < 5 cm
- AliDebug(1,Form("Processing histogram %s",hname.Data()));
+ AliDebug(AliQAv1::GetQADebugLevel(),Form("Processing histogram %s",hname.Data()));
verSPDZ = kTRUE;
if(hdata->GetMean()<-5. && hdata->GetMean()>5.){
verSPDZ = kFALSE;
- AliInfo(Form("Average z vertex coordinate is at z= %10.4g cm",hdata->GetMean()));
+ AliDebug(AliQAv1::GetQADebugLevel(),Form("Average z vertex coordinate is at z= %10.4g cm",hdata->GetMean()));
}
}
}
-
else{
AliError("ESD Checker - invalid data type");
}
-
- rv[specie] = 0.;
- if(tested>0){
- if(tested == empty){
- rv[specie] = 0.1;
- AliWarning("All ESD histograms are empty");
- }
- else {
- rv[specie] = 0.1+0.4*(static_cast<Double_t>(tested-empty)/static_cast<Double_t>(tested));
- if(cluMapSA)rv[specie]+=0.1;
- if(cluMapMI)rv[specie]+=0.1;
- if(cluMI)rv[specie]+=0.1;
- if(cluSA)rv[specie]+=0.1;
- if(verSPDZ)rv[specie]+=0.1;
- }
- }
- }
- }
+ }
+ rv[specie] = 0.;
+ if(tested>0){
+ if(tested == empty){
+ rv[specie] = 2500.; // set to error
+ AliWarning(Form("All ESD histograms are empty - specie=%d",specie));
+ }
+ else {
+ rv[specie] = 2500.-1500.*(static_cast<Double_t>(tested-empty)/static_cast<Double_t>(tested)); // INFO if all histos are filled
+ if(cluMapSA)rv[specie]-=200.;
+ if(cluMapMI)rv[specie]-=200.;
+ if(cluMI)rv[specie]-=200.;
+ if(cluSA)rv[specie]-=200.;
+ if(verSPDZ)rv[specie]-=199.; // down to 1 if everything is OK
+ }
+ }
+ }
+ // AliDebug(AliQAv1::GetQADebugLevel(), Form("ESD - Tested %d histograms, Return value %f \n",tested,rv[specie]));
AliInfo(Form("ESD - Tested %d histograms, Return value %f \n",tested,rv[specie]));
}
return rv ;
Double_t * retval = new Double_t[AliRecoParam::kNSpecies] ;
//____________________________________________________________________________
- Double_t spdCheck, sddCheck, ssdCheck;
- //pixel
- if(fDet == 0 || fDet == 1) {
- AliDebug(1,"AliITSQAChecker::Create SPD Checker\n");
- if(!fSPDChecker) {
- fSPDChecker = new AliITSQASPDChecker();
- }
- fSPDChecker->SetTaskOffset(fSPDOffset);
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
- retval[specie] = 1.0 ;
- if ( AliQA::Instance()->IsEventSpecieSet(specie) ) {
- spdCheck = fSPDChecker->Check(index, list[specie]);
- if(spdCheck<retval[specie])retval[specie] = spdCheck;
- }
- }
- }
- //drift
- if(fDet == 0 || fDet == 2) {
- AliDebug(1,"AliITSQAChecker::Create SDD Checker\n");
- if(!fSDDChecker) {
- fSDDChecker = new AliITSQASDDChecker();
- }
- fSDDChecker->SetTaskOffset(fSDDOffset);
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
- retval[specie] = 1.0 ;
- if ( AliQA::Instance()->IsEventSpecieSet(specie) ) {
- sddCheck = fSDDChecker->Check(index, list[specie]);
- if(sddCheck<retval[specie])retval[specie] = sddCheck;
- }
- }
- }
- //strip
- if(fDet == 0 || fDet == 3) {
- AliDebug(1,"AliITSQAChecker::Create SSD Checker\n");
- if(!fSSDChecker) {
- fSSDChecker = new AliITSQASSDChecker();
- AliInfo(Form("Number of monitored objects SSD: %d", list[AliRecoParam::kDefault]->GetEntries()));
- }
- fSSDChecker->SetTaskOffset(fSSDOffset);
+ Double_t spdCheck[AliRecoParam::kNSpecies] ;
+ Double_t sddCheck[AliRecoParam::kNSpecies] ;
+ Double_t ssdCheck[AliRecoParam::kNSpecies] ;
+
+
+
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
- retval[specie] = 1.0 ;
- if ( AliQA::Instance()->IsEventSpecieSet(specie) ) {
- ssdCheck = fSSDChecker->Check(index, list[specie]);
- if(ssdCheck<retval[specie])retval[specie] = ssdCheck;
- }
- }
- }
- // here merging part for common ITS QA result
- //
+ if ( AliQAv1::Instance()->IsEventSpecieSet(specie) ) {
+ Double_t histotot=list[specie]->GetEntries();
+ if(histotot!=0)
+ {
+ spdCheck[specie]=0.;
+ sddCheck[specie]=0.;
+ ssdCheck[specie]=0.;
+ retval[specie] = 0.0 ;//
+ //pixel
+ if(fDet == 0 || fDet == 1) {
+ fSPDChecker->SetTaskOffset(fSPDOffset);
+ //printf("spdoffset = %i \n",fSPDOffset );
+ Double_t histoSPD=double(GetSPDHisto());
- return retval;
+ Double_t *stepSPD=new Double_t[AliQAv1::kNBIT];
+ CreateStepForBit(histoSPD,stepSPD);
+ fSPDChecker->SetStepBit(stepSPD);
+ spdCheck[specie] = fSPDChecker->Check(index, list[specie], recoParam);
+ if(spdCheck[specie]>fUpTestValue[AliQAv1::kFATAL]||spdCheck[specie]<0.)
+ {
+ AliInfo(Form("SPD check result for %s is out of range (%f)!!! Retval of specie %s is sit to -1\n ",AliQAv1::GetAliTaskName(index),spdCheck[specie],AliRecoParam::GetEventSpecieName(specie)));
+ spdCheck[specie]=fUpTestValue[AliQAv1::kFATAL];
+ }
+ //if(spdCheck[specie]<0.5)AliInfo(Form("SPD check result for %s (%s) is < 0.5 .The result is %f ",AliQAv1::GetAliTaskName(index),AliRecoParam::GetEventSpecieName(specie),spdCheck[specie]) );
+ delete []stepSPD;
+ retval[specie]=spdCheck[specie];
+ }
+ //drift
+ if(fDet == 0 || fDet == 2) {
+ fSDDChecker->SetTaskOffset(fSDDOffset);
+ Double_t histoSDD=double(GetSDDHisto());
+ Double_t *stepSDD=new Double_t[AliQAv1::kNBIT];
+ CreateStepForBit(histoSDD,stepSDD);
+ fSDDChecker->SetStepBit(stepSDD);
+ sddCheck[specie] = fSDDChecker->Check(index, list[specie], recoParam);
+ if(sddCheck[specie]>fUpTestValue[AliQAv1::kFATAL]||sddCheck[specie]<0.)
+ {
+ AliInfo(Form("SDD check result for %s is out of range (%f)!!! Retval of specie %s is sit to -1\n ",AliQAv1::GetAliTaskName(index),sddCheck[specie],AliRecoParam::GetEventSpecieName(specie)));
+ sddCheck[specie]=fUpTestValue[AliQAv1::kFATAL];
+ }
+ //if(sddCheck[specie]<0.5)AliInfo(Form("SDD check result for %s (%s) is < 0.5 .The result is %f\f ",AliQAv1::GetAliTaskName(index),AliRecoParam::GetEventSpecieName(specie),sddCheck[specie]) );
+ delete []stepSDD;
+ if(sddCheck[specie]>retval[specie])retval[specie]=sddCheck[specie];
+ }
+ //strip
+ if(fDet == 0 || fDet == 3) {
+ fSSDChecker->SetTaskOffset(fSSDOffset);
+ Double_t histoSSD=double(GetSSDHisto());
+ Double_t *stepSSD=new Double_t[AliQAv1::kNBIT];
+ CreateStepForBit(histoSSD,stepSSD);
+ fSSDChecker->SetStepBit(stepSSD);
+ ssdCheck[specie] = fSSDChecker->Check(index, list[specie], recoParam);
+ if(ssdCheck[specie]>fUpTestValue[AliQAv1::kFATAL]||ssdCheck[specie]<0.)
+ {
+ AliInfo(Form("SSD check result for %s is out of range (%f)!!! Retval of specie %s is sit to -1\n ",AliQAv1::GetAliTaskName(index),ssdCheck[specie],AliRecoParam::GetEventSpecieName(specie)));
+ ssdCheck[specie]=fUpTestValue[AliQAv1::kFATAL];
+ }
+ //if(ssdCheck[specie]<0.5)AliInfo(Form("SSD check result for %s (%s) is < 0.5 . The result is %f ",AliQAv1::GetAliTaskName(index),AliRecoParam::GetEventSpecieName(specie),ssdCheck[specie]) );
+ delete [] stepSSD;
+ if(ssdCheck[specie]>retval[specie])retval[specie]=ssdCheck[specie];
+ }
+
+ AliInfo(Form("Check result for %s: \n\t SPD %f \n\t SDD %f \n\t SSD %f \n Check result %f \n ",AliQAv1::GetAliTaskName(index),spdCheck[specie],sddCheck[specie],ssdCheck[specie],retval[specie]));
+ // here merging part for common ITS QA result
+ //
+ }//end entries
+ }//end if event specie
+ }//end for
+ return retval;
}
fSSDOffset = SSDOffset;
}
+//____________________________________________________________________________
+void AliITSQAChecker::SetHisto(Int_t SPDhisto, Int_t SDDhisto, Int_t SSDhisto)
+{
+ //Setting the 3 offsets for each task called
+ fSPDHisto = SPDhisto;
+ fSDDHisto = SDDhisto;
+ fSSDHisto = SSDhisto;
+}
+
//____________________________________________________________________________
void AliITSQAChecker::SetDetTaskOffset(Int_t subdet,Int_t offset)
{
break;
}
}
+
+ //____________________________________________________________________________
+ void AliITSQAChecker::SetDetHisto(Int_t subdet,Int_t histo)
+ {
+ switch(subdet){
+ case 1:
+ SetSPDHisto(histo);
+ break;
+ case 2:
+ SetSDDHisto(histo);
+ break;
+ case 3:
+ SetSSDHisto(histo);
+ break;
+ default:
+ AliWarning("No specific (SPD,SDD or SSD) subdetector correspond to to this number!!! all offsets set to zero for all the detectors\n");
+ SetHisto(0, 0, 0);
+ break;
+ }
+ }
+
+//_____________________________________________________________________________
+
+void AliITSQAChecker::InitQACheckerLimits()
+{
+
+ AliInfo("Setting of tolerance values\n");
+
+ Float_t lowtolerancevalue[AliQAv1::kNBIT];
+
+ Float_t hightolerancevalue[AliQAv1::kNBIT];
+ for(Int_t bit=0;bit<AliQAv1::kNBIT;bit++)
+ {
+ lowtolerancevalue[bit]=(bit*1000.);
+ hightolerancevalue[bit]=((bit+1.)*1000.);
+ }
+ SetHiLo(hightolerancevalue,lowtolerancevalue);
+ // AliInfo(Form("Range Value \n INFO -> %f < value < %f \n WARNING -> %f < value <= %f \n ERROR -> %f < value <= %f \n FATAL -> %f <= value < %f \n", fLowTestValue[AliQAv1::kINFO], fUpTestValue[AliQAv1::kINFO], fLowTestValue[AliQAv1::kWARNING], fUpTestValue[AliQAv1::kWARNING], fLowTestValue[AliQAv1::kERROR], fUpTestValue[AliQAv1::kERROR], fLowTestValue[AliQAv1::kFATAL], fUpTestValue[AliQAv1::kFATAL] ));
+
+ if(fDet == 0 || fDet == 1) {
+ fSPDChecker->SetSPDLimits( lowtolerancevalue,hightolerancevalue );
+ }
+ if(fDet == 0 || fDet == 2) {
+ fSDDChecker->SetSDDLimits( lowtolerancevalue,hightolerancevalue );
+ }
+ if(fDet == 0 || fDet == 3) {
+ fSSDChecker->SetSSDLimits( lowtolerancevalue,hightolerancevalue );
+ }
+
+
+
+}
+
+
+//_____________________________________________________________________________
+
+void AliITSQAChecker::CreateStepForBit(Double_t histonumb,Double_t *steprange)
+{
+ for(Int_t bit=0;bit < AliQAv1::kNBIT; bit++)
+ {
+ //printf("%i\t %f \t %f \t %f \n",bit, fUpTestValue[bit],fLowTestValue[AliQAv1::kINFO],histonumb);
+ steprange[bit]=double((fUpTestValue[bit] - fLowTestValue[AliQAv1::kINFO])/histonumb);
+ //printf("%i\t %f \t %f \t %f \t %f\n",bit, fUpTestValue[bit],fLowTestValue[AliQAv1::kINFO],histonumb,steprange[bit] );
+ }
+ //AliInfo(Form("StepBitValue:numner of histo %f\n\t INFO %f \t WARNING %f \t ERROR %f \t FATAL %f \n",histonumb, steprange[AliQAv1::kINFO],steprange[AliQAv1::kWARNING],steprange[AliQAv1::kERROR],steprange[AliQAv1::kFATAL]));
+}
+
+
+//_____________________________________________________________________________
+void AliITSQAChecker::SetQA(AliQAv1::ALITASK_t index, Double_t * value) const
+{
+
+ AliQAv1 * qa = AliQAv1::Instance(index) ;
+
+
+ for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+
+ if (! qa->IsEventSpecieSet(AliRecoParam::ConvertIndex(specie)))
+ continue ;
+ if ( value == NULL ) { // No checker is implemented, set all QA to Fatal
+ qa->Set(AliQAv1::kFATAL, specie) ;
+ } else {
+ if ( value[specie] > fLowTestValue[AliQAv1::kFATAL] && value[specie] <= fUpTestValue[AliQAv1::kFATAL] )
+ qa->Set(AliQAv1::kFATAL, AliRecoParam::ConvertIndex(specie)) ;
+ else if ( value[specie] > fLowTestValue[AliQAv1::kERROR] && value[specie] <= fUpTestValue[AliQAv1::kERROR] )
+ qa->Set(AliQAv1::kERROR, AliRecoParam::ConvertIndex(specie)) ;
+ else if ( value[specie] > fLowTestValue[AliQAv1::kWARNING] && value[specie] <= fUpTestValue[AliQAv1::kWARNING] )
+ qa->Set(AliQAv1::kWARNING, AliRecoParam::ConvertIndex(specie)) ;
+ else if ( value[specie] > fLowTestValue[AliQAv1::kINFO] && value[specie] <= fUpTestValue[AliQAv1::kINFO] )
+ qa->Set(AliQAv1::kINFO, AliRecoParam::ConvertIndex(specie)) ;
+ //else if(value[specie]==0) qa->Set(AliQAv1::kFATAL, AliRecoParam::ConvertIndex(specie)) ; //no ckeck has been done
+ }
+ qa->ShowStatus(AliQAv1::kITS,index,AliRecoParam::ConvertIndex(specie));
+ }//end for
+
+}
+
+