]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/ITSSSDPEDda.cxx
Eff C++ warning removal (Marian)
[u/mrichter/AliRoot.git] / ITS / ITSSSDPEDda.cxx
index 7a712b9be86c5f34ada23fd222c13e4ce8cad0b8..cd60d293064b78682982df89f94787fec5e76c32 100644 (file)
@@ -1,18 +1,13 @@
 /**************************************************************************
-- "Contact": - Oleksandr Borysov, aborysov@ts.infnf.it
-- "Link:" - link to test files: /afs/infn.it/ts/user/aborysov/public/C23_run387.000.raw
-- "Run Type:" - run type (exactly as defined in the ECS)
-- "DA Type:" -  LDC
-- "Number of events needed:"   at least 500
-
-- "Input Files:" - config file:    ssdpeddaconfig 
-                   previous result files:  
-                  data source:   raw data file on LDC
-                   
-- "Output Files:" -  local names $DA_TEST_DIR/ssddaldc_<LDCID>_<RunID>.root 
-                     FXS name: ITSSSDda_<LDCID>_<RunID>.root, 
-                     local files are persistent over runs: data source
-- "Trigger types used:"
+- Contact: Oleksandr_Borysov aborysov@ts.infnf.it
+- Link: /afs/infn.it/ts/user/efragiac/public/testCosm3125.001
+- Run Type: 
+- DA Type: LDC
+- Number of events needed: >=500
+- Input Files: ssdpeddaconfig, raw_data_file_on_LDC
+- Output Files: ./ssddaldc_<LDCID>_<RunID>.root, FXS_name=ITSSSDda_<LDCID>_<RunID>.root 
+                local files are persistent over runs: data source
+- Trigger types used:
  **************************************************************************/
 
 
@@ -21,6 +16,8 @@
 #include "TFile.h"
 #include "daqDA.h"
 #include "AliITSHandleDaSSD.h" 
+#include "TROOT.h"
+#include "TPluginManager.h"
 
 using namespace std;
 
@@ -28,13 +25,22 @@ using namespace std;
 int main( int argc, char** argv )
 {
   AliITSHandleDaSSD  *ssddaldc;
-  TString             feefname, cmddbsave;
+  TString             feefname, fcdbsave;
   Int_t               status;
-  Char_t             *dafname = NULL, *dadaqdir = NULL;
+  Char_t             *dafname = NULL;
+
+
+   gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
+                                        "*",
+                                        "TStreamerInfo",
+                                        "RIO",
+                                        "TStreamerInfo()");
+
+
 
   /* check that we got some arguments = list of files */
   if (argc<2) {
-    printf("Wrong number of arguments\n");
+    fprintf(stderr, "Wrong number of arguments\n");
     return -1;
   }
 
@@ -44,39 +50,44 @@ int main( int argc, char** argv )
   if (ssddaldc->IsZombie()) return -1;
   if (!ssddaldc->ProcessRawData())
   {
-     cout << "Error !ssddaldc->ProcessRawData()" << endl;
+     cerr << "Error !ssddaldc->ProcessRawData()" << endl;
      delete ssddaldc;
      return -1;
   }  
   daqDA_progressReport(90);
 
   if (!system(NULL)) {
-    cout << "Error: the call system(NULL) in main() returned NULL!" << endl;
+    cerr << "Error: the call system(NULL) in main() returned NULL!" << endl;
     return -1;
   }
-  dadaqdir = getenv ("DA_TEST_DIR");
-  if (dadaqdir) {
-    dafname = dadaqdir;
-    if (!(ssddaldc->SaveCalibrationSSDLDC(dafname))) 
-      cout << "Error saving DA data to the file! Probably $DA_TEST_DIR defined incorrectly!" << endl;
-    else cout << "SSDDA data are saved in " << dafname << endl;
-    feefname = Form("%s/ssddaldc_%i_%i.root", dadaqdir, ssddaldc->GetLdcId(), ssddaldc->GetRunId());
-    cout << "Saving feessdda data in " << feefname << endl;
-    TFile *fileRun = new TFile (feefname.Data(),"RECREATE");
-    ssddaldc->Write();
-    fileRun->Close();
+  dafname = ".";
+  if (ssddaldc->SaveCalibrationSSDLDC(dafname)) {
+    cout << "SSDDA data are saved in " << dafname << endl;
+    status = daqDA_FES_storeFile(dafname, "CALIBRATION");
+    if (status) fprintf(stderr, "Failed to export file : %d\n", status);
+  } else cerr << "Error saving DA data to the file! Probably $DA_TEST_DIR defined incorrectly!" << endl;
+
+  feefname.Form("%s/ssddaldc_%i_%i.root", ".", ssddaldc->GetLdcId(), ssddaldc->GetRunId());
+  cout << "Saving feessdda data in " << feefname << endl;
+  TFile *fileRun = new TFile (feefname.Data(),"RECREATE");
+  if (fileRun->IsZombie()) {
+    cerr << "Error open file " << feefname << endl;
+    delete ssddaldc;
     delete fileRun;
-    status = daqDA_FES_storeFile(dafname, "DASSD_DB_results");
-    if (status) printf("Failed to export file : %d\n",status);
-
-    if (getenv("DATE_DB_DIR")) {
-      cmddbsave = Form("$DATE_DB_DIR/daqDetDB_store ssddaldc.root %s", feefname.Data());
-      status = system(cmddbsave.Data());
-      if (status) printf("Failed to export file to the detector db: %d\n",status);
-    } else cout << "Error main(): $DATE_DB_DIR is not defined!" << endl;
-  }
-  else cout << "Error: DA_TEST_DIR is not defined, DA data are not saved!" << endl;
+    return 2;
+  }  
+  ssddaldc->Write();
+  fileRun->Close();
+  delete fileRun;
+
+  fcdbsave.Form("ssddaldc_%i.root", ssddaldc->GetLdcId());
+  status = daqDA_DB_storeFile(feefname.Data(), fcdbsave.Data());
+  if (status) fprintf(stderr, "Failed to export file %s to the detector db: %d, %s \n", feefname.Data(), status, fcdbsave.Data());
+  fcdbsave.Form("ssddaldc_%i_%i.root", ssddaldc->GetLdcId(), ssddaldc->GetRunId());
+  status = daqDA_DB_storeFile(feefname.Data(), fcdbsave.Data());
+  if (status) fprintf(stderr, "Failed to export file %s to the detector db: %d, %s \n", feefname.Data(), status, fcdbsave.Data());
+
   delete ssddaldc;
   daqDA_progressReport(100);
   return 0;
-}
\ No newline at end of file
+}