]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDCalibStripRange.cxx
Update rawdata format for trigger (Christian)
[u/mrichter/AliRoot.git] / FMD / AliFMDCalibStripRange.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    AliFMDCalibStripRange.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 which strips are read-out.  
24 // In principle this can be set for each half-ring.   
25 // However, in real life, all the detectors will probably read out all
26 // strips, and dead areas can be handled off-line. 
27 // This information comes from DCS or the like.
28 //
29 #include "AliFMDCalibStripRange.h"      // ALIFMDCALIBGAIN_H
30 // #include "AliFMDParameters.h"           // ALIFMDPARAMETERS_H
31
32 //____________________________________________________________________
33 ClassImp(AliFMDCalibStripRange)
34 #if 0
35   ; // This is here to keep Emacs for indenting the next line
36 #endif
37
38 //____________________________________________________________________
39 AliFMDCalibStripRange::AliFMDCalibStripRange()
40   : fRanges(AliFMDMap::kMaxDetectors, AliFMDMap::kMaxRings, 2, 1)
41   // fRanges(3)
42 {
43   // CTOR 
44   fRanges.Reset(1);
45 }
46
47 //____________________________________________________________________
48 AliFMDCalibStripRange::AliFMDCalibStripRange(const AliFMDCalibStripRange& o)
49   : TObject(o), fRanges(o.fRanges)
50 {
51   // Copy CTOR 
52 }
53
54 //____________________________________________________________________
55 AliFMDCalibStripRange&
56 AliFMDCalibStripRange::operator=(const AliFMDCalibStripRange& o)
57 {
58   // Assignement operator
59   fRanges     = o.fRanges;
60   return (*this);
61 }
62
63 //____________________________________________________________________
64 void
65 AliFMDCalibStripRange::Set(UShort_t det, Char_t ring, 
66                            UShort_t sector, UShort_t, UShort_t min, 
67                            UShort_t max)
68 {
69   // Set the min and max for a half-ring 
70   UInt_t nSec  = (ring == 'I' ? 20 : 40);
71   UInt_t board = sector / nSec;
72   fRanges(det, ring, board, 0) = ((max & 0x7f) << 8) + (min & 0x7f);
73 }
74
75 //____________________________________________________________________
76 UShort_t
77 AliFMDCalibStripRange::Min(UShort_t det, Char_t ring, 
78                            UShort_t sec, UShort_t) const
79 {
80   // Get the min for a half-ring 
81   UInt_t nSec  = (ring == 'I' ? 20 : 40);
82   UInt_t board = sec / nSec;
83   return (fRanges(det, ring, board, 0) & 0x7f);
84 }
85
86 //____________________________________________________________________
87 UShort_t
88 AliFMDCalibStripRange::Max(UShort_t det, Char_t ring, 
89                            UShort_t sec, UShort_t) const
90 {
91   // Get the max for a half-ring 
92   UInt_t nSec  = (ring == 'I' ? 20 : 40);
93   UInt_t board = sec / nSec;
94   return ((fRanges(det, ring, board, 0) >> 8) & 0x7f);
95 }
96
97 //____________________________________________________________________
98 //
99 // EOF
100 //