+ nameOfFile = GetFile(kDAQ, "PMDGAINS.root", source->GetName());
+ if(nameOfFile.Length() == 0)
+ {
+ Log(Form("PMDGAIN: Error retrieving file from source %s failed!", source->GetName()));
+ delete gfsPmdGain;
+ return kFALSE;
+ }
+
+ Log(Form("PMDGAIN: File with id PMDGAINS.root got from %s", source->GetName()));
+
+ Int_t det, sm, row, col;
+ Float_t gain;
+
+ TFile *opnFile = new TFile(nameOfFile.Data());
+ if (!opnFile || !opnFile->IsOpen())
+ {
+ Log(Form("PMDGAIN: Error opening file with Id PMDGAINS.root from source %s!", source->GetName()));
+ return kFALSE;
+ }
+
+ TTree *tree = dynamic_cast<TTree *> (opnFile->Get("ic"));
+ if (!tree)
+ {
+ Log("PMDGAIN: Could not find object \"ic\" in DAQ file!");
+ return kFALSE;
+ }
+
+ tree->SetBranchAddress("det", &det);
+ tree->SetBranchAddress("sm", &sm);
+ tree->SetBranchAddress("row", &row);
+ tree->SetBranchAddress("col", &col);
+ tree->SetBranchAddress("gain", &gain);
+
+ Int_t nEntries = (Int_t) tree->GetEntries();
+ AliPMDCalibData *calibda = new AliPMDCalibData();
+
+ for(Int_t i = 0; i < nEntries; i++)
+ {
+ tree->GetEntry(i);
+ calibda->SetGainFact(det,sm,row,col,gain);
+ }
+ opnFile->Close();
+ delete opnFile;
+
+ AliCDBMetaData mdGAIN;
+ mdGAIN.SetBeamPeriod(0);
+ mdGAIN.SetResponsible("Satyajit Jena");
+ mdGAIN.SetComment("PMDGAIN: PMD GAIN Data");
+ result = Store("Calib","Gain", calibda, &mdGAIN);
+ delete calibda;