1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 // $MpId: AliMpTrigger.cxx,v 1.4 2006/05/24 13:58:52 ivana Exp $
19 //-----------------------------------------------------------------------------
20 // Class AliMpGlobalCrate
21 // --------------------
22 // The class defines the properties of trigger crate
23 // Author: Ch. Finck, Subatech Nantes
24 //-----------------------------------------------------------------------------
26 #include "AliMpGlobalCrate.h"
27 #include "AliMpDEManager.h"
28 #include "AliMpConstants.h"
32 #include <Riostream.h>
35 ClassImp(AliMpGlobalCrate)
38 const Char_t* AliMpGlobalCrate::fgkJtagName = "JtagBoard";
39 const Char_t* AliMpGlobalCrate::fgkFirstDarcName = "LeftDarcBoard";
40 const Char_t* AliMpGlobalCrate::fgkSecondDarcName = "RightDarcBoard";
41 const Char_t* AliMpGlobalCrate::fgkGlobalName = "GlobalBoard";
42 const Char_t* AliMpGlobalCrate::fgkFetName = "FetBoard";
44 const Int_t AliMpGlobalCrate::fgkGlobalNofRegisters = 13;
45 const Int_t AliMpGlobalCrate::fgkFetNofRegisters = 7;
46 const Int_t AliMpGlobalCrate::fgkJtagNofLines = 4;
47 //______________________________________________________________________________
48 AliMpGlobalCrate::AliMpGlobalCrate()
49 : TNamed("GlobalCrate", "mapping trigger global crate"),
56 fFirstDarcVmeAddr(0x0),
60 fFirstDarcL1TimeOut(0),
61 fSecondDarcVmeAddr(0x0),
63 fSecondDarcDisable(0),
64 fSecondDarcL0Delay(0),
65 fSecondDarcL1TimeOut(0),
70 for (Int_t i = 0; i < fgkGlobalNofRegisters; ++i)
71 fGlobalRegisters[i] = 0;
73 for (Int_t j = 0; j < fgkFetNofRegisters; ++j)
79 /// Standard constructor
82 //______________________________________________________________________________
83 AliMpGlobalCrate::AliMpGlobalCrate(TRootIOCtor* /*ioCtor*/)
84 : TNamed("GlobalCrate", "mapping trigger global crate"),
91 fFirstDarcVmeAddr(0x0),
95 fFirstDarcL1TimeOut(0),
96 fSecondDarcVmeAddr(0x0),
98 fSecondDarcDisable(0),
99 fSecondDarcL0Delay(0),
100 fSecondDarcL1TimeOut(0),
106 /// Root IO constructor
109 //______________________________________________________________________________
110 AliMpGlobalCrate::~AliMpGlobalCrate()
115 //______________________________________________________________________________
116 Bool_t AliMpGlobalCrate::GetEnableJtag(Int_t index) const
118 /// returns enable mask for a given Jtag line
120 if (index > fgkJtagNofLines) {
121 AliWarning("Index size too big for Jtag line");
124 return ((fEnableJtag >> index) & 0x1);
128 //______________________________________________________________________________
129 void AliMpGlobalCrate::SetJtagCrateName(Int_t index, TString name)
131 /// Get Jtag crate name for a given index
132 if (index > AliMpConstants::LocalBoardNofChannels()) {
133 AliWarning("Index size too big for Jtag line");
136 fJtagCrateName[index] = name;
139 //______________________________________________________________________________
140 TString AliMpGlobalCrate::GetJtagCrateName(Int_t jtagLine, Int_t index) const
142 /// Get the crate name for a given line and a given index
143 if (jtagLine > AliMpConstants::LocalBoardNofChannels() || index > AliMpConstants::LocalBoardNofChannels())
146 return fJtagCrateName[jtagLine*fgkJtagNofLines + index];
149 //______________________________________________________________________________
150 UInt_t AliMpGlobalCrate::GetGlobalRegister(Int_t index) const
152 /// return global register for a given index
153 if (index > fgkGlobalNofRegisters) {
154 AliWarning("Index size too big for Global Register");
157 return fGlobalRegisters[index];
160 //______________________________________________________________________________
161 void AliMpGlobalCrate::SetGlobalRegister(Int_t index, UInt_t reg)
163 /// set Global register for a given index
164 if (index > fgkGlobalNofRegisters) {
165 AliWarning("Index size too big for Global Register");
168 fGlobalRegisters[index] = reg;
171 //______________________________________________________________________________
172 UInt_t AliMpGlobalCrate::GetFetRegister(Int_t index) const
174 /// return global register for a given index
175 if (index > fgkFetNofRegisters) {
176 AliWarning("Index size too big for Fet Register");
179 return fFetRegisters[index];
182 //______________________________________________________________________________
183 void AliMpGlobalCrate::SetFetRegister(Int_t index, UInt_t reg)
185 /// set Global register for a given index
186 if (index > fgkFetNofRegisters) {
187 AliWarning("Index size too big for Global Register");
190 fFetRegisters[index] = reg;