]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDEdepMap.cxx
Zero mis-alignment parameters for FMD (C.Cheshkov using AliFMDAlignFaker)
[u/mrichter/AliRoot.git] / FMD / AliFMDEdepMap.cxx
CommitLineData
e802be3e 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
e802be3e 15/* $Id$ */
c2fc1258 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
20*/
e802be3e 21//____________________________________________________________________
22//
23//
24//
25#include "AliFMDEdepMap.h" // ALIFMDEDEPMAP_H
26
27//____________________________________________________________________
925e6570 28ClassImp(AliFMDEdepMap)
1a1fdef7 29#if 0
30 ; // This is here to keep Emacs for indenting the next line
31#endif
e802be3e 32
33//____________________________________________________________________
34AliFMDEdepMap::AliFMDEdepMap(const AliFMDEdepMap& other)
35 : AliFMDMap(other.fMaxDetectors, other.fMaxRings, other.fMaxSectors,
36 other.fMaxStrips),
37 fData(0)
38{
088f8e79 39 // Copy constructor
bfdc7f5d 40 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
41 fData = new AliFMDEdepHitPair[fTotal];
42 for (size_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
e802be3e 43}
44
45
46
47//____________________________________________________________________
48AliFMDEdepMap::AliFMDEdepMap(size_t maxDet,
49 size_t maxRing,
50 size_t maxSec,
51 size_t maxStr)
52 : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
53 fData(0)
54{
55 // Construct a map
56 //
57 // Parameters:
58 // maxDet Maximum # of detectors
59 // maxRinf Maximum # of rings
60 // maxSec Maximum # of sectors
61 // maxStr Maximum # of strips
bfdc7f5d 62 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
63 fData = new AliFMDEdepHitPair[fTotal];
e802be3e 64}
65
66//____________________________________________________________________
67AliFMDEdepMap&
68AliFMDEdepMap::operator=(const AliFMDEdepMap& other)
69{
088f8e79 70 // Assignment operator
e802be3e 71 fMaxDetectors = other.fMaxDetectors;
72 fMaxRings = other.fMaxRings;
73 fMaxSectors = other.fMaxSectors;
74 fMaxStrips = other.fMaxStrips;
75 if (fData) delete [] fData;
bfdc7f5d 76 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
77 fData = new AliFMDEdepHitPair[fTotal];
78 for (size_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
e802be3e 79 return *this;
80}
81
088f8e79 82//____________________________________________________________________
83void
84AliFMDEdepMap::Reset()
85{
86 // Reset to zero
bfdc7f5d 87 for (size_t i = 0; i < fTotal; i++) {
88 fData[i].fEdep = 0;
89 fData[i].fN = 0;
90 };
088f8e79 91}
92
e802be3e 93//____________________________________________________________________
94void
69b696b9 95AliFMDEdepMap::Reset(const AliFMDEdepHitPair& val)
e802be3e 96{
088f8e79 97 // Reset to val
bfdc7f5d 98 for (size_t i = 0; i < fTotal; i++) {
99 fData[i].fEdep = val.fEdep;
100 fData[i].fN = val.fN;
101 };
e802be3e 102}
103
104//____________________________________________________________________
105AliFMDEdepHitPair&
106AliFMDEdepMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str)
107{
108 // Get data
109 //
110 // Parameters:
111 // det Detector #
112 // ring Ring ID
113 // sec Sector #
114 // str Strip #
115 //
116 // Returns appropriate data
117 //
118 return fData[CalcIndex(det, ring, sec, str)];
119}
120
121//____________________________________________________________________
122const AliFMDEdepHitPair&
123AliFMDEdepMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
124{
125 // Get data
126 //
127 // Parameters:
128 // det Detector #
129 // ring Ring ID
130 // sec Sector #
131 // str Strip #
132 //
133 // Returns appropriate data
134 //
135 return fData[CalcIndex(det, ring, sec, str)];
136}
137
138
139//___________________________________________________________________
140//
141// EOF
142//