]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/AliZDCReconstructor.h
Propagate correction for ladder swap on layer 3 in SDD macros (F. Prino)
[u/mrichter/AliRoot.git] / ZDC / AliZDCReconstructor.h
index 78175d19cc22259931f48611e53975b922b2515c..139b2a5dc0bb6d746c905ff165232520afc4e4a6 100644 (file)
@@ -5,18 +5,23 @@
 
 /* $Id$ */
 
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-// class for ZDC reconstruction                                              //
-//                                                                           //
-///////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////
+//                                        //
+//       class for ZDC reconstruction      //
+//                                        //
+/////////////////////////////////////////////
 
 #include "AliReconstructor.h"
 #include "AliCDBManager.h"
 #include "AliCDBStorage.h"
-#include "AliZDCCalibData.h"
+#include "AliZDCPedestals.h"
+#include "AliZDCEnCalib.h"
+#include "AliZDCTowerCalib.h"
+#include "AliZDCRecoParam.h"
+#include "AliZDCRecoParampp.h"
+#include "AliZDCRecoParamPbPb.h"
+#include "AliLog.h"
 
-class TF1;
 class AliLoader;
 
 class AliZDCReconstructor: public AliReconstructor {
@@ -24,47 +29,74 @@ public:
   AliZDCReconstructor();
   virtual ~AliZDCReconstructor();
 
-  virtual void Reconstruct(AliRunLoader* runLoader) const;
-  virtual void Reconstruct(AliRunLoader* runLoader,
-               AliRawReader* rawReader) const;
-  virtual void Reconstruct(TTree* digitsTree, TTree* clustersTree) const 
-               {AliReconstructor::Reconstruct(digitsTree,clustersTree);}
-  virtual void Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const 
-               {AliReconstructor::Reconstruct(rawReader,clustersTree);}
-  virtual void FillESD(AliRunLoader* runLoader, AliESDEvent* esd) const;
-  virtual void FillESD(TTree* digitsTree, TTree* clustersTree, AliESDEvent* esd) const 
-               {AliReconstructor::FillESD(digitsTree,clustersTree,esd);}
-  virtual void FillESD(AliRawReader* rawReader, TTree* clustersTree, AliESDEvent* esd) const 
-               {AliReconstructor::FillESD(rawReader,clustersTree,esd);}
-  virtual void FillESD(AliRunLoader* runLoader, AliRawReader* rawReader, AliESDEvent* esd) const 
-                 {AliReconstructor::FillESD(runLoader,rawReader,esd);}
+  virtual void   Init();
+  virtual Bool_t HasDigitConversion() const {return kFALSE;};
   
-  AliCDBStorage   *SetStorage(const char* uri);
-  AliZDCCalibData *GetCalibData() const; 
+  virtual void Reconstruct(TTree* digitsTree, TTree* clustersTree) const; 
+  virtual void Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const;
+
+  virtual void FillESD(TTree* /*digitsTree*/, TTree* clustersTree, AliESDEvent* esd) const 
+               {FillZDCintoESD(clustersTree, esd);}
+  virtual void FillESD(AliRawReader* /*rawReader*/, TTree* clustersTree, AliESDEvent* esd) const 
+               {FillZDCintoESD(clustersTree, esd);}
+  
+  // parameter settings for reconstruction
+  void SetRecoMode(Int_t recoMode, Float_t beamEnergy) 
+                 {fRecoMode=recoMode; fBeamEnergy=beamEnergy;}
+  static void SetRecoParam(AliZDCRecoParam * param){fRecoParam = param;}
+  
+  Int_t   GetRecoMode() {return fRecoMode;}
+  Float_t GetBeamEnergy() {return fBeamEnergy;}
+  
+  static const AliZDCRecoParam* GetRecoParam() {return dynamic_cast<const AliZDCRecoParam*>(AliReconstructor::GetRecoParam(9));}
+
+  void  SetPedSubMode(Int_t pedsubMode) {fPedSubMode=pedsubMode;}
+  Int_t GetPedSubMode() {return fPedSubMode;}
+  
+  void    SetSignalThreshold(Float_t val) {fSignalThreshold=val;}
+  Float_t GetSignalThreshold() {return fSignalThreshold;}
+  
+  // OCDB objects for reconstruction
+  AliCDBStorage       *SetStorage(const char* uri);
+  AliZDCPedestals     *GetPedestalData() const; 
+  AliZDCEnCalib       *GetEnergyCalibData() const; 
+  AliZDCTowerCalib    *GetTowerCalibData() const; 
+  AliZDCRecoParampp   *GetppRecoParamFromOCDB() const;  
+  AliZDCRecoParamPbPb *GetPbPbRecoParamFromOCDB() const;  
+  
+  void WritePbPbRecoParamInOCDB() const;
 
 private:
   AliZDCReconstructor(const AliZDCReconstructor&);
   AliZDCReconstructor& operator =(const AliZDCReconstructor&);
 
-  void   ReconstructEvent(AliLoader* loader, Float_t zn1corr, Float_t zp1corr, Float_t zemcorr,
-               Float_t zn2corr, Float_t zp2corr) const;
+  void   ReconstructEventpp(TTree *clustersTree, 
+           Float_t* ZN1ADCCorr, Float_t* ZP1ADCCorr, Float_t* ZN2ADCCorr, Float_t* ZP2ADCCorr,
+           Float_t* ZEM1ADCCorr, Float_t* ZEM2ADCCorr, Float_t* PMRef1, Float_t* PMRef2,
+           Bool_t channelsOff, Bool_t chUnderflow, Bool_t chOverflow) const;
+  void   ReconstructEventPbPb(TTree *clustersTree, 
+           Float_t* ZN1ADCCorr, Float_t* ZP1ADCCorr, Float_t* ZN2ADCCorr, Float_t* ZP2ADCCorr,
+           Float_t* ZEM1ADCCorr, Float_t* ZEM2ADCCorr, Float_t* PMRef1, Float_t* PMRef2,
+           Bool_t channelsOff, Bool_t chUnderflow, Bool_t chOverflow) const;
+  void   BuildRecoParam(Float_t ZDCC, Float_t ZDCA, Float_t ZEM) const;
+  
+  void   FillZDCintoESD(TTree *clustersTree, AliESDEvent*esd) const;
+
+
+  static AliZDCRecoParam *fRecoParam; // reconstruction parameters
 
-  TF1*   fZNCen;     //! Nspectator n true vs. EZN
-  TF1*   fZNPer;     //! Nspectator n true vs. EZN
-  TF1*   fZPCen;     //! Nspectator p true vs. EZP
-  TF1*   fZPPer;     //! Nspectator p true vs. EZP
-  TF1*   fZDCCen;    //! Nspectators true vs. EZDC
-  TF1*   fZDCPer;    //! Nspectators true vs. EZDC
-  TF1*   fbCen;      //! b vs. EZDC
-  TF1*   fbPer;      //! b vs. EZDC
-  TF1*   fZEMn;      //! Nspectators n from ZEM energy
-  TF1*   fZEMp;      //! Nspectators p from ZEM energy
-  TF1*   fZEMsp;     //! Nspectators from ZEM energy
-  TF1*   fZEMb;      //! b from ZEM energy
+  AliZDCPedestals  *fPedData;      //! pedestal calibration data
+  AliZDCEnCalib    *fEnCalibData;   //! energy calibration data
+  AliZDCTowerCalib *fTowCalibData;  //! equalization calibration data
   
-  AliZDCCalibData *fCalibData;         //! calibration data
+  Int_t   fRecoMode;       // =1->p-p, =2->A-A
+  Float_t fBeamEnergy;     // beam energy
+  Int_t          fNRun;            // Run Number (from raw data)
+  Bool_t  fIsCalibrationMB; // true if run type = "CALIBRATION_MB"
+  Int_t   fPedSubMode;     // =0->mean values, =1->from correlations
+  Float_t fSignalThreshold; // Threshold value for "triggering" in p-p
 
-  ClassDef(AliZDCReconstructor, 1)   // class for the ZDC reconstruction
+  ClassDef(AliZDCReconstructor, 9)   // class for the ZDC reconstruction
 };
 
 #endif