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).
22 // Used for various calib information, and the like,
23 // as well as in reconstruction.
24 // Can be used elsewhere too.
26 #include "AliFMDUShortMap.h" // ALIFMDUSHORTMAP_H
28 //____________________________________________________________________
29 ClassImp(AliFMDUShortMap)
31 ; // This is here to keep Emacs for indenting the next line
34 //____________________________________________________________________
35 AliFMDUShortMap::AliFMDUShortMap(const AliFMDUShortMap& other)
36 : AliFMDMap(other.fMaxDetectors, other.fMaxRings, other.fMaxSectors,
41 fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
42 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
43 i++) fData[i] = other.fData[i];
48 //____________________________________________________________________
49 AliFMDUShortMap::AliFMDUShortMap(size_t maxDet,
53 : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
59 // maxDet Maximum # of detectors
60 // maxRinf Maximum # of rings
61 // maxSec Maximum # of sectors
62 // maxStr Maximum # of strips
63 fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
66 //____________________________________________________________________
68 AliFMDUShortMap::operator=(const AliFMDUShortMap& other)
70 // Assignment operator
71 fMaxDetectors = other.fMaxDetectors;
72 fMaxRings = other.fMaxRings;
73 fMaxSectors = other.fMaxSectors;
74 fMaxStrips = other.fMaxStrips;
75 if (fData) delete [] fData;
76 fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
77 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
78 i++) fData[i] = other.fData[i];
82 //____________________________________________________________________
84 AliFMDUShortMap::Reset(const UShort_t& val)
87 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
91 //____________________________________________________________________
93 AliFMDUShortMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str)
103 // Returns appropriate data
105 return fData[CalcIndex(det, ring, sec, str)];
108 //____________________________________________________________________
110 AliFMDUShortMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
120 // Returns appropriate data
122 return fData[CalcIndex(det, ring, sec, str)];
126 //___________________________________________________________________