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),
69 /// Standard constructor
71 for (Int_t i = 0; i < fgkGlobalNofRegisters; ++i)
72 fGlobalRegisters[i] = 0;
74 for (Int_t j = 0; j < fgkFetNofRegisters; ++j)
78 //______________________________________________________________________________
79 AliMpGlobalCrate::AliMpGlobalCrate(TRootIOCtor* /*ioCtor*/)
80 : TNamed("GlobalCrate", "mapping trigger global crate"),
87 fFirstDarcVmeAddr(0x0),
91 fFirstDarcL1TimeOut(0),
92 fSecondDarcVmeAddr(0x0),
94 fSecondDarcDisable(0),
95 fSecondDarcL0Delay(0),
96 fSecondDarcL1TimeOut(0),
102 /// Root IO constructor
105 //______________________________________________________________________________
106 AliMpGlobalCrate::~AliMpGlobalCrate()
111 //______________________________________________________________________________
112 Bool_t AliMpGlobalCrate::GetEnableJtag(Int_t index) const
114 /// returns enable mask for a given Jtag line
116 if (index > fgkJtagNofLines) {
117 AliWarning("Index size too big for Jtag line");
120 return ((fEnableJtag >> index) & 0x1);
124 //______________________________________________________________________________
125 void AliMpGlobalCrate::SetJtagCrateName(Int_t index, TString name)
127 /// Get Jtag crate name for a given index
128 if (index > AliMpConstants::LocalBoardNofChannels()) {
129 AliWarning("Index size too big for Jtag line");
132 fJtagCrateName[index] = name;
135 //______________________________________________________________________________
136 TString AliMpGlobalCrate::GetJtagCrateName(Int_t jtagLine, Int_t index) const
138 /// Get the crate name for a given line and a given index
139 if (jtagLine > AliMpConstants::LocalBoardNofChannels() || index > AliMpConstants::LocalBoardNofChannels())
142 return fJtagCrateName[jtagLine*fgkJtagNofLines + index];
145 //______________________________________________________________________________
146 UInt_t AliMpGlobalCrate::GetGlobalRegister(Int_t index) const
148 /// return global register for a given index
149 if (index > fgkGlobalNofRegisters) {
150 AliWarning("Index size too big for Global Register");
153 return fGlobalRegisters[index];
156 //______________________________________________________________________________
157 void AliMpGlobalCrate::SetGlobalRegister(Int_t index, UInt_t reg)
159 /// set Global register for a given index
160 if (index > fgkGlobalNofRegisters) {
161 AliWarning("Index size too big for Global Register");
164 fGlobalRegisters[index] = reg;
167 //______________________________________________________________________________
168 UInt_t AliMpGlobalCrate::GetFetRegister(Int_t index) const
170 /// return global register for a given index
171 if (index > fgkFetNofRegisters) {
172 AliWarning("Index size too big for Fet Register");
175 return fFetRegisters[index];
178 //______________________________________________________________________________
179 void AliMpGlobalCrate::SetFetRegister(Int_t index, UInt_t reg)
181 /// set Global register for a given index
182 if (index > fgkFetNofRegisters) {
183 AliWarning("Index size too big for Global Register");
186 fFetRegisters[index] = reg;