]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Remove old switches format (10 words) using one integer for all switches
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Nov 2007 14:53:15 +0000 (14:53 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Nov 2007 14:53:15 +0000 (14:53 +0000)
- Add default masks member
(Christian)

MUON/mapping/AliMpLocalBoard.cxx
MUON/mapping/AliMpLocalBoard.h

index 17100f2a7e5072c81be01ae07d89839f3389c379..eed7177e3cceba2cc7bf7e971cd22eefbf4b9c39 100644 (file)
@@ -43,7 +43,6 @@ AliMpLocalBoard::AliMpLocalBoard(Int_t id, const Char_t* name, Int_t slot)
       fSlot(slot),
       fTC(true),
       fCrate(),
-      fSwitches(false),
       fSwitch(0),
       fNotified(true),
       fDEId(false),
@@ -62,7 +61,6 @@ AliMpLocalBoard::AliMpLocalBoard(TRootIOCtor* /*ioCtor*/)
       fSlot(),
       fTC(),
       fCrate(),
-      fSwitches(),
       fSwitch(),
       fNotified(),
       fDEId(),
@@ -158,44 +156,24 @@ Bool_t  AliMpLocalBoard::HasDEId(Int_t detElemId) const
 }
 
 //______________________________________________________________________________
-Bool_t AliMpLocalBoard::AddSwitch(Int_t swit)
+void AliMpLocalBoard::SetSwitch(UInt_t swit) 
 {
-/// Add a swicth for the given local board
-/// Return true if switch was added
-
-    if ( swit > 1 ) {
-      AliWarningStream() 
-         << "Invalid value for switch = " << swit 
-         << endl;
-      return false;
-    }
-
-    fSwitches.Add(swit);
-    fSwitch <<= 1;
-    fSwitch |= (swit & 0x1);
-    return true;
-}   
-
-
-//______________________________________________________________________________
-Int_t AliMpLocalBoard::GetNofSwitches() const
-{  
-/// Return the number switches in this local board
-
-  return fSwitches.GetSize(); 
+/// set compact switch 
+  
+  fSwitch = swit;
 }
 
 //______________________________________________________________________________
 Int_t  AliMpLocalBoard::GetSwitch(Int_t index) const
 {
-/// Return switch by index (in loop)
+/// Return switch bit wise
 
-    if (index < fSwitches.GetSize())
-       return fSwitches.GetValue(index);
-    else 
+    if (index > 9) {
        AliWarning("Switch index too large");
-
-    return -1;
+        return -1;
+    }
+    return  (fSwitch >> 9-index) & 0x1;
 }
 
 //______________________________________________________________________________
index 241cfdf0d2ee6d7fa2d28fdcf056f8af1ddef333..1f6f159183588731b77ac31d00f1b2cc890bc24e 100644 (file)
@@ -46,12 +46,10 @@ class AliMpLocalBoard : public TNamed
 
     // Switches
     //
-    Bool_t AddSwitch(Int_t swit);
-    Int_t  GetNofSwitches() const;
+            /// Get switch bit wise (return a inteter for backware compatibility)
     Int_t  GetSwitch(Int_t index) const;
-
             /// Set switch in a compact way
-    void   SetSwitch(UInt_t swit) {fSwitch = swit;}
+    void   SetSwitch(UInt_t swit);
             /// Get switch in a compact way
     UInt_t  GetSwitch() const {return fSwitch;}
 
@@ -85,7 +83,8 @@ class AliMpLocalBoard : public TNamed
              /// Return notified flag (not copy card) 
     Bool_t   IsNotified() const {return fNotified;}
 
-    // given position (line, col)
+    
+    /// given position (line, col)
     AliMpIntPair GetPosition() const;
 
     // Id to be copy to or from
@@ -120,10 +119,8 @@ class AliMpLocalBoard : public TNamed
    
    Int_t       fId;       ///< Identifier (unique)
    Int_t       fSlot;     ///< Slot Identifier in the given crate 
-
    Bool_t      fTC;       ///< Transverse connector
    TString     fCrate;    ///< Crate name
-   AliMpArrayI fSwitches; ///< switches
    UInt_t      fSwitch;   ///< switches in compact way
    Bool_t      fNotified; ///< notified flag (not copy card)
    AliMpArrayI fDEId;     ///< list of Detection element to which this local board is connected
@@ -132,7 +129,7 @@ class AliMpLocalBoard : public TNamed
    Int_t       fInputYfrom;///< local id of y1-4 inputs copied from (zero: not copied)
    Int_t       fInputYto;  ///< local id of y1-4 inputs copied to (zero: not copied)
 
-  ClassDef(AliMpLocalBoard,2) //utility class for the motif type
+  ClassDef(AliMpLocalBoard,3) //utility class for the motif type
 };