]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add methods to set/get cable length & change patch module interface needed for station 2
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Jul 2007 13:29:01 +0000 (13:29 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Jul 2007 13:29:01 +0000 (13:29 +0000)
(Christian)

MUON/mapping/AliMpBusPatch.cxx
MUON/mapping/AliMpBusPatch.h

index 0e41dfe8c580d405a530fe8d61901b768acf24ca..c5917775c7ad9b03a0b18fe6b0324d7352dea23c 100644 (file)
@@ -68,7 +68,8 @@ AliMpBusPatch::AliMpBusPatch(Int_t id, Int_t detElemId, Int_t ddlId)
     fDEId(detElemId),
     fDdlId(ddlId),
     fManus(false),
-    fNofManusPerModule(false)
+    fNofManusPerModule(false),
+    fCableLength(-1)
 {
 /// Standard constructor
 }
@@ -80,7 +81,8 @@ AliMpBusPatch::AliMpBusPatch(TRootIOCtor* /*ioCtor*/)
     fDEId(),
     fDdlId(),
     fManus(),
-    fNofManusPerModule(false)
+    fNofManusPerModule(false),
+    fCableLength(-1)
 {
 /// Root IO constructor
 }
@@ -113,23 +115,32 @@ Bool_t AliMpBusPatch::AddManu(Int_t manuId)
 }   
 
 //______________________________________________________________________________
-Bool_t AliMpBusPatch::SetNofManusPerModule()
+Bool_t AliMpBusPatch::SetNofManusPerModule(Int_t manuNumber)
 {
 /// Set the number of manus per patch module (PCB):
-/// - for stations 12 all manus are connected to one PCB,
+/// - for stations 1 all manus are connected to one PCB,
+/// - for stations 2 there maximum two PCBs per buspatch,
 /// - for slat stations there are maximum three PCBs per buspatch
-/// Not correct for station 2
 
-  if ( AliMpDEManager::GetStationType(fDEId) == AliMp::kStation1 ||
-       AliMpDEManager::GetStationType(fDEId) == AliMp::kStation2 ) {
+  if ( AliMpDEManager::GetStationType(fDEId) == AliMp::kStation1) {
 
     // simply fill the number of manus, no bridge for station 1
-    // not the case for station 2.
        
     fNofManusPerModule.Add(GetNofManus());
     return true;
   }
 
+ if ( AliMpDEManager::GetStationType(fDEId) == AliMp::kStation2) {
+
+    // there is max two patch modules per buspatch
+       
+    fNofManusPerModule.Add(manuNumber);
+    if (manuNumber != GetNofManus())
+       fNofManusPerModule.Add(GetNofManus() - manuNumber);
+
+    return true;
+  }
+
   if ( AliMpDEManager::GetStationType(fDEId) == AliMp::kStation345 ) {
   
     const AliMpSlatSegmentation* seg0 
index 073ceacc17279028fafcb7719d1f31dd2e90b71b..10158a88a1d29a6a72ee2f8cb209229f8672ab9a 100644 (file)
@@ -30,7 +30,8 @@ class AliMpBusPatch : public  TObject {
 
     // methods 
     Bool_t AddManu(Int_t manuId);
-    Bool_t SetNofManusPerModule();
+    Bool_t SetNofManusPerModule(Int_t manuNumber = 0);
+    void   SetCableLength(Float_t length);
 
     // get methods
     Int_t  GetId() const;
@@ -43,6 +44,7 @@ class AliMpBusPatch : public  TObject {
     Int_t  GetNofPatchModules() const;
     Int_t  GetNofManusPerModule(Int_t patchModule) const;
     
+    Float_t  GetCableLength() const;
 
   private:
     /// Not implemented
@@ -61,8 +63,9 @@ class AliMpBusPatch : public  TObject {
     Int_t        fDdlId; ///< DDL to which this bus patch is connected
     AliMpArrayI  fManus; ///< Manu Ids connected to this bus patch
     AliMpArrayI  fNofManusPerModule;///< Nof Manus per patch modules (PCBs)
-    
-  ClassDef(AliMpBusPatch,1)  // The class collectiong electronics properties of DDL
+    Float_t      fCableLength; ///< length of the buspatch cable
+
+  ClassDef(AliMpBusPatch,2)  // The class collectiong electronics properties of DDL
 };
 
 // inline functions
@@ -79,6 +82,14 @@ inline Int_t AliMpBusPatch::GetDEId() const
 inline Int_t AliMpBusPatch::GetDdlId() const
 {  return fDdlId; }
 
+/// Return length of buspatch
+inline Float_t  AliMpBusPatch::GetCableLength() const
+{ return fCableLength; }
+
+/// Set length of buspatch
+inline void  AliMpBusPatch::SetCableLength(Float_t length)
+{ fCableLength = length; }
+
 #endif //ALI_BUS_PATCH_H