Changes to make DAs publish information to AMORE.
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 May 2010 22:49:03 +0000 (22:49 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 May 2010 22:49:03 +0000 (22:49 +0000)
The pedestal DA will publish a TH2F for each ring, containg as content
the pedestal values, and as errors the noise values.

The gain DA will publish two TH2F per ring.  One contains the gains
and the error on the gains, and the other contains the reduced
chi^2 for each of the strips.

Both will also publish a TObject with the unique identifier set to the
run number used to generate the data.
:
The base DA does not publish anything at this time.

FMD/AliFMDBaseDA.cxx
FMD/AliFMDBaseDA.h
FMD/AliFMDGainDA.cxx
FMD/AliFMDGainDA.h
FMD/AliFMDPedestalDA.cxx
FMD/AliFMDPedestalDA.h
FMD/FMDGainda.cxx
FMD/FMDPedestalda.cxx

index 71fbc91..9850d85 100644 (file)
@@ -35,6 +35,7 @@
 #include "AliRawEventHeaderBase.h"
 #include <TDatime.h>
 #include <TSystem.h>
+#include <TH2F.h>
 
 //_____________________________________________________________________
 ClassImp(AliFMDBaseDA)
@@ -136,12 +137,14 @@ AliFMDBaseDA::AliFMDBaseDA() :
   fOutputFile(),
   fConditionsFile(),
   fSaveHistograms(kFALSE),
+  fMakeSummaries(kFALSE),
   fDetectorArray(),
   fPulseSize(10),
   fPulseLength(10),
   fRequiredEvents(0),
   fCurrentEvent(0), 
-  fRunno(0)
+  fRunno(0),
+  fSummaries(0)
 {
   //Constructor
   fSeenDetectors[0] = fSeenDetectors[1] = fSeenDetectors[2] = kFALSE;
@@ -156,12 +159,14 @@ AliFMDBaseDA::AliFMDBaseDA(const AliFMDBaseDA & baseDA) :
   fOutputFile(),
   fConditionsFile(),
   fSaveHistograms(baseDA.fSaveHistograms),
+  fMakeSummaries(baseDA.fMakeSummaries),
   fDetectorArray(baseDA.fDetectorArray),
   fPulseSize(baseDA.fPulseSize),
   fPulseLength(baseDA.fPulseLength),
   fRequiredEvents(baseDA.fRequiredEvents),
   fCurrentEvent(baseDA.fCurrentEvent),
-  fRunno(baseDA.fRunno)
+  fRunno(baseDA.fRunno),
+  fSummaries(0)
 {
   //Copy constructor
   fSeenDetectors[0] = baseDA.fSeenDetectors[0];
@@ -255,6 +260,9 @@ void AliFMDBaseDA::Run(AliRawReader* reader)
       Char_t   ring = (ir == 0 ? 'O' : 'I');
       UShort_t nsec = (ir == 0 ? 40  : 20);
       UShort_t nstr = (ir == 0 ? 256 : 512);
+
+      if (fMakeSummaries) MakeSummary(det, ring);
+
       std::cout << " Ring " << ring << ": " << std::flush;
       for(UShort_t sec =0; sec < nsec;  sec++)  {
        for(UShort_t strip = 0; strip < nstr; strip++) {
@@ -482,6 +490,24 @@ void AliFMDBaseDA::Rotate(const char* base, int max) const
   }
 }
 
+//_____________________________________________________________________ 
+TH2*
+AliFMDBaseDA::MakeSummaryHistogram(const char* prefix, const char* title, 
+                                  UShort_t d, Char_t r) 
+{
+  Int_t nX = ((d == 1 || r == 'I' || r == 'i') ?  20 :  40);
+  Int_t nY = ((d == 1 || r == 'I' || r == 'i') ? 512 : 256);
+  
+  TH2* ret = new TH2F(Form("%sFMD%d%c", prefix, d, r), 
+                     Form("%s for FMD%d%c", title, d, r), 
+                     nX, -0.5, nX-0.5, nY, -0.5, nY-0.5);
+  ret->SetXTitle("Sector #");
+  ret->SetYTitle("Strip #");
+
+  // if (!fSummaries) fSummaries = new TObjArray;
+  fSummaries.Add(ret);
+  return ret;
+}
 
 //_____________________________________________________________________ 
 //
index 6e13dc5..c0674d4 100644 (file)
@@ -33,6 +33,7 @@
 #include "TArrayS.h"
 class TDirectory;
 class AliFMDRawReader;
+class TH2;
 
 class AliFMDBaseDA: public TNamed 
 {
@@ -67,6 +68,12 @@ public:
    */
   void SetSaveDiagnostics(Bool_t save) {fSaveHistograms = save;}
   /** 
+   * Set whether to make summary histograms to be published to AMORE
+   * 
+   * @param save If true, will generate summary QA histograms
+   */
+  void SetMakeSummaries(Bool_t save) {fMakeSummaries = save;}
+  /** 
    * Set the number of requried events
    * 
    * @param nEvents Number of event we need
@@ -79,6 +86,19 @@ public:
    * @return number of required events
    */
   Int_t GetRequiredEvents() const {return fRequiredEvents ;}
+  /** 
+   * Get list of summary histograms 
+   *
+   * @return Array of summary histograms or null if not defined 
+   */
+  const TObjArray& GetSummaries() const { return fSummaries; }
+  /** 
+   * Check if we saw data for detector 
+   * 
+   * @param det Detector number to check 
+   * @return true if the code has seen data from the detector 
+   */
+  bool HasSeenDetector(UShort_t d) { return (d == 0 || d > 3) ? false : fSeenDetectors[d-1]; }
 protected:
   /** 
    * Initialize 
@@ -94,7 +114,7 @@ protected:
    * Analyse a single strip result
    * 
    */
-  virtual void Analyse(UShort_t, Char_t, UShort_t, UShort_t )  {};
+  virtual void Analyse(UShort_t, Char_t, UShort_t, UShort_t)  {};
   /** 
    * Write header to output file
    * 
@@ -140,6 +160,7 @@ protected:
   std::ofstream fOutputFile;               // output file
   std::ofstream fConditionsFile;           // conditions file
   Bool_t fSaveHistograms;                  // save hists or not
+  Bool_t fMakeSummaries;                   // save hists or not
   TObjArray fDetectorArray;                // array indiced by detector
   /** 
    * Ge the half-ring index 
@@ -256,7 +277,18 @@ private:
   Int_t fCurrentEvent;              // the current event       
 protected:
   UInt_t fRunno;                    // Current run number 
-  
+  /** 
+   * Utility function for defining summary histograms 
+   *
+   * @param det    Detector 
+   * @param ring   Ring identifier 
+   * @param prefix Histogram prefix 
+   * @param title  Histogram title 
+   */
+  TH2* MakeSummaryHistogram(const char* prefix, const char* title, 
+                           UShort_t det, Char_t ring);
+  virtual void  MakeSummary(UShort_t, Char_t) { }
+  TObjArray fSummaries;
   
   ClassDef(AliFMDBaseDA,0) // Base Detector algorithm for all run types
 
index 2d0c069..4071f9c 100644 (file)
@@ -39,6 +39,7 @@
 #include "AliFMDParameters.h"
 #include "AliFMDAltroMapping.h"
 #include <TDatime.h>
+#include <TH2.h>
 
 //_____________________________________________________________________
 ClassImp(AliFMDGainDA)
@@ -56,7 +57,17 @@ AliFMDGainDA::AliFMDGainDA()
     fCurrentChannel(10),
     fNumberOfStripsPerChip(128),
     fSummaryGains("GainsSummary","Summary of gains",51200,0,51200),
-    fCurrentSummaryStrip(1)
+    fCurrentSummaryStrip(1),
+    fGainFMD1i(0),
+    fGainFMD2i(0),
+    fGainFMD2o(0),
+    fGainFMD3i(0),
+    fGainFMD3o(0),
+    fChi2FMD1i(0),
+    fChi2FMD2i(0),
+    fChi2FMD2o(0),
+    fChi2FMD3i(0),
+    fChi2FMD3o(0)
 {
   // Constructor 
   // 
@@ -70,15 +81,25 @@ AliFMDGainDA::AliFMDGainDA()
 
 //_____________________________________________________________________
 AliFMDGainDA::AliFMDGainDA(const AliFMDGainDA & gainDA) 
-  :  AliFMDBaseDA(gainDA),
-     fGainArray(gainDA.fGainArray),
-     fHighPulse(gainDA.fHighPulse),
-     fEventsPerChannel(gainDA.fEventsPerChannel),
-     fCurrentPulse(gainDA.fCurrentPulse),
-     fCurrentChannel(gainDA.fCurrentChannel),
-     fNumberOfStripsPerChip(gainDA.fNumberOfStripsPerChip),
-     fSummaryGains(gainDA.fSummaryGains),
-     fCurrentSummaryStrip(gainDA.fCurrentSummaryStrip)
+  : AliFMDBaseDA(gainDA),
+    fGainArray(gainDA.fGainArray),
+    fHighPulse(gainDA.fHighPulse),
+    fEventsPerChannel(gainDA.fEventsPerChannel),
+    fCurrentPulse(gainDA.fCurrentPulse),
+    fCurrentChannel(gainDA.fCurrentChannel),
+    fNumberOfStripsPerChip(gainDA.fNumberOfStripsPerChip),
+    fSummaryGains(gainDA.fSummaryGains),
+    fCurrentSummaryStrip(gainDA.fCurrentSummaryStrip),
+    fGainFMD1i(gainDA.fGainFMD1i),
+    fGainFMD2i(gainDA.fGainFMD2i),
+    fGainFMD2o(gainDA.fGainFMD2o),
+    fGainFMD3i(gainDA.fGainFMD3i),
+    fGainFMD3o(gainDA.fGainFMD3o),
+    fChi2FMD1i(gainDA.fChi2FMD1i),
+    fChi2FMD2i(gainDA.fChi2FMD2i),
+    fChi2FMD2o(gainDA.fChi2FMD2o),
+    fChi2FMD3i(gainDA.fChi2FMD3i),
+    fChi2FMD3o(gainDA.fChi2FMD3o)
 {  
   // Copy Constructor 
   // 
@@ -197,6 +218,41 @@ void AliFMDGainDA::FillChannels(AliFMDDigit* digit)
 }
 
 //_____________________________________________________________________
+void AliFMDGainDA::MakeSummary(UShort_t det, Char_t ring)
+{
+  switch (det) { 
+  case 1: 
+    fGainFMD1i = MakeSummaryHistogram("gain", "Gains", det, ring);
+    fChi2FMD1i = MakeSummaryHistogram("chi2", "#Chi^{2}/NDF", det, ring);
+    break;
+  case 2:
+    switch (ring) { 
+    case 'I': case 'i':
+      fGainFMD2i = MakeSummaryHistogram("gain", "Gains", det, ring);
+      fChi2FMD2i = MakeSummaryHistogram("chi2", "#Chi^{2}/NDF", det, ring);
+      break;
+    case 'O': case 'o':
+      fGainFMD2o = MakeSummaryHistogram("gain", "Gains", det, ring);
+      fChi2FMD2o = MakeSummaryHistogram("chi2", "#Chi^{2}/NDF", det, ring);
+      break;
+    }
+    break;
+  case 3:
+    switch (ring) { 
+    case 'I': case 'i':
+      fGainFMD3i = MakeSummaryHistogram("gain", "Gains", det, ring);
+      fChi2FMD3i = MakeSummaryHistogram("chi2", "#Chi^{2}/NDF", det, ring);
+      break;
+    case 'O': case 'o':
+      fGainFMD3o = MakeSummaryHistogram("gain", "Gains", det, ring);
+      fChi2FMD3o = MakeSummaryHistogram("chi2", "#Chi^{2}/NDF", det, ring);
+      break;
+    }
+    break;
+  }
+}
+
+//_____________________________________________________________________
 void AliFMDGainDA::Analyse(UShort_t det, 
                           Char_t   ring, 
                           UShort_t sec, 
@@ -244,6 +300,31 @@ void AliFMDGainDA::Analyse(UShort_t det,
   fSummaryGains.SetBinError(fCurrentSummaryStrip,fitFunc.GetParError(1));
   
   fCurrentSummaryStrip++;
+
+  TH2* hGain = 0;
+  TH2* hChi2 = 0;
+  switch (det) { 
+  case 1: hGain = fGainFMD1i; hChi2 = fChi2FMD1i; break;
+  case 2: 
+    switch (ring) { 
+    case 'I':  hGain = fGainFMD2i; hChi2 = fChi2FMD2i; break;
+    case 'O':  hGain = fGainFMD2o; hChi2 = fChi2FMD2o; break;
+    }
+    break;
+  case 3:
+    switch (ring) { 
+    case 'I':  hGain = fGainFMD3i; hChi2 = fChi2FMD3i; break;
+    case 'O':  hGain = fGainFMD3o; hChi2 = fChi2FMD3o; break;
+    }
+    break;
+  }
+  if (hGain && hChi2) {
+    Int_t bin = hGain->FindBin(sec, strip);
+    hGain->SetBinContent(bin, gain);
+    hGain->SetBinError(bin, error);
+    hChi2->SetBinContent(bin, chi2ndf);
+  }
+
     // }
   if(fSaveHistograms) {
     gDirectory->cd(GetSectorPath(det,ring, sec, kTRUE));
index 797467e..c3bf829 100644 (file)
@@ -76,10 +76,11 @@ protected:
   /** 
    * Analyse the result
    * 
-   * @param det         Detector # 
-   * @param ring        Ring identifier 
-   * @param sec         Sector number
-   * @param strip       Strip number
+   * @param det   Detector # 
+   * @param ring  Ring identifier 
+   * @param sec   Sector number
+   * @param strip Strip number
+   * @param h     Summary histogram with bins for sector and strip
    */
   void Analyse(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
   /**
@@ -114,7 +115,7 @@ protected:
    * @param dummy Not used
    */
   void Terminate(TFile* dummy);
-  
+
 private:
   /** 
    * Get the channel histogram
@@ -149,6 +150,19 @@ private:
   
   TH1F      fSummaryGains;         // Summary histogram 
   Int_t     fCurrentSummaryStrip;  // Current strip for summary
+
+  void  MakeSummary(UShort_t det, Char_t ring);
+
+  TH2* fGainFMD1i;
+  TH2* fGainFMD2i;
+  TH2* fGainFMD2o;
+  TH2* fGainFMD3i;
+  TH2* fGainFMD3o;
+  TH2* fChi2FMD1i;
+  TH2* fChi2FMD2i;
+  TH2* fChi2FMD2o;
+  TH2* fChi2FMD3i;
+  TH2* fChi2FMD3o;
   
   ClassDef(AliFMDGainDA,0) // Detector algorithm for gain runs
 
index 2a6da0a..8ca309a 100644 (file)
 #include "TMath.h"
 #include <TSystem.h>
 #include <TDatime.h>
+#include <TH2.h>
 
 //_____________________________________________________________________
 ClassImp(AliFMDPedestalDA)
 
 //_____________________________________________________________________
-AliFMDPedestalDA::AliFMDPedestalDA() : AliFMDBaseDA(),
-  fCurrentChannel(1),
-  fPedSummary("PedestalSummary","pedestals",51200,0,51200),
-  fNoiseSummary("NoiseSummary","noise",51200,0,51200),
-  fZSfileFMD1(),
-  fZSfileFMD2(),
-  fZSfileFMD3(), 
-  fMinTimebin(3 * 4 * 3 * 16), // 3 ddls, 4 FECs, 3 Altros, 16 channels
-  fMaxTimebin(3 * 4 * 3 * 16)  // 3 ddls, 4 FECs, 3 Altros, 16 channels
+AliFMDPedestalDA::AliFMDPedestalDA() 
+  : AliFMDBaseDA(),
+    fCurrentChannel(1),
+    fPedSummary("PedestalSummary","pedestals",51200,0,51200),
+    fNoiseSummary("NoiseSummary","noise",51200,0,51200),
+    fZSfileFMD1(),
+    fZSfileFMD2(),
+    fZSfileFMD3(), 
+    fMinTimebin(3 * 4 * 3 * 16), // 3 ddls, 4 FECs, 3 Altros, 16 channels
+    fMaxTimebin(3 * 4 * 3 * 16), // 3 ddls, 4 FECs, 3 Altros, 16 channels
+    fSummaryFMD1i(0),
+    fSummaryFMD2i(0),
+    fSummaryFMD2o(0),
+    fSummaryFMD3i(0),
+    fSummaryFMD3o(0)
 {
   // Default constructor 
   Rotate("peds.csv", 3);
@@ -73,7 +80,12 @@ AliFMDPedestalDA::AliFMDPedestalDA(const AliFMDPedestalDA & pedDA) :
   fZSfileFMD2(),
   fZSfileFMD3(),
   fMinTimebin(pedDA.fMinTimebin),
-  fMaxTimebin(pedDA.fMaxTimebin)
+  fMaxTimebin(pedDA.fMaxTimebin),
+  fSummaryFMD1i(pedDA.fSummaryFMD1i),
+  fSummaryFMD2i(pedDA.fSummaryFMD2i),
+  fSummaryFMD2o(pedDA.fSummaryFMD2o),
+  fSummaryFMD3i(pedDA.fSummaryFMD3i),
+  fSummaryFMD3o(pedDA.fSummaryFMD3o)
 {
   // Copy constructor 
 }
@@ -91,6 +103,8 @@ void AliFMDPedestalDA::Init()
   SetRequiredEvents(1000);
   fMinTimebin.Reset(1024);
   fMaxTimebin.Reset(-1);
+
+
 }
 
 //_____________________________________________________________________
@@ -148,6 +162,37 @@ void AliFMDPedestalDA::FillChannels(AliFMDDigit* digit)
 }
 
 //_____________________________________________________________________
+void AliFMDPedestalDA::MakeSummary(UShort_t det, Char_t ring)
+{
+  std::cout << "Making summary for FMD" << det << ring << " ..." << std::endl;
+  switch (det) { 
+  case 1: 
+    fSummaryFMD1i = MakeSummaryHistogram("ped", "Pedestals", det, ring);
+    break;
+  case 2:
+    switch (ring) { 
+    case 'I': case 'i':
+      fSummaryFMD2i = MakeSummaryHistogram("ped", "Pedestals", det, ring);
+      break;
+    case 'O': case 'o':
+      fSummaryFMD2o = MakeSummaryHistogram("ped", "Pedestals", det, ring);
+      break;
+    }
+    break;
+  case 3:
+    switch (ring) { 
+    case 'I': case 'i':
+      fSummaryFMD3i = MakeSummaryHistogram("ped", "Pedestals", det, ring);
+      break;
+    case 'O': case 'o':
+      fSummaryFMD3o = MakeSummaryHistogram("ped", "Pedestals", det, ring);
+      break;
+    }
+    break;
+  }
+}
+
+//_____________________________________________________________________
 void AliFMDPedestalDA::Analyse(UShort_t det, 
                               Char_t   ring, 
                               UShort_t sec, 
@@ -162,6 +207,28 @@ void AliFMDPedestalDA::Analyse(UShort_t det,
   //     sec   Sector 
   //     strip Strip.
   AliFMDParameters* pars     = AliFMDParameters::Instance();
+  TH2* summary = 0;
+  switch (det) { 
+  case 1: summary = fSummaryFMD1i; break;
+  case 2: 
+    switch (ring) { 
+    case 'I':  summary = fSummaryFMD2i; break;
+    case 'O':  summary = fSummaryFMD2o; break;
+    }
+    break;
+  case 3:
+    switch (ring) { 
+    case 'I':  summary = fSummaryFMD3i; break;
+    case 'O':  summary = fSummaryFMD3o; break;
+    }
+    break;
+  }
+  static bool first = true;
+  if (summary && first) { 
+    std::cout << "Filling summary " << summary->GetName() << std::endl;
+    first = false;
+  }
+
   // Float_t           factor   = pars->GetPedestalFactor();
   UInt_t            samples  = pars->GetSampleRate(det, ring, sec, strip);
   for (UShort_t sample = 0; sample < samples; sample++) {
@@ -239,7 +306,13 @@ void AliFMDPedestalDA::Analyse(UShort_t det,
                << fitFunc.GetParameter(1)     << ','
                << fitFunc.GetParameter(2)     << ','
                << chi2ndf                     <<"\n";
-    
+
+    if (summary) { 
+      Int_t bin = summary->FindBin(sec, strip);
+      summary->SetBinContent(bin, mean);
+      summary->SetBinError(bin, rms);
+    }
+
     if(fSaveHistograms  ) {
       gDirectory->cd(GetSectorPath(det, ring, sec, kTRUE));
       TH1F* sumPed   = dynamic_cast<TH1F*>(gDirectory->Get("Pedestals"));
index 5617467..1c64d0a 100644 (file)
@@ -15,6 +15,7 @@
 #include "AliFMDBaseDA.h"
 #include "TH1.h"
 #include "TObjArray.h"
+class TH2;
 
 class AliFMDPedestalDA: public AliFMDBaseDA 
 {
@@ -68,6 +69,7 @@ protected:
    * @param ring  Ring
    * @param sec   Sector 
    * @param strip Strip.
+   * @param h     Summary histogram with bins for sector and strip
    */
   void Analyse(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
   /** 
@@ -130,6 +132,13 @@ private:
   /** The maximum timebin seen for all channels */
   TArrayS fMaxTimebin;
   
+  void  MakeSummary(UShort_t det, Char_t ring);
+
+  TH2* fSummaryFMD1i;
+  TH2* fSummaryFMD2i;
+  TH2* fSummaryFMD2o;
+  TH2* fSummaryFMD3i;
+  TH2* fSummaryFMD3o;
   
   ClassDef(AliFMDPedestalDA,0)
 };
index 126ff22..4ab6a5b 100644 (file)
 #include "daqDA.h"
 #include "TROOT.h"
 #include "TPluginManager.h"
+#ifdef ALI_AMORE
+# include <AmoreDA.h>
+# include <TH2.h>
+#endif
 
 
 
@@ -109,21 +113,54 @@ int main(int argc, char **argv)
   timer.Start();
   AliFMDGainDA gainDA;
   gainDA.SetSaveDiagnostics(diagnostics);
+#ifdef ALI_AMORE
+  gainDA.SetMakeSummaries(kTRUE);
+#endif
   gainDA.Run(reader);
   
   timer.Stop();
   timer.Print();
   
-  Int_t  retvalConditions = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
-  Int_t  retvalGain = daqDA_FES_storeFile("gains.csv", AliFMDParameters::Instance()->GetGainShuttleID());
+  Int_t  retvalConditions = 
+    daqDA_FES_storeFile("conditions.csv", 
+                       AliFMDParameters::Instance()->GetConditionsShuttleID());
+  Int_t  retvalGain = 
+    daqDA_FES_storeFile("gains.csv", 
+                       AliFMDParameters::Instance()->GetGainShuttleID());
 
   if(retvalConditions!=0 || retvalGain!=0)
     std::cerr << "Pedestal DA failed" << std::endl;
   
+#ifdef ALI_AMORE
+  try { 
+    amore::da::AmoreDA myAmore(amore::da::AmoreDA::kSender);
+
+    UShort_t det = 0;
+    for (det = 1; det <= 3; det++) 
+      if (gainDA.HasSeenDetector(det)) break;
+    if (det >= 1 && det <= 3) { 
+      TObject* runNo = new TObject;
+      runNo->SetUniqueID(reader->GetRunNumber());
+      myAmore.Send(Form("gainRunNoFMD%d", det), runNo);
+    }
+                  
+    TIter     next(&gainDA.GetSummaries());
+    TObject*  obj = 0;
+    while ((obj = next())) 
+      myAmore.Send(obj->GetName(), obj);
+    
+  }
+  catch (std::exception& e) {
+    std::cerr << "Failed to make AMORE instance: " << e.what() << std::endl;
+  }
+                              
+#endif
+
   if(retvalGain != 0) return retvalGain;
-  else return retvalConditions;
-  
-  
-  
-  
+  return retvalConditions;
+
 }
+//
+// EOF
+//
+
index 2463a5a..5160565 100644 (file)
 #include "TROOT.h"
 #include "TPluginManager.h"
 #include <AliLog.h>
-
+#ifdef ALI_AMORE
+# include <AmoreDA.h>
+# include <TH2.h>
+#endif
 
 int main(int argc, char **argv) 
 {
@@ -116,6 +119,9 @@ int main(int argc, char **argv)
   timer.Start();
   AliFMDPedestalDA pedDA;
   pedDA.SetSaveDiagnostics(diagnostics);
+#ifdef ALI_AMORE
+  pedDA.SetMakeSummaries(kTRUE);
+#endif
   pedDA.Run(reader);
   
   timer.Stop();
@@ -131,7 +137,30 @@ int main(int argc, char **argv)
   if(retvalConditions!=0 || retvalPeds!=0)
     std::cerr << "Pedestal DA failed" << std::endl;
   
+#ifdef ALI_AMORE
+  try { 
+    amore::da::AmoreDA myAmore(amore::da::AmoreDA::kSender);
+
+    UShort_t det = 0;
+    for (det = 1; det <= 3; det++) 
+      if (pedDA.HasSeenDetector(det)) break;
+    if (det >= 1 && det <= 3) { 
+      TObject* runNo = new TObject;
+      runNo->SetUniqueID(reader->GetRunNumber());
+      myAmore.Send(Form("pedRunNoFMD%d", det), runNo);
+    }
+
+    TIter     next(&pedDA.GetSummaries());
+    TObject*  obj = 0;
+    while ((obj = next())) 
+      myAmore.Send(obj->GetName(), obj);
+  }
+  catch (std::exception& e) {
+    std::cerr << "Failed to make AMORE instance: " << e.what() << std::endl;
+  }
+                              
+#endif
   if(retvalPeds != 0) return retvalPeds;
-  else return retvalConditions;
-  
+  return retvalConditions;
+
 }