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: AliMpBusPatch.cxx,v 1.4 2006/05/24 13:58:34 ivana Exp $
19 // --------------------
20 // Class AliMpBusPatch
21 // --------------------
22 // The class defines the properties of BusPatch
23 // Author: Ivana Hrivnacova, IPN Orsay
25 #include "AliMpBusPatch.h"
29 #include <Riostream.h>
32 ClassImp(AliMpBusPatch)
35 const Int_t AliMpBusPatch::fgkOffset = 100;
40 //____________________________________________________________________
41 Int_t AliMpBusPatch::GetGlobalBusID(Int_t localID, Int_t ddlID)
43 /// return global bus id from local bus and ddl id
45 return ddlID*fgkOffset + localID;
48 //____________________________________________________________________
49 Int_t AliMpBusPatch::GetLocalBusID(Int_t globalID, Int_t ddlID)
51 /// return local bus id from local bus id
53 return globalID - ddlID*fgkOffset;
57 //______________________________________________________________________________
58 AliMpBusPatch::AliMpBusPatch(Int_t id, Int_t detElemId, Int_t ddlId)
65 /// Standard constructor
68 //______________________________________________________________________________
69 AliMpBusPatch::AliMpBusPatch(TRootIOCtor* /*ioCtor*/)
76 /// Root IO constructor
79 //______________________________________________________________________________
80 AliMpBusPatch::~AliMpBusPatch()
89 //______________________________________________________________________________
90 Bool_t AliMpBusPatch::AddManu(Int_t manuId)
92 /// Add detection element with given detElemId.
93 /// Return true if the detection element was added
95 if ( HasManu(manuId) ) {
97 << "Manu with manuId=" << manuId << " already present."
106 //______________________________________________________________________________
107 Int_t AliMpBusPatch::GetNofManus() const
109 /// Return the number of detection elements connected to this DDL
111 return fManus.GetSize();
114 //______________________________________________________________________________
115 Int_t AliMpBusPatch::GetManuId(Int_t index) const
117 /// Return the detection element by index (in loop)
119 return fManus.GetValue(index);
122 //______________________________________________________________________________
123 Bool_t AliMpBusPatch::HasManu(Int_t manuId) const
125 /// Return true if bus patch has manu with given manuId
127 return fManus.HasValue(manuId);