1 /**************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN. *
3 * All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************/
18 /** @file AliFMDBoolMap.cxx
19 @author Christian Holm Christensen <cholm@nbi.dk>
20 @date Sun Mar 26 18:28:42 2006
21 @brief Per strip Boolean map
23 //__________________________________________________________
25 // Map of Bool_t for each FMD strip
26 // Used in calibration and the like classes.
27 // Used amoung other things for dead-channel map
28 // Can also be used for other stuff too
29 // Created Mon Nov 8 12:51:51 2004 by Christian Holm Christensen
31 #include "AliFMDBoolMap.h" //ALIFMDBOOLMAP_H
32 //__________________________________________________________
33 ClassImp(AliFMDBoolMap)
35 ; // This is here to keep Emacs for indenting the next line
37 //__________________________________________________________
38 AliFMDBoolMap::AliFMDBoolMap(const AliFMDBoolMap& other)
39 : AliFMDMap(other.fMaxDetectors,
43 fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
47 if (fTotal == 0) fTotal = 51200;
48 fData = new Bool_t[fTotal];
49 for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
52 //__________________________________________________________
53 AliFMDBoolMap::AliFMDBoolMap()
63 //__________________________________________________________
64 AliFMDBoolMap::AliFMDBoolMap(UShort_t maxDet,
68 : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
69 fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
74 // maxDet Maximum number of detectors
75 // maxRing Maximum number of rings per detector
76 // maxSec Maximum number of sectors per ring
77 // maxStr Maximum number of strips per sector
78 if (fTotal == 0) fTotal = 51200;
79 fData = new Bool_t[fTotal];
83 //__________________________________________________________
85 AliFMDBoolMap::operator=(const AliFMDBoolMap& other)
87 // Assignment operator
88 fMaxDetectors = other.fMaxDetectors;
89 fMaxRings = other.fMaxRings;
90 fMaxSectors = other.fMaxSectors;
91 fMaxStrips = other.fMaxStrips;
92 if (fData) delete [] fData;
93 fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
94 if (fTotal == 0) fTotal = 51200;
95 fData = new Bool_t[fTotal];
96 for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
100 //__________________________________________________________
102 AliFMDBoolMap::Reset(const Bool_t& val)
105 for (Int_t i = 0; i < fTotal; i++) fData[i] = val;
108 //__________________________________________________________
110 AliFMDBoolMap::operator()(UShort_t det,
121 // Returns appropriate data
122 return fData[CalcIndex(det, ring, sec, str)];
125 //__________________________________________________________
127 AliFMDBoolMap::operator()(UShort_t det,
138 // Returns appropriate data
139 return fData[CalcIndex(det, ring, sec, str)];
142 //__________________________________________________________