+}
+
+//_____________________________________________________________________________
+Bool_t AliQADataMakerSteer::DoIt(const AliQA::TASKINDEX taskIndex, const char * mode)
+{
+ // Runs all the QA data Maker for every detector
+
+ Bool_t rv = kFALSE ;
+ // Fill QA data in event loop
+ for (UInt_t iEvent = 0 ; iEvent < fNumberOfEvents ; iEvent++) {
+ // Get the event
+ if ( iEvent%10 == 0 )
+ AliInfo(Form("processing event %d", iEvent));
+ if ( taskIndex == AliQA::kRAWS ) {
+ if ( !fRawReader->NextEvent() )
+ break ;
+ } else if ( taskIndex == AliQA::kESDS ) {
+ if ( fESDTree->GetEntry(iEvent) == 0 )
+ break ;
+ } else {
+ if ( fRunLoader->GetEvent(iEvent) != 0 )
+ break ;
+ }
+ // loop over detectors
+ TObjArray* detArray = NULL ;
+ if (fRunLoader) // check if RunLoader exists
+ if ( fRunLoader->GetAliRun() ) // check if AliRun exists in gAlice.root
+ detArray = fRunLoader->GetAliRun()->Detectors() ;
+ for (UInt_t iDet = 0 ; iDet < fgkNDetectors ; iDet++) {
+ if (detArray) {
+ AliModule* det = static_cast<AliModule*>(detArray->FindObject(AliQA::GetDetName(iDet))) ;
+ if (!det || !det->IsActive())
+ continue ;
+ }
+ if (!IsSelected(AliQA::GetDetName(iDet)))
+ continue ;
+ AliQADataMaker * qadm = GetQADataMaker(iDet, mode) ;
+ if (!qadm) {
+ rv = kFALSE ;
+ } else {
+ if ( qadm->IsCycleDone() ) {
+ qadm->EndOfCycle(AliQA::kRAWS) ;
+ qadm->StartOfCycle(AliQA::kRAWS) ;
+ }
+ TTree * data ;
+ switch (taskIndex) {
+ case AliQA::kRAWS :
+ qadm->Exec(taskIndex, fRawReader) ;
+ break ;
+ case AliQA::kHITS :
+ GetLoader(iDet)->LoadHits() ;
+ data = GetLoader(iDet)->TreeH() ;
+ if ( ! data ) {
+ AliWarning(Form(" Hit Tree not found for %s", AliQA::GetDetName(iDet))) ;
+ } else {
+ qadm->Exec(taskIndex, data) ;
+ }
+ break ;
+ case AliQA::kSDIGITS :
+ GetLoader(iDet)->LoadSDigits() ;
+ data = GetLoader(iDet)->TreeS() ;
+ if ( ! data ) {
+ AliWarning(Form(" SDigit Tree not found for %s", AliQA::GetDetName(iDet))) ;
+ } else {
+ qadm->Exec(taskIndex, data) ;
+ }
+ break;
+ case AliQA::kDIGITS :
+ GetLoader(iDet)->LoadDigits() ;
+ data = GetLoader(iDet)->TreeD() ;
+ if ( ! data ) {
+ AliWarning(Form(" Digit Tree not found for %s", AliQA::GetDetName(iDet))) ;
+ } else {
+ qadm->Exec(taskIndex, data) ;
+ }
+ break;
+ case AliQA::kRECPOINTS :
+ GetLoader(iDet)->LoadRecPoints() ;
+ data = GetLoader(iDet)->TreeR() ;
+ if (!data) {
+ AliWarning(Form("RecPoints not found for %s", AliQA::GetDetName(iDet))) ;
+ } else {
+ qadm->Exec(taskIndex, data) ;
+ }
+ break;
+ case AliQA::kTRACKSEGMENTS :
+ break;
+ case AliQA::kRECPARTICLES :
+ break;
+ case AliQA::kESDS :
+ qadm->Exec(taskIndex, fESD) ;
+ break;
+ case AliQA::kNTASKINDEX :
+ break;
+ } //task switch
+ //qadm->Increment() ;
+ } //data maker exist
+ } // detector loop
+ } // event loop
+// // Save QA data for all detectors
+ rv = Finish(taskIndex, mode) ;
+
+ return rv ;
+}
+
+//_____________________________________________________________________________
+Bool_t AliQADataMakerSteer::Finish(const AliQA::TASKINDEX taskIndex, const char * mode)
+{
+ // write output to file for all detectors
+ for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
+ if (IsSelected(AliQA::GetDetName(iDet))) {
+ AliQADataMaker * qadm = GetQADataMaker(iDet, mode) ;
+ if (qadm) {
+ qadm->EndOfCycle(taskIndex) ;
+ }
+ }
+ }
+ return kTRUE ;
+}