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 AliFMDEdepMap.cxx
17 @author Christian Holm Christensen <cholm@nbi.dk>
18 @date Mon Mar 27 12:39:50 2006
19 @brief Per strip map of energy deposited and number of hits
22 //____________________________________________________________________
24 // Contains a pair of energy deposited fEdep and number of hits
25 // fN, fEdep is the summed energy deposition, and fN is the
26 // number of hits. The map contains one such object or each strip.
27 // It is used to cache the data in the digitization classes
28 // AliFMDBaseDigitizer and so on.
31 #include "AliFMDEdepMap.h" // ALIFMDEDEPMAP_H
33 //____________________________________________________________________
34 ClassImp(AliFMDEdepMap)
36 ; // This is here to keep Emacs for indenting the next line
39 //____________________________________________________________________
40 AliFMDEdepMap::AliFMDEdepMap(const AliFMDEdepMap& other)
41 : AliFMDMap(other.fMaxDetectors, other.fMaxRings, other.fMaxSectors,
47 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
48 fData = new AliFMDEdepHitPair[fTotal];
49 for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
54 //____________________________________________________________________
55 AliFMDEdepMap::AliFMDEdepMap(UShort_t maxDet,
59 : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
66 // maxDet Maximum # of detectors
67 // maxRinf Maximum # of rings
68 // maxSec Maximum # of sectors
69 // maxStr Maximum # of strips
70 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
71 fData = new AliFMDEdepHitPair[fTotal];
74 //____________________________________________________________________
76 AliFMDEdepMap::operator=(const AliFMDEdepMap& other)
78 // Assignment operator
79 fMaxDetectors = other.fMaxDetectors;
80 fMaxRings = other.fMaxRings;
81 fMaxSectors = other.fMaxSectors;
82 fMaxStrips = other.fMaxStrips;
83 if (fData) delete [] fData;
84 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
85 fData = new AliFMDEdepHitPair[fTotal];
86 for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
90 //____________________________________________________________________
92 AliFMDEdepMap::Reset()
95 for (Int_t i = 0; i < fTotal; i++) {
101 //____________________________________________________________________
103 AliFMDEdepMap::Reset(const AliFMDEdepHitPair& val)
106 for (Int_t i = 0; i < fTotal; i++) {
107 fData[i].fEdep = val.fEdep;
108 fData[i].fN = val.fN;
112 //____________________________________________________________________
114 AliFMDEdepMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str)
124 // Returns appropriate data
126 return fData[CalcIndex(det, ring, sec, str)];
129 //____________________________________________________________________
130 const AliFMDEdepHitPair&
131 AliFMDEdepMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
141 // Returns appropriate data
143 return fData[CalcIndex(det, ring, sec, str)];
147 //___________________________________________________________________