]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding switch enum & local board id for X-Y copied inputs
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Jun 2007 09:02:15 +0000 (09:02 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Jun 2007 09:02:15 +0000 (09:02 +0000)
(Christian)

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

index c38cccef05ded7a6680cd984d2540667cbb971e0..2ca7a5b29876cb9ba758f353ca6f0f44a93aa79f 100644 (file)
@@ -9,7 +9,7 @@
  * without fee, provided that the above copyright notice appears in all   *
  * copies and that both the copyright notice and this permission notice   *
  * appear in the supporting documentation. The authors make no claims     *
  * without fee, provided that the above copyright notice appears in all   *
  * copies and that both the copyright notice and this permission notice   *
  * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *Crate
+ * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
@@ -38,7 +38,7 @@
 #include "AliMpLocalBoard.h"
 #include "AliMpSegmentation.h"
 #include "AliMpVSegmentation.h"
 #include "AliMpLocalBoard.h"
 #include "AliMpSegmentation.h"
 #include "AliMpVSegmentation.h"
-
+#include "AliMpStringObjMap.h"
 #include "AliLog.h"
 
 #include <Riostream.h>
 #include "AliLog.h"
 
 #include <Riostream.h>
@@ -271,6 +271,11 @@ Bool_t  AliMpDDLStore::ReadTriggerDDLs()
 {
 /// create trigger DDL object ddl<->Crate<->local board
   
 {
 /// create trigger DDL object ddl<->Crate<->local board
   
+   AliMpStringObjMap inputXfromMap;
+   AliMpStringObjMap inputXtoMap;
+   AliMpStringObjMap inputYfromMap;
+   AliMpStringObjMap inputYtoMap;
+
     Int_t nonNotified = 0;
 
     Int_t iDDL = -1;
     Int_t nonNotified = 0;
 
     Int_t iDDL = -1;
@@ -381,6 +386,42 @@ Bool_t  AliMpDDLStore::ReadTriggerDDLs()
        }
       }
 
        }
       }
 
+      // map the different copies between cards in X and Y inputs
+      // when copying Xinput, Yinput are copied as well
+      if (tmp.Contains("X3input1")) 
+      {
+       TObjArray* stringList = tmp.Tokenize(TString(" "));
+  
+       TString copyX = ((TObjString*)stringList->At(3))->GetString();
+       TString input = ((TObjString*)stringList->At(2))->GetString();;
+
+       if (copyX.Contains("(1)")) { 
+         inputXfromMap.Add(input, board);
+         inputYfromMap.Add(input, board);
+
+       }
+       if (copyX.Contains("(2)")) {
+         inputXtoMap.Add(input, board);
+         inputYtoMap.Add(input, board);
+       }
+       delete stringList;
+      }
+
+      if (tmp.Contains("Y1input1")) 
+      {
+       TObjArray* stringList = tmp.Tokenize(TString(" "));
+
+       TString copyY = ((TObjString*)stringList->At(3))->GetString();
+       TString input = ((TObjString*)stringList->At(2))->GetString();;
+
+       if (copyY.Contains("(1)")) 
+           inputYfromMap.Add(input, board);
+       if (copyY.Contains("(2)")) 
+           inputYtoMap.Add(input, board);
+       delete stringList;
+      }
+
+
       if (tmp.Contains("transv")) 
       {
        // set transverse connector
       if (tmp.Contains("transv")) 
       {
        // set transverse connector
@@ -414,6 +455,37 @@ Bool_t  AliMpDDLStore::ReadTriggerDDLs()
 
       }
     }
 
       }
     }
+    
+    // set copy card number to where the X-Y inputs are copied and
+    // from where the X-Y inputs come.
+    // deleting the first item (TString) done by AliMpStringObjMap itself
+    // keep AliMpLocalBoard object undelete
+
+    TString value;
+
+    for (inputXfromMap.First(); !inputXfromMap.IsDone(); inputXfromMap.Next()) {
+      
+      value = inputXfromMap.CurrentKey();
+      AliMpLocalBoard* boardFrom = (AliMpLocalBoard*)inputXfromMap.CurrentItem();
+      AliMpLocalBoard* boardTo   = (AliMpLocalBoard*)inputXtoMap.Get(value);
+      boardFrom->SetInputXto(boardTo->GetId());
+      boardTo->SetInputXfrom(boardFrom->GetId());
+      AliDebug(3, Form("copy xInputs from local id %d_%s_%d to %d_%s_%d\n", 
+                      boardTo->GetInputXfrom(), boardFrom->GetCrate().Data(), boardFrom->GetSlot(),
+                      boardFrom->GetInputXto(), boardTo->GetCrate().Data(), boardTo->GetSlot()));
+    }
+
+    for (inputYfromMap.First(); !inputYfromMap.IsDone(); inputYfromMap.Next()) {
+
+      value = inputYfromMap.CurrentKey();
+      AliMpLocalBoard* boardFrom = (AliMpLocalBoard*)inputYfromMap.CurrentItem();
+      AliMpLocalBoard* boardTo   = (AliMpLocalBoard*)inputYtoMap.Get(value);
+      boardFrom->SetInputYto(boardTo->GetId());
+      boardTo->SetInputYfrom(boardFrom->GetId());
+      AliDebug(3, Form("copy yInputs from local id %d_%s_%d to %d_%s_%d\n", 
+                      boardTo->GetInputYfrom(), boardFrom->GetCrate().Data(), boardFrom->GetSlot(),
+                      boardFrom->GetInputYto(), boardTo->GetCrate().Data(), boardTo->GetSlot()));
+    }
 
     return kTRUE;
 }
 
     return kTRUE;
 }
index 39f96e0902aa279ff518f0e88bf477f75fac94e3..4c09198b621e3c5e1bd128dec2b1ed902d4d4472 100644 (file)
@@ -44,8 +44,11 @@ AliMpLocalBoard::AliMpLocalBoard(Int_t id, const Char_t* name, Int_t slot)
       fCrate(),
       fSwitches(false),
       fNotified(true),
       fCrate(),
       fSwitches(false),
       fNotified(true),
-      fDEId(false)
-
+      fDEId(false),
+      fInputXfrom(0),
+      fInputXto(0),
+      fInputYfrom(0),
+      fInputYto(0)
 {
 /// Default constructor
 }
 {
 /// Default constructor
 }
@@ -59,7 +62,11 @@ AliMpLocalBoard::AliMpLocalBoard(TRootIOCtor* /*ioCtor*/)
       fCrate(),
       fSwitches(),
       fNotified(),
       fCrate(),
       fSwitches(),
       fNotified(),
-      fDEId()
+      fDEId(),
+      fInputXfrom(0),
+      fInputXto(0),
+      fInputYfrom(0),
+      fInputYto(0)
 {
 /// Root IO constructor
 }
 {
 /// Root IO constructor
 }
index a8a6ebeb29a2892480583ea549d8e2376e00d54b..b2bbc82f140509436d16328864abc687f8415687 100644 (file)
@@ -47,6 +47,14 @@ class AliMpLocalBoard : public TNamed
     Int_t  GetNofSwitches() const;
     Int_t  GetSwitch(Int_t index) const;
 
     Int_t  GetNofSwitches() const;
     Int_t  GetSwitch(Int_t index) const;
 
+    // switch enum for local board (see PRR, chpt: 2.4.4)
+    enum {kX2d, kX2m, kX2u, ///< (1) indicate a change of strip pitch in Y circuit
+         kOR0, kOR1,  ///< taking into account the different segmentation in Y from MT1 to MT2
+         kENY,        ///< (0) enable communication in Y to n+/-1 board via tranverse connector, (1) disable
+         kZeroAllYLSB,///< (1) reset the LSB for special configuration of board RC2L5B4 & RC2L6B1
+         kZeroDown,   ///< (0) information is expected from n-1 board for X input, (1) not
+         kZeroMiddle, ///< (0) always, not used
+         kZeroUp };   ///< (0) information is expected from n+1 board for X input, (1) not
 
     // Transverse connector
     //     
 
     // Transverse connector
     //     
@@ -72,6 +80,16 @@ class AliMpLocalBoard : public TNamed
     // given position (line, col)
     AliMpIntPair GetPosition() const;
 
     // given position (line, col)
     AliMpIntPair GetPosition() const;
 
+    // Id to be copy to or from
+    Int_t GetInputXfrom() {return fInputXfrom;}
+    Int_t GetInputXto()   {return fInputXto;}
+    Int_t GetInputYfrom() {return fInputYfrom;}
+    Int_t GetInputYto()   {return fInputYto;}
+
+    void SetInputXfrom(Int_t id) {fInputXfrom = id;}
+    void SetInputXto(Int_t id)   {fInputXto   = id;}
+    void SetInputYfrom(Int_t id) {fInputYfrom = id;}
+    void SetInputYto(Int_t id)   {fInputYto   = id;}
 
  private:
   /// Not implemented
 
  private:
   /// Not implemented
@@ -90,7 +108,11 @@ class AliMpLocalBoard : public TNamed
    TString     fCrate;    ///< Crate name
    AliMpArrayI fSwitches; ///< switches
    Bool_t      fNotified; ///< notified flag (not copy card)
    TString     fCrate;    ///< Crate name
    AliMpArrayI fSwitches; ///< switches
    Bool_t      fNotified; ///< notified flag (not copy card)
-   AliMpArrayI fDEId;    ///< list of Detection element to which this local board is connected
+   AliMpArrayI fDEId;     ///< list of Detection element to which this local board is connected
+   Int_t       fInputXfrom;///< local id of x3-4 inputs copied from (zero: not copied)
+   Int_t       fInputXto;  ///< local id of x3-4 inputs copied to (zero: not copied)
+   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,1) //utility class for the motif type
 };
 
   ClassDef(AliMpLocalBoard,1) //utility class for the motif type
 };