+/// Structure of file (.root) containing local board efficency
+ TFile *file = new TFile(filename, "read");
+ if(!file || !file->IsOpen()) {
+ AliError(Form("Can't read file %s",filename));
+ return;
+ }
+
+ if ( ! fCountHistoList ) {
+ fCountHistoList = new TList();
+ fCountHistoList->SetOwner();
+ }
+
+ TH1F *histo = 0x0;
+ const Char_t* histoName;
+
+ TList* listInFile = 0x0;
+ TString listNameString(listname);
+ if ( ! listNameString.IsNull() )
+ listInFile = (TList*)file->FindObjectAny(listname);
+
+ for ( Int_t ide=0; ide<=kHchamberCount; ide++){
+ for(Int_t ich=0; ich<fgkNchambers; ich++){
+
+ // Efficiency per chamber is provided by 1 histogram only
+ if ( ide == kHchamberCount ) ich = fgkNchambers;
+
+ for(Int_t hType=0; hType<kNcounts; hType++){
+ histoName = GetHistoName(ide, hType, ich);
+ histo = ( listInFile ) ? (TH1F*)listInFile->FindObject(histoName) : (TH1F*)file->Get(histoName);
+ if ( ! histo ) {
+ AliWarning(Form("Cannot find %s in file. Skip histogram", histoName));
+ continue;
+ }
+ histo->SetDirectory(0);
+ fCountHistoList->Add(histo);
+
+ AliDebug(5,Form("Adding histogram %s\n",histoName));
+
+ // Do not fill efficiency per chamber histos
+ if ( ide == kHchamberCount )
+ continue;
+
+ // Fill old historgrams for consistency
+ if ( hType < kBothPlanesEff ){
+ TString newName = histoName;
+ newName.ReplaceAll("Counts","Eff");
+ TH1F* auxHisto = (TH1F*)histo->Clone(newName.Data());
+ auxHisto->SetDirectory(0);
+ if ( ide == kHboardCount )
+ fBoardEfficiency[fgkNchambers*hType+ich] = auxHisto;
+ else if ( ide == kHslatCount )
+ fSlatEfficiency[fgkNchambers*hType+ich] = auxHisto;
+
+ AliDebug(5,Form("Creating histogram %s\n",auxHisto->GetName()));
+ }
+ else if ( hType == kAllTracks ){
+ for ( Int_t icath=0; icath<2; icath++){
+ if ( ide == kHboardCount )
+ fBoardEfficiency[fgkNchambers*icath+ich]->Divide(histo);
+ else if ( ide == kHslatCount )
+ fSlatEfficiency[fgkNchambers*icath+ich]->Divide(histo);
+ }
+ }
+ } // loop on count types
+ } // loop on chambers
+ } // loop on detection element type
+
+ file->Close();