- TString className(hist->ClassName()) ;
- if( ! className.BeginsWith("T") ) {
- AliError(Form("QA data Object must be a generic ROOT object and not %s", className.Data())) ;
-// return -1 ;
- }
- if ( index > 10000 ) {
- AliError("Max number of authorized QA objects is 10000") ;
- return -1 ;
- } else {
- hist->SetDirectory(0) ;
- list->AddAtAndExpand(hist, index) ;
- return list->GetLast() ;
- }
+
+ Int_t rv = -1 ;
+ TClass * classType = hist->Class() ;
+ TString className(classType->GetName()) ;
+ if( ! className.BeginsWith("T") && ! classType->InheritsFrom("TH1") ) {
+ AliError(Form("QA data Object must be a generic ROOT object and derive fom TH1 and not %s", className.Data())) ;
+ } else if ( index > AliQAv1::GetMaxQAObj() ) {
+ AliError(Form("Max number of authorized QA objects is %d", AliQAv1::GetMaxQAObj())) ;
+ } else {
+ hist->SetDirectory(0) ;
+ if (expert)
+ hist->SetBit(AliQAv1::GetExpertBit()) ;
+ if (image)
+ hist->SetBit(AliQAv1::GetImageBit()) ;
+ const Char_t * name = Form("%s_%s", AliRecoParam::GetEventSpecieName(fEventSpecie), hist->GetName()) ;
+ hist->SetName(name) ;
+ if(saveForCorr) {
+ const Char_t * cname = Form("%s_%s", list[AliRecoParam::AConvert(AliRecoParam::kDefault)]->GetName(), hist->GetName()) ;
+ TParameter<double> * p = new TParameter<double>(cname, 9999.9999) ;
+ if ( fParameterList[AliRecoParam::AConvert(fEventSpecie)] == NULL )
+ fParameterList[AliRecoParam::AConvert(fEventSpecie)] = new TList() ;
+ fParameterList[AliRecoParam::AConvert(fEventSpecie)]->Add(p) ;
+ }
+ list[AliRecoParam::AConvert(fEventSpecie)]->AddAtAndExpand(hist, index) ;
+ rv = list[AliRecoParam::AConvert(fEventSpecie)]->GetLast() ;
+ }
+ return rv ;
+}
+
+//____________________________________________________________________________
+TH1 * AliQADataMaker::CloneMe(TH1 * hist, Int_t specie) const
+{
+ // clones a histogram
+ const Char_t * name = Form("%s_%s", AliRecoParam::GetEventSpecieName(specie), hist->GetName()) ;
+ TH1 * hClone = static_cast<TH1 *>(hist->Clone(name)) ;
+ if ( hist->TestBit(AliQAv1::GetExpertBit()) )
+ hClone->SetBit(AliQAv1::GetExpertBit()) ;
+ if ( hist->TestBit(AliQAv1::GetImageBit()) )
+ hClone->SetBit(AliQAv1::GetImageBit()) ;
+ return hClone ;