+//______________________________________________________________________________________________
+Bool_t AliTRDPreprocessor::ExtractHalfChamberStatusDAQ()
+{
+ //
+ // Half chamber status algorithm running on DAQ
+ //
+
+ Bool_t error = kFALSE;
+
+ AliCDBMetaData metaData;
+ metaData.SetBeamPeriod(0);
+ metaData.SetResponsible("Raphaelle Bailhache");
+ metaData.SetComment("TRD calib test");
+
+ // Take the output of the DA on DAQ
+ TList * listpad = GetFileSources(kDAQ,"HALFCHAMBERSTATUS");
+ if (!listpad) {
+ Log("No list found for the HalfChamberStatus");
+ return kTRUE;
+ }
+
+ AliTRDCalibChamberStatus *calPed = 0x0;
+
+ // loop through all files (only one normally)
+ UInt_t index = 0;
+ while (listpad->At(index)!=NULL) {
+ TObjString* fileNameEntry = (TObjString*) listpad->At(index);
+ if (fileNameEntry != NULL)
+ {
+ TString fileName = GetFile(kDAQ, "HALFCHAMBERSTATUS",
+ fileNameEntry->GetString().Data());
+ if(fileName.Length() ==0){
+ Log(Form("Error by retrieving the file %d for the halfchamberstatus",(Int_t)index));
+ delete listpad;
+ return kTRUE;
+ }
+
+ TFile *f = TFile::Open(fileName);
+ f->GetObject("calibchamberstatus",calPed);
+
+ if(calPed) {
+
+ // store as reference data
+ TString name("HalfChamberStatus");
+ if(!StoreReferenceData("DAQData",(const char *)name,(TObject *) calPed,&metaData)){
+ Log(Form("Error storing AliTRDCalibPadStatus object %d as reference data",(Int_t)index));
+ error = kTRUE;
+ }
+ } // calPed
+ else Log(Form("Error getting AliTRDCalibChamberStatus onject from file"));
+
+ } // fileNameEntry
+ ++index;
+ }// while (list)
+
+ Log(Form("%d elements found in the list for the halfchamberstatus",(Int_t)index));
+ if(index!=1){
+ delete listpad;
+ return kTRUE;
+ }
+
+ //
+ // Produce the AliTRDCalChamberStatus name calHalfChamberStatus
+ //
+ AliTRDCalChamberStatus *calHalfChamberStatus = 0x0;
+ if(calPed) {
+ //calPed->AnalyseHisto(); // check number of events, create calHalfChamberStatus (done on DAQ)
+ if(fCalDCSObjEOR) {
+ calPed->CheckEORStatus((AliTRDCalDCSv2 *)fCalDCSObjEOR);
+ }
+ calHalfChamberStatus=(AliTRDCalChamberStatus *)calPed->GetCalChamberStatus();
+ }
+
+ //
+ // Store
+ //