Changed a small bug in histogram definition to avoid filling underflow bin
[u/mrichter/AliRoot.git] / FMD / AliFMDCalibSampleRate.cxx
CommitLineData
8f6ee336 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 **************************************************************************/
8f6ee336 15/* $Id$ */
c2fc1258 16/** @file AliFMDCalibSampleRate.cxx
17 @author Christian Holm Christensen <cholm@nbi.dk>
18 @date Sun Mar 26 18:31:09 2006
19 @brief Per digitizer card pulser calibration
20*/
8f6ee336 21//____________________________________________________________________
22//
02a27b50 23// This class stores the sample rate (that is, how many times the
24// ATLRO's sample each VA1 channel). In principle these can be
25// controlled per half ring, but in real life it's most likely that
26// this value will be the same for all detectors. This value must be
27// retrived from DCS or the like.
8f6ee336 28//
29#include "AliFMDCalibSampleRate.h" // ALIFMDCALIBGAIN_H
6169f936 30// #include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
f95a63c4 31// #include <AliLog.h>
32#include "AliFMDDebug.h" // Better debug macros
8f6ee336 33
34//____________________________________________________________________
35ClassImp(AliFMDCalibSampleRate)
36#if 0
37 ; // This is here to keep Emacs for indenting the next line
38#endif
39
40//____________________________________________________________________
41AliFMDCalibSampleRate::AliFMDCalibSampleRate()
c2fc1258 42 : fRates(AliFMDMap::kMaxDetectors, AliFMDMap::kMaxRings, 2, 1)
43 // fRates(3)
8f6ee336 44{
02a27b50 45 // CTOR
c2fc1258 46 fRates.Reset(1);
8f6ee336 47}
48
49//____________________________________________________________________
50AliFMDCalibSampleRate::AliFMDCalibSampleRate(const AliFMDCalibSampleRate& o)
51 : TObject(o), fRates(o.fRates)
02a27b50 52{
53 // Copy ctor
54}
8f6ee336 55
56//____________________________________________________________________
57AliFMDCalibSampleRate&
58AliFMDCalibSampleRate::operator=(const AliFMDCalibSampleRate& o)
59{
02a27b50 60 // Assignment operator
8f6ee336 61 fRates = o.fRates;
62 return (*this);
63}
64
65//____________________________________________________________________
66void
c2fc1258 67AliFMDCalibSampleRate::Set(UShort_t det, Char_t ring,
68 UShort_t sector, UShort_t, UShort_t rate)
8f6ee336 69{
02a27b50 70 // Set values. Strip argument is ignored
c2fc1258 71 UInt_t nSec = (ring == 'I' ? 20 : 40);
72 UInt_t board = sector / nSec;
73 fRates(det, ring, board, 0) = rate;
8f6ee336 74}
75
76//____________________________________________________________________
77UShort_t
c2fc1258 78AliFMDCalibSampleRate::Rate(UShort_t det, Char_t ring,
79 UShort_t sec, UShort_t) const
8f6ee336 80{
02a27b50 81 // Get the sample rate
c2fc1258 82 UInt_t nSec = (ring == 'I' ? 20 : 40);
83 UInt_t board = sec / nSec;
f95a63c4 84 AliFMDDebug(10, ("Getting sample rate for FMD%d%c[%2d,0] (board %d)",
c2fc1258 85 det, ring, sec, board));
86 return fRates(det, ring, board, 0);
8f6ee336 87}
88
89//____________________________________________________________________
90//
91// EOF
92//