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 AliMpTriggerCrate
21 // --------------------
22 // The class defines the properties of trigger crate
23 // Author: Ch. Finck, Subatech Nantes
24 //-----------------------------------------------------------------------------
26 #include "AliMpTriggerCrate.h"
30 #include <Riostream.h>
33 ClassImp(AliMpTriggerCrate)
37 //______________________________________________________________________________
38 TString AliMpTriggerCrate::GenerateName(Int_t crateId, Int_t ddlId, Int_t nofDDLs)
45 name = Form("%d", crateId+1);
51 name = Form("%d", crateId);
54 printf("crateId index too large\n");
64 //______________________________________________________________________________
65 AliMpTriggerCrate::AliMpTriggerCrate(const Char_t* name, UShort_t id)
66 : TNamed(name, "mapping trigger crate"),
72 /// Standard constructor
75 //______________________________________________________________________________
76 AliMpTriggerCrate::AliMpTriggerCrate(TRootIOCtor* /*ioCtor*/)
82 /// Root IO constructor
85 //______________________________________________________________________________
86 AliMpTriggerCrate::~AliMpTriggerCrate()
95 //______________________________________________________________________________
96 Bool_t AliMpTriggerCrate::AddLocalBoard(Int_t localBoardId)
98 /// Add local boards with given detElemId.
99 /// Return true if the local board was added
101 if ( HasLocalBoard(localBoardId) ) {
103 << "Local board with Id=" << localBoardId << " already present."
108 fLocalBoard.Add(localBoardId);
113 //______________________________________________________________________________
114 Int_t AliMpTriggerCrate::GetNofLocalBoards() const
116 /// Return the number of local board in this crate
118 return fLocalBoard.GetSize();
121 //______________________________________________________________________________
122 Int_t AliMpTriggerCrate::GetLocalBoardId(Int_t index) const
124 /// Return the local board by index (in loop)
126 if (index >= 0 && index < fLocalBoard.GetSize())
127 return fLocalBoard.GetValue(index);
129 return 0; // begin at 1
132 //______________________________________________________________________________
133 Bool_t AliMpTriggerCrate::HasLocalBoard(Int_t localBoardId) const
135 /// Return true if crate has local boardwith given localBoardId
137 return fLocalBoard.HasValue(localBoardId);