]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/TPCPULSERda.cxx
including possibility of selecting negatively charged kaons and pions
[u/mrichter/AliRoot.git] / TPC / TPCPULSERda.cxx
index 64248b3520b5d53461bbfd224d3c5b356a86919b..a06c2d47abaaf97d5210dc69cba986f635b12988 100644 (file)
@@ -22,6 +22,8 @@ TPCda_pulser.cxx - calibration algorithm for TPC pulser events
 19/09/2008  J.Wiechula@gsi.de:            Added export of the calibration data to the AMORE data base.
                                           Added support for configuration files.
 23/04/2011  Christian.Lippmann@cern.ch :  Added output of acsii files for online
+26/09/2014  Christian.Lippmann@cern.ch :  CHange for new DAQ setup with one CRORC per LDC
+26/09/2014  Jens.Wiechula@cern.ch      :  comment out obsolete AliTPCRawStream
 
  contact: marian.ivanov@cern.ch
 
@@ -62,7 +64,7 @@ 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 "AliTPCRawStreamV3.h"
 #include "AliTPCROC.h"
 #include "AliTPCCalROC.h"
 #include "AliTPCCalPad.h"
@@ -91,7 +93,7 @@ int main(int argc, char **argv) {
     printf("Wrong number of arguments\n");
     return -1;
   }
-  AliLog::SetClassDebugLevel("AliTPCRawStream",-5);
+  //AliLog::SetClassDebugLevel("AliTPCRawStreamV3",-5);
   AliLog::SetClassDebugLevel("AliRawReaderDate",-5);
   AliLog::SetClassDebugLevel("AliTPCAltroMapping",-5);
   AliLog::SetModuleDebugLevel("RAW",-5);
@@ -102,7 +104,7 @@ int main(int argc, char **argv) {
                                         "RIO",
                                         "TStreamerInfo()");
 
-
+  /*
   TString daterolename(gSystem->Getenv("DATE_ROLE_NAME"));
   if ( daterolename == "" ) {
     printf("Error: Variable DATE_ROLE_NAME not defined! Exiting ...\n");
@@ -115,6 +117,7 @@ int main(int argc, char **argv) {
     printf("Error: Variable DATE_ROLE_NAME neither ends with -0 nor -1 (E.g. ldc-TPC-C12-1)! Exiting ...\n");
     return -1;
   }
+  */
 
   /* declare monitoring program */
   int i,status;
@@ -129,7 +132,6 @@ int main(int argc, char **argv) {
   char localfile[255];
   unsigned long32 runNb=0;      //run number
   // configuration options 
-  Bool_t fastDecoding = kFALSE;
   // if  test setup get parameters from $DAQDA_TEST_DIR 
    
   if (!mapping){
@@ -166,9 +168,12 @@ int main(int argc, char **argv) {
   }
   AliTPCConfigDA config(CONFIG_FILE);
   // check configuration options
-  if ( (Int_t)config.GetValue("UseFastDecoder") == 1 ) {
-    printf("Info: The fast decoder will be used for the processing.\n");
-    fastDecoding=kTRUE;
+  Bool_t  skipAmore=kFALSE;
+
+  //skip the amore part
+  if ( config.GetConfigurationMap()->GetValue("SkipAmore") ) {
+    skipAmore=((TObjString*)config.GetConfigurationMap()->GetValue("SkipAmore"))->GetString().Atoi();
+    printf("TPCPULSERda: Skip Amore set in config\n");
   }
 
   // create calibration object
@@ -243,48 +248,49 @@ int main(int argc, char **argv) {
   //
   //Send objects to the AMORE DB
   //
-  printf ("AMORE part\n");
-  const char *amoreDANameorig=gSystem->Getenv("AMORE_DA_NAME");
-  //cheet a little -- temporary solution (hopefully)
-  // 
-  //currently amoreDA uses the environment variable AMORE_DA_NAME to create the mysql
-  //table in which the calib objects are stored. This table is dropped each time AmoreDA
-  //is initialised. This of course makes a problem if we would like to store different
-  //calibration entries in the AMORE DB. Therefore in each DA which writes to the AMORE DB
-  //the AMORE_DA_NAME env variable is overwritten.  
-  //find processed sector
-  Char_t sideName='A';
-  Int_t sector = -1;
-  for ( Int_t roc = 0; roc < 72; roc++ ) {
-    if ( !calibPulser.GetCalRocT0(roc) ) continue;
-    if (mapping->GetSideFromRoc(roc)==1) sideName='C';
-    sector = mapping->GetSectorFromRoc(roc);
+  if (!skipAmore){
+    printf ("AMORE part\n");
+    const char *amoreDANameorig=gSystem->Getenv("AMORE_DA_NAME");
+    //cheet a little -- temporary solution (hopefully)
+    //
+    //currently amoreDA uses the environment variable AMORE_DA_NAME to create the mysql
+    //table in which the calib objects are stored. This table is dropped each time AmoreDA
+    //is initialised. This of course makes a problem if we would like to store different
+    //calibration entries in the AMORE DB. Therefore in each DA which writes to the AMORE DB
+    //the AMORE_DA_NAME env variable is overwritten.
+
+    //find processed sector
+    Char_t sideName='A';
+    Int_t sector = -1;
+    for ( Int_t roc = 0; roc < 72; roc++ ) {
+      if ( !calibPulser.GetCalRocT0(roc) ) continue;
+      if (mapping->GetSideFromRoc(roc)==1) sideName='C';
+      sector = mapping->GetSectorFromRoc(roc);
+    }
+    //gSystem->Setenv("AMORE_DA_NAME",Form("TPC-%c%02d-%s",sideName,sector,FILE_ID));
+    gSystem->Setenv("AMORE_DA_NAME",Form("%s-%s", gSystem->Getenv("DATE_ROLE_NAME"), FILE_ID));
+    //
+    // end cheet
+    if (sector>-1){
+      TDatime time;
+      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("PulserT0",calibPulser.GetCalPadT0());
+      statusDA+=amoreDA.Send("PulserQ",calibPulser.GetCalPadQ());
+      statusDA+=amoreDA.Send("PulserRMS",calibPulser.GetCalPadRMS());
+      statusDA+=amoreDA.Send("arrayTmean",calibPulser.GetMeanTimeSectorArray());
+      statusDA+=amoreDA.Send("Info",&info);
+      if ( statusDA!=0 )
+        printf("Waring: Failed to write one of the calib objects to the AMORE database\n");
+    } else {
+      printf("Waring: No data found!\n");
+    }
+    // reset env var
+    if (amoreDANameorig) gSystem->Setenv("AMORE_DA_NAME",amoreDANameorig);
   }
-  //gSystem->Setenv("AMORE_DA_NAME",Form("TPC-%c%02d-%s",sideName,sector,FILE_ID));
-  gSystem->Setenv("AMORE_DA_NAME",Form("%s-%s", gSystem->Getenv("DATE_ROLE_NAME"), FILE_ID));
   
-  // 
-  // end cheet
-  if (sector>-1){
-    TDatime time;
-    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("PulserT0",calibPulser.GetCalPadT0());
-    statusDA+=amoreDA.Send("PulserQ",calibPulser.GetCalPadQ());
-    statusDA+=amoreDA.Send("PulserRMS",calibPulser.GetCalPadRMS());
-    statusDA+=amoreDA.Send("arrayTmean",calibPulser.GetMeanTimeSectorArray());
-    statusDA+=amoreDA.Send("Info",&info);
-    if ( statusDA!=0 )
-      printf("Waring: Failed to write one of the calib objects to the AMORE database\n");
-  } else {
-    printf("Waring: No data found!\n");
-  }
-  // reset env var
-  if (amoreDANameorig) gSystem->Setenv("AMORE_DA_NAME",amoreDANameorig);
-
   //
   // Now prepare ASCII files for local ALTRO configuration through DDL. 
   //
@@ -308,9 +314,10 @@ int main(int argc, char **argv) {
     Int_t side = mapping->GetSideFromRoc(roc);
     Int_t sec= mapping->GetSectorFromRoc(roc);
     Int_t minrcu, maxrcu;
-    if( isIROC ) { minrcu=0; maxrcu=1; }
-    else if ( inner) { minrcu=2; maxrcu=2; }
-    else { minrcu=3; maxrcu=5; }
+    if( isIROC )     { minrcu=0; maxrcu=1; }
+    //else if ( inner) { minrcu=2; maxrcu=2; }
+    //else             { minrcu=3; maxrcu=5; }
+    else             { minrcu=2; maxrcu=5; }
     for ( int rcu = minrcu; rcu <= maxrcu; rcu++ ) {
       //Int_t patch = mapping->IsIROC(roc) ? rcu : rcu+2; 
       for ( int branch = 0; branch < 2; branch++ ) {