]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/TPCPEDESTALda.cxx
Using custom streamer to guarantie back compatibility (Peter Christiansen)
[u/mrichter/AliRoot.git] / TPC / TPCPEDESTALda.cxx
index faca07b9d6bb95bfa27126eabe00d9f732d9a809..e919d85a4eb2b2b2875d72bcf0b49dd3ac2cbe54 100644 (file)
@@ -211,22 +211,19 @@ int main(int argc, char **argv) {
         break;
       }
 
-      /* skip start/end of run events */
-      if ( (event->eventType != physicsEvent) && (event->eventType != calibrationEvent) )
-        continue;
-
       /* retry if got no event */
       if (event==NULL)
         continue;
       
+      /* skip start/end of run events */
+      if ( (event->eventType != physicsEvent) && (event->eventType != calibrationEvent) )
+        continue;
+
       nevents++;
       // get the run number
       runNb = event->eventRunNb;
       //  Pedestal calibration
-      AliRawReader *rawReader = new AliRawReaderDate((void*)event);
-      if ( fastDecoding ) calibPedestal.ProcessEventFast(rawReader);
-      else calibPedestal.ProcessEvent(rawReader);
-      delete rawReader;
+      calibPedestal.ProcessEvent(event);
 
       /* free resources */
       free(event);
@@ -265,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.AsString()));
-
-  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.
   //