]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/TPCCEnewda.cxx
ATO-98 - Connecting distortion trees - selection as an argument
[u/mrichter/AliRoot.git] / TPC / TPCCEnewda.cxx
index d9cdc59b8a146b55ca5bf8f2f0409a0e021265de..26a4b96071cc91993cf38f1068fc2d5c2977bd70 100644 (file)
@@ -61,7 +61,6 @@ and save results in a file (named from RESULT_FILE define - see below).
 #include "AliRawReader.h"
 #include "AliRawReaderDate.h"
 #include "AliTPCmapper.h"
-#include "AliTPCRawStream.h"
 #include "AliTPCROC.h"
 #include "AliTPCCalROC.h"
 #include "AliTPCCalPad.h"
@@ -96,7 +95,6 @@ int main(int argc, char **argv) {
     return -1;
   }
   
-  AliLog::SetClassDebugLevel("AliTPCRawStream",-5);
   AliLog::SetClassDebugLevel("AliRawReaderDate",-5);
   AliLog::SetClassDebugLevel("AliTPCAltroMapping",-5);
   AliLog::SetModuleDebugLevel("RAW",-5);
@@ -139,6 +137,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 +153,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 +284,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 +326,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 +367,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");