]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/EMCAL/AliAnalysisTaskEMCALClusterizeFast.h
- Fix for the patch energy introduced in commit 05a42e4d3e68cf9929437bb2bc1310476f097476
[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 class AliVCaloCells;
17 class AliEMCALGeometry;
18
19 #include "AliAnalysisTaskSE.h"
20
21 class AliAnalysisTaskEMCALClusterizeFast : public AliAnalysisTaskSE {
22  public:
23   enum InputCellType {
24     kFEEData = 0,
25     kFEEDataMCOnly,
26     kFEEDataExcludeMC,
27     kPattern,
28     kL0FastORs,
29     kL0FastORsTC,
30     kL1FastORs
31   };
32   
33
34   AliAnalysisTaskEMCALClusterizeFast();
35   AliAnalysisTaskEMCALClusterizeFast(const char *name);
36   virtual ~AliAnalysisTaskEMCALClusterizeFast();
37   
38  public:
39   virtual void           UserCreateOutputObjects();
40   virtual void           UserExec(Option_t *option);
41
42   Bool_t                 GetAttachClusters()                          const   { return fAttachClusters               ; }
43   Bool_t                 GetSubBackground()                           const   { return fSubBackground                ; }
44   const TObjArray       *GetClusters()                                const   { return fClusterArr                   ; }
45   const TClonesArray    *GetDigits()                                  const   { return fDigitsArr                    ; }
46   const TString         &GeometryName()                               const   { return fGeomName                     ; }  
47   AliEMCALRecParam      *GetRecParam()                                const   { return fRecParam                     ; }
48   AliEMCALRecoUtils     *GetRecoUtils()                               const   { return fRecoUtils                    ; }
49   AliEMCALCalibData     *GetCalibData()                               const   { return fCalibData                    ; }
50   AliCaloCalibPedestal  *GetPedData()                                 const   { return fPedestalData                 ; }
51   TGeoHMatrix           *GetGeometryMatrix(Int_t i)                   const   { return fGeomMatrix[i]                ; }
52   const TString         &GetCaloClustersName()                        const   { return fCaloClustersName             ; }
53   Int_t                  GetnPhi()                                    const   { return fNPhi                         ; }
54   Int_t                  GetnEta()                                    const   { return fNEta                         ; }
55   Int_t                  GetShiftPhi()                                const   { return fShiftPhi                     ; }
56   Int_t                  GetShiftEta()                                const   { return fShiftEta                     ; }
57   Bool_t                 GetTRUShift()                                const   { return fTRUShift                     ; }
58   InputCellType          GetInputCellType()                           const   { return fInputCellType                ; }
59   void                   JustUnfold(Bool_t yesno)                             { fJustUnfold                  = yesno ; }
60   void                   LoadOwnGeometryMatrices(Bool_t b)                    { fLoadGeomMatrices            = b     ; }
61   void                   SetAODBranchName(const char *name)                   { fOutputAODBrName             = name  ; }
62   void                   SetAttachClusters(Bool_t b)                          { fAttachClusters              = b     ; }
63   void                   SetCalibData(AliEMCALCalibData *d)                   { fCalibData                   = d     ; }
64   void                   SetEMCALRecoUtils(AliEMCALRecoUtils *ru)             { fRecoUtils                   = ru    ; }
65   void                   SetGeometryMatrix(TGeoHMatrix* m, Int_t i)           { fGeomMatrix[i]               = m     ; }
66   void                   SetGeometryName(const char *name)                    { fGeomName                    = name  ; }
67   void                   SetLoadCalib(Bool_t b)                               { fLoadCalib                   = b     ; }
68   void                   SetLoadPed(Bool_t b)                                 { fLoadPed                     = b     ; }
69   void                   SetOCDBPath(const char *path)                        { fOCDBpath                    = path  ; }
70   void                   SetPedestalData(AliCaloCalibPedestal *d)             { fPedestalData                = d     ; }
71   void                   SetSubBackground(Bool_t b)                           { fSubBackground               = b     ; }
72   void                   SetnPhi(Int_t n)                                     { fNPhi                        = n     ; }
73   void                   SetnEta(Int_t n)                                     { fNEta                        = n     ; }
74   void                   SetShiftPhi(Int_t n)                                 { fShiftPhi                    = n     ; }
75   void                   SetShiftEta(Int_t n)                                 { fShiftEta                    = n     ; }
76   void                   SetTRUShift(Bool_t yes)                              { fTRUShift                    = yes   ; }
77   void                   SetInputCellType(InputCellType ic)                   { fInputCellType               = ic    ; }
78   void                   SetTrackName(const char *n)                          { fTrackName                   = n     ; }
79   void                   SetCaloClustersName(const char *name)                { fCaloClustersName            = name  ; }
80   void                   SetCaloCellsName(const char *name)                   { fCaloCellsName               = name  ; }
81   void                   SetUpdateCells(Bool_t b)                             { fDoUpdateCells               = b     ; }
82   void                   SetClusterize(Bool_t b)                              { fDoClusterize                = b     ; }
83   void                   SetClusterBadChannelCheck(Bool_t b)                  { fClusterBadChannelCheck      = b     ; }
84   void                   SetRejectExoticClusters(Bool_t b)                    { fRejectExoticClusters        = b     ; }
85   void                   SetRejectExoticCells(Bool_t b)                       { fRejectExoticCells           = b     ; }
86   void                   SetFiducial(Bool_t b)                                { fFiducial                    = b     ; }
87   void                   SetDoNonLinearity(Bool_t b)                          { fDoNonLinearity              = b     ; }
88   void                   SetRecalDistToBadChannels(Bool_t b)                  { fRecalDistToBadChannels      = b     ; }
89
90   // For backward compatibility
91   const TString         &GetNewClusterArrayName()                     const   { return GetCaloClustersName()         ; }
92   void                   SetNewClusterArrayName(const char *name)             { SetCaloClustersName(name)            ; }
93   void                   SetOverwrite(Bool_t b)                               { if (b) SetCaloClustersName(""); else SetCaloClustersName("newCaloClusters");}
94   void                   SetRecalibrateCellsOnly(Bool_t b)                    { if (b) { SetUpdateCells(kTRUE); SetClusterize(kFALSE);} else { SetClusterize(kTRUE); } }
95   Bool_t                 GetRecalibrateOnly()                         const   { return (Bool_t)(fDoUpdateCells && !fDoClusterize); }
96   Bool_t                 GetOverwrite()                               const   { return fCaloClustersName.IsNull()                ; }
97     
98  protected:
99   Bool_t                 AcceptCell(Int_t cellNumber);
100   virtual void           Clusterize();
101   virtual void           FillDigitsArray();
102   virtual void           Init();
103   virtual void           RecPoints2Clusters(TClonesArray *clus);
104   virtual void           UpdateCells();
105   virtual void           UpdateClusters();
106   virtual void           CalibrateClusters();
107   virtual void           TrackClusterMatching(AliVCluster *c, TClonesArray *tarr);
108   virtual void           CopyClusters(TClonesArray *orig, TClonesArray *dest);
109
110   Int_t                  fRun;                            //!run number
111   TClonesArray          *fDigitsArr;                      //!digits array
112   TObjArray             *fClusterArr;                     //!recpoints array
113   AliEMCALRecParam      *fRecParam;                       // reconstruction parameters container
114   AliEMCALClusterizer   *fClusterizer;                    //!clusterizer
115   AliEMCALAfterBurnerUF *fUnfolder;                       //!unfolding procedure
116   Bool_t                 fJustUnfold;                     // just unfold, do not recluster
117   TString                fGeomName;                       // name of geometry to use.
118   Bool_t                 fGeomMatrixSet;                  // set geometry matrices only once, for the first event.         
119   Bool_t                 fLoadGeomMatrices;               // matrices from configuration, not geometry.root nor ESDs/AODs
120   TGeoHMatrix           *fGeomMatrix[12];                 // geometry matrices with alignments
121   TString                fOCDBpath;                       // path with OCDB location
122   AliEMCALCalibData     *fCalibData;                      // EMCAL calib data
123   AliCaloCalibPedestal  *fPedestalData;                   // EMCAL pedestal
124   TClonesArray          *fOutputAODBranch;                //!AOD Branch with output clusters  
125   TString                fOutputAODBrName;                // output AOD branch name (none by default)
126   AliEMCALRecoUtils     *fRecoUtils;                      // access to factorized reconstruction algorithms
127   Bool_t                 fLoadCalib;                      // access calib object from OCDB (def=off)
128   Bool_t                 fLoadPed;                        // access ped object from OCDB (def=off)
129   Bool_t                 fAttachClusters;                 // attach clusters to input event (AOD or ESD)
130   Bool_t                 fSubBackground;                  // subtract background if true (def=off)
131   Int_t                  fNPhi;                           // nPhi (for FixedWindowsClusterizer)
132   Int_t                  fNEta;                           // nEta (for FixedWinoswsClusterizer)
133   Int_t                  fShiftPhi;                       // shift in phi (for FixedWindowsClusterizer)
134   Int_t                  fShiftEta;                       // shift in eta (for FixedWindowsClusterizer)
135   Bool_t                 fTRUShift;                       // shifting inside a TRU (true) or through the whole calorimeter (false) (for FixedWindowsClusterizer)
136   InputCellType          fInputCellType;                  // input cells type to make clusters
137   TString                fTrackName;                      // if not null use track collection for track/cluster matching
138   TString                fCaloCellsName;                  // name of calo cells object
139   TString                fCaloClustersName;               // name of calo cluster collection
140   Bool_t                 fDoUpdateCells;                  // recalibrate cells
141   Bool_t                 fDoClusterize;                   // clusterize
142   Bool_t                 fClusterBadChannelCheck;         // cluster bad channel check
143   Bool_t                 fRejectExoticClusters;           // reject exotic cluster
144   Bool_t                 fRejectExoticCells;              // reject exotic cells on-the-fly
145   Bool_t                 fFiducial;                       // fiducial cut
146   Bool_t                 fDoNonLinearity;                 // non linearity calib
147   Bool_t                 fRecalDistToBadChannels;         // recalculate distance to bad channel
148   AliVCaloCells         *fCaloCells;                      //!calo cells object
149   TClonesArray          *fCaloClusters;                   //!calo clusters array       
150   AliESDEvent           *fEsd;                            //!esd event
151   AliAODEvent           *fAod;                            //!aod event
152   AliEMCALGeometry      *fGeom;                           //!geometry object
153
154  private:
155   AliAnalysisTaskEMCALClusterizeFast(const AliAnalysisTaskEMCALClusterizeFast&);            // not implemented
156   AliAnalysisTaskEMCALClusterizeFast &operator=(const AliAnalysisTaskEMCALClusterizeFast&); // not implemented
157
158   ClassDef(AliAnalysisTaskEMCALClusterizeFast, 9);
159 };
160 #endif //ALIANALYSISTASKEMCALCLUSTERIZEFAST_H