#include "AliCDBEntry.h"
#include "AliLog.h"
+#include "AliTRDPIDReference.h"
#include "AliTRDcalibDB.h"
#include "Cal/AliTRDCalROC.h"
fPIDResponse = new AliTRDPIDResponse;
// Load Reference Histos from OCDB
fPIDResponse->SetPIDmethod(method);
- fPIDResponse->Load(dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDPIDLQ1D)));
+ const TObjArray *references = dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDPIDLQ1D));
+ TIter refs(references);
+ TObject *obj = NULL;
+ AliTRDPIDReference *ref = NULL;
+ Bool_t hasReference = kFALSE;
+ while((obj = refs())){
+ if((ref = dynamic_cast<AliTRDPIDReference *>(obj))){
+ fPIDResponse->Load(ref);
+ hasReference = kTRUE;
+ break;
+ }
+ }
+ if(!hasReference) AliError("Reference histograms not found in the OCDB");
}
return fPIDResponse;
}