Bug fix. Removed delete statement
[u/mrichter/AliRoot.git] / STEER / AliFMDFloatMap.h
CommitLineData
9da38871 1#ifndef ALIFMDFLOATMAP_H
2#define ALIFMDFLOATMAP_H
3/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
4 * reserved.
5 *
6 * See cxx source for full Copyright notice
7 */
8#ifndef ALIFMDMAP_H
d65adc48 9# include "AliFMDMap.h"
9da38871 10#endif
11//____________________________________________________________________
12//
13// Array of floats indexed by strip identifier.
6169f936 14// the floats are indexed by the coordinates
15// DETECTOR # (1-3)
16// RING ID ('I' or 'O', any case)
17// SECTOR # (0-39)
18// STRIP # (0-511)
9da38871 19//
20class AliFMDFloatMap : public AliFMDMap
21{
22public:
021f1396 23 AliFMDFloatMap();
24 AliFMDFloatMap(Int_t maxDet,
25 Int_t maxRing= 0,
26 Int_t maxSec = 0,
27 Int_t maxStr = 0);
28 AliFMDFloatMap(const AliFMDMap& o);
9da38871 29 AliFMDFloatMap(const AliFMDFloatMap& o);
a2fbb067 30 virtual ~AliFMDFloatMap() { delete [] fData;fData = 0; }
9da38871 31 AliFMDFloatMap& operator=(const AliFMDFloatMap& o);
32 virtual void Reset(const Float_t& v=Float_t());
33 virtual Float_t& operator()(UShort_t det,
34 Char_t ring,
35 UShort_t sec,
36 UShort_t str);
37 virtual const Float_t& operator()(UShort_t det,
38 Char_t ring,
39 UShort_t sec,
40 UShort_t str) const;
c05d076f 41 Float_t* Data() const { return fData; }
021f1396 42 void Print(Option_t* option="%8.4f") const;
9da38871 43protected:
021f1396 44 Int_t MaxIndex() const { return fTotal; }
45 Float_t AtAsFloat(Int_t i) const { return fData[i]; }
46 Float_t& AtAsFloat(Int_t i) { return fData[i]; }
47 Bool_t IsFloat() const { return kTRUE; }
48
fe12e09c 49 Int_t fTotal; // Total number of entries
ac07a8f5 50 Float_t* fData; //[fTotal]
021f1396 51 ClassDef(AliFMDFloatMap,3) // Map of floats
9da38871 52};
53
021f1396 54inline AliFMDFloatMap
55operator*(const AliFMDMap& lhs, const AliFMDMap& rhs)
56{
57 AliFMDFloatMap r(lhs);
58 r *= rhs;
59 return r;
60}
61inline AliFMDFloatMap
62operator/(const AliFMDMap& lhs, const AliFMDMap& rhs)
63{
64 AliFMDFloatMap r(lhs);
65 r /= rhs;
66 return r;
67}
68inline AliFMDFloatMap
69operator+(const AliFMDMap& lhs, const AliFMDMap& rhs)
70{
71 AliFMDFloatMap r(lhs);
72 r += rhs;
73 return r;
74}
75inline AliFMDFloatMap
76operator-(const AliFMDMap& lhs, const AliFMDMap& rhs)
77{
78 AliFMDFloatMap r(lhs);
79 r -= rhs;
80 return r;
81}
82
9da38871 83#endif
84//____________________________________________________________________
85//
86// Local Variables:
87// mode: C++
88// End:
89//
90