#include "AliLog.h"
#include "AliQADataMakerRec.h"
+#include "AliQAManager.h"
#include "AliESDEvent.h"
#include "AliRawReader.h"
if ( fESDsQAList ) {
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
if ( fESDsQAList[specie] ) {
- if ( fESDsQAList[specie]->IsOwner() )
fESDsQAList[specie]->Delete() ;
}
}
if ( fRawsQAList ) {
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
if ( fRawsQAList[specie] ) {
- if ( fRawsQAList[specie]->IsOwner() )
- fRawsQAList[specie]->Delete() ;
+ fRawsQAList[specie]->Delete() ;
}
}
delete[] fRawsQAList ;
if ( fDigitsQAList ) {
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
if ( fDigitsQAList[specie] ) {
- if ( fDigitsQAList[specie]->IsOwner() )
- fDigitsQAList[specie]->Delete() ;
+ fDigitsQAList[specie]->Delete() ;
}
}
delete[] fDigitsQAList ;
if ( fRecPointsQAList ) {
for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
if ( fRecPointsQAList[specie] ) {
- if ( fRecPointsQAList[specie]->IsOwner() )
- fRecPointsQAList[specie]->Delete() ;
+ fRecPointsQAList[specie]->Delete() ;
}
}
delete[] fRecPointsQAList ;
fRecPointsArray->Clear() ;
delete fRecPointsArray ;
}
-
- if ( fCorrNt ) {
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
- if ( fCorrNt[specie] )
- delete fCorrNt[specie] ;
- }
- delete fCorrNt ;
- }
}
//__________________________________________________________________
{
// Finishes a cycle of QA
- TObjArray ** list = NULL ;
+
+ TObjArray ** list = NULL ;
if ( task == AliQAv1::kRAWS )
list = fRawsQAList ;
return ;
//DefaultEndOfDetectorCycle(task) ;
EndOfDetectorCycle(task, list) ;
+
+ if (! AliQAManager::QAManager(AliQAv1::kRECMODE)->IsSaveData())
+ return ;
+
fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
if (!fDetectorDir)
fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
if (!eventSpecieDir)
eventSpecieDir = subDir->mkdir(AliRecoParam::GetEventSpecieName(specie)) ;
eventSpecieDir->cd() ;
- if (list[specie]) {
- TIter next(list[specie]) ;
- TObject * obj ;
- while( (obj = next()) ) {
- if (!obj->TestBit(AliQAv1::GetExpertBit()))
- obj->Write() ;
- }
- if (WriteExpert()) {
- TDirectory * expertDir = eventSpecieDir->GetDirectory(AliQAv1::GetExpert()) ;
- if (!expertDir)
- expertDir = eventSpecieDir->mkdir(AliQAv1::GetExpert()) ;
- expertDir->cd() ;
- next.Reset() ;
+ if (list) {
+ if (list[specie]) {
+ TIter next(list[specie]) ;
+ TObject * obj ;
while( (obj = next()) ) {
if (!obj->TestBit(AliQAv1::GetExpertBit()))
- continue ;
- obj->Write() ;
- }
+ obj->Write() ;
+ }
+ if (WriteExpert()) {
+ TDirectory * expertDir = eventSpecieDir->GetDirectory(AliQAv1::GetExpert()) ;
+ if (!expertDir)
+ expertDir = eventSpecieDir->mkdir(AliQAv1::GetExpert()) ;
+ expertDir->cd() ;
+ next.Reset() ;
+ while( (obj = next()) ) {
+ if (!obj->TestBit(AliQAv1::GetExpertBit()))
+ continue ;
+ obj->Write() ;
+ }
+ }
}
+ }
+ else if ( fCorrNt ) {
+ if (fCorrNt[specie] && AliQAv1::GetDetIndex(GetName()) == AliQAv1::kCORR) {
+ eventSpecieDir->cd() ;
+ fCorrNt[specie]->Write() ;
+ }
+ fOutput->Save() ;
}
- if ( !fCorrNt )
- continue ;
- if (fCorrNt[specie] && AliQAv1::GetDetIndex(GetName()) == AliQAv1::kCORR) {
- eventSpecieDir->cd() ;
- fCorrNt[specie]->Write() ;
- }
- fOutput->Save() ;
}
}
//____________________________________________________________________________
void AliQADataMakerRec::InitRecoParams()
{
+ // Get the recoparam form the OCDB
if (!fRecoParam) {
AliDebug(AliQAv1::GetQADebugLevel(), Form("Loading reconstruction parameter objects for detector %s", GetName()));
AliCDBPath path(GetName(),"Calib","RecoParam");
AliError(Form("No valid RecoParam object found in the OCDB for detector %s",GetName()));
}
}
- AliCDBManager::Instance()->UnloadFromCache(path.GetPath());
+ }
+}
+
+//____________________________________________________________________________
+void AliQADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
+{
+ // default reset that resets all the QA objects.
+ // to be overloaded by detectors, if necessary
+
+ TObjArray ** list = NULL ;
+ if ( task == AliQAv1::kRAWS ) {
+ list = fRawsQAList ;
+ } else if ( task == AliQAv1::kDIGITSR ) {
+ list = fDigitsQAList ;
+ } else if ( task == AliQAv1::kRECPOINTS ) {
+ list = fRecPointsQAList ;
+ } else if ( task == AliQAv1::kESDS ) {
+ list = fESDsQAList ;
+ }
+ //list was not initialized, skip
+ if (!list)
+ return ;
+
+ for (int spec = 0; spec < AliRecoParam::kNSpecies; spec++) {
+ if (!AliQAv1::Instance()->IsEventSpecieSet(AliRecoParam::ConvertIndex(spec)))
+ continue;
+ TIter next(list[spec]) ;
+ TH1 * histo = NULL ;
+ while ( (histo = dynamic_cast<TH1*> (next())) ) {
+ histo->Reset("ICE") ;
+ }
}
}
ResetCycle() ;
if (fOutput)
fOutput->Close() ;
- fOutput = AliQAv1::GetQADataFile(GetName(), fRun) ;
+ if (AliQAManager::QAManager(AliQAv1::kRECMODE)->IsSaveData())
+ fOutput = AliQAv1::GetQADataFile(GetName(), fRun) ;
}
AliDebug(AliQAv1::GetQADebugLevel(), Form(" Run %d Cycle %d task %s file %s",
fRun, fCurrentCycle, AliQAv1::GetTaskName(task).Data(), fOutput->GetName() )) ;