Moving the destructor to the implementation file
[u/mrichter/AliRoot.git] / STEER / AliFMDFloatMap.cxx
CommitLineData
9da38871 1/**************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN. *
3 * All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
8 * Permission to use, copy, modify and distribute this *
9 * software and its documentation strictly for non-commercial *
10 * purposes is hereby granted without fee, provided that the *
11 * above copyright notice appears in all copies and that both *
12 * the copyright notice and this permission notice appear in *
13 * the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It *
15 * is provided "as is" without express or implied warranty. *
16 **************************************************************/
17/* $Id$ */
18//__________________________________________________________
19//
20// Map of per strip Float_t information
21//
22// Created Mon Nov 8 12:51:51 2004 by Christian Holm Christensen
23//
24#include "AliFMDFloatMap.h" //ALIFMDFLOATMAP_H
25//__________________________________________________________
26ClassImp(AliFMDFloatMap)
27#if 0
28 ; // This is here to keep Emacs for indenting the next line
29#endif
30//__________________________________________________________
31AliFMDFloatMap::AliFMDFloatMap(const AliFMDFloatMap& other)
32 : AliFMDMap(other.fMaxDetectors,
33 other.fMaxRings,
34 other.fMaxSectors,
35 other.fMaxStrips),
36 fData(0)
37{
38 // Copy constructor
ac07a8f5 39 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
40 fData = new Float_t[fTotal];
9da38871 41 for (size_t i = 0; i < fMaxDetectors * fMaxRings
42 * fMaxSectors * fMaxStrips; i++)
43 fData[i] = other.fData[i];
44}
45
46//__________________________________________________________
47AliFMDFloatMap::AliFMDFloatMap(size_t maxDet,
48 size_t maxRing,
49 size_t maxSec,
50 size_t maxStr)
51 : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
52 fData(0)
53{
54 // Constructor.
55 // Parameters:
56 // maxDet Maximum number of detectors
57 // maxRing Maximum number of rings per detector
58 // maxSec Maximum number of sectors per ring
59 // maxStr Maximum number of strips per sector
ac07a8f5 60 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
61 fData = new Float_t[fTotal];
9da38871 62 Reset();
63}
64
65//__________________________________________________________
66AliFMDFloatMap&
67AliFMDFloatMap::operator=(const AliFMDFloatMap& other)
68{
69 // Assignment operator
70 fMaxDetectors = other.fMaxDetectors;
71 fMaxRings = other.fMaxRings;
72 fMaxSectors = other.fMaxSectors;
73 fMaxStrips = other.fMaxStrips;
ac07a8f5 74 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
9da38871 75 if (fData) delete [] fData;
ac07a8f5 76 fData = new Float_t[fTotal];
77 for (size_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
9da38871 78 return *this;
79}
80
81//__________________________________________________________
82void
83AliFMDFloatMap::Reset(const Float_t& val)
84{
85 // Reset map to val
ac07a8f5 86 for (size_t i = 0; i < fTotal; i++) fData[i] = val;
9da38871 87}
88
89//__________________________________________________________
90Float_t&
91AliFMDFloatMap::operator()(UShort_t det,
92 Char_t ring,
93 UShort_t sec,
94 UShort_t str)
95{
96 // Get data
97 // Parameters:
98 // det Detector #
99 // ring Ring ID
100 // sec Sector #
101 // str Strip #
102 // Returns appropriate data
103 return fData[CalcIndex(det, ring, sec, str)];
104}
105
106//__________________________________________________________
107const Float_t&
108AliFMDFloatMap::operator()(UShort_t det,
109 Char_t ring,
110 UShort_t sec,
111 UShort_t str) const
112{
113 // Get data
114 // Parameters:
115 // det Detector #
116 // ring Ring ID
117 // sec Sector #
118 // str Strip #
119 // Returns appropriate data
120 return fData[CalcIndex(det, ring, sec, str)];
121}
122
123//__________________________________________________________
124//
125// EOF
126//
127