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 "AliFMDEdepMap.h" // ALIFMDEDEPMAP_H
24 //____________________________________________________________________
25 ClassImp(AliFMDEdepMap);
27 //____________________________________________________________________
28 AliFMDEdepMap::AliFMDEdepMap(const AliFMDEdepMap& other)
29 : AliFMDMap(other.fMaxDetectors, other.fMaxRings, other.fMaxSectors,
33 fData = new AliFMDEdepHitPair[fMaxDetectors * fMaxRings *
34 fMaxSectors * fMaxStrips];
35 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
36 i++) fData[i] = other.fData[i];
41 //____________________________________________________________________
42 AliFMDEdepMap::AliFMDEdepMap(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 AliFMDEdepHitPair[fMaxDetectors * fMaxRings *
57 fMaxSectors * fMaxStrips];
60 //____________________________________________________________________
62 AliFMDEdepMap::operator=(const AliFMDEdepMap& other)
64 fMaxDetectors = other.fMaxDetectors;
65 fMaxRings = other.fMaxRings;
66 fMaxSectors = other.fMaxSectors;
67 fMaxStrips = other.fMaxStrips;
68 if (fData) delete [] fData;
69 fData = new AliFMDEdepHitPair[fMaxDetectors * fMaxRings *
70 fMaxSectors * fMaxStrips];
71 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
72 i++) fData[i] = other.fData[i];
76 //____________________________________________________________________
78 AliFMDEdepMap::Clear(const AliFMDEdepHitPair& val)
80 for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
84 //____________________________________________________________________
86 AliFMDEdepMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str)
96 // Returns appropriate data
98 return fData[CalcIndex(det, ring, sec, str)];
101 //____________________________________________________________________
102 const AliFMDEdepHitPair&
103 AliFMDEdepMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
113 // Returns appropriate data
115 return fData[CalcIndex(det, ring, sec, str)];
119 //___________________________________________________________________