From: dsilverm Date: Mon, 2 Jun 2008 12:23:31 +0000 (+0000) Subject: silvermy@ornl.gov - safety check in AliCaloCalibSignal, and saving objects/class... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=452729ca9e1860315cf9930a6b55760670ecebf9;p=u%2Fmrichter%2FAliRoot.git silvermy@ornl.gov - safety check in AliCaloCalibSignal, and saving objects/class in DA --- diff --git a/EMCAL/AliCaloCalibSignal.cxx b/EMCAL/AliCaloCalibSignal.cxx index 4f5d1d2c950..a6de78ce96f 100644 --- a/EMCAL/AliCaloCalibSignal.cxx +++ b/EMCAL/AliCaloCalibSignal.cxx @@ -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 } diff --git a/EMCAL/EMCALda.cxx b/EMCAL/EMCALda.cxx index c273df60b0f..2a1f6695874 100644 --- a/EMCAL/EMCALda.cxx +++ b/EMCAL/EMCALda.cxx @@ -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 @@ -13,12 +13,13 @@ */ /* 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 @@ -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);