]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changes of Jens
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Sep 2009 13:56:21 +0000 (13:56 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Sep 2009 13:56:21 +0000 (13:56 +0000)
TPCPEDESTALda.cxx.diff add check if any data was processed before exporting to amore
TPCPULSERda.cxx.diff add check if any data was processed before exporting to amore

TPC/TPCPEDESTALda.cxx
TPC/TPCPULSERda.cxx

index 15bf18c7f7acc6fd481c329e3d077f6725462f71..e919d85a4eb2b2b2875d72bcf0b49dd3ac2cbe54 100644 (file)
@@ -262,30 +262,33 @@ int main(int argc, char **argv) {
 
   //find processed sector
   Char_t sideName='A';
-  Int_t sector = 0;
+  Int_t sector = -1;
   for ( Int_t roc = 0; roc < 72; roc++ ) {
     if ( !calibPedestal.GetCalRocPedestal(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));
-
+  
   //
   // end cheet
-  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("Pedestals",calibPedestal.GetCalPadPedestal());
-  statusDA+=amoreDA.Send("Noise",calibPedestal.GetCalPadRMS());
-  statusDA+=amoreDA.Send("Info",&info);
-  if ( statusDA )
-    printf("Waring: Failed to write one of the calib objects to the AMORE database\n");
+  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("Pedestals",calibPedestal.GetCalPadPedestal());
+    statusDA+=amoreDA.Send("Noise",calibPedestal.GetCalPadRMS());
+    statusDA+=amoreDA.Send("Info",&info);
+    if ( statusDA )
+      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.
   //
index a4d5f733be10a609af3bce8d1febb8a6e177d915..e9003803aee5239bb3bff73cd1cd0d3d7a4c8f31 100644 (file)
@@ -237,7 +237,7 @@ int main(int argc, char **argv) {
  
   //find processed sector
   Char_t sideName='A';
-  Int_t sector = 0;
+  Int_t sector = -1;
   for ( Int_t roc = 0; roc < 72; roc++ ) {
     if ( !calibPulser.GetCalRocT0(roc) ) continue;
     if (mapping->GetSideFromRoc(roc)==1) sideName='C';
@@ -246,19 +246,23 @@ int main(int argc, char **argv) {
   gSystem->Setenv("AMORE_DA_NAME",Form("TPC-%c%02d-%s",sideName,sector,FILE_ID));
   // 
   // end cheet
-  TDatime time;
-  TObjString info(Form("Run: %u; Date: %s",runNb,time.AsSQLString()));
+  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");
-  // reset env var  
+    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);
 
   return status;