ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
/* $Id$ */
/** @file    AliFMDUShortMap.cxx
    @author  Christian Holm Christensen <cholm@nbi.dk>
    @date    Mon Mar 27 12:48:18 2006
    @brief   Per strip of unisgned shorts (16 bit) data 
*/
//____________________________________________________________________
//                                                                          
// A map of per strip UShort_t information (for example ADC values,
// number of hits and so on). 
// Used for various calib information, and the like, 
// as well as in reconstruction. 
// Can be used elsewhere too.
//
#include "AliFMDUShortMap.h"		// ALIFMDUSHORTMAP_H

//____________________________________________________________________
ClassImp(AliFMDUShortMap)
#if 0
  ; // This is here to keep Emacs for indenting the next line
#endif

//____________________________________________________________________
AliFMDUShortMap::AliFMDUShortMap(const AliFMDUShortMap& other)
  : AliFMDMap(other.fMaxDetectors, other.fMaxRings, other.fMaxSectors, 
	      other.fMaxStrips), 
    fTotal(0),
    fData(0)
{
  // CTOR
  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
  fData  = new UShort_t[fTotal];
  for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
}

  

//____________________________________________________________________
AliFMDUShortMap::AliFMDUShortMap(UShort_t maxDet, 
				 UShort_t maxRing, 
				 UShort_t maxSec, 
				 UShort_t maxStr)
  : AliFMDMap(maxDet, maxRing, maxSec, maxStr), 
    fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
    fData(0)
{
  // Construct a map
  //
  // Parameters:
  //     maxDet       Maximum # of detectors
  //     maxRinf      Maximum # of rings
  //     maxSec       Maximum # of sectors
  //     maxStr       Maximum # of strips
  if (fTotal == 0) fTotal = 51200;
  fData  = new UShort_t[fTotal];
}

//____________________________________________________________________
AliFMDUShortMap::AliFMDUShortMap()
  : AliFMDMap(), 
    fTotal(0),
    fData(0)
{
  // Construct a map
  //
  // Parameters:
  //     None
}

//____________________________________________________________________
AliFMDUShortMap&
AliFMDUShortMap::operator=(const AliFMDUShortMap& other) 
{
  // Assignment operator
  if (&other == this) return *this; 
  fMaxDetectors = other.fMaxDetectors;
  fMaxRings     = other.fMaxRings;
  fMaxSectors   = other.fMaxSectors;
  fMaxStrips    = other.fMaxStrips;
  if (fData) delete [] fData;
  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
  fData  = new UShort_t[fTotal];
  for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
  return *this;
}

//____________________________________________________________________
void
AliFMDUShortMap::Reset(const UShort_t& val) 
{
  // Reset to val
  for (Int_t i = 0; i < fTotal; i++) fData[i] = val;
}

//____________________________________________________________________
UShort_t& 
AliFMDUShortMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) 
{
  // Get data 
  // 
  // Parameters: 
  //     det       Detector #
  //     ring      Ring ID
  //     sec       Sector # 
  //     str       Strip # 
  //
  // Returns appropriate data
  //
  return fData[CalcIndex(det, ring, sec, str)];
}

//____________________________________________________________________
const UShort_t& 
AliFMDUShortMap::operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
{
  // Get data 
  // 
  // Parameters: 
  //     det       Detector #
  //     ring      Ring ID
  //     sec       Sector # 
  //     str       Strip # 
  //
  // Returns appropriate data
  //
  return fData[CalcIndex(det, ring, sec, str)];
}


//___________________________________________________________________
//
// EOF
//
 AliFMDUShortMap.cxx:1
 AliFMDUShortMap.cxx:2
 AliFMDUShortMap.cxx:3
 AliFMDUShortMap.cxx:4
 AliFMDUShortMap.cxx:5
 AliFMDUShortMap.cxx:6
 AliFMDUShortMap.cxx:7
 AliFMDUShortMap.cxx:8
 AliFMDUShortMap.cxx:9
 AliFMDUShortMap.cxx:10
 AliFMDUShortMap.cxx:11
 AliFMDUShortMap.cxx:12
 AliFMDUShortMap.cxx:13
 AliFMDUShortMap.cxx:14
 AliFMDUShortMap.cxx:15
 AliFMDUShortMap.cxx:16
 AliFMDUShortMap.cxx:17
 AliFMDUShortMap.cxx:18
 AliFMDUShortMap.cxx:19
 AliFMDUShortMap.cxx:20
 AliFMDUShortMap.cxx:21
 AliFMDUShortMap.cxx:22
 AliFMDUShortMap.cxx:23
 AliFMDUShortMap.cxx:24
 AliFMDUShortMap.cxx:25
 AliFMDUShortMap.cxx:26
 AliFMDUShortMap.cxx:27
 AliFMDUShortMap.cxx:28
 AliFMDUShortMap.cxx:29
 AliFMDUShortMap.cxx:30
 AliFMDUShortMap.cxx:31
 AliFMDUShortMap.cxx:32
 AliFMDUShortMap.cxx:33
 AliFMDUShortMap.cxx:34
 AliFMDUShortMap.cxx:35
 AliFMDUShortMap.cxx:36
 AliFMDUShortMap.cxx:37
 AliFMDUShortMap.cxx:38
 AliFMDUShortMap.cxx:39
 AliFMDUShortMap.cxx:40
 AliFMDUShortMap.cxx:41
 AliFMDUShortMap.cxx:42
 AliFMDUShortMap.cxx:43
 AliFMDUShortMap.cxx:44
 AliFMDUShortMap.cxx:45
 AliFMDUShortMap.cxx:46
 AliFMDUShortMap.cxx:47
 AliFMDUShortMap.cxx:48
 AliFMDUShortMap.cxx:49
 AliFMDUShortMap.cxx:50
 AliFMDUShortMap.cxx:51
 AliFMDUShortMap.cxx:52
 AliFMDUShortMap.cxx:53
 AliFMDUShortMap.cxx:54
 AliFMDUShortMap.cxx:55
 AliFMDUShortMap.cxx:56
 AliFMDUShortMap.cxx:57
 AliFMDUShortMap.cxx:58
 AliFMDUShortMap.cxx:59
 AliFMDUShortMap.cxx:60
 AliFMDUShortMap.cxx:61
 AliFMDUShortMap.cxx:62
 AliFMDUShortMap.cxx:63
 AliFMDUShortMap.cxx:64
 AliFMDUShortMap.cxx:65
 AliFMDUShortMap.cxx:66
 AliFMDUShortMap.cxx:67
 AliFMDUShortMap.cxx:68
 AliFMDUShortMap.cxx:69
 AliFMDUShortMap.cxx:70
 AliFMDUShortMap.cxx:71
 AliFMDUShortMap.cxx:72
 AliFMDUShortMap.cxx:73
 AliFMDUShortMap.cxx:74
 AliFMDUShortMap.cxx:75
 AliFMDUShortMap.cxx:76
 AliFMDUShortMap.cxx:77
 AliFMDUShortMap.cxx:78
 AliFMDUShortMap.cxx:79
 AliFMDUShortMap.cxx:80
 AliFMDUShortMap.cxx:81
 AliFMDUShortMap.cxx:82
 AliFMDUShortMap.cxx:83
 AliFMDUShortMap.cxx:84
 AliFMDUShortMap.cxx:85
 AliFMDUShortMap.cxx:86
 AliFMDUShortMap.cxx:87
 AliFMDUShortMap.cxx:88
 AliFMDUShortMap.cxx:89
 AliFMDUShortMap.cxx:90
 AliFMDUShortMap.cxx:91
 AliFMDUShortMap.cxx:92
 AliFMDUShortMap.cxx:93
 AliFMDUShortMap.cxx:94
 AliFMDUShortMap.cxx:95
 AliFMDUShortMap.cxx:96
 AliFMDUShortMap.cxx:97
 AliFMDUShortMap.cxx:98
 AliFMDUShortMap.cxx:99
 AliFMDUShortMap.cxx:100
 AliFMDUShortMap.cxx:101
 AliFMDUShortMap.cxx:102
 AliFMDUShortMap.cxx:103
 AliFMDUShortMap.cxx:104
 AliFMDUShortMap.cxx:105
 AliFMDUShortMap.cxx:106
 AliFMDUShortMap.cxx:107
 AliFMDUShortMap.cxx:108
 AliFMDUShortMap.cxx:109
 AliFMDUShortMap.cxx:110
 AliFMDUShortMap.cxx:111
 AliFMDUShortMap.cxx:112
 AliFMDUShortMap.cxx:113
 AliFMDUShortMap.cxx:114
 AliFMDUShortMap.cxx:115
 AliFMDUShortMap.cxx:116
 AliFMDUShortMap.cxx:117
 AliFMDUShortMap.cxx:118
 AliFMDUShortMap.cxx:119
 AliFMDUShortMap.cxx:120
 AliFMDUShortMap.cxx:121
 AliFMDUShortMap.cxx:122
 AliFMDUShortMap.cxx:123
 AliFMDUShortMap.cxx:124
 AliFMDUShortMap.cxx:125
 AliFMDUShortMap.cxx:126
 AliFMDUShortMap.cxx:127
 AliFMDUShortMap.cxx:128
 AliFMDUShortMap.cxx:129
 AliFMDUShortMap.cxx:130
 AliFMDUShortMap.cxx:131
 AliFMDUShortMap.cxx:132
 AliFMDUShortMap.cxx:133
 AliFMDUShortMap.cxx:134
 AliFMDUShortMap.cxx:135
 AliFMDUShortMap.cxx:136
 AliFMDUShortMap.cxx:137
 AliFMDUShortMap.cxx:138
 AliFMDUShortMap.cxx:139
 AliFMDUShortMap.cxx:140
 AliFMDUShortMap.cxx:141
 AliFMDUShortMap.cxx:142
 AliFMDUShortMap.cxx:143
 AliFMDUShortMap.cxx:144
 AliFMDUShortMap.cxx:145
 AliFMDUShortMap.cxx:146
 AliFMDUShortMap.cxx:147