]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - MUON/AliMUONTriggerCrateConfig.cxx
Fixes from Andrea
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerCrateConfig.cxx
... / ...
CommitLineData
1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16// $Id$
17// $MpId: AliMpTrigger.cxx,v 1.4 2006/05/24 13:58:52 ivana Exp $
18
19//-----------------------------------------------------------------------------
20// Class AliMUONTriggerCrateConfig
21// --------------------
22// The class defines the configuration of trigger crate
23// Author: Ch. Finck, Subatech Nantes
24//-----------------------------------------------------------------------------
25
26#include "AliMUONTriggerCrateConfig.h"
27
28#include "AliLog.h"
29
30#include <Riostream.h>
31
32/// \cond CLASSIMP
33ClassImp(AliMUONTriggerCrateConfig)
34/// \endcond
35
36
37 //______________________________________________________________________________
38AliMUONTriggerCrateConfig::AliMUONTriggerCrateConfig()
39 : TNamed("Trigger Crate","configuration trigger crate"),
40 fId(0),
41 fMask(0),
42 fMode(0),
43 fCoinc(0),
44 fLocalBoard(false)
45{
46/// Standard constructor for Shuttle + DA
47}
48
49
50 //______________________________________________________________________________
51AliMUONTriggerCrateConfig::AliMUONTriggerCrateConfig(const Char_t* name, UShort_t id, UShort_t mask, UShort_t mode, UShort_t coinc)
52 : TNamed(name, "configuration trigger crate"),
53 fId(id),
54 fMask(mask),
55 fMode(mode),
56 fCoinc(coinc),
57 fLocalBoard(false)
58{
59/// Standard constructor for Shuttle + DA
60}
61
62
63//______________________________________________________________________________
64AliMUONTriggerCrateConfig::~AliMUONTriggerCrateConfig()
65{
66/// Destructor
67}
68
69//
70// public methods
71//
72
73//______________________________________________________________________________
74Bool_t AliMUONTriggerCrateConfig::AddLocalBoard(Int_t localBoardId)
75{
76/// Add detection element with given detElemId.
77/// Return true if the detection element was added
78
79 if ( HasLocalBoard(localBoardId) ) {
80 AliWarningStream()
81 << "Local board with Id=" << localBoardId << " already present."
82 << endl;
83 return false;
84 }
85
86 fLocalBoard.Add(localBoardId);
87 return true;
88}
89
90
91//______________________________________________________________________________
92Int_t AliMUONTriggerCrateConfig::GetNofLocalBoards() const
93{
94/// Return the number of local board in this crate
95
96 return fLocalBoard.GetSize();
97}
98
99//______________________________________________________________________________
100Int_t AliMUONTriggerCrateConfig::GetLocalBoardId(Int_t index) const
101{
102/// Return the local board by index (in loop)
103
104 if (index >= 0 && index < fLocalBoard.GetSize())
105 return fLocalBoard.GetValue(index);
106 else
107 return 0; // begin at 1
108}
109
110//______________________________________________________________________________
111Bool_t AliMUONTriggerCrateConfig::HasLocalBoard(Int_t localBoardId) const
112{
113/// Return true if crate has local boardwith given localBoardId
114
115 return fLocalBoard.HasValue(localBoardId);
116}
117