X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=MUON%2Fmapping%2FAliMpTriggerCrate.cxx;h=96c5f13d4ad62999526f7369a3e6dea70273a318;hb=654f27d444d5d5e23903b26effb5df5e1d7e2a8e;hp=30d86b3baa5c3ae2efa0405ee6de77d505b7a1f6;hpb=30f77987447097cacd4d2f9a1c52c7b84e50e783;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/mapping/AliMpTriggerCrate.cxx b/MUON/mapping/AliMpTriggerCrate.cxx index 30d86b3baa5..96c5f13d4ad 100644 --- a/MUON/mapping/AliMpTriggerCrate.cxx +++ b/MUON/mapping/AliMpTriggerCrate.cxx @@ -13,16 +13,17 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +// $Id$ +// $MpId: AliMpTrigger.cxx,v 1.4 2006/05/24 13:58:52 ivana Exp $ -// -// -------------------- +//----------------------------------------------------------------------------- // Class AliMpTriggerCrate // -------------------- // The class defines the properties of trigger crate // Author: Ch. Finck, Subatech Nantes +//----------------------------------------------------------------------------- #include "AliMpTriggerCrate.h" -#include "AliMpDEManager.h" #include "AliLog.h" @@ -39,11 +40,18 @@ TString AliMpTriggerCrate::GenerateName(Int_t crateId, Int_t ddlId, Int_t nofDDL /// Generate name TString name; - // \todo parameterise this - if (crateId == 23) + + if (crateId < 2) + name = Form("%d", crateId+1); + + if (crateId == 2) name = "2-3"; - else + + if (crateId > 2) name = Form("%d", crateId); + + if (crateId > 7) + printf("crateId index too large\n"); if (ddlId == nofDDLs) name.Append("R"); @@ -53,20 +61,21 @@ TString AliMpTriggerCrate::GenerateName(Int_t crateId, Int_t ddlId, Int_t nofDDL return name; } - //______________________________________________________________________________ -AliMpTriggerCrate::AliMpTriggerCrate(const Char_t* name, Int_t ddlId) +AliMpTriggerCrate::AliMpTriggerCrate(const Char_t* name, UShort_t id) : TNamed(name, "mapping trigger crate"), - fDdlId(ddlId), + fId(id), + fDdlId(-1), fLocalBoard(false) { -/// Standard constructor +/// Standard constructor } //______________________________________________________________________________ AliMpTriggerCrate::AliMpTriggerCrate(TRootIOCtor* /*ioCtor*/) : TNamed(), + fId(), fDdlId(), fLocalBoard() { @@ -86,8 +95,8 @@ AliMpTriggerCrate::~AliMpTriggerCrate() //______________________________________________________________________________ Bool_t AliMpTriggerCrate::AddLocalBoard(Int_t localBoardId) { -/// Add detection element with given detElemId. -/// Return true if the detection element was added +/// Add local boards with given detElemId. +/// Return true if the local board was added if ( HasLocalBoard(localBoardId) ) { AliWarningStream() @@ -114,7 +123,10 @@ Int_t AliMpTriggerCrate::GetLocalBoardId(Int_t index) const { /// Return the local board by index (in loop) - return fLocalBoard.GetValue(index); + if (index >= 0 && index < fLocalBoard.GetSize()) + return fLocalBoard.GetValue(index); + else + return 0; // begin at 1 } //______________________________________________________________________________