]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/TPCCEnewda.cxx
Test for Coverity
[u/mrichter/AliRoot.git] / TPC / TPCCEnewda.cxx
index d9cdc59b8a146b55ca5bf8f2f0409a0e021265de..5907674eb631b3546ba6f8e45a9251b8ab2b6a60 100644 (file)
@@ -139,6 +139,7 @@ int main(int argc, char **argv) {
   TString monitoringType("YES");
   TString cdb("local:///local/cdb");
   Int_t   forceTriggerId=-1;
+  Bool_t  skipAmore=kFALSE;
   
   if ( config.GetConfigurationMap()->GetValue("LaserTriggerName") ) {
     laserTriggerName=config.GetConfigurationMap()->GetValue("LaserTriggerName")->GetName();
@@ -154,7 +155,12 @@ int main(int argc, char **argv) {
     forceTriggerId=TMath::Nint(config.GetValue("ForceLaserTriggerId"));
     printf("TPCCEnewda: Only processing triggers with Id: %d.\n",forceTriggerId);
   }
-  
+
+  if ( config.GetConfigurationMap()->GetValue("SkipAmore") ) {
+    skipAmore=((TObjString*)config.GetConfigurationMap()->GetValue("SkipAmore"))->GetString().Atoi();
+    printf("TPCCENEWda: Skip Amore set in config\n");
+  }
+
   //subsribe to laser triggers only in physics partition
   //if the trigger class is not available the return value is -1
   //in this case we are most probably running as a standalone
@@ -280,7 +286,7 @@ int main(int argc, char **argv) {
         // send the data to AMOREdb
         if (stopWatch.RealTime()>updateInterval){
           calibCE.Analyse();
-          SendToAmoreDB(calibCE,runNb);
+          if (!skipAmore) SendToAmoreDB(calibCE,runNb);
           stopWatch.Start();
         } else {
           stopWatch.Continue();
@@ -322,17 +328,21 @@ int main(int argc, char **argv) {
 //   TFile * fileTPC = new TFile (RESULT_FILE,"recreate");
 //   calibCE.Write("tpcCalibCE");
 //   delete fileTPC;
-  calibCE.DumpToFile(RESULT_FILE,"name=tpcCalibCE,type=3");
+  
+  calibCE.DumpToFile(RESULT_FILE,"name=tpcCalibCE,type=4");
   printf("TPCCEnewda: Wrote %s\n",RESULT_FILE);
   
   /* store the result file on FES */
-  
+
   status=daqDA_FES_storeFile(RESULT_FILE,FILE_ID);
   if (status) {
     status = -2;
   }
-  
-  SendToAmoreDB(calibCE,runNb);
+
+  if (!skipAmore) {
+    printf("TPCCEnewda: Amore part %s\n",RESULT_FILE);
+    SendToAmoreDB(calibCE,runNb);
+  }
   
   return status;
 }
@@ -359,11 +369,12 @@ void SendToAmoreDB(AliTPCCalibCE &calibCE, unsigned long32 runNb)
   TObjString info(Form("Run: %u; Date: %s",runNb,time.AsSQLString()));
   amore::da::AmoreDA amoreDA(amore::da::AmoreDA::kSender);
   Int_t statusDA=0;
-  statusDA+=amoreDA.Send("CET0",calibCE.GetCalPadT0());
-  statusDA+=amoreDA.Send("CEQ",calibCE.GetCalPadQ());
-  statusDA+=amoreDA.Send("CERMS",calibCE.GetCalPadRMS());
-  statusDA+=amoreDA.Send("DriftA",grA);
-  statusDA+=amoreDA.Send("DriftC",grC);
+//   statusDA+=amoreDA.Send("CET0",calibCE.GetCalPadT0());
+//   statusDA+=amoreDA.Send("CEQ",calibCE.GetCalPadQ());
+//   statusDA+=amoreDA.Send("CERMS",calibCE.GetCalPadRMS());
+//   statusDA+=amoreDA.Send("DriftA",grA);
+//   statusDA+=amoreDA.Send("DriftC",grC);
+  statusDA+=amoreDA.Send("FitGraphs",calibCE.GetArrFitGraphs());
   statusDA+=amoreDA.Send("Info",&info);
   if ( statusDA!=0 )
     printf("TPCCEnewda: Waring: Failed to write one of the calib objects to the AMORE database\n");