Calibration object splitted in: pedestal + E calib + reco parameters
authorcoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Nov 2007 13:31:24 +0000 (13:31 +0000)
committercoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Nov 2007 13:31:24 +0000 (13:31 +0000)
16 files changed:
ZDC/AliZDC.cxx
ZDC/AliZDC.h
ZDC/AliZDCCalib.cxx [new file with mode: 0644]
ZDC/AliZDCCalib.h [new file with mode: 0644]
ZDC/AliZDCDigitizer.cxx
ZDC/AliZDCDigitizer.h
ZDC/AliZDCPedestals.cxx [new file with mode: 0644]
ZDC/AliZDCPedestals.h [new file with mode: 0644]
ZDC/AliZDCPreprocessor.cxx
ZDC/AliZDCRecParam.cxx [new file with mode: 0644]
ZDC/AliZDCRecParam.h [new file with mode: 0644]
ZDC/AliZDCReconstructor.cxx
ZDC/AliZDCReconstructor.h
ZDC/TestZDCPreprocessor.C
ZDC/ZDCbaseLinkDef.h
ZDC/libZDCbase.pkg

index 68b2329..45a73f6 100644 (file)
@@ -49,7 +49,9 @@
 #include "AliZDCDigit.h"
 #include "AliZDCDigitizer.h"
 #include "AliZDCRawStream.h"
-#include "AliZDCCalibData.h"
+#include "AliZDCPedestals.h"
+#include "AliZDCCalib.h"
+#include "AliZDCRecParam.h"
 #include "AliFstream.h"
 
  
@@ -59,8 +61,9 @@ ClassImp(AliZDC)
 AliZDC::AliZDC() :
   AliDetector(),
   fNoShower  (0),
-  fCalibData (0)
-
+  fPedCalib(0),
+  fCalibData(0),
+  fRecParam(0)
 {
   //
   // Default constructor for the Zero Degree Calorimeter base class
@@ -78,8 +81,9 @@ AliZDC::AliZDC() :
 AliZDC::AliZDC(const char *name, const char *title) : 
   AliDetector(name,title),
   fNoShower  (0),
-  fCalibData (0)
-                
+  fPedCalib(0),
+  fCalibData(0),
+  fRecParam(0)
 {
   //
   // Standard constructor for the Zero Degree Calorimeter base class
@@ -108,7 +112,9 @@ AliZDC::~AliZDC()
   //
 
   fIshunt = 0;
+  delete fPedCalib;
   delete fCalibData;
+  delete fRecParam;
 
 }
 
@@ -118,7 +124,9 @@ AliZDC::AliZDC(const AliZDC& ZDC) :
 {
   // copy constructor
     fNoShower = ZDC.fNoShower;
+    fPedCalib = ZDC.fPedCalib;
     fCalibData = ZDC.fCalibData;
+    fRecParam = ZDC.fRecParam;
     fZDCCalibFName = ZDC.fZDCCalibFName;
 }
 
@@ -128,7 +136,9 @@ AliZDC& AliZDC::operator=(const AliZDC& ZDC)
   // assignement operator
   if(this!=&ZDC){
     fNoShower = ZDC.fNoShower;
+    fPedCalib = ZDC.fPedCalib;
     fCalibData = ZDC.fCalibData;
+    fRecParam = ZDC.fRecParam;
     fZDCCalibFName = ZDC.fZDCCalibFName;
   } return *this;
 }
@@ -222,11 +232,11 @@ void AliZDC::BuildGeometry()
   top=gAlice->GetGeometry()->GetNode("alice");
   
   // ZDC
-    brik = new TBRIK("S_ZDC","ZDC box","void",300,300,5);
-    top->cd();
-    node = new TNode("ZDC","ZDC","S_ZDC",0,0,600,"");
-    node->SetLineColor(kColorZDC);
-    fNodes->Add(node);
+  brik = new TBRIK("S_ZDC","ZDC box","void",300,300,5);
+  top->cd();
+  node = new TNode("ZDC","ZDC","S_ZDC",0,0,600,"");
+  node->SetLineColor(kColorZDC);
+  fNodes->Add(node);
 }
 
 //____________________________________________________________________________
@@ -691,9 +701,9 @@ Int_t AliZDC::Pedestal(Int_t Det, Int_t Quad, Int_t Res) const
   // Getting calibration object for ZDC set
   AliCDBManager *man = AliCDBManager::Instance();
   AliCDBEntry  *entry = man->Get("ZDC/Calib/Data");
-  AliZDCCalibData *calibData = (AliZDCCalibData*) entry->GetObject();
+  AliZDCPedestals *calibPed = (AliZDCPedestals*) entry->GetObject();
   //
-  if(!calibData){
+  if(!calibPed){
     printf("\t No calibration object found for ZDC!");
     return -1;
   }
@@ -709,8 +719,8 @@ Int_t AliZDC::Pedestal(Int_t Det, Int_t Quad, Int_t Res) const
   else index = 10*(Quad-1)+(Det-1)*1/3+2*Res+4; // Reference PMs
   //
   //
-  meanPed = calibData->GetMeanPed(index);
-  pedWidth = calibData->GetMeanPedWidth(index);
+  meanPed = calibPed->GetMeanPed(index);
+  pedWidth = calibPed->GetMeanPedWidth(index);
   pedValue = gRandom->Gaus(meanPed,pedWidth);
   //
   //printf("\t AliZDC::Pedestal - det(%d, %d) - Ped[%d] = %d\n",Det, Quad, index,(Int_t) pedValue); // Chiara debugging!
@@ -755,62 +765,3 @@ void AliZDC::SetTreeAddress(){
       
   AliDetector::SetTreeAddress();
 }
-//________________________________________________________________
-void AliZDC::CreateCalibData()
-{
-  // 
-  //if(fCalibData) delete fCalibData; // delete previous version
-  fCalibData = new AliZDCCalibData(GetName());
-}
-//________________________________________________________________
-void AliZDC::WriteCalibData(Int_t option)
-{
-  //
-  const int kCompressLevel = 9;
-  char* fnam = GetZDCCalibFName();
-  if(!fnam || fnam[0]=='\0') {
-    fnam = gSystem->ExpandPathName("$(ALICE_ROOT)/data/AliZDCCalib.root");
-    Warning("WriteCalibData","No File Name is provided, using default %s",fnam);
-  }
-  TFile* cdfile = TFile::Open(fnam,"UPDATE","",kCompressLevel);
-
-  // Writes Calibration Data to current directory. 
-  // User MUST take care of corresponding file opening and ->cd()... !!!
-  // By default, the object is overwritten. Use 0 option for opposite.
-  if(option) option = TObject::kOverwrite;
-  if(fCalibData) fCalibData->Write(0,option);
-  else if(fCalibData) fCalibData->Write(0,option);
-
-  cdfile->Close();
-  delete cdfile;
-}
-
-//________________________________________________________________
-void AliZDC::LoadCalibData()
-{
-  //
-  char* fnam = GetZDCCalibFName();
-  if(!fnam || fnam[0]=='\0') return; 
-  if(!gAlice->IsFileAccessible(fnam)) {
-    Error("LoadCalibData","ZDC Calibration Data file is not accessible, %s",fnam);
-    exit(1);
-  }
-  TFile* cdfile = TFile::Open(fnam);
-
-  // Loads Calibration Data from current directory. 
-  // User MUST take care of corresponding file opening and ->cd()...!!!
-  //
-  if(fCalibData) delete fCalibData; // delete previous version
-  TString dtname = "Calib_";
-  dtname += GetName();
-  fCalibData = (AliZDCCalibData*) gDirectory->Get(dtname.Data());
-  if(!fCalibData) { 
-    Error("LoadCalibData","No Calibration data found for %s",GetName());
-    exit(1);
-  }
-
-  cdfile->Close();
-  delete cdfile;
-}
-
index b0fb379..3494bec 100644 (file)
@@ -14,7 +14,9 @@
 #include "AliDetector.h"
 #include "AliZDCTrigger.h"
 
-class AliZDCCalibData;
+class AliZDCPedestals;
+class AliZDCCalib;
+class AliZDCRecParam;
  
 class AliZDC : public AliDetector {
 
@@ -49,11 +51,9 @@ public:
   //Calibration methods 
   void    SetZDCCalibFName(const char *name);
   char*   GetZDCCalibFName() const {return (char*)fZDCCalibFName.Data();}
-  void    CreateCalibData();
-  void    WriteCalibData(Int_t option=TObject::kOverwrite);
-  void    LoadCalibData();
-  void    SetCalibData(AliZDCCalibData* data) {fCalibData = data;}
-  AliZDCCalibData* GetCalibData() const  {return fCalibData;}
+  AliZDCPedestals* GetPedCalib()   const  {return fPedCalib;}
+  AliZDCCalib*     GetECalibData() const  {return fCalibData;}
+  AliZDCRecParam*  GetRecParams()  const  {return fRecParam;}
 
   // Trigger
   virtual AliTriggerDetector* CreateTriggerDetector() const
@@ -68,10 +68,12 @@ protected:
   Int_t        fNoShower;              // Flag to switch off the shower        
 
   //Calibration data member 
-  AliZDCCalibData* fCalibData;         // Calibration data for ZDC
-  TString          fZDCCalibFName;     //  Name of the ZDC calibration data
+  AliZDCPedestals* fPedCalib;          // Pedestal data for ZDC
+  AliZDCCalib*     fCalibData;         // Energy and equalization data for ZDC
+  AliZDCRecParam*  fRecParam;          // Parameters for reconstruction for ZDC
+  TString          fZDCCalibFName;     // Name of the ZDC calibration data
   
-  ClassDef(AliZDC,5)   // Zero Degree Calorimeter base class
+  ClassDef(AliZDC,6)   // Zero Degree Calorimeter base class
 };
  
 // Calibration
diff --git a/ZDC/AliZDCCalib.cxx b/ZDC/AliZDCCalib.cxx
new file mode 100644 (file)
index 0000000..8aadfe4
--- /dev/null
@@ -0,0 +1,175 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// class for ZDC calibration                                                //
+// -> values for energy calibration and relative sector calibration          //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliZDCCalib.h"
+
+ClassImp(AliZDCCalib)
+
+//________________________________________________________________
+AliZDCCalib::AliZDCCalib():
+TNamed()
+{
+  Reset();
+}
+
+//________________________________________________________________
+AliZDCCalib::AliZDCCalib(const char* name):
+TNamed()
+{
+  // Constructor
+  TString namst = "Calib_";
+  namst += name;
+  SetName(namst.Data());
+  SetTitle(namst.Data());
+  Reset();
+  for(Int_t i=0; i<6; i++){
+    fEnCalibration[i] = 0.;
+    if(i<5){
+      fZN1EqualCoeff[i] = 0.;
+      fZP1EqualCoeff[i] = 0.;
+      fZN2EqualCoeff[i] = 0.;
+      fZP2EqualCoeff[i] = 0.;
+    }
+  }
+}
+
+//________________________________________________________________
+AliZDCCalib::AliZDCCalib(const AliZDCCalib& calibda) :
+  TNamed(calibda)
+{
+  // Copy constructor
+  SetName(calibda.GetName());
+  SetTitle(calibda.GetName());
+  Reset();
+  for(int i=0; i<6; i++){
+    fEnCalibration[i] = calibda.GetEnCalib(i);
+    if(i<5){
+      fZN1EqualCoeff[i] =  calibda.GetZN1EqualCoeff(i);
+      fZP1EqualCoeff[i] =  calibda.GetZP1EqualCoeff(i);
+      fZN2EqualCoeff[i] =  calibda.GetZN2EqualCoeff(i);
+      fZP2EqualCoeff[i] =  calibda.GetZP2EqualCoeff(i);
+    }
+  }
+}
+
+//________________________________________________________________
+AliZDCCalib &AliZDCCalib::operator =(const AliZDCCalib& calibda)
+{
+// assignment operator
+  SetName(calibda.GetName());
+  SetTitle(calibda.GetName());
+  Reset();
+  for(int i=0; i<6; i++){
+     fEnCalibration[i] = calibda.GetEnCalib(i);
+     if(i<5){
+      fZN1EqualCoeff[i] =  calibda.GetZN1EqualCoeff(i);
+      fZP1EqualCoeff[i] =  calibda.GetZP1EqualCoeff(i);
+      fZN2EqualCoeff[i] =  calibda.GetZN2EqualCoeff(i);
+      fZP2EqualCoeff[i] =  calibda.GetZP2EqualCoeff(i);
+     }
+  }
+  
+  return *this;
+}
+
+//________________________________________________________________
+AliZDCCalib::~AliZDCCalib()
+{
+}
+
+//________________________________________________________________
+void AliZDCCalib::Reset()
+{
+  // Reset
+  memset(fEnCalibration,0,6*sizeof(Float_t));
+  memset(fZN1EqualCoeff,0,5*sizeof(Float_t));
+  memset(fZP1EqualCoeff,0,5*sizeof(Float_t));
+  memset(fZN2EqualCoeff,0,5*sizeof(Float_t));
+  memset(fZP2EqualCoeff,0,5*sizeof(Float_t));
+}                                                                                       
+
+
+//________________________________________________________________
+void  AliZDCCalib::Print(Option_t *) const
+{
+   // Printing of calibration object
+   printf("\n\n ####### Energy calibration coefficients #######        \n");
+   printf("  ZN1 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[0]);
+   printf("  ZP1 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[1]);
+   printf("  ZN2 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[2]);
+   printf("  ZP2 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[3]);
+   printf("  ZEM1 = %.2f (E[TeV]/ADCch.) \n",fEnCalibration[4]);
+   printf("  ZEM2 = %.2f (E[TeV]/ADCch.) \n",fEnCalibration[5]);
+   printf("\n\n ####### Equalization coefficients ####### \n");
+   printf("  ZN1 -> %1.2f %1.2f %1.2f %1.2f %1.2f  \n",
+    fZN1EqualCoeff[0],fZN1EqualCoeff[1],fZN1EqualCoeff[2],fZN1EqualCoeff[3],fZN1EqualCoeff[4]);
+   printf("  ZP1 -> %1.2f %1.2f %1.2f %1.2f %1.2f  \n",
+    fZP1EqualCoeff[0],fZP1EqualCoeff[1],fZP1EqualCoeff[2],fZP1EqualCoeff[3],fZP1EqualCoeff[4]);
+   printf("  ZN2 -> %1.2f %1.2f %1.2f %1.2f %1.2f  \n",
+    fZN2EqualCoeff[0],fZN2EqualCoeff[1],fZN2EqualCoeff[2],fZN2EqualCoeff[3],fZN2EqualCoeff[4]);
+   printf("  ZP2 -> %1.2f %1.2f %1.2f %1.2f %1.2f  \n",
+    fZP2EqualCoeff[0],fZP2EqualCoeff[1],fZP2EqualCoeff[2],fZP2EqualCoeff[3],fZP2EqualCoeff[4]);
+
+} 
+
+//________________________________________________________________
+void AliZDCCalib::SetEnCalib(Float_t* EnCalib) 
+{
+  // Set energy calibration coefficients
+  if(EnCalib) for(int t=0; t<6; t++) fEnCalibration[t] = EnCalib[t];
+  else for(int t=0; t<6; t++) fEnCalibration[t] = 0.;
+}
+
+//________________________________________________________________
+void AliZDCCalib::SetZN1EqualCoeff(Float_t* EqualCoeff)
+{
+  // Set ZN1 equalization coefficients
+  if(EqualCoeff) for(int t=0; t<5; t++) fZN1EqualCoeff[t] = EqualCoeff[t];
+  else for(int t=0; t<5; t++) fZN1EqualCoeff[t] = 1.;
+}
+//________________________________________________________________
+void AliZDCCalib::SetZP1EqualCoeff(Float_t* EqualCoeff)
+{
+  // Set ZP1 equalization coefficients
+  if(EqualCoeff) for(int t=0; t<5; t++) fZP1EqualCoeff[t] = EqualCoeff[t];
+  else for(int t=0; t<5; t++) fZP1EqualCoeff[t] = 1.;
+}
+//________________________________________________________________
+void AliZDCCalib::SetZN2EqualCoeff(Float_t* EqualCoeff)
+{
+  // Set ZN2 equalization coefficients
+  if(EqualCoeff) for(int t=0; t<5; t++) fZN2EqualCoeff[t] = EqualCoeff[t];
+  else for(int t=0; t<5; t++) fZN2EqualCoeff[t] = 1.;
+}
+//________________________________________________________________
+void AliZDCCalib::SetZP2EqualCoeff(Float_t* EqualCoeff)
+{
+  // Set ZN1 equalization coefficients
+  if(EqualCoeff) for(int t=0; t<5; t++) fZP2EqualCoeff[t] = EqualCoeff[t];
+  else for(int t=0; t<5; t++) fZP2EqualCoeff[t] = 1.;
+}
diff --git a/ZDC/AliZDCCalib.h b/ZDC/AliZDCCalib.h
new file mode 100644 (file)
index 0000000..a42c40b
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef ALIZDCCALIB_H
+#define ALIZDCCALIB_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+////////////////////////////////////////////////
+//  class for ZDC calibration -> CALIBCOEFF   //
+////////////////////////////////////////////////
+
+#include "TNamed.h"
+#include "TH1.h"
+#include "AliCDBEntry.h"
+
+class AliZDC;
+
+class AliZDCCalib: public TNamed {
+
+ public:
+  AliZDCCalib();
+  AliZDCCalib(const char* name);
+  AliZDCCalib(const AliZDCCalib &calibda);
+  AliZDCCalib& operator= (const AliZDCCalib &calibda);
+  virtual ~AliZDCCalib();
+  void Reset();
+  virtual void  Print(Option_t *) const; 
+  //
+  Float_t  GetEnCalib(Int_t channel)   const {return fEnCalibration[channel];}
+  Float_t* GetEnCalib()                const {return (float*)fEnCalibration;}
+  //
+  Float_t  GetZN1EqualCoeff(Int_t channel) const {return fZN1EqualCoeff[channel];}
+  Float_t* GetZN1EqualCoeffs()            const {return (float*)fZN1EqualCoeff;}
+  Float_t  GetZP1EqualCoeff(Int_t channel) const {return fZP1EqualCoeff[channel];}
+  Float_t* GetZP1EqualCoeffs()            const {return (float*)fZP1EqualCoeff;}
+  Float_t  GetZN2EqualCoeff(Int_t channel) const {return fZN2EqualCoeff[channel];}
+  Float_t* GetZN2EqualCoeffs()            const {return (float*)fZN2EqualCoeff;}
+  Float_t  GetZP2EqualCoeff(Int_t channel) const {return fZP2EqualCoeff[channel];}
+  Float_t* GetZP2EqualCoeffs()            const {return (float*)fZP2EqualCoeff;}
+
+  void         SetEnCalib(Int_t channel, Float_t val) {fEnCalibration[channel]=val;}
+  void         SetEnCalib(Float_t* EnCalib);
+  //
+  void         SetZN1EqualCoeff(Int_t channel, Float_t val) {fZN1EqualCoeff[channel]=val;}
+  void         SetZN1EqualCoeff(Float_t* EqualCoeff);
+  void         SetZP1EqualCoeff(Int_t channel, Float_t val) {fZP1EqualCoeff[channel]=val;}
+  void         SetZP1EqualCoeff(Float_t* EqualCoeff);
+  void         SetZN2EqualCoeff(Int_t channel, Float_t val) {fZN2EqualCoeff[channel]=val;}
+  void         SetZN2EqualCoeff(Float_t* EqualCoeff);
+  void         SetZP2EqualCoeff(Int_t channel, Float_t val) {fZP2EqualCoeff[channel]=val;}
+  void         SetZP2EqualCoeff(Float_t* EqualCoeff);
+  
+ protected:
+  // --- E calibration
+  Float_t  fEnCalibration[6];   // Coeff. for energy calibration
+  // --- Coefficients for tower calibration
+  Float_t  fZN1EqualCoeff[5];   // Equalization coefficients for ZN1 PTMs
+  Float_t  fZP1EqualCoeff[5];   // Equalization coefficients for ZN1 PTMs
+  Float_t  fZN2EqualCoeff[5];   // Equalization coefficients for ZN1 PTMs
+  Float_t  fZP2EqualCoeff[5];   // Equalization coefficients for ZN1 PTMs
+  //
+  ClassDef(AliZDCCalib,1)    // ZDC pedestal calibration data
+};
+
+#endif
index 0fbf745..4e1237c 100644 (file)
@@ -44,7 +44,9 @@
 #include "AliZDCDigitizer.h"
 
 class AliCDBStorage;
-class AliZDCCalibData;
+class AliZDCPedestals;
+class AliZDCCalib;
+class AliZDCRecParam;
 
 ClassImp(AliZDCDigitizer)
 
@@ -61,9 +63,11 @@ AliZDCDigitizer::AliZDCDigitizer(AliRunDigitizer* manager):
   AliDigitizer(manager)
 {
   fIsCalibration=0; //By default the simulation doesn't create calib. data
-//  fIsCalibration=1; //To create calib. data
+//  fIsCalibration=1; //To create pedestal calib. data
   // Get calibration data
+  fPedData = GetPedData(); 
   fCalibData = GetCalibData(); 
+  fRecParam = GetRecParam(); 
   if(fIsCalibration!=0) printf("\n\t AliZDCDigitizer -> Creating calibration data (pedestals)\n");
 
 }
@@ -89,7 +93,9 @@ AliZDCDigitizer::AliZDCDigitizer(const AliZDCDigitizer &digitizer):
   }
   for(Int_t i=0; i<2; i++) fADCRes[i] = digitizer.fADCRes[i];
   fIsCalibration = digitizer.fIsCalibration;
+  fPedData = digitizer.fPedData;
   fCalibData = digitizer.fCalibData;
+  fRecParam = digitizer.fRecParam;
 
 }
 
@@ -474,8 +480,8 @@ Int_t AliZDCDigitizer::Pedestal(Int_t Det, Int_t Quad, Int_t Res) const
     }
     else index = 10*(Quad-1)+(Det-1)*1/3+2*Res+4; // Reference PMs
     //
-    meanPed = fCalibData->GetMeanPed(index);
-    pedWidth = fCalibData->GetMeanPedWidth(index);
+    meanPed = fPedData->GetMeanPed(index);
+    pedWidth = fPedData->GetMeanPedWidth(index);
     pedValue = gRandom->Gaus(meanPed,pedWidth);
     //
     /*printf("\t Pedestal -> det = %d, quad = %d, res = %d - Ped[%d] = %d\n",
@@ -517,15 +523,45 @@ AliCDBStorage* AliZDCDigitizer::SetStorage(const char *uri)
 }
 
 //_____________________________________________________________________________
-AliZDCCalibData* AliZDCDigitizer::GetCalibData() const
+AliZDCPedestals* AliZDCDigitizer::GetPedData() const
+{
+
+  // Getting pedestal calibration object for ZDC set
+
+  AliCDBEntry  *entry = AliCDBManager::Instance()->Get("ZDC/Calib/Pedestals");
+  if(!entry) AliFatal("No calibration data loaded!");  
+
+  AliZDCPedestals *calibdata = dynamic_cast<AliZDCPedestals*>  (entry->GetObject());
+  if(!calibdata)  AliFatal("Wrong calibration object in calibration  file!");
+
+  return calibdata;
+}
+
+//_____________________________________________________________________________
+AliZDCCalib* AliZDCDigitizer::GetCalibData() const
+{
+
+  // Getting calibration object for ZDC set
+
+  AliCDBEntry  *entry = AliCDBManager::Instance()->Get("ZDC/Calib/Calib");
+  if(!entry) AliFatal("No calibration data loaded!");  
+
+  AliZDCCalib *calibdata = dynamic_cast<AliZDCCalib*>  (entry->GetObject());
+  if(!calibdata)  AliFatal("Wrong calibration object in calibration  file!");
+
+  return calibdata;
+}
+
+//_____________________________________________________________________________
+AliZDCRecParam* AliZDCDigitizer::GetRecParam() const
 {
 
   // Getting calibration object for ZDC set
 
-  AliCDBEntry  *entry = AliCDBManager::Instance()->Get("ZDC/Calib/Data");
+  AliCDBEntry  *entry = AliCDBManager::Instance()->Get("ZDC/Calib/RecParam");
   if(!entry) AliFatal("No calibration data loaded!");  
 
-  AliZDCCalibData *calibdata = dynamic_cast<AliZDCCalibData*>  (entry->GetObject());
+  AliZDCRecParam *calibdata = dynamic_cast<AliZDCRecParam*>  (entry->GetObject());
   if(!calibdata)  AliFatal("Wrong calibration object in calibration  file!");
 
   return calibdata;
index f2ddddb..fd6221f 100644 (file)
@@ -12,7 +12,9 @@
 #include "AliDigitizer.h"
 #include "AliCDBManager.h"
 #include "AliCDBStorage.h"
-#include "AliZDCCalibData.h"
+#include "AliZDCPedestals.h"
+#include "AliZDCCalib.h"
+#include "AliZDCRecParam.h"
 
 class AliRunDigitizer;
 
@@ -44,7 +46,9 @@ public:
   
   void   SetCalibrationOn() {fIsCalibration=1;}  
   AliCDBStorage   *SetStorage(const char* uri);
-  AliZDCCalibData *GetCalibData() const; 
+  AliZDCPedestals *GetPedData() const; 
+  AliZDCCalib     *GetCalibData() const; 
+  AliZDCRecParam  *GetRecParam() const; 
 
 private:
 
@@ -64,8 +68,11 @@ private:
   Float_t fADCRes[2];          // ADC conversion factors
   
   Int_t   fIsCalibration;      // !=0 if simulation creates calibration data
-  AliZDCCalibData *fCalibData;         //! calibration data
+  
+  AliZDCPedestals *fPedData;   //! pedestal calibration data
+  AliZDCCalib     *fCalibData;         //! energy and equalization calibration data
+  AliZDCRecParam  *fRecParam;  //! parameters used in reconstruction
        
-  ClassDef(AliZDCDigitizer, 5)     // digitizer for ZDC
+  ClassDef(AliZDCDigitizer, 6)     // digitizer for ZDC
 };    
 #endif
diff --git a/ZDC/AliZDCPedestals.cxx b/ZDC/AliZDCPedestals.cxx
new file mode 100644 (file)
index 0000000..7e0422c
--- /dev/null
@@ -0,0 +1,186 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// class for ZDC calibration      -> values for pedestal subtraction         //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliZDCPedestals.h"
+
+ClassImp(AliZDCPedestals)
+
+//________________________________________________________________
+AliZDCPedestals::AliZDCPedestals():
+TNamed()
+{
+  Reset();
+}
+
+//________________________________________________________________
+AliZDCPedestals::AliZDCPedestals(const char* name):
+TNamed()
+{
+  // Constructor
+  TString namst = "Calib_";
+  namst += name;
+  SetName(namst.Data());
+  SetTitle(namst.Data());
+  Reset();
+  for(Int_t i=0; i<48; i++){
+    fMeanPedestal[i] = 0.;
+    fMeanPedWidth[i] = 0.;
+    fOOTPedestal[i] = 0.;
+    fOOTPedWidth[i] = 0.;
+    for(Int_t j=0; j<2; j++) fPedCorrCoeff[j][i] = 0.;
+  }
+  
+  
+}
+
+//________________________________________________________________
+AliZDCPedestals::AliZDCPedestals(const AliZDCPedestals& calibda) :
+  TNamed(calibda)
+{
+  // Copy constructor
+  SetName(calibda.GetName());
+  SetTitle(calibda.GetName());
+  Reset();
+  for(int t=0; t<48; t++){
+     fMeanPedestal[t] = calibda.GetMeanPed(t);
+     fMeanPedWidth[t] = calibda.GetMeanPedWidth(t);
+     fOOTPedestal[t]  = calibda.GetOOTPed(t);
+     fOOTPedWidth[t]  = calibda.GetOOTPedWidth(t);
+     fPedCorrCoeff[0][t] = calibda.GetPedCorrCoeff0(t);
+     fPedCorrCoeff[1][t] = calibda.GetPedCorrCoeff1(t);
+  }
+}
+
+//________________________________________________________________
+AliZDCPedestals &AliZDCPedestals::operator =(const AliZDCPedestals& calibda)
+{
+// assignment operator
+  SetName(calibda.GetName());
+  SetTitle(calibda.GetName());
+  Reset();
+  for(int t=0; t<48; t++){
+     fMeanPedestal[t] = calibda.GetMeanPed(t);
+     fMeanPedWidth[t] = calibda.GetMeanPedWidth(t);
+     fOOTPedestal[t]  = calibda.GetOOTPed(t);
+     fOOTPedWidth[t]  = calibda.GetOOTPedWidth(t);
+     fPedCorrCoeff[0][t] = calibda.GetPedCorrCoeff0(t);
+     fPedCorrCoeff[1][t] = calibda.GetPedCorrCoeff1(t);
+  }
+
+  return *this;
+}
+
+//________________________________________________________________
+AliZDCPedestals::~AliZDCPedestals()
+{
+}
+
+//________________________________________________________________
+void AliZDCPedestals::Reset()
+{
+  // Reset
+  memset(fMeanPedestal,0,48*sizeof(Float_t));
+  memset(fMeanPedWidth,0,48*sizeof(Float_t));
+  memset(fOOTPedestal,0,48*sizeof(Float_t));
+  memset(fOOTPedWidth,0,48*sizeof(Float_t));
+}                                                                                       
+
+
+//________________________________________________________________
+void  AliZDCPedestals::Print(Option_t *) const
+{
+   // Printing of calibration object
+   printf("\n ####### In-time pedestal values (mean value, sigma) ####### \n");
+   for(int t=0; t<48; t++) 
+      printf("\t ADC%d (%.1f, %.1f)\n",t,fMeanPedestal[t],fMeanPedWidth[t]);
+   //
+   printf("\n\n ####### Out-of-time pedestal values (mean value, sigma) ####### \n");
+   for(int t=0; t<48; t++)
+      printf("\t ADC-OoT%d (%.1f, %.1f)\n",t,fOOTPedestal[t],fOOTPedWidth[t]);
+} 
+
+//________________________________________________________________
+void AliZDCPedestals::SetMeanPed(Float_t* MeanPed)
+{
+  if(MeanPed) for(int t=0; t<48; t++) fMeanPedestal[t] = MeanPed[t];
+  else for(int t=0; t<48; t++) fMeanPedestal[t] = 0.;
+}
+//________________________________________________________________
+void AliZDCPedestals::SetMeanPedWidth(Float_t* MeanPedWidth)
+{
+  if(MeanPedWidth) for(int t=0; t<48; t++) fMeanPedWidth[t] = MeanPedWidth[t];
+  else for(int t=0; t<48; t++) fMeanPedWidth[t] = 0.;
+}
+
+//________________________________________________________________
+void AliZDCPedestals::SetOOTPed(Float_t* OOTPed)
+{
+  if(OOTPed) for(int t=0; t<48; t++) fOOTPedestal[t] = OOTPed[t];
+  else for(int t=0; t<48; t++) fOOTPedestal[t] = 0.;
+}
+
+//________________________________________________________________
+void AliZDCPedestals::SetOOTPedWidth(Float_t* OOTPedWidth)
+{
+  if(OOTPedWidth) for(int t=0; t<48; t++) fOOTPedWidth[t] = OOTPedWidth[t];
+  else for(int t=0; t<48; t++) fOOTPedWidth[t] = 0.;
+}
+
+//________________________________________________________________
+void AliZDCPedestals:: SetPedCorrCoeff(Float_t* PedCorrCoeff)
+{
+  // Set coefficients for pedestal correlations
+  if(PedCorrCoeff){
+    for(Int_t j=0; j<2; j++){
+     for(int t=0; t<48; t++)
+       fPedCorrCoeff[j][t] = PedCorrCoeff[t];
+    }
+  }
+  else{
+    for(Int_t j=0; j<2; j++){
+     for(int t=0; t<48; t++)
+       fPedCorrCoeff[j][t] = 0.;
+    }
+  }
+}
+
+//________________________________________________________________
+void AliZDCPedestals:: SetPedCorrCoeff(Float_t* PedCorrCoeff0, Float_t* PedCorrCoeff1)
+{
+  // Set coefficients for pedestal correlations
+  if(PedCorrCoeff0 && PedCorrCoeff1){
+    for(int t=0; t<48; t++){
+       fPedCorrCoeff[0][t] = PedCorrCoeff0[t];
+       fPedCorrCoeff[0][t] = PedCorrCoeff1[t];
+    }
+  }
+  else{
+     for(int t=0; t<48; t++){
+       fPedCorrCoeff[0][t] = 0.;
+       fPedCorrCoeff[1][t] = 0.;
+    }
+  }
+}
diff --git a/ZDC/AliZDCPedestals.h b/ZDC/AliZDCPedestals.h
new file mode 100644 (file)
index 0000000..4aad988
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef ALIZDCPEDESTALS_H
+#define ALIZDCPEDESTALS_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+////////////////////////////////////////////////
+//  class for ZDC calibration -> PEDESTALS    //
+////////////////////////////////////////////////
+
+#include "TNamed.h"
+#include "TH1.h"
+#include "AliCDBEntry.h"
+
+class AliZDC;
+
+class AliZDCPedestals: public TNamed {
+
+ public:
+  AliZDCPedestals();
+  AliZDCPedestals(const char* name);
+  AliZDCPedestals(const AliZDCPedestals &calibda);
+  AliZDCPedestals& operator= (const AliZDCPedestals &calibda);
+  virtual ~AliZDCPedestals();
+  void Reset();
+  virtual void  Print(Option_t *) const; 
+  //
+  Float_t  GetMeanPed(Int_t channel)              const {return fMeanPedestal[channel];}
+  Float_t* GetMeanPed()                   const {return (float*)fMeanPedestal;}
+  Float_t  GetMeanPedWidth(Int_t channel)  const {return fMeanPedWidth[channel];}
+  Float_t* GetMeanPedWidth()                      const {return (float*)fMeanPedWidth;}
+  Float_t  GetOOTPed(Int_t channel)       const {return fOOTPedestal[channel];}
+  Float_t* GetOOTPed()                    const {return (float*)fOOTPedestal;}
+  Float_t  GetOOTPedWidth(Int_t channel)   const {return fOOTPedWidth[channel];}
+  Float_t* GetOOTPedWidth()               const {return (float*)fOOTPedWidth;}
+  Float_t  GetPedCorrCoeff0(Int_t channel) const {return fPedCorrCoeff[0][channel];}
+  Float_t  GetPedCorrCoeff1(Int_t channel) const {return fPedCorrCoeff[1][channel];}
+  Float_t* GetPedCorrCoeff()              const {return (float*)fPedCorrCoeff;}
+
+  void  SetMeanPed(Int_t channel, Float_t val) {fMeanPedestal[channel]=val;}
+  void  SetMeanPed(Float_t* MeanPed);
+  void  SetMeanPedWidth(Int_t channel, Float_t val) {fMeanPedWidth[channel]=val;}
+  void  SetMeanPedWidth(Float_t* MeanPedWidth);
+  void  SetOOTPed(Int_t channel, Float_t val) {fOOTPedestal[channel]=val;}
+  void  SetOOTPed(Float_t* OOTPed);
+  void  SetOOTPedWidth(Int_t channel, Float_t val) {fOOTPedWidth[channel]=val;}
+  void  SetOOTPedWidth(Float_t* OOTPedWidth);
+  void  SetPedCorrCoeff(Int_t channel, Float_t valCoeff0, Float_t valCoeff1)
+       {fPedCorrCoeff[0][channel]=valCoeff0; fPedCorrCoeff[1][channel]=valCoeff1;}
+  void  SetPedCorrCoeff(Float_t* PedCorrCoeff);
+  void  SetPedCorrCoeff(Float_t* PedCorrCoeff0, Float_t* PedCorrCoeff1);
+  
+ protected:
+  // --- Pedestals
+  Float_t  fMeanPedestal[48];   // Mean pedestal values 
+  Float_t  fMeanPedWidth[48];   // Mean pedestal widths 
+  Float_t  fOOTPedestal[48];    // "Out of Time" pedestal values
+  Float_t  fOOTPedWidth[48];    // "Out of Time" pedestal widths
+  Float_t  fPedCorrCoeff[2][48]; // Fit of correlation in-time vs. out-of-time
+  //
+  ClassDef(AliZDCPedestals,1)    // ZDC pedestal calibration data
+};
+
+#endif
index b6ce012..c4c4235 100644 (file)
@@ -14,7 +14,9 @@
 #include "AliAlignObjParams.h"
 #include "AliLog.h"
 #include "AliZDCDataDCS.h"
-#include "AliZDCCalibData.h"
+#include "AliZDCPedestals.h"
+#include "AliZDCCalib.h"
+#include "AliZDCRecParam.h"
 
 /////////////////////////////////////////////////////////////////////
 //                                                                //
@@ -101,9 +103,8 @@ UInt_t AliZDCPreprocessor::Process(TMap* dcsAliasMap)
   Bool_t resultAl = kFALSE;
   resultAl = Store("Align","Data", array, &md, 0, 0);
   
-  AliZDCCalibData *calibdata = new AliZDCCalibData("ZDC");
-  
 // *************** From DAQ ******************
+Bool_t resPedCal = kFALSE, resECal = kFALSE, resRecPar = kFALSE;
 // *****************************************************
 // [a] PEDESTALS -> Pedestal subtraction
 // *****************************************************
@@ -128,6 +129,9 @@ if(runType == "PEDESTAL_RUN"){
           Log(Form("No PEDESTAL file from source %s!", source->GetName()));
          return 1;
        }
+       // --- Initializing pedestal calibration object
+       AliZDCPedestals *pedCalib = new AliZDCPedestals("ZDC");
+       // --- Reading file with pedestal calibration data
        const char* pedFileName = stringPedFileName.Data();
        // no. ADCch = (22 signal ch. + 2 reference PMs) * 2 gain chain = 48
        const Int_t knZDCch = 48;
@@ -145,15 +149,15 @@ if(runType == "PEDESTAL_RUN"){
               //if(j==1) printf("pedVal[%d] -> %f, %f \n",i,pedVal[i][0],pedVal[i][1]);
             }
             if(i<knZDCch){
-              calibdata->SetMeanPed(i,pedVal[i][0]);
-              calibdata->SetMeanPedWidth(i,pedVal[i][1]);
+              pedCalib->SetMeanPed(i,pedVal[i][0]);
+              pedCalib->SetMeanPedWidth(i,pedVal[i][1]);
             }
             else if(i>=knZDCch && i<(2*knZDCch)){
-              calibdata->SetOOTPed(i-knZDCch,pedVal[i][0]);
-              calibdata->SetOOTPedWidth(i-knZDCch,pedVal[i][1]);
+              pedCalib->SetOOTPed(i-knZDCch,pedVal[i][0]);
+              pedCalib->SetOOTPedWidth(i-knZDCch,pedVal[i][1]);
             }
             else if(i>=(2*knZDCch) && i<(3*knZDCch)){
-              calibdata->SetPedCorrCoeff(i-(2*knZDCch),pedVal[i][0],pedVal[i][1]);
+              pedCalib->SetPedCorrCoeff(i-(2*knZDCch),pedVal[i][0],pedVal[i][1]);
             }
          }
        }
@@ -162,7 +166,14 @@ if(runType == "PEDESTAL_RUN"){
           return 1;
        }
        //
-      //calibdata->Print("");
+      //pedCalib->Print("");
+      // 
+      AliCDBMetaData metaData;
+      metaData.SetBeamPeriod(0);
+      metaData.SetResponsible("Chiara");
+      metaData.SetComment("Filling AliZDCPedestals object");  
+      //
+      resPedCal = Store("Calib","Pedestals",pedCalib, &metaData, 0, 1);
   }
   delete daqSources; daqSources = 0;
 }
@@ -188,6 +199,9 @@ else if(runType == "PULSER_RUN"){
          Log(Form("No EMDCALIB file from source %s!", source->GetName()));
         return 1;
        }
+       // --- Initializing pedestal calibration object
+       AliZDCCalib *eCalib = new AliZDCCalib("ZDC");
+       // --- Reading file with pedestal calibration data
        const char* emdFileName = stringEMDFileName.Data();
        if(emdFileName){
         FILE *file;
@@ -204,17 +218,17 @@ else if(runType == "PULSER_RUN"){
             fscanf(file,"%f",&fitValEMD[j]);
              if(j<4){
               calibVal[j] = fitValEMD[j]/2.76;
-              calibdata->SetEnCalib(j,calibVal[j]);
+              eCalib->SetEnCalib(j,calibVal[j]);
             }
-            else calibdata->SetEnCalib(j,fitValEMD[j]);
+            else eCalib->SetEnCalib(j,fitValEMD[j]);
           }
           else{
             for(Int_t k=0; k<5; k++){
                fscanf(file,"%f",&equalCoeff[j][k]);
-               if(j==6) calibdata->SetZN1EqualCoeff(k, equalCoeff[j][k]);
-               else if(j==7) calibdata->SetZP1EqualCoeff(k, equalCoeff[j][k]);
-               else if(j==8) calibdata->SetZN2EqualCoeff(k, equalCoeff[j][k]);
-               else if(j==9) calibdata->SetZP2EqualCoeff(k, equalCoeff[j][k]);  
+               if(j==6) eCalib->SetZN1EqualCoeff(k, equalCoeff[j][k]);
+               else if(j==7) eCalib->SetZP1EqualCoeff(k, equalCoeff[j][k]);
+               else if(j==8) eCalib->SetZN2EqualCoeff(k, equalCoeff[j][k]);
+               else if(j==9) eCalib->SetZP2EqualCoeff(k, equalCoeff[j][k]);  
              }
           }
          }
@@ -224,6 +238,13 @@ else if(runType == "PULSER_RUN"){
          return 1;
        }
        //calibdata->Print("");
+      // 
+      AliCDBMetaData metaData;
+      metaData.SetBeamPeriod(0);
+      metaData.SetResponsible("Chiara");
+      metaData.SetComment("Filling AliZDCCalib object");  
+      //
+      resECal = Store("Calib","Calib",eCalib, &metaData, 0, 1);
   }
 }
 // ********************************************************
@@ -248,6 +269,9 @@ else if(runType == "PHYSICS"){
          Log(Form("No PHYSICS file from source %s!", source->GetName()));
         return 1;
        }
+       // --- Initializing pedestal calibration object
+       AliZDCRecParam *recCalib = new AliZDCRecParam("ZDC");
+       // --- Reading file with pedestal calibration data
        const char* physFileName = stringPHYSFileName.Data();
        if(physFileName){
         FILE *file;
@@ -259,22 +283,29 @@ else if(runType == "PHYSICS"){
         //
         Float_t physRecParam[10]; 
         for(Int_t j=0; j<10; j++) fscanf(file,"%f",&physRecParam[j]);
-        calibdata->SetZEMEndValue(physRecParam[0]);
-        calibdata->SetZEMCutFraction(physRecParam[1]);
-        calibdata->SetDZEMSup(physRecParam[2]);
-        calibdata->SetDZEMInf(physRecParam[3]);
-        calibdata->SetEZN1MaxValue(physRecParam[4]);
-        calibdata->SetEZP1MaxValue(physRecParam[5]);
-        calibdata->SetEZDC1MaxValue(physRecParam[6]);
-        calibdata->SetEZN2MaxValue(physRecParam[7]);
-        calibdata->SetEZP2MaxValue(physRecParam[8]);
-        calibdata->SetEZDC2MaxValue(physRecParam[9]);
+        recCalib->SetZEMEndValue(physRecParam[0]);
+        recCalib->SetZEMCutFraction(physRecParam[1]);
+        recCalib->SetDZEMSup(physRecParam[2]);
+        recCalib->SetDZEMInf(physRecParam[3]);
+        recCalib->SetEZN1MaxValue(physRecParam[4]);
+        recCalib->SetEZP1MaxValue(physRecParam[5]);
+        recCalib->SetEZDC1MaxValue(physRecParam[6]);
+        recCalib->SetEZN2MaxValue(physRecParam[7]);
+        recCalib->SetEZP2MaxValue(physRecParam[8]);
+        recCalib->SetEZDC2MaxValue(physRecParam[9]);
        }
        else{
          Log(Form("File %s not found", physFileName));
          return 1;
        }
        //calibdata->Print("");
+      // 
+      AliCDBMetaData metaData;
+      metaData.SetBeamPeriod(0);
+      metaData.SetResponsible("Chiara");
+      metaData.SetComment("Filling AliZDCCalib object");  
+      //
+      resRecPar = Store("Calib","RecParam",recCalib, &metaData, 0, 1);
   }
 } 
 else {
@@ -286,20 +317,13 @@ else {
   const char* nEvents = GetRunParameter("totalEvents");
   if(nEvents) Log(Form("Number of events for run %d: %s",fRun, nEvents));
   else Log(Form("Number of events not put in logbook!"));
-
-  // Storing the final CDB file
-  AliCDBMetaData metaData;
-  metaData.SetBeamPeriod(0);
-  metaData.SetResponsible("Chiara");
-  metaData.SetComment("Filling AliZDCCalibData object");
-
-  Bool_t resultCal = kFALSE;
-  resultCal = Store("Calib","Data",calibdata, &metaData, 0, 1);
  
   UInt_t result = 0;
-  if(resultAl == kFALSE || resultCal == kFALSE){
-    if(resultAl == kFALSE  && resultCal == kFALSE ) result = 3;
-    else result = 2;
+  if(resultAl==kFALSE || resPedCal==kFALSE || resECal==kFALSE || resRecPar==kFALSE){
+    if(resultAl == kFALSE) result = 1;
+    else if(resPedCal == kFALSE) result = 2;
+    else if(resECal == kFALSE)   result = 3;
+    else if(resRecPar == kFALSE) result = 4;
   }
   
   return result;
diff --git a/ZDC/AliZDCRecParam.cxx b/ZDC/AliZDCRecParam.cxx
new file mode 100644 (file)
index 0000000..4eae00c
--- /dev/null
@@ -0,0 +1,244 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// class for ZDC calibration                                                 //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliZDCRecParam.h"
+
+ClassImp(AliZDCRecParam)
+
+//________________________________________________________________
+AliZDCRecParam::AliZDCRecParam():
+TNamed()
+{
+  Reset();
+}
+
+//________________________________________________________________
+AliZDCRecParam::AliZDCRecParam(const char* name):
+TNamed(),
+fZEMEndValue(0),
+fZEMCutFraction(0),
+fDZEMSup(0),
+fDZEMInf(0),
+fEZN1MaxValue(0),
+fEZP1MaxValue(0),
+fEZDC1MaxValue(0),
+fEZN2MaxValue(0),
+fEZP2MaxValue(0),
+fEZDC2MaxValue(0)
+{
+  // Constructor
+  TString namst = "Calib_";
+  namst += name;
+  SetName(namst.Data());
+  SetTitle(namst.Data());
+  Reset();
+}
+
+//________________________________________________________________
+AliZDCRecParam::AliZDCRecParam(const AliZDCRecParam& calibda) :
+  TNamed(calibda)
+{
+  // Copy constructor
+  SetName(calibda.GetName());
+  SetTitle(calibda.GetName());
+  Reset();
+  for(int t=0; t<48; t++){
+     fMeanPedestal[t] = calibda.GetMeanPed(t);
+     fMeanPedWidth[t] = calibda.GetMeanPedWidth(t);
+     fOOTPedestal[t]  = calibda.GetOOTPed(t);
+     fOOTPedWidth[t]  = calibda.GetOOTPedWidth(t);
+     fPedCorrCoeff[0][t] = calibda.GetPedCorrCoeff0(t);
+     fPedCorrCoeff[1][t] = calibda.GetPedCorrCoeff1(t);
+  }
+  for(int t=0; t<6; t++)  fEnCalibration[t] = calibda.GetEnCalib(t);
+  //
+  fZEMEndValue    = calibda.GetZEMEndValue();   
+  fZEMCutFraction = calibda.GetZEMCutFraction();
+  fDZEMSup       = calibda.GetDZEMSup();
+  fDZEMInf       = calibda.GetDZEMInf();
+}
+
+//________________________________________________________________
+AliZDCRecParam &AliZDCRecParam::operator =(const AliZDCRecParam& calibda)
+{
+// assignment operator
+  SetName(calibda.GetName());
+  SetTitle(calibda.GetName());
+  Reset();
+  for(int t=0; t<48; t++){
+     fMeanPedestal[t] = calibda.GetMeanPed(t);
+     fMeanPedWidth[t] = calibda.GetMeanPedWidth(t);
+     fOOTPedestal[t]  = calibda.GetOOTPed(t);
+     fOOTPedWidth[t]  = calibda.GetOOTPedWidth(t);
+     fPedCorrCoeff[0][t] = calibda.GetPedCorrCoeff0(t);
+     fPedCorrCoeff[1][t] = calibda.GetPedCorrCoeff1(t);
+  }
+  for(int t=0; t<6; t++) fEnCalibration[t] = calibda.GetEnCalib(t);
+  fZEMEndValue    = calibda.GetZEMEndValue();
+  fZEMCutFraction = calibda.GetZEMCutFraction();
+
+  return *this;
+}
+
+//________________________________________________________________
+AliZDCRecParam::~AliZDCRecParam()
+{
+}
+
+//________________________________________________________________
+void AliZDCRecParam::Reset()
+{
+  // Reset
+  memset(fMeanPedestal,0,48*sizeof(Float_t));
+  memset(fMeanPedWidth,0,48*sizeof(Float_t));
+  memset(fOOTPedestal,0,48*sizeof(Float_t));
+  memset(fOOTPedWidth,0,48*sizeof(Float_t));
+  memset(fEnCalibration,0,6*sizeof(Float_t));
+  memset(fZN1EqualCoeff,0,5*sizeof(Float_t));
+  memset(fZP1EqualCoeff,0,5*sizeof(Float_t));
+  memset(fZN2EqualCoeff,0,5*sizeof(Float_t));
+  memset(fZP2EqualCoeff,0,5*sizeof(Float_t));
+}                                                                                       
+
+
+//________________________________________________________________
+void  AliZDCRecParam::Print(Option_t *) const
+{
+   // Printing calibration object
+   printf("\n\n ####### Parameters from EZDC vs. ZEM correlation #######       \n");
+   printf("  ZEMEndPoint = %1.2f, ZEMCutFraction = %1.2f \n"
+     "  DZEMInf = %1.2f, DZEMSup = %1.2f\n",
+     fZEMEndValue, fZEMCutFraction, fDZEMInf, fDZEMSup);
+   printf("\n\n ####### Parameters from EZDC vs. Nspec correlation #######     \n");
+   printf("  EZN1MaxValue = %1.2f, EZP1MaxValue = %1.2f, EZDC1MaxValue = %1.2f \n"
+     "  EZN2MaxValue = %1.2f, EZP2MaxValue = %1.2f, EZDC2MaxValue = %1.2f \n\n",
+     fEZN1MaxValue, fEZP1MaxValue, fEZDC1MaxValue,
+     fEZN2MaxValue, fEZP2MaxValue, fEZDC2MaxValue);
+
+} 
+
+//________________________________________________________________
+void AliZDCRecParam::SetMeanPed(Float_t* MeanPed)
+{
+  if(MeanPed) for(int t=0; t<48; t++) fMeanPedestal[t] = MeanPed[t];
+  else for(int t=0; t<48; t++) fMeanPedestal[t] = 0.;
+}
+//________________________________________________________________
+void AliZDCRecParam::SetMeanPedWidth(Float_t* MeanPedWidth)
+{
+  if(MeanPedWidth) for(int t=0; t<48; t++) fMeanPedWidth[t] = MeanPedWidth[t];
+  else for(int t=0; t<48; t++) fMeanPedWidth[t] = 0.;
+}
+
+//________________________________________________________________
+void AliZDCRecParam::SetOOTPed(Float_t* OOTPed)
+{
+  if(OOTPed) for(int t=0; t<48; t++) fOOTPedestal[t] = OOTPed[t];
+  else for(int t=0; t<48; t++) fOOTPedestal[t] = 0.;
+}
+
+//________________________________________________________________
+void AliZDCRecParam::SetOOTPedWidth(Float_t* OOTPedWidth)
+{
+  if(OOTPedWidth) for(int t=0; t<48; t++) fOOTPedWidth[t] = OOTPedWidth[t];
+  else for(int t=0; t<48; t++) fOOTPedWidth[t] = 0.;
+}
+
+//________________________________________________________________
+void AliZDCRecParam:: SetPedCorrCoeff(Float_t* PedCorrCoeff)
+{
+  // Set coefficients for pedestal correlations
+  if(PedCorrCoeff){
+    for(Int_t j=0; j<2; j++){
+     for(int t=0; t<48; t++)
+       fPedCorrCoeff[j][t] = PedCorrCoeff[t];
+    }
+  }
+  else{
+    for(Int_t j=0; j<2; j++){
+     for(int t=0; t<48; t++)
+       fPedCorrCoeff[j][t] = 0.;
+    }
+  }
+}
+
+//________________________________________________________________
+void AliZDCRecParam:: SetPedCorrCoeff(Float_t* PedCorrCoeff0, Float_t* PedCorrCoeff1)
+{
+  // Set coefficients for pedestal correlations
+  if(PedCorrCoeff0 && PedCorrCoeff1){
+    for(int t=0; t<48; t++){
+       fPedCorrCoeff[0][t] = PedCorrCoeff0[t];
+       fPedCorrCoeff[0][t] = PedCorrCoeff1[t];
+    }
+  }
+  else{
+     for(int t=0; t<48; t++){
+       fPedCorrCoeff[0][t] = 0.;
+       fPedCorrCoeff[1][t] = 0.;
+    }
+  }
+}
+
+//________________________________________________________________
+void AliZDCRecParam::SetEnCalib(Float_t* EnCalib) 
+{
+  // Set energy calibration coefficients
+  if(EnCalib) for(int t=0; t<6; t++) fEnCalibration[t] = EnCalib[t];
+  else for(int t=0; t<6; t++) fEnCalibration[t] = 0.;
+}
+
+//________________________________________________________________
+void AliZDCRecParam::SetZN1EqualCoeff(Float_t* EqualCoeff)
+{
+  // Set ZN1 equalization coefficients
+  if(EqualCoeff) for(int t=0; t<5; t++) fZN1EqualCoeff[t] = EqualCoeff[t];
+  else for(int t=0; t<5; t++) fZN1EqualCoeff[t] = 1.;
+}
+//________________________________________________________________
+void AliZDCRecParam::SetZP1EqualCoeff(Float_t* EqualCoeff)
+{
+  // Set ZP1 equalization coefficients
+  if(EqualCoeff) for(int t=0; t<5; t++) fZP1EqualCoeff[t] = EqualCoeff[t];
+  else for(int t=0; t<5; t++) fZP1EqualCoeff[t] = 1.;
+}
+//________________________________________________________________
+void AliZDCRecParam::SetZN2EqualCoeff(Float_t* EqualCoeff)
+{
+  // Set ZN2 equalization coefficients
+  if(EqualCoeff) for(int t=0; t<5; t++) fZN2EqualCoeff[t] = EqualCoeff[t];
+  else for(int t=0; t<5; t++) fZN2EqualCoeff[t] = 1.;
+}
+//________________________________________________________________
+void AliZDCRecParam::SetZP2EqualCoeff(Float_t* EqualCoeff)
+{
+  // Set ZN1 equalization coefficients
+  if(EqualCoeff) for(int t=0; t<5; t++) fZP2EqualCoeff[t] = EqualCoeff[t];
+  else for(int t=0; t<5; t++) fZP2EqualCoeff[t] = 1.;
+}
diff --git a/ZDC/AliZDCRecParam.h b/ZDC/AliZDCRecParam.h
new file mode 100644 (file)
index 0000000..a202ebc
--- /dev/null
@@ -0,0 +1,131 @@
+#ifndef ALIZDCRECPARAM_H
+#define ALIZDCRECPARAM_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+////////////////////////////////////////////////
+//  class for ZDC calibration                 //
+////////////////////////////////////////////////
+
+#include "TNamed.h"
+#include "TH1.h"
+#include "AliCDBEntry.h"
+
+class AliZDC;
+
+class AliZDCRecParam: public TNamed {
+
+ public:
+  AliZDCRecParam();
+  AliZDCRecParam(const char* name);
+  AliZDCRecParam(const AliZDCRecParam &calibda);
+  AliZDCRecParam& operator= (const AliZDCRecParam &calibda);
+  virtual ~AliZDCRecParam();
+  void Reset();
+  virtual void  Print(Option_t *) const; 
+  //
+  Float_t  GetMeanPed(Int_t channel)              const {return fMeanPedestal[channel];}
+  Float_t* GetMeanPed()                   const {return (float*)fMeanPedestal;}
+  Float_t  GetMeanPedWidth(Int_t channel)  const {return fMeanPedWidth[channel];}
+  Float_t* GetMeanPedWidth()                      const {return (float*)fMeanPedWidth;}
+  Float_t  GetOOTPed(Int_t channel)       const {return fOOTPedestal[channel];}
+  Float_t* GetOOTPed()                    const {return (float*)fOOTPedestal;}
+  Float_t  GetOOTPedWidth(Int_t channel)   const {return fOOTPedWidth[channel];}
+  Float_t* GetOOTPedWidth()               const {return (float*)fOOTPedWidth;}
+  Float_t  GetPedCorrCoeff0(Int_t channel) const {return fPedCorrCoeff[0][channel];}
+  Float_t  GetPedCorrCoeff1(Int_t channel) const {return fPedCorrCoeff[1][channel];}
+  Float_t* GetPedCorrCoeff()              const {return (float*)fPedCorrCoeff;}
+  //
+  Float_t  GetEnCalib(Int_t channel)   const {return fEnCalibration[channel];}
+  Float_t* GetEnCalib()                const {return (float*)fEnCalibration;}
+  //
+  Float_t  GetZN1EqualCoeff(Int_t channel) const {return fZN1EqualCoeff[channel];}
+  Float_t* GetZN1EqualCoeffs()            const {return (float*)fZN1EqualCoeff;}
+  Float_t  GetZP1EqualCoeff(Int_t channel) const {return fZP1EqualCoeff[channel];}
+  Float_t* GetZP1EqualCoeffs()            const {return (float*)fZP1EqualCoeff;}
+  Float_t  GetZN2EqualCoeff(Int_t channel) const {return fZN2EqualCoeff[channel];}
+  Float_t* GetZN2EqualCoeffs()            const {return (float*)fZN2EqualCoeff;}
+  Float_t  GetZP2EqualCoeff(Int_t channel) const {return fZP2EqualCoeff[channel];}
+  Float_t* GetZP2EqualCoeffs()            const {return (float*)fZP2EqualCoeff;}
+  //
+  Float_t GetZEMEndValue()     const {return fZEMEndValue;}
+  Float_t GetZEMCutFraction()  const {return fZEMCutFraction;}
+  Float_t GetDZEMSup()        const {return fDZEMSup;}
+  Float_t GetDZEMInf()        const {return fDZEMInf;}
+  //
+  Float_t GetEZN1MaxValue()  const {return fEZN1MaxValue;}
+  Float_t GetEZP1MaxValue()  const {return fEZP1MaxValue;}
+  Float_t GetEZDC1MaxValue() const {return fEZDC1MaxValue;}
+  Float_t GetEZN2MaxValue()  const {return fEZN2MaxValue;}
+  Float_t GetEZP2MaxValue()  const {return fEZP2MaxValue;}
+  Float_t GetEZDC2MaxValue() const {return fEZDC2MaxValue;}
+
+  void  SetMeanPed(Int_t channel, Float_t val) {fMeanPedestal[channel]=val;}
+  void  SetMeanPed(Float_t* MeanPed);
+  void  SetMeanPedWidth(Int_t channel, Float_t val) {fMeanPedWidth[channel]=val;}
+  void  SetMeanPedWidth(Float_t* MeanPedWidth);
+  void  SetOOTPed(Int_t channel, Float_t val) {fOOTPedestal[channel]=val;}
+  void  SetOOTPed(Float_t* OOTPed);
+  void  SetOOTPedWidth(Int_t channel, Float_t val) {fOOTPedWidth[channel]=val;}
+  void  SetOOTPedWidth(Float_t* OOTPedWidth);
+  void  SetPedCorrCoeff(Int_t channel, Float_t valCoeff0, Float_t valCoeff1)
+       {fPedCorrCoeff[0][channel]=valCoeff0; fPedCorrCoeff[1][channel]=valCoeff1;}
+  void  SetPedCorrCoeff(Float_t* PedCorrCoeff);
+  void  SetPedCorrCoeff(Float_t* PedCorrCoeff0, Float_t* PedCorrCoeff1);
+  //
+  void         SetEnCalib(Int_t channel, Float_t val) {fEnCalibration[channel]=val;}
+  void         SetEnCalib(Float_t* EnCalib);
+  //
+  void         SetZN1EqualCoeff(Int_t channel, Float_t val) {fZN1EqualCoeff[channel]=val;}
+  void         SetZN1EqualCoeff(Float_t* EqualCoeff);
+  void         SetZP1EqualCoeff(Int_t channel, Float_t val) {fZP1EqualCoeff[channel]=val;}
+  void         SetZP1EqualCoeff(Float_t* EqualCoeff);
+  void         SetZN2EqualCoeff(Int_t channel, Float_t val) {fZN2EqualCoeff[channel]=val;}
+  void         SetZN2EqualCoeff(Float_t* EqualCoeff);
+  void         SetZP2EqualCoeff(Int_t channel, Float_t val) {fZP2EqualCoeff[channel]=val;}
+  void         SetZP2EqualCoeff(Float_t* EqualCoeff);
+  //  
+  void  SetZEMEndValue(Float_t ZEMEndValue) {fZEMEndValue = ZEMEndValue;}
+  void  SetZEMCutFraction(Float_t ZEMCutFraction) {fZEMCutFraction = ZEMCutFraction;}
+  void  SetDZEMSup(Float_t DZEMSup) {fDZEMSup = DZEMSup;}
+  void  SetDZEMInf(Float_t DZEMInf) {fDZEMInf = DZEMInf;}
+  //
+  void SetEZN1MaxValue(Float_t value)  {fEZN1MaxValue = value;}
+  void SetEZP1MaxValue(Float_t value)  {fEZP1MaxValue = value;}
+  void SetEZDC1MaxValue(Float_t value) {fEZDC1MaxValue = value;}
+  void SetEZN2MaxValue(Float_t value)  {fEZN2MaxValue = value;}
+  void SetEZP2MaxValue(Float_t value)  {fEZP2MaxValue = value;}
+  void SetEZDC2MaxValue(Float_t value) {fEZDC2MaxValue = value;}
+  
+ protected:
+  // --- Pedestals
+  Float_t  fMeanPedestal[48];   // Mean pedestal values 
+  Float_t  fMeanPedWidth[48];   // Mean pedestal widths 
+  Float_t  fOOTPedestal[48];    // "Out of Time" pedestal values
+  Float_t  fOOTPedWidth[48];    // "Out of Time" pedestal widths
+  Float_t  fPedCorrCoeff[2][48]; // Fit of correlation in-time vs. out-of-time
+  // --- E calibration
+  Float_t  fEnCalibration[6];   // Coeff. for energy calibration
+  // --- Coefficients for tower calibration
+  Float_t  fZN1EqualCoeff[5];   // Equalization coefficients for ZN1 PTMs
+  Float_t  fZP1EqualCoeff[5];   // Equalization coefficients for ZN1 PTMs
+  Float_t  fZN2EqualCoeff[5];   // Equalization coefficients for ZN1 PTMs
+  Float_t  fZP2EqualCoeff[5];   // Equalization coefficients for ZN1 PTMs
+  // --- Coefficients for centrality selection from ZEM signal
+  Float_t  fZEMEndValue;        // End point value of ZEM energy spectrum
+  Float_t  fZEMCutFraction;     // Fraction of ZEM energy spectrum used to cut
+  Float_t  fDZEMSup;// Upper value of EZDCvs.ZEM correlation where ZEM signal is used
+  Float_t  fDZEMInf;// Lower value of EZDCvs.ZEM correlation where ZEM signal is used
+  // --- Parameters from EZDC vs. Nspec correlation
+  Float_t  fEZN1MaxValue;       // Max value of ZN1 vs. Nspec n correlation
+  Float_t  fEZP1MaxValue;       // Max value of ZP1 vs. Nspec p correlation
+  Float_t  fEZDC1MaxValue;      // Max value of ZDC1 vs. Nspec n+p correlation
+  Float_t  fEZN2MaxValue;       // Max value of ZN2 vs. Nspec n correlation
+  Float_t  fEZP2MaxValue;       // Max value of ZP2 vs. Nspec p correlation
+  Float_t  fEZDC2MaxValue;      // Max value of ZDC2 vs. Nspec n+p correlation
+  //
+  ClassDef(AliZDCRecParam,11)    // ZDC  Calibration data
+};
+
+#endif
index 68f419a..41a103b 100644 (file)
@@ -31,7 +31,9 @@
 #include "AliZDCRawStream.h"
 #include "AliZDCReco.h"
 #include "AliZDCReconstructor.h"
-#include "AliZDCCalibData.h"
+#include "AliZDCPedestals.h"
+#include "AliZDCCalib.h"
+#include "AliZDCRecParam.h"
 
 
 ClassImp(AliZDCReconstructor)
@@ -61,8 +63,9 @@ AliZDCReconstructor:: AliZDCReconstructor() :
   fZEMb(new TF1("fZEMb",
        "13.83-0.02851*x+5.101e-5*x*x-7.305e-8*x*x*x+5.101e-11*x*x*x*x-1.25e-14*x*x*x*x*x",0.,1200.)),
   //
-  fCalibData(GetCalibData())
-
+  fPedData(GetPedData()),
+  fECalibData(GetECalibData()),
+  fRecParam(GetRecParams())
 {
   // **** Default constructor
 
@@ -98,7 +101,7 @@ void AliZDCReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) co
     
   // Retrieving calibration data  
   Float_t meanPed[47];
-  for(Int_t jj=0; jj<47; jj++) meanPed[jj] = fCalibData->GetMeanPed(jj);
+  for(Int_t jj=0; jj<47; jj++) meanPed[jj] = fPedData->GetMeanPed(jj);
 
   // get digits
   AliZDCDigit digit;
@@ -203,7 +206,7 @@ void AliZDCReconstructor::Reconstruct(AliRawReader* rawReader, TTree* clustersTr
   
   // Retrieving calibration data  
   Float_t meanPed[47];
-  for(Int_t jj=0; jj<47; jj++) meanPed[jj] = fCalibData->GetMeanPed(jj);
+  for(Int_t jj=0; jj<47; jj++) meanPed[jj] = fPedData->GetMeanPed(jj);
 
   rawReader->Reset();
 
@@ -320,31 +323,31 @@ void AliZDCReconstructor::ReconstructEvent(TTree *clustersTree,
   // --- Equalization coefficients ---------------------------------------------
   Float_t equalCoeffZN1[5], equalCoeffZP1[5], equalCoeffZN2[5], equalCoeffZP2[5];
   for(Int_t ji=0; ji<5; ji++){
-     equalCoeffZN1[ji] = fCalibData->GetZN1EqualCoeff(ji);
-     equalCoeffZP1[ji] = fCalibData->GetZP1EqualCoeff(ji); 
-     equalCoeffZN2[ji] = fCalibData->GetZN2EqualCoeff(ji); 
-     equalCoeffZP2[ji] = fCalibData->GetZP2EqualCoeff(ji); 
+     equalCoeffZN1[ji] = fECalibData->GetZN1EqualCoeff(ji);
+     equalCoeffZP1[ji] = fECalibData->GetZP1EqualCoeff(ji); 
+     equalCoeffZN2[ji] = fECalibData->GetZN2EqualCoeff(ji); 
+     equalCoeffZP2[ji] = fECalibData->GetZP2EqualCoeff(ji); 
   }
   // --- Energy calibration factors ------------------------------------
   Float_t calibEne[4];
-  for(Int_t ij=0; ij<4; ij++) calibEne[ij] = fCalibData->GetEnCalib(ij);
+  for(Int_t ij=0; ij<4; ij++) calibEne[ij] = fECalibData->GetEnCalib(ij);
   //
   // --- Reconstruction parameters ------------------
-  Float_t endPointZEM = fCalibData->GetZEMEndValue();
-  Float_t cutFractionZEM = fCalibData->GetZEMCutFraction();
-  Float_t dZEMSup = fCalibData->GetDZEMSup();
-  Float_t dZEMInf = fCalibData->GetDZEMInf();
+  Float_t endPointZEM = fRecParam->GetZEMEndValue();
+  Float_t cutFractionZEM = fRecParam->GetZEMCutFraction();
+  Float_t dZEMSup = fRecParam->GetDZEMSup();
+  Float_t dZEMInf = fRecParam->GetDZEMInf();
   //
   Float_t cutValueZEM = endPointZEM*cutFractionZEM;
   Float_t supValueZEM = cutValueZEM+(endPointZEM*dZEMSup);
   Float_t infValueZEM = cutValueZEM-(endPointZEM*dZEMInf);
   //
-  Float_t maxValEZN1 = fCalibData->GetEZN1MaxValue();
-  Float_t maxValEZP1 = fCalibData->GetEZP1MaxValue();
-  Float_t maxValEZDC1 = fCalibData->GetEZDC1MaxValue();
-  Float_t maxValEZN2 = fCalibData->GetEZN2MaxValue();
-  Float_t maxValEZP2 = fCalibData->GetEZP2MaxValue();
-  Float_t maxValEZDC2 = fCalibData->GetEZDC2MaxValue();
+  Float_t maxValEZN1 = fRecParam->GetEZN1MaxValue();
+  Float_t maxValEZP1 = fRecParam->GetEZP1MaxValue();
+  Float_t maxValEZDC1 = fRecParam->GetEZDC1MaxValue();
+  Float_t maxValEZN2 = fRecParam->GetEZN2MaxValue();
+  Float_t maxValEZP2 = fRecParam->GetEZP2MaxValue();
+  Float_t maxValEZDC2 = fRecParam->GetEZDC2MaxValue();
   //
   //printf("\n\t AliZDCReconstructor -> ZEMEndPoint %1.0f, ZEMCutValue %1.0f,"
   //   " ZEMSupValue %1.0f, ZEMInfValue %1.0f\n",endPointZEM,cutValueZEM,supValueZEM,infValueZEM);
@@ -575,15 +578,45 @@ AliCDBStorage* AliZDCReconstructor::SetStorage(const char *uri)
 }
 
 //_____________________________________________________________________________
-AliZDCCalibData* AliZDCReconstructor::GetCalibData() const
+AliZDCPedestals* AliZDCReconstructor::GetPedData() const
+{
+
+  // Getting pedestal calibration object for ZDC set
+
+  AliCDBEntry  *entry = AliCDBManager::Instance()->Get("ZDC/Calib/Pedestals");
+  if(!entry) AliFatal("No calibration data loaded!");  
+
+  AliZDCPedestals *calibdata = dynamic_cast<AliZDCPedestals*>  (entry->GetObject());
+  if(!calibdata)  AliFatal("Wrong calibration object in calibration  file!");
+
+  return calibdata;
+}
+
+//_____________________________________________________________________________
+AliZDCCalib* AliZDCReconstructor::GetECalibData() const
+{
+
+  // Getting energy and equalization calibration object for ZDC set
+
+  AliCDBEntry  *entry = AliCDBManager::Instance()->Get("ZDC/Calib/Calib");
+  if(!entry) AliFatal("No calibration data loaded!");  
+
+  AliZDCCalib *calibdata = dynamic_cast<AliZDCCalib*>  (entry->GetObject());
+  if(!calibdata)  AliFatal("Wrong calibration object in calibration  file!");
+
+  return calibdata;
+}
+
+//_____________________________________________________________________________
+AliZDCRecParam* AliZDCReconstructor::GetRecParams() const
 {
 
-  // Getting calibration object for ZDC set
+  // Getting energy and equalization calibration object for ZDC set
 
-  AliCDBEntry  *entry = AliCDBManager::Instance()->Get("ZDC/Calib/Data");
+  AliCDBEntry  *entry = AliCDBManager::Instance()->Get("ZDC/Calib/RecParam");
   if(!entry) AliFatal("No calibration data loaded!");  
 
-  AliZDCCalibData *calibdata = dynamic_cast<AliZDCCalibData*>  (entry->GetObject());
+  AliZDCRecParam *calibdata = dynamic_cast<AliZDCRecParam*>  (entry->GetObject());
   if(!calibdata)  AliFatal("Wrong calibration object in calibration  file!");
 
   return calibdata;
index 429cda2..3457567 100644 (file)
@@ -14,7 +14,9 @@
 #include "AliReconstructor.h"
 #include "AliCDBManager.h"
 #include "AliCDBStorage.h"
-#include "AliZDCCalibData.h"
+#include "AliZDCPedestals.h"
+#include "AliZDCCalib.h"
+#include "AliZDCRecParam.h"
 #include "AliLog.h"
 
 class TF1;
@@ -36,7 +38,9 @@ public:
                {FillZDCintoESD(clustersTree,esd);}
     
   AliCDBStorage   *SetStorage(const char* uri);
-  AliZDCCalibData *GetCalibData() const; 
+  AliZDCPedestals *GetPedData() const; 
+  AliZDCCalib     *GetECalibData() const; 
+  AliZDCRecParam  *GetRecParams() const; 
   
 private:
   AliZDCReconstructor(const AliZDCReconstructor&);
@@ -62,9 +66,11 @@ private:
   TF1*   fZEMsp;     //! Nspectators from ZEM energy
   TF1*   fZEMb;      //! b from ZEM energy
   
-  AliZDCCalibData *fCalibData;         //! calibration data
+  AliZDCPedestals *fPedData;   //! pedestal calibration data
+  AliZDCCalib     *fECalibData; //! energy and equalization calibration data
+  AliZDCRecParam  *fRecParam;  //! reconstruction parameters
 
-  ClassDef(AliZDCReconstructor, 2)   // class for the ZDC reconstruction
+  ClassDef(AliZDCReconstructor, 3)   // class for the ZDC reconstruction
 };
 
 #endif
index 1f4697e..7a04981 100644 (file)
@@ -62,15 +62,16 @@ void TestZDCPreprocessor()
   // Note that the test preprocessor name is TPC. The name of the detector's preprocessor must follow
   // the "online" naming convention ALICE-INT-2003-039.
   shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "PEDESTALS", "LDC0", "ZDCPedestal.dat");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "EMDCALIB", "LDC0", "ZDCEMDCalib.dat");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "PHYSICS", "LDC0", "ZDCRecParam.dat");
+  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "EMDCALIB",  "LDC0", "ZDCEMDCalib.dat");
+  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "EMDCALIB",  "LDC0", "ZDCEMDEqual.dat");
+  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "PHYSICS",   "LDC0", "ZDCRecParam.dat");
 
   // TODO(3)
   //
   // The shuttle can read run type stored in the DAQ logbook.
   // To test it, we must provide the run type manually. They will be retrieved in the preprocessor
   // using GetRunType function.
-//  shuttle->SetInputRunType("PEDESTALS");
+//  shuttle->SetInputRunType("PEDESTAL_RUN");
 //  shuttle->SetInputRunType("PULSER_RUN");
   shuttle->SetInputRunType("PHYSICS");
 
@@ -119,8 +120,15 @@ void TestZDCPreprocessor()
   // $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB/<detector>/SHUTTLE/Data
   //
   // Check the file which should have been created
+  /*AliCDBEntry* chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
+                       ->Get("ZDC/Calib/Pedestals", 7);
+  */
+  /*AliCDBEntry* chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
+                       ->Get("ZDC/Calib/Calib", 7);
+  */
   AliCDBEntry* chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
-                       ->Get("ZDC/Calib/Data", 7);
+                       ->Get("ZDC/Calib/RecParam", 7);
+  
   if (!chkEntry)
   {
     printf("The file is not there. Something went wrong.\n");
index 7df951a..848f55d 100644 (file)
@@ -10,7 +10,9 @@
  
 #pragma link C++ class  AliZDCDigit+;
 #pragma link C++ class  AliZDCRawStream+;
-#pragma link C++ class  AliZDCCalibData+;
+#pragma link C++ class  AliZDCPedestals+;
+#pragma link C++ class  AliZDCCalib+;
+#pragma link C++ class  AliZDCRecParam+;
 #pragma link C++ class  AliZDCDataDCS+;
 #pragma link C++ class  AliZDCPreprocessor+;
 
index 55b6ba1..2d29ea9 100644 (file)
@@ -2,7 +2,8 @@
 # $Id$
 
 SRCS= AliZDCDigit.cxx AliZDCRawStream.cxx \
-      AliZDCCalibData.cxx AliZDCDataDCS.cxx AliZDCPreprocessor.cxx
+      AliZDCPedestals.cxx AliZDCCalib.cxx AliZDCRecParam.cxx \
+      AliZDCDataDCS.cxx AliZDCPreprocessor.cxx
 
 HDRS= $(SRCS:.cxx=.h)