]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
silvermy@ornl.gov - safety check in AliCaloCalibSignal, and saving objects/class...
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Jun 2008 12:23:31 +0000 (12:23 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Jun 2008 12:23:31 +0000 (12:23 +0000)
EMCAL/AliCaloCalibSignal.cxx
EMCAL/EMCALda.cxx

index 4f5d1d2c950584d876081f4bf6e4e1cb058b81b2..a6de78ce96fd59eeb2407fff3242e38d13988c1d 100644 (file)
@@ -370,7 +370,10 @@ Bool_t AliCaloCalibSignal::ProcessEvent(AliCaloRawStream *in, AliRawEventHeaderB
   
   // now check if it was a led event, only use high gain (that should be sufficient)
   if (fReqFractionAboveAmp) {
-    bool ok = CheckFractionAboveAmp(AmpValHighGain, nHighChan);
+    bool ok = false;
+    if (nHighChan > 0) { 
+      ok = CheckFractionAboveAmp(AmpValHighGain, nHighChan); 
+    }
     if (!ok) return false; // skip event
   }
 
index c273df60b0f92bd08ef19a582a6563b2c56504a3..2a1f6695874e44f744d6a8715d563cd2679902c7 100644 (file)
@@ -2,7 +2,7 @@
   EMCAL DA for online calibration
   
   Contact: silvermy@ornl.gov
-  Run Type: PEDESTAL_RUN or PULSER_RUN
+  Run Type: PEDESTAL or PHYSICS or STANDALONE
   DA Type: LDC
   Number of events needed: ~100
   Input Files: argument list
 */
 /*
   This process reads RAW data from the files provided as command line arguments
-  and save results in a file (named from RESULT_FILE define - see below).
+  and save results (class itself) in a file (named from RESULT_FILE define - see below).
 */
 
 #define RESULT_FILE  "EMCALda.root"
 #define FILE_ID "EMCALda"
 #define AliDebugLevel() -1
+#define ClassName "emcCalibPedestal"
 
 extern "C" {
 #include <daqDA.h>
@@ -110,12 +111,21 @@ int main(int argc, char **argv) {
   } // loop over files
 
   //
-  // write results/histograms to rootfile
+  // write class to rootfile
   //
 
   printf ("%d physics/calibration events processed.\n",nevents);
-  calibPedestal->SaveHistograms(RESULT_FILE);
-  printf("Wrote %s.\n",RESULT_FILE);
+
+  TFile f(RESULT_FILE, "recreate");
+  if (!f.IsZombie()) { 
+    f.cd();
+    calibPedestal->Write(ClassName);
+    f.Close();
+    printf("Object saved to file \"%s\" as \"%s\".\n", RESULT_FILE, ClassName); 
+  } 
+  else {
+    printf("Could not save the object to file \"%s\".\n", RESULT_FILE);
+  }
 
   /* store the result file on FES */
   status = daqDA_FES_storeFile(RESULT_FILE, FILE_ID);