]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDCalibSampleRate.cxx
Removing semaphore .done files.
[u/mrichter/AliRoot.git] / FMD / AliFMDCalibSampleRate.cxx
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  **************************************************************************/
15 /* $Id$ */
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 */
21 //____________________________________________________________________
22 //                                                                          
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. 
28 //
29 #include "AliFMDCalibSampleRate.h"      // ALIFMDCALIBGAIN_H
30 // #include "AliFMDParameters.h"           // ALIFMDPARAMETERS_H
31 #include <AliLog.h>
32
33 //____________________________________________________________________
34 ClassImp(AliFMDCalibSampleRate)
35 #if 0
36   ; // This is here to keep Emacs for indenting the next line
37 #endif
38
39 //____________________________________________________________________
40 AliFMDCalibSampleRate::AliFMDCalibSampleRate()
41   : fRates(AliFMDMap::kMaxDetectors, AliFMDMap::kMaxRings, 2, 1)
42   // fRates(3)
43 {
44   // CTOR 
45   fRates.Reset(1);
46 }
47
48 //____________________________________________________________________
49 AliFMDCalibSampleRate::AliFMDCalibSampleRate(const AliFMDCalibSampleRate& o)
50   : TObject(o), fRates(o.fRates)
51 {
52   // Copy ctor 
53 }
54
55 //____________________________________________________________________
56 AliFMDCalibSampleRate&
57 AliFMDCalibSampleRate::operator=(const AliFMDCalibSampleRate& o)
58 {
59   // Assignment operator 
60   fRates     = o.fRates;
61   return (*this);
62 }
63
64 //____________________________________________________________________
65 void
66 AliFMDCalibSampleRate::Set(UShort_t det, Char_t ring, 
67                            UShort_t sector, UShort_t, UShort_t rate)
68 {
69   // Set values.  Strip argument is ignored 
70   UInt_t nSec  = (ring == 'I' ? 20 : 40);
71   UInt_t board = sector / nSec;
72   fRates(det, ring, board, 0) = rate;
73 }
74
75 //____________________________________________________________________
76 UShort_t
77 AliFMDCalibSampleRate::Rate(UShort_t det, Char_t ring, 
78                             UShort_t sec, UShort_t) const
79 {
80   // Get the sample rate 
81   UInt_t nSec  = (ring == 'I' ? 20 : 40);
82   UInt_t board = sec / nSec;
83   AliDebug(10, Form("Getting sample rate for FMD%d%c[%2d,0] (board %d)", 
84                     det, ring, sec, board));
85   return fRates(det, ring, board, 0);
86 }
87
88 //____________________________________________________________________
89 //
90 // EOF
91 //