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 //____________________________________________________________________
20 // A map of per strip UShort_t information (for example ADC values,
21 // number of hits and so on).
23 #include "AliFMDUShortMap.h" // ALIFMDUSHORTMAP_H
25 //____________________________________________________________________
26 ClassImp(AliFMDUShortMap);
28 //____________________________________________________________________
29 AliFMDUShortMap::AliFMDUShortMap(const AliFMDUShortMap& other)
30 : AliFMDMap(other.fMaxDetectors, other.fMaxRings, other.fMaxSectors,
34 fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
35 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
36 i++) fData[i] = other.fData[i];
41 //____________________________________________________________________
42 AliFMDUShortMap::AliFMDUShortMap(size_t maxDet,
46 : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
52 // maxDet Maximum # of detectors
53 // maxRinf Maximum # of rings
54 // maxSec Maximum # of sectors
55 // maxStr Maximum # of strips
56 fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
59 //____________________________________________________________________
61 AliFMDUShortMap::operator=(const AliFMDUShortMap& other)
63 fMaxDetectors = other.fMaxDetectors;
64 fMaxRings = other.fMaxRings;
65 fMaxSectors = other.fMaxSectors;
66 fMaxStrips = other.fMaxStrips;
67 if (fData) delete [] fData;
68 fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
69 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
70 i++) fData[i] = other.fData[i];
74 //____________________________________________________________________
76 AliFMDUShortMap::Clear(const UShort_t& val)
78 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
82 //____________________________________________________________________
84 AliFMDUShortMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str)
94 // Returns appropriate data
96 return fData[CalcIndex(det, ring, sec, str)];
99 //____________________________________________________________________
101 AliFMDUShortMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
111 // Returns appropriate data
113 return fData[CalcIndex(det, ring, sec, str)];
117 //___________________________________________________________________