]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONTriggerCrateConfig.h
minor coverity defect: added protection for self-assignment
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerCrateConfig.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 // $Id$ 
5
6 /// \ingroup calib
7 /// \class AliMUONTriggerCrateConfig
8 /// \brief The class defines the configuration of trigger crate
9 ///
10 /// \author Ch. Finck, Subatech Nantes
11
12 #ifndef ALI_MUON_TRIGGER_CRATE_CONFIG_H
13 #define ALI_MUON_TRIGGER_CRATE_CONFIG_H
14
15 #include "AliMpArrayI.h"
16 #include "AliMpTriggerCrate.h"
17
18 #include <TObject.h>
19 #include <TString.h>
20 #include "AliMpArrayI.h"
21
22 class AliMUONTriggerCrateConfig : public  TObject {
23
24   public:
25     AliMUONTriggerCrateConfig(AliMpTriggerCrate* mpTriggerCrate);
26     AliMUONTriggerCrateConfig(TRootIOCtor* ioCtor);
27     virtual ~AliMUONTriggerCrateConfig();
28     
29       // set methods
30     void SetMask(UShort_t mask);
31     void SetMode(UShort_t mode);
32     void SetCoinc(UShort_t coinc);
33
34       // get methods
35     const Char_t* GetName() const;
36     UShort_t GetId()  const;
37     UShort_t GetMask() const;
38     UShort_t GetMode() const;
39     UShort_t GetCoinc() const;
40     Int_t  GetNofLocalBoards() const;
41     Int_t  GetLocalBoardId(Int_t index) const;
42     Bool_t HasLocalBoard(Int_t localBoardId) const;
43     Bool_t AddLocalBoard(Int_t localBoardId);
44     
45     // Only for checking data memebres for backward compatibility
46     // These methods should not be called from other code !!!
47     Int_t  GetNofLocalBoardsOld() const;
48     Int_t  GetLocalBoardIdOld(Int_t index) const;
49
50   private:
51     /// Not implemented
52     AliMUONTriggerCrateConfig();
53     /// Not implemented
54     AliMUONTriggerCrateConfig(const AliMUONTriggerCrateConfig& rhs);
55     /// Not implemented
56     AliMUONTriggerCrateConfig& operator=(const AliMUONTriggerCrateConfig& rhs);
57
58     // data members
59     AliMpTriggerCrate* fMpCrate; ///< mapping crate
60     UShort_t           fMask;    ///< regional mask
61     UShort_t           fMode;    ///< mode operating for crate
62     UShort_t           fCoinc;   ///< coincidence mode for crate
63     
64     // not used data members kept for backward compatibility
65     UShort_t     fId;            ///< crate number 
66     AliMpArrayI  fLocalBoard;    ///< local board connected to this crate
67  
68   ClassDef(AliMUONTriggerCrateConfig,2)  // The class collectiong electronics properties of DDL
69 };
70
71 // inline functions
72
73 /// Set regional mask
74 inline void AliMUONTriggerCrateConfig::SetMask(UShort_t mask)   
75 { fMask = mask; }
76
77 /// Set mode operating for crate
78 inline void AliMUONTriggerCrateConfig::SetMode(UShort_t mode)   
79 { fMode = mode; }
80
81 /// Set coincidence mode for crate
82 inline void AliMUONTriggerCrateConfig::SetCoinc(UShort_t coinc) 
83 { fCoinc = coinc; }
84
85 /// Return  name
86 inline const Char_t* AliMUONTriggerCrateConfig::GetName() const
87 {  return fMpCrate->GetName(); }
88
89 /// Return  Id
90 inline UShort_t AliMUONTriggerCrateConfig::GetId() const
91 {  return fMpCrate->GetId(); }
92
93 /// Return mask
94 inline UShort_t AliMUONTriggerCrateConfig::GetMask() const
95 {  return fMask; }
96
97 /// Return Mode
98 inline UShort_t AliMUONTriggerCrateConfig::GetMode() const
99 {  return fMode; }
100
101 /// Return coinc
102 inline UShort_t AliMUONTriggerCrateConfig::GetCoinc() const
103 {  return fCoinc; }
104
105 #endif
106
107
108
109
110
111
112
113
114
115
116
117
118
119