ROOT logo
#ifndef ALIEMCALLOADER_H
#define ALIEMCALLOADER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id$ */

//_________________________________________________________________________
//  The AliEMCALLoader gets the TClonesArray and TObjArray for reading
//  Hits, Dgits, SDigits and RecPoints. Filling is managed in the GetEvent()
//  method. The objects are retrived from  the corresponding folders.  
//
//  It also provides acces methods to the calibration and simulation OCDB parameters 
//

//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
//    


// --- ROOT system ---
#include "TClonesArray.h"
#include "TFolder.h"  
#include "TTree.h"
class TString ;
class TParticle ;

// --- AliRoot header files ---
#include "AliLoader.h"
#include "AliEMCALCalibData.h"
#include "AliCaloCalibPedestal.h"
#include "AliEMCALSimParam.h"
#include "AliEMCALRecParam.h"

class AliLoader ;
class AliEMCAL ; 
class AliEMCALDigit ;
class AliEMCALSDigit ;
class AliEMCALRecPoint ; 

class AliEMCALLoader : public AliLoader {
  
 public:

  AliEMCALLoader();
  AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername); 
  AliEMCALLoader(const Char_t *name,TFolder *topfolder);
  
  virtual ~AliEMCALLoader() ; 

  virtual Int_t GetEvent();  // Overload to fill TClonesArray

  //Clean arrays methods
  virtual void    CleanHits() const {GetHitsDataLoader()->Clean();}       
  virtual void    CleanSDigits() const {GetSDigitsDataLoader()->Clean();}  
  virtual void    CleanDigits() const {GetDigitsDataLoader()->Clean();}  
  virtual void    CleanRecPoints() const {GetRecPointsDataLoader()->Clean();}  
  
  // Initialize arrays methods
  void MakeSDigitsArray() ;
  void MakeDigitsArray() ;
  void MakeRecPointsArray() ;
  
  // ************    TClonesArrays Access functions
  
  TClonesArray*  SDigits() {return (TClonesArray*)GetDetectorData(fgkECASDigitsBranchName);} //const { return fSDigits;}
  const AliEMCALDigit*  SDigit(Int_t index)  {
    if (SDigits())return (const AliEMCALDigit*) SDigits()->At(index);
    return 0x0; 
  }
  
  TClonesArray*   Digits() {return (TClonesArray*)GetDetectorData(fgkECADigitsBranchName);}//const { return fDigits;}
  const AliEMCALDigit *  Digit(Int_t index)  {
    if (Digits()) return (const AliEMCALDigit*) Digits()->At(index);
    return 0x0; 
  }
  
  TObjArray * RecPoints()  {return (TObjArray*)GetDetectorData(fgkECARecPointsBranchName);}//const { return fRecPoints;}
  const AliEMCALRecPoint * RecPoint(Int_t index)  {
    if (RecPoints())return (const AliEMCALRecPoint*) RecPoints()->At(index);
    return 0x0; 
  }
  
  void   SetDebug(Int_t level) {fDebug = level;} // Set debug level
  
  //OCDB access methods
  
  void  SetCalibData(AliEMCALCalibData* calibda)  { fgCalibData = calibda; }
  AliEMCALCalibData * CalibData();              // to get the calibration CDB object
  
  void  SetPedestalData(AliCaloCalibPedestal* caloped)  { fgCaloPed = caloped; }
  AliCaloCalibPedestal* PedestalData();         // to get the pedestal CDB object
  
  void  SetSimParam(AliEMCALSimParam* simparam)  { fgSimParam = simparam; }
  AliEMCALSimParam* SimulationParameters();     // to get the simulation parameter CDB object
  
  void  SetRecParam(AliEMCALRecParam* recparam)  { fgRecParam = recparam; }
  AliEMCALRecParam* ReconstructionParameters(Int_t eventType); // to get the reconstruction parameter CDB object

 private:
  
  // assignement operator requested by coding convention, but not needed
  AliEMCALLoader(const AliEMCALLoader &); //Not implemented
  const AliEMCALLoader & operator = (const AliEMCALLoader &); //Not implemented
  
  static const TString fgkECASDigitsBranchName;   //! Name of branch with ECA SDigits
  static const TString fgkECADigitsBranchName;    //! Name of branch with ECA Digits
  static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points
  
  Int_t  fDebug ;             // Debug level
	
  static AliEMCALCalibData    * fgCalibData;  //  calibration data 
  static AliCaloCalibPedestal * fgCaloPed;    //  dead map
  static AliEMCALSimParam     * fgSimParam;   //  sim param 
  static AliEMCALRecParam     * fgRecParam;   //  rec param 

  ClassDef(AliEMCALLoader,7)  // Algorithm class that provides methods to retrieve objects from a list knowing the index 
    
};

#endif // AliEMCALLOADER_H
 AliEMCALLoader.h:1
 AliEMCALLoader.h:2
 AliEMCALLoader.h:3
 AliEMCALLoader.h:4
 AliEMCALLoader.h:5
 AliEMCALLoader.h:6
 AliEMCALLoader.h:7
 AliEMCALLoader.h:8
 AliEMCALLoader.h:9
 AliEMCALLoader.h:10
 AliEMCALLoader.h:11
 AliEMCALLoader.h:12
 AliEMCALLoader.h:13
 AliEMCALLoader.h:14
 AliEMCALLoader.h:15
 AliEMCALLoader.h:16
 AliEMCALLoader.h:17
 AliEMCALLoader.h:18
 AliEMCALLoader.h:19
 AliEMCALLoader.h:20
 AliEMCALLoader.h:21
 AliEMCALLoader.h:22
 AliEMCALLoader.h:23
 AliEMCALLoader.h:24
 AliEMCALLoader.h:25
 AliEMCALLoader.h:26
 AliEMCALLoader.h:27
 AliEMCALLoader.h:28
 AliEMCALLoader.h:29
 AliEMCALLoader.h:30
 AliEMCALLoader.h:31
 AliEMCALLoader.h:32
 AliEMCALLoader.h:33
 AliEMCALLoader.h:34
 AliEMCALLoader.h:35
 AliEMCALLoader.h:36
 AliEMCALLoader.h:37
 AliEMCALLoader.h:38
 AliEMCALLoader.h:39
 AliEMCALLoader.h:40
 AliEMCALLoader.h:41
 AliEMCALLoader.h:42
 AliEMCALLoader.h:43
 AliEMCALLoader.h:44
 AliEMCALLoader.h:45
 AliEMCALLoader.h:46
 AliEMCALLoader.h:47
 AliEMCALLoader.h:48
 AliEMCALLoader.h:49
 AliEMCALLoader.h:50
 AliEMCALLoader.h:51
 AliEMCALLoader.h:52
 AliEMCALLoader.h:53
 AliEMCALLoader.h:54
 AliEMCALLoader.h:55
 AliEMCALLoader.h:56
 AliEMCALLoader.h:57
 AliEMCALLoader.h:58
 AliEMCALLoader.h:59
 AliEMCALLoader.h:60
 AliEMCALLoader.h:61
 AliEMCALLoader.h:62
 AliEMCALLoader.h:63
 AliEMCALLoader.h:64
 AliEMCALLoader.h:65
 AliEMCALLoader.h:66
 AliEMCALLoader.h:67
 AliEMCALLoader.h:68
 AliEMCALLoader.h:69
 AliEMCALLoader.h:70
 AliEMCALLoader.h:71
 AliEMCALLoader.h:72
 AliEMCALLoader.h:73
 AliEMCALLoader.h:74
 AliEMCALLoader.h:75
 AliEMCALLoader.h:76
 AliEMCALLoader.h:77
 AliEMCALLoader.h:78
 AliEMCALLoader.h:79
 AliEMCALLoader.h:80
 AliEMCALLoader.h:81
 AliEMCALLoader.h:82
 AliEMCALLoader.h:83
 AliEMCALLoader.h:84
 AliEMCALLoader.h:85
 AliEMCALLoader.h:86
 AliEMCALLoader.h:87
 AliEMCALLoader.h:88
 AliEMCALLoader.h:89
 AliEMCALLoader.h:90
 AliEMCALLoader.h:91
 AliEMCALLoader.h:92
 AliEMCALLoader.h:93
 AliEMCALLoader.h:94
 AliEMCALLoader.h:95
 AliEMCALLoader.h:96
 AliEMCALLoader.h:97
 AliEMCALLoader.h:98
 AliEMCALLoader.h:99
 AliEMCALLoader.h:100
 AliEMCALLoader.h:101
 AliEMCALLoader.h:102
 AliEMCALLoader.h:103
 AliEMCALLoader.h:104
 AliEMCALLoader.h:105
 AliEMCALLoader.h:106
 AliEMCALLoader.h:107
 AliEMCALLoader.h:108
 AliEMCALLoader.h:109
 AliEMCALLoader.h:110
 AliEMCALLoader.h:111
 AliEMCALLoader.h:112
 AliEMCALLoader.h:113
 AliEMCALLoader.h:114
 AliEMCALLoader.h:115
 AliEMCALLoader.h:116
 AliEMCALLoader.h:117
 AliEMCALLoader.h:118
 AliEMCALLoader.h:119
 AliEMCALLoader.h:120