+UInt_t AliT0Preprocessor::ProcessLaser()
+{
+ // Processing data from DAQ Standalone run
+ Log("Processing Laser calibration - Walk Correction");
+ Bool_t resultLaser = kFALSE;
+ Bool_t writeok = kFALSE;
+ //processing DAQ
+ TList* list = GetFileSources(kDAQ, "AMPLITUDE_CALIBRATION");
+ AliT0CalibWalk *laser = new AliT0CalibWalk();
+ TObjString *source;
+ if (list)
+ {
+ TIter iter(list);
+ while ((source = dynamic_cast<TObjString *> (iter.Next())))
+ {
+ const char *laserFile = GetFile(kDAQ, "AMPLITUDE_CALIBRATION", source->GetName());
+ if (laserFile)
+ {
+ Log(Form("File with Id AMPLITUDE_CALIBRAION found in source %s!", source->GetName()));
+ writeok = laser->MakeWalkCorrGraph(laserFile);
+
+ }
+ }
+
+ AliCDBMetaData metaData;
+ metaData.SetBeamPeriod(0);
+ metaData.SetResponsible("Tomek&Michal");
+ metaData.SetComment("Walk correction from laser runs.");
+ if (writeok) resultLaser=Store("Calib","Slewing_Walk", laser, &metaData, 0, 1);
+ else {
+
+ Log(Form("writeok = %d no peaks in CFD spectra",writeok));
+ return 0;
+ }
+ Log(Form("resultLaser = %d",resultLaser));
+ if (!resultLaser)
+ {
+ Log("No Laser Data stored");
+ return 3;//return error code for failure in storing Laser Data
+ }
+ }
+ else
+ {
+ Log(Form("Could not find file with Id AMPLITUDE_CALIBRAION "));
+ return 1;
+ }
+
+ return 0;
+}