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 **************************************************************************/
18 // --------------------
19 // Class AliMpTriggerCrate
20 // --------------------
21 // The class defines the properties of trigger crate
22 // Author: Ch. Finck, Subatech Nantes
24 #include "AliMpTriggerCrate.h"
25 #include "AliMpDEManager.h"
29 #include <Riostream.h>
32 ClassImp(AliMpTriggerCrate)
36 //______________________________________________________________________________
37 TString AliMpTriggerCrate::GenerateName(Int_t crateId, Int_t ddlId, Int_t nofDDLs)
42 // \todo parameterise this
46 name = Form("%d", crateId);
57 //______________________________________________________________________________
58 AliMpTriggerCrate::AliMpTriggerCrate(const Char_t* name, Int_t ddlId)
59 : TNamed(name, "mapping trigger crate"),
64 /// Standard constructor
67 //______________________________________________________________________________
68 AliMpTriggerCrate::AliMpTriggerCrate(TRootIOCtor* /*ioCtor*/)
73 /// Root IO constructor
76 //______________________________________________________________________________
77 AliMpTriggerCrate::~AliMpTriggerCrate()
86 //______________________________________________________________________________
87 Bool_t AliMpTriggerCrate::AddLocalBoard(Int_t localBoardId)
89 /// Add detection element with given detElemId.
90 /// Return true if the detection element was added
92 if ( HasLocalBoard(localBoardId) ) {
94 << "Local board with Id=" << localBoardId << " already present."
99 fLocalBoard.Add(localBoardId);
104 //______________________________________________________________________________
105 Int_t AliMpTriggerCrate::GetNofLocalBoards() const
107 /// Return the number of local board in this crate
109 return fLocalBoard.GetSize();
112 //______________________________________________________________________________
113 Int_t AliMpTriggerCrate::GetLocalBoardId(Int_t index) const
115 /// Return the local board by index (in loop)
117 return fLocalBoard.GetValue(index);
120 //______________________________________________________________________________
121 Bool_t AliMpTriggerCrate::HasLocalBoard(Int_t localBoardId) const
123 /// Return true if crate has local boardwith given localBoardId
125 return fLocalBoard.HasValue(localBoardId);