]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/EMCAL/AliAnalysisTaskEMCALClusterizeFast.h
protections against failures in deleting event content
[u/mrichter/AliRoot.git] / PWG / EMCAL / AliAnalysisTaskEMCALClusterizeFast.h
1 #ifndef ALIANALYSISTASKEMCALCLUSTERIZEFAST_H
2 #define ALIANALYSISTASKEMCALCLUSTERIZEFAST_H
3
4 // $Id$
5
6 class TObjArray;
7 class TClonesArray;
8 class AliAODEvent;
9 class AliESDEvent;
10 class AliEMCALCalibData;
11 class AliCaloCalibPedestal;
12 class AliEMCALClusterizer;
13 class AliEMCALAfterBurnerUF;
14 class AliEMCALRecParam;
15 class AliEMCALRecoUtils;
16
17 #include "AliAnalysisTaskSE.h"
18
19 class AliAnalysisTaskEMCALClusterizeFast : public AliAnalysisTaskSE {
20  public:
21   enum InputCellType {
22     kFEEData = 0,
23     kPattern,
24     kL0FastORs,
25     kL0FastORsTC,
26     kL1FastORs
27   };
28   
29
30   AliAnalysisTaskEMCALClusterizeFast();
31   AliAnalysisTaskEMCALClusterizeFast(const char *name);
32   virtual ~AliAnalysisTaskEMCALClusterizeFast();
33   
34  public:
35   virtual void           UserCreateOutputObjects();
36   virtual void           UserExec(Option_t *option);
37
38   Bool_t                 GetAttachClusters()                          const   { return fAttachClusters               ; }
39   Bool_t                 GetRecalibrateOnly()                         const   { return fRecalibOnly                  ; }
40   Bool_t                 GetSubBackground()                           const   { return fSubBackground                ; }
41   const TObjArray       *GetClusters()                                const   { return fClusterArr                   ; }
42   const TClonesArray    *GetDigits()                                  const   { return fDigitsArr                    ; }
43   const TString         &GeometryName()                               const   { return fGeomName                     ; }  
44   AliEMCALRecParam      *GetRecParam()                                const   { return fRecParam                     ; }
45   AliEMCALRecoUtils     *GetRecoUtils()                               const   { return fRecoUtils                    ; }
46   AliEMCALCalibData     *GetCalibData()                               const   { return fCalibData                    ; }
47   AliCaloCalibPedestal  *GetPedData()                                 const   { return fPedestalData                 ; }
48   TGeoHMatrix           *GetGeometryMatrix(Int_t i)                   const   { return fGeomMatrix[i]                ; }
49   Bool_t                 GetOverwrite()                               const   { return fOverwrite                    ; }
50   const TString         &GetNewClusterArrayName()                     const   { return fNewClusterArrayName          ; }
51   Int_t                  GetnPhi()                                    const   { return fNPhi                         ; }
52   Int_t                  GetnEta()                                    const   { return fNEta                         ; }
53   Int_t                  GetShiftPhi()                                const   { return fShiftPhi                     ; }
54   Int_t                  GetShiftEta()                                const   { return fShiftEta                     ; }
55   Bool_t                 GetTRUShift()                                const   { return fTRUShift                     ; }
56   InputCellType          GetInputCellType()                           const   { return fInputCellType                ; }
57   void                   JustUnfold(Bool_t yesno)                             { fJustUnfold                  = yesno ; }
58   void                   LoadOwnGeometryMatrices(Bool_t b)                    { fLoadGeomMatrices            = b     ; }
59   void                   SetAODBranchName(const char *name)                   { fOutputAODBrName             = name  ; }
60   void                   SetAttachClusters(Bool_t b)                          { fAttachClusters              = b     ; }
61   void                   SetCalibData(AliEMCALCalibData *d)                   { fCalibData                   = d     ; }
62   void                   SetEMCALRecoUtils(AliEMCALRecoUtils *ru)             { fRecoUtils                   = ru    ; }
63   void                   SetGeometryMatrix(TGeoHMatrix* m, Int_t i)           { fGeomMatrix[i]               = m     ; }
64   void                   SetGeometryName(const char *name)                    { fGeomName                    = name  ; }
65   void                   SetLoadCalib(Bool_t b)                               { fLoadCalib                   = b     ; }
66   void                   SetLoadPed(Bool_t b)                                 { fLoadPed                     = b     ; }
67   void                   SetOCDBPath(const char *path)                        { fOCDBpath                    = path  ; }
68   void                   SetPedestalData(AliCaloCalibPedestal *d)             { fPedestalData                = d     ; }
69   void                   SetRecalibrateCellsOnly(Bool_t b)                    { fRecalibOnly                 = b     ; }
70   void                   SetSubBackground(Bool_t b)                           { fSubBackground               = b     ; }
71   void                   SetOverwrite(Bool_t yes)                             { fOverwrite                   = yes   ; }
72   void                   SetNewClusterArrayName(const char *name)             { fNewClusterArrayName         = name  ; }
73   void                   SetnPhi(Int_t n)                                     { fNPhi                        = n     ; }
74   void                   SetnEta(Int_t n)                                     { fNEta                        = n     ; }
75   void                   SetShiftPhi(Int_t n)                                 { fShiftPhi                    = n     ; }
76   void                   SetShiftEta(Int_t n)                                 { fShiftEta                    = n     ; }
77   void                   SetTRUShift(Bool_t yes)                              { fTRUShift                    = yes   ; }
78   void                   SetInputCellType(InputCellType ic)                   { fInputCellType               = ic    ; }
79   void                   SetTrackName(const char *n)                          { fTrackName                   = n     ; }
80
81  protected:
82   virtual void           Clusterize();
83   virtual void           FillDigitsArray();
84   virtual void           Init();
85   virtual void           RecPoints2Clusters(TClonesArray *clus);
86   virtual void           UpdateCells();
87   virtual void           UpdateClusters();
88
89   Int_t                  fRun;                            //!run number
90   TClonesArray          *fDigitsArr;                      //!digits array
91   TObjArray             *fClusterArr;                     //!recpoints array
92   AliEMCALRecParam      *fRecParam;                       // reconstruction parameters container
93   AliEMCALClusterizer   *fClusterizer;                    //!clusterizer
94   AliEMCALAfterBurnerUF *fUnfolder;                       //!unfolding procedure
95   Bool_t                 fJustUnfold;                     // just unfold, do not recluster
96   TString                fGeomName;                       // name of geometry to use.
97   Bool_t                 fGeomMatrixSet;                  // set geometry matrices only once, for the first event.         
98   Bool_t                 fLoadGeomMatrices;               // matrices from configuration, not geometry.root nor ESDs/AODs
99   TGeoHMatrix           *fGeomMatrix[12];                 // geometry matrices with alignments
100   TString                fOCDBpath;                       // path with OCDB location
101   AliEMCALCalibData     *fCalibData;                      // EMCAL calib data
102   AliCaloCalibPedestal  *fPedestalData;                   // EMCAL pedestal
103   TClonesArray          *fOutputAODBranch;                //!AOD Branch with output clusters  
104   TString                fOutputAODBrName;                // output AOD branch name (none by default)
105   AliEMCALRecoUtils     *fRecoUtils;                      // access to factorized reconstruction algorithms
106   Bool_t                 fLoadCalib;                      // access calib object from OCDB (def=off)
107   Bool_t                 fLoadPed;                        // access ped object from OCDB (def=off)
108   Bool_t                 fAttachClusters;                 // attach clusters to input event (AOD or ESD)
109   Bool_t                 fRecalibOnly;                    // only recalibrate cells if true (def=off)
110   Bool_t                 fSubBackground;                  // subtract background if true (def=off)
111   Bool_t                 fOverwrite;                      // overwrite existing clusters
112   TString                fNewClusterArrayName;            // if not overwriting, name of the new cluster array
113   Int_t                  fNPhi;                           // nPhi (for FixedWindowsClusterizer)
114   Int_t                  fNEta;                           // nEta (for FixedWinoswsClusterizer)
115   Int_t                  fShiftPhi;                       // shift in phi (for FixedWindowsClusterizer)
116   Int_t                  fShiftEta;                       // shift in eta (for FixedWindowsClusterizer)
117   Bool_t                 fTRUShift;                       // shifting inside a TRU (true) or through the whole calorimeter (false) (for FixedWindowsClusterizer)
118   InputCellType          fInputCellType;                  // input cells type to make clusters
119   TString                fTrackName;                      // if not null use track collection for track/cluster matching
120
121
122  private:
123   AliAnalysisTaskEMCALClusterizeFast(const AliAnalysisTaskEMCALClusterizeFast&);            // not implemented
124   AliAnalysisTaskEMCALClusterizeFast &operator=(const AliAnalysisTaskEMCALClusterizeFast&); // not implemented
125
126   ClassDef(AliAnalysisTaskEMCALClusterizeFast, 8);
127 };
128 #endif //ALIANALYSISTASKEMCALCLUSTERIZEFAST_H