1 /**************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN. *
3 * All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************/
18 //__________________________________________________________
20 // Map of per strip Float_t information
21 // the floats are indexed by the coordinates
23 // RING ID ('I' or 'O', any case)
28 // Created Mon Nov 8 12:51:51 2004 by Christian Holm Christensen
30 #include "AliFMDFloatMap.h" //ALIFMDFLOATMAP_H
31 //__________________________________________________________
32 ClassImp(AliFMDFloatMap)
34 ; // This is here to keep Emacs for indenting the next line
37 //__________________________________________________________
38 AliFMDFloatMap::AliFMDFloatMap(const AliFMDMap& other)
40 fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
43 if (fTotal == 0) fTotal = 51200;
44 fData = new Float_t[fTotal];
46 if (!other.IsFloat()) return;
47 for (Int_t i = 0; i < fTotal; i++) fData[i] = other.AtAsFloat(i);
50 //__________________________________________________________
51 AliFMDFloatMap::AliFMDFloatMap(const AliFMDFloatMap& other)
52 : AliFMDMap(other.fMaxDetectors,
56 fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
59 if (fTotal == 0) fTotal = 51200;
60 fData = new Float_t[fTotal];
62 for (Int_t i = 0; i < fTotal; i++)
63 fData[i] = other.fData[i];
66 //__________________________________________________________
67 AliFMDFloatMap::AliFMDFloatMap()
77 //__________________________________________________________
78 AliFMDFloatMap::AliFMDFloatMap(Int_t maxDet,
82 : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
83 fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
88 // maxDet Maximum number of detectors
89 // maxRing Maximum number of rings per detector
90 // maxSec Maximum number of sectors per ring
91 // maxStr Maximum number of strips per sector
92 if (fTotal == 0) fTotal = 51200;
93 fData = new Float_t[fTotal];
97 //__________________________________________________________
99 AliFMDFloatMap::operator=(const AliFMDFloatMap& other)
101 // Assignment operator
103 if(fMaxDetectors!= other.fMaxDetectors||
104 fMaxRings != other.fMaxRings||
105 fMaxSectors != other.fMaxSectors||
106 fMaxStrips != other.fMaxStrips){
107 // allocate new memory only if the array size is different....
108 fMaxDetectors = other.fMaxDetectors;
109 fMaxRings = other.fMaxRings;
110 fMaxSectors = other.fMaxSectors;
111 fMaxStrips = other.fMaxStrips;
112 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
113 if (fTotal == 0) fTotal = 51200;
114 if (fData) delete [] fData;
115 fData = new Float_t[fTotal];
117 for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
123 //__________________________________________________________
125 AliFMDFloatMap::Reset(const Float_t& val)
128 for (Int_t i = 0; i < fTotal; i++) fData[i] = val;
131 //__________________________________________________________
133 AliFMDFloatMap::operator()(UShort_t det,
144 // Returns appropriate data
145 return fData[CalcIndex(det, ring, sec, str)];
148 //__________________________________________________________
150 AliFMDFloatMap::operator()(UShort_t det,
161 // Returns appropriate data
162 return fData[CalcIndex(det, ring, sec, str)];
165 //__________________________________________________________