- return -1 ;
- } else {
- hist->SetDirectory(0) ;
- list->AddAtAndExpand(hist, index) ;
- return list->GetLast() ;
- }
+ } else {
+ if (expert)
+ hist->SetBit(AliQA::GetExpertBit()) ;
+ TH1 * histClone[AliRecoParam::kNSpecies] ;
+ for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+ histClone[specie] = CloneMe(hist, specie) ;
+ histClone[specie]->SetDirectory(0) ;
+ list[specie]->AddAtAndExpand(histClone[specie], index) ;
+ if(saveForCorr) {
+ char * name = Form("%s_%s", list[AliRecoParam::kDefault]->GetName(), hist->GetName()) ;
+ TParameter<double> * p = new TParameter<double>(name, 9999.9999) ;
+ if ( fParameterList[specie] == NULL )
+ fParameterList[specie] = new TList() ;
+ fParameterList[specie]->Add(p) ;
+ }
+ }
+ rv = list[AliRecoParam::kDefault]->GetLast() ;
+ }
+ delete hist ;
+ return rv ;
+}
+
+//____________________________________________________________________________
+TH1 * AliQADataMaker::CloneMe(TH1 * hist, Int_t specie) const
+{
+ // clones a histogram
+ char * name = Form("%s_%s", AliRecoParam::GetEventSpecieName(specie), hist->GetName()) ;
+ TH1 * hClone = dynamic_cast<TH1 *>(hist->Clone(name)) ;
+ if ( hist->TestBit(AliQA::GetExpertBit()) )
+ hClone->SetBit(AliQA::GetExpertBit()) ;
+ return hClone ;