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 **************************************************************************/
16 /** @file AliFMDUShortMap.cxx
17 @author Christian Holm Christensen <cholm@nbi.dk>
18 @date Mon Mar 27 12:48:18 2006
19 @brief Per strip of unisgned shorts (16 bit) data
21 //____________________________________________________________________
23 // A map of per strip UShort_t information (for example ADC values,
24 // number of hits and so on).
25 // Used for various calib information, and the like,
26 // as well as in reconstruction.
27 // Can be used elsewhere too.
29 #include "AliFMDUShortMap.h" // ALIFMDUSHORTMAP_H
31 //____________________________________________________________________
32 ClassImp(AliFMDUShortMap)
34 ; // This is here to keep Emacs for indenting the next line
37 //____________________________________________________________________
38 AliFMDUShortMap::AliFMDUShortMap(const AliFMDUShortMap& other)
39 : AliFMDMap(other.fMaxDetectors, other.fMaxRings, other.fMaxSectors,
45 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
46 fData = new UShort_t[fTotal];
47 for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
52 //____________________________________________________________________
53 AliFMDUShortMap::AliFMDUShortMap(UShort_t maxDet,
57 : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
58 fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
64 // maxDet Maximum # of detectors
65 // maxRinf Maximum # of rings
66 // maxSec Maximum # of sectors
67 // maxStr Maximum # of strips
68 if (fTotal == 0) fTotal = 51200;
69 fData = new UShort_t[fTotal];
72 //____________________________________________________________________
73 AliFMDUShortMap::AliFMDUShortMap()
84 //____________________________________________________________________
86 AliFMDUShortMap::operator=(const AliFMDUShortMap& other)
88 // Assignment operator
89 if (&other == this) return *this;
90 fMaxDetectors = other.fMaxDetectors;
91 fMaxRings = other.fMaxRings;
92 fMaxSectors = other.fMaxSectors;
93 fMaxStrips = other.fMaxStrips;
94 if (fData) delete [] fData;
95 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
96 fData = new UShort_t[fTotal];
97 for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
101 //____________________________________________________________________
103 AliFMDUShortMap::Reset(const UShort_t& val)
106 for (Int_t i = 0; i < fTotal; i++) fData[i] = val;
109 //____________________________________________________________________
111 AliFMDUShortMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str)
121 // Returns appropriate data
123 return fData[CalcIndex(det, ring, sec, str)];
126 //____________________________________________________________________
128 AliFMDUShortMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
138 // Returns appropriate data
140 return fData[CalcIndex(det, ring, sec, str)];
144 //___________________________________________________________________