]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliFMDFloatMap.cxx
Possibility to convolute the original cov.matrix of the point with the matrix coming...
[u/mrichter/AliRoot.git] / STEER / AliFMDFloatMap.cxx
CommitLineData
9da38871 1/**************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN. *
3 * All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
8 * Permission to use, copy, modify and distribute this *
9 * software and its documentation strictly for non-commercial *
10 * purposes is hereby granted without fee, provided that the *
11 * above copyright notice appears in all copies and that both *
12 * the copyright notice and this permission notice appear in *
13 * the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It *
15 * is provided "as is" without express or implied warranty. *
16 **************************************************************/
17/* $Id$ */
18//__________________________________________________________
19//
20// Map of per strip Float_t information
6169f936 21// the floats are indexed by the coordinates
22// DETECTOR # (1-3)
23// RING ID ('I' or 'O', any case)
24// SECTOR # (0-39)
25// STRIP # (0-511)
26//
9da38871 27//
28// Created Mon Nov 8 12:51:51 2004 by Christian Holm Christensen
29//
30#include "AliFMDFloatMap.h" //ALIFMDFLOATMAP_H
31//__________________________________________________________
32ClassImp(AliFMDFloatMap)
33#if 0
34 ; // This is here to keep Emacs for indenting the next line
35#endif
36//__________________________________________________________
37AliFMDFloatMap::AliFMDFloatMap(const AliFMDFloatMap& other)
38 : AliFMDMap(other.fMaxDetectors,
39 other.fMaxRings,
40 other.fMaxSectors,
41 other.fMaxStrips),
fe12e09c 42 fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
43 fData(new Float_t[fTotal])
9da38871 44{
45 // Copy constructor
fe12e09c 46 for (Int_t i = 0; i < fTotal; i++)
9da38871 47 fData[i] = other.fData[i];
48}
49
50//__________________________________________________________
fe12e09c 51AliFMDFloatMap::AliFMDFloatMap(Int_t maxDet,
52 Int_t maxRing,
53 Int_t maxSec,
54 Int_t maxStr)
9da38871 55 : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
fe12e09c 56 fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
57 fData(new Float_t[fTotal])
9da38871 58{
59 // Constructor.
60 // Parameters:
61 // maxDet Maximum number of detectors
62 // maxRing Maximum number of rings per detector
63 // maxSec Maximum number of sectors per ring
64 // maxStr Maximum number of strips per sector
cd888a89 65 Reset(0);
9da38871 66}
67
68//__________________________________________________________
69AliFMDFloatMap&
70AliFMDFloatMap::operator=(const AliFMDFloatMap& other)
71{
72 // Assignment operator
cd888a89 73 if(&other != this){
74 fMaxDetectors = other.fMaxDetectors;
75 fMaxRings = other.fMaxRings;
76 fMaxSectors = other.fMaxSectors;
77 fMaxStrips = other.fMaxStrips;
78 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
79 if (fData) delete [] fData;
80 fData = new Float_t[fTotal];
81 for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
82 }
9da38871 83 return *this;
84}
85
86//__________________________________________________________
87void
88AliFMDFloatMap::Reset(const Float_t& val)
89{
90 // Reset map to val
fe12e09c 91 for (Int_t i = 0; i < fTotal; i++) fData[i] = val;
9da38871 92}
93
94//__________________________________________________________
95Float_t&
96AliFMDFloatMap::operator()(UShort_t det,
97 Char_t ring,
98 UShort_t sec,
99 UShort_t str)
100{
101 // Get data
102 // Parameters:
103 // det Detector #
104 // ring Ring ID
105 // sec Sector #
106 // str Strip #
107 // Returns appropriate data
108 return fData[CalcIndex(det, ring, sec, str)];
109}
110
111//__________________________________________________________
112const Float_t&
113AliFMDFloatMap::operator()(UShort_t det,
114 Char_t ring,
115 UShort_t sec,
116 UShort_t str) const
117{
118 // Get data
119 // Parameters:
120 // det Detector #
121 // ring Ring ID
122 // sec Sector #
123 // str Strip #
124 // Returns appropriate data
125 return fData[CalcIndex(det, ring, sec, str)];
126}
127
128//__________________________________________________________
129//
130// EOF
131//
132