1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //____________________________________________________________________
22 #include "AliFMDUShortMap.h" // ALIFMDUSHORTMAP_H
24 //____________________________________________________________________
25 ClassImp(AliFMDUShortMap);
27 //____________________________________________________________________
28 AliFMDUShortMap::AliFMDUShortMap(const AliFMDUShortMap& other)
29 : AliFMDMap(other.fMaxDetectors, other.fMaxRings, other.fMaxSectors,
33 fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
34 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
35 i++) fData[i] = other.fData[i];
40 //____________________________________________________________________
41 AliFMDUShortMap::AliFMDUShortMap(size_t maxDet,
45 : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
51 // maxDet Maximum # of detectors
52 // maxRinf Maximum # of rings
53 // maxSec Maximum # of sectors
54 // maxStr Maximum # of strips
55 fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
58 //____________________________________________________________________
60 AliFMDUShortMap::operator=(const AliFMDUShortMap& other)
62 fMaxDetectors = other.fMaxDetectors;
63 fMaxRings = other.fMaxRings;
64 fMaxSectors = other.fMaxSectors;
65 fMaxStrips = other.fMaxStrips;
66 if (fData) delete [] fData;
67 fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
68 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
69 i++) fData[i] = other.fData[i];
73 //____________________________________________________________________
75 AliFMDUShortMap::Clear(const UShort_t& val)
77 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
81 //____________________________________________________________________
83 AliFMDUShortMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str)
93 // Returns appropriate data
95 return fData[CalcIndex(det, ring, sec, str)];
98 //____________________________________________________________________
100 AliFMDUShortMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
110 // Returns appropriate data
112 return fData[CalcIndex(det, ring, sec, str)];
116 //___________________________________________________________________