]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpGlobalCrate.cxx
In assignment operator: added check for assignment to self
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpGlobalCrate.cxx
CommitLineData
4d2d44ab 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
16// $Id$
17// $MpId: AliMpTrigger.cxx,v 1.4 2006/05/24 13:58:52 ivana Exp $
18
19//-----------------------------------------------------------------------------
20// Class AliMpGlobalCrate
21// --------------------
22// The class defines the properties of trigger crate
23// Author: Ch. Finck, Subatech Nantes
24//-----------------------------------------------------------------------------
25
26#include "AliMpGlobalCrate.h"
4d2d44ab 27#include "AliMpConstants.h"
28
29#include "AliLog.h"
30
31#include <Riostream.h>
32
33/// \cond CLASSIMP
34ClassImp(AliMpGlobalCrate)
35/// \endcond
36
37const Char_t* AliMpGlobalCrate::fgkJtagName = "JtagBoard";
38const Char_t* AliMpGlobalCrate::fgkFirstDarcName = "LeftDarcBoard";
39const Char_t* AliMpGlobalCrate::fgkSecondDarcName = "RightDarcBoard";
40const Char_t* AliMpGlobalCrate::fgkGlobalName = "GlobalBoard";
41const Char_t* AliMpGlobalCrate::fgkFetName = "FetBoard";
42
43const Int_t AliMpGlobalCrate::fgkGlobalNofRegisters = 13;
44const Int_t AliMpGlobalCrate::fgkFetNofRegisters = 7;
45const Int_t AliMpGlobalCrate::fgkJtagNofLines = 4;
46//______________________________________________________________________________
47AliMpGlobalCrate::AliMpGlobalCrate()
48 : TNamed("GlobalCrate", "mapping trigger global crate"),
49 fJtagVmeAddr(0x0),
50 fJtagClockDiv(0),
51 fJtagRxPhase(0),
52 fJtagRdDelay(0),
53 fEnableJtag(0),
54 fJtagCrateName(),
55 fFirstDarcVmeAddr(0x0),
56 fFirstDarcType(0),
57 fFirstDarcDisable(0),
58 fFirstDarcL0Delay(0),
59 fFirstDarcL1TimeOut(0),
60 fSecondDarcVmeAddr(0x0),
61 fSecondDarcType(0),
62 fSecondDarcDisable(0),
63 fSecondDarcL0Delay(0),
64 fSecondDarcL1TimeOut(0),
65 fGlobalVmeAddr(0x0),
66 fFetVmeAddr(0x0)
67{
a7a4911b 68/// Standard constructor
4d2d44ab 69
70 for (Int_t i = 0; i < fgkGlobalNofRegisters; ++i)
71 fGlobalRegisters[i] = 0;
72
73 for (Int_t j = 0; j < fgkFetNofRegisters; ++j)
74 fFetRegisters[j] = 0;
4d2d44ab 75}
76
77//______________________________________________________________________________
78AliMpGlobalCrate::AliMpGlobalCrate(TRootIOCtor* /*ioCtor*/)
79 : TNamed("GlobalCrate", "mapping trigger global crate"),
80 fJtagVmeAddr(0x0),
81 fJtagClockDiv(0),
82 fJtagRxPhase(0),
83 fJtagRdDelay(0),
84 fEnableJtag(0),
85 fJtagCrateName(),
86 fFirstDarcVmeAddr(0x0),
87 fFirstDarcType(0),
88 fFirstDarcDisable(0),
89 fFirstDarcL0Delay(0),
90 fFirstDarcL1TimeOut(0),
91 fSecondDarcVmeAddr(0x0),
92 fSecondDarcType(0),
93 fSecondDarcDisable(0),
94 fSecondDarcL0Delay(0),
95 fSecondDarcL1TimeOut(0),
96 fGlobalVmeAddr(0x0),
97 fGlobalRegisters(),
98 fFetVmeAddr(0x0),
99 fFetRegisters()
100{
101/// Root IO constructor
102}
103
104//______________________________________________________________________________
105AliMpGlobalCrate::~AliMpGlobalCrate()
106{
107/// Destructor
108}
109
110//______________________________________________________________________________
111Bool_t AliMpGlobalCrate::GetEnableJtag(Int_t index) const
112{
113 /// returns enable mask for a given Jtag line
114
115 if (index > fgkJtagNofLines) {
116 AliWarning("Index size too big for Jtag line");
117 return kFALSE;
118 }
119 return ((fEnableJtag >> index) & 0x1);
120
121}
122
123//______________________________________________________________________________
124void AliMpGlobalCrate::SetJtagCrateName(Int_t index, TString name)
125{
126 /// Get Jtag crate name for a given index
127 if (index > AliMpConstants::LocalBoardNofChannels()) {
128 AliWarning("Index size too big for Jtag line");
129 return;
130 }
131 fJtagCrateName[index] = name;
132}
133
134//______________________________________________________________________________
135TString AliMpGlobalCrate::GetJtagCrateName(Int_t jtagLine, Int_t index) const
136{
137 /// Get the crate name for a given line and a given index
138 if (jtagLine > AliMpConstants::LocalBoardNofChannels() || index > AliMpConstants::LocalBoardNofChannels())
139 return 0x0;
140 else
141 return fJtagCrateName[jtagLine*fgkJtagNofLines + index];
142}
143
144//______________________________________________________________________________
145UInt_t AliMpGlobalCrate::GetGlobalRegister(Int_t index) const
146{
147 /// return global register for a given index
148 if (index > fgkGlobalNofRegisters) {
149 AliWarning("Index size too big for Global Register");
150 return 0;
151 } else
152 return fGlobalRegisters[index];
153}
154
155//______________________________________________________________________________
156void AliMpGlobalCrate::SetGlobalRegister(Int_t index, UInt_t reg)
157{
158 /// set Global register for a given index
159 if (index > fgkGlobalNofRegisters) {
160 AliWarning("Index size too big for Global Register");
161 return;
162 }
163 fGlobalRegisters[index] = reg;
164}
165
166//______________________________________________________________________________
167UInt_t AliMpGlobalCrate::GetFetRegister(Int_t index) const
168{
169 /// return global register for a given index
170 if (index > fgkFetNofRegisters) {
171 AliWarning("Index size too big for Fet Register");
172 return 0;
173 } else
174 return fFetRegisters[index];
175}
176
177//______________________________________________________________________________
178void AliMpGlobalCrate::SetFetRegister(Int_t index, UInt_t reg)
179{
180 /// set Global register for a given index
181 if (index > fgkFetNofRegisters) {
182 AliWarning("Index size too big for Global Register");
183 return;
184 }
185 fFetRegisters[index] = reg;
186}