ZS parameters taking from the file in the DA working directory.
authorpolicheh <policheh@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Jul 2009 12:56:50 +0000 (12:56 +0000)
committerpolicheh <policheh@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Jul 2009 12:56:50 +0000 (12:56 +0000)
PHOS/PHOSLEDda.cxx

index 1a6bd30..e453d41 100644 (file)
@@ -51,6 +51,17 @@ int main(int argc, char **argv) {
     return -1;
   }
 
+  /* Retrieve ZS parameters from DAQ DB */
+  const char* zsfile = "zs.txt";
+  int failZS = daqDA_DB_getFile(zsfile, zsfile);
+  
+  Int_t offset,threshold;
+  
+  if(!failZS) {
+    FILE *f = fopen(zsfile,"r");
+    int scan = fscanf(f,"%d %d",&offset,&threshold);
+  }
+
   /* Retrieve mapping files from DAQ DB */ 
   const char* mapFiles[4] = {"RCU0.data","RCU1.data","RCU2.data","RCU3.data"};
 
@@ -156,6 +167,12 @@ int main(int argc, char **argv) {
       AliCaloRawStreamV3 stream(rawReader,"PHOS",mapping);
       AliPHOSRawFitterv0 fitter;
       fitter.SubtractPedestals(kTRUE); // assume that data is non-ZS
+
+      if(!failZS) {
+       fitter.SubtractPedestals(kFALSE);
+       fitter.SetAmpOffset(offset);
+       fitter.SetAmpThreshold(threshold);
+      }
       
       while (stream.NextDDL()) {
        while (stream.NextChannel()) {