memory leak in the unpacking of compressed HLT TPC clusters fixed
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALReconstructor.h
CommitLineData
f6019cda 1#ifndef ALIEMCALRECONSTRUCTOR_H
2#define ALIEMCALRECONSTRUCTOR_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8//_________________________________________________________________________
9// Wrapping class for reconstruction
10//*--
11//*-- Author: Yves Schutz (SUBATECH)
12//*-- Dmitri Peressounko (SUBATECH & Kurchatov Institute)
40164976 13// Reconstruction class. Redesigned from the old AliReconstructionner class and
14// derived from STEER/AliReconstructor.
15//
f6019cda 16
f6019cda 17// --- ROOT system ---
85c25c2e 18class TClonesArray;
19class TTree;
20
0c5b726e 21// --- AliRoot header files ---
22#include "AliReconstructor.h"
23#include "AliEMCALTracker.h"
24#include "AliEMCALRecParam.h"
25
f6019cda 26class AliEMCALDigitizer ;
27class AliEMCALClusterizer ;
f6019cda 28class AliEMCALSDigitizer ;
c47157cd 29class AliEMCALRecParam;
af885e0f 30class AliESDEvent ;
1d59832c 31class AliRawReader ;
65bdc82f 32class AliEMCALRawUtils;
33class AliEMCALGeometry;
0c5b726e 34class AliEMCALCalibData ;
40164976 35class AliCaloCalibPedestal ;
916f1e76 36class AliEMCALTriggerElectronics;
de39a0ff 37class AliEMCALTriggerData;
f6019cda 38
f6019cda 39class AliEMCALReconstructor : public AliReconstructor {
29c9d15f 40
41 public:
42
f6019cda 43 AliEMCALReconstructor() ; //ctor
29c9d15f 44
f6019cda 45 virtual ~AliEMCALReconstructor() ; //dtor
29c9d15f 46
47 virtual void Init() {;}
48 virtual void InitClusterizer() const;
49
4800667c 50 using AliReconstructor::FillESD;
29c9d15f 51 virtual void FillESD(TTree* digitsTree, TTree* clustersTree, AliESDEvent* esd) const;
52 AliTracker* CreateTracker () const {return new AliEMCALTracker;}
4800667c 53 using AliReconstructor::Reconstruct;
29c9d15f 54 virtual void Reconstruct(TTree* digitsTree, TTree* clustersTree) const ;
55
56 virtual Bool_t HasDigitConversion() const {return kTRUE;};
57 virtual void ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const;
58
59 static void SetRecParam(AliEMCALRecParam * recParam){ fgkRecParam = recParam;}
60
61 void ReadDigitsArrayFromTree(TTree *digitsTree) const;
a68156e6 62
0832a2bf 63 static const AliEMCALRecParam* GetRecParam() {
64 return dynamic_cast<const AliEMCALRecParam*>(AliReconstructor::GetRecoParam(6)); }
29c9d15f 65
85c25c2e 66 static TClonesArray* GetDigitsArr() {return fgDigitsArr;}
29c9d15f 67
68 void FillMisalMatrixes(AliESDEvent* esd)const ;
5970dfe2 69
70 //New class used to sort the matched tracks
71 class AliEMCALMatch : public TObject
72 {
73 public:
74 AliEMCALMatch();
75 AliEMCALMatch(const AliEMCALMatch& copy);
76 virtual ~AliEMCALMatch() { }
77 //----------------------------------------------------------------------------
78 Int_t Compare(const TObject *obj) const;
79 Bool_t IsSortable() const {return kTRUE;}
80 Double_t GetDistance() const {return fDistance;}
81 Double_t GetdEta() const {return fdEta;}
82 Double_t GetdPhi() const {return fdPhi;}
83 Int_t GetIndexT() const {return fIndexT;}
84 void SetIndexT(Int_t itr) {fIndexT=itr;}
85 void SetDistance(Double_t dist) {fDistance=dist;}
86 void SetdEta(Double_t dEta) {fdEta=dEta;}
87 void SetdPhi(Double_t dPhi) {fdPhi=dPhi;}
88 private:
89 Int_t fIndexT; // track index in 'fTracks' array
90 Double_t fDistance; // track - cluster distance
91 Double_t fdEta; // track - cluster residual in eta
92 Double_t fdPhi; // track - cluster residual in phi
93 };
94 Bool_t CalculateResidual(AliESDtrack *track, AliESDCaloCluster *cluster, Double_t &dEta, Double_t &dPhi) const;
29c9d15f 95
96 private:
f6019cda 97
3abc001d 98 AliEMCALReconstructor(const AliEMCALReconstructor &); //Not implemented
99 AliEMCALReconstructor & operator = (const AliEMCALReconstructor &); //Not implemented
29c9d15f 100
101 AliEMCALGeometry * fGeom; // pointer to the EMCAL geometry
102 static AliEMCALClusterizer * fgClusterizer; // clusterizer
103 static AliEMCALRawUtils * fgRawUtils; // raw utilities class
104
105 //Temporal arrays with clusters, digits, triggers, to be reused per event
106 static TClonesArray * fgDigitsArr; //-> Array with EMCAL digits
107 static TObjArray * fgClustersArr; //-> Array with EMCAL clusters
108 static TClonesArray * fgTriggerDigits; //-> Array with EMCAL trigger digits
109
110 //OCDB
111 static const AliEMCALRecParam* fgkRecParam; // reconstruction parameters for EMCAL
112 AliEMCALCalibData * fCalibData ; //! Calibration database if aval
113 AliCaloCalibPedestal * fPedestalData ; //! Tower status database if aval
114
115 //Trigger specific
116 static AliEMCALTriggerElectronics* fgTriggerProcessor; // Trigger preprocessor
117 AliEMCALTriggerData * fTriggerData; // Trigger parameters data container
5970dfe2 118
119 //Track matching
120 TList * fMatches; //! collection of matches between tracks and clusters
29c9d15f 121
5970dfe2 122 ClassDef(AliEMCALReconstructor,12) // Reconstruction algorithm class (Base Class)
123};
f6019cda 124
125#endif // ALIEMCALRECONSTRUCTOR_H
916f1e76 126