X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2Fmapping%2FAliMpTriggerSegmentation.cxx;h=caced37e65ebf2081f50e4bcf186619cc8011290;hb=986c0fd379f3eab79564add7996b3b6e412dff5d;hp=fbb5adfcc16bd36cff9e60c9609adb2566dc9fd6;hpb=71a2d3aa63e94daa0244d8d6d1c7c162ae29a374;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/mapping/AliMpTriggerSegmentation.cxx b/MUON/mapping/AliMpTriggerSegmentation.cxx index fbb5adfcc16..caced37e65e 100644 --- a/MUON/mapping/AliMpTriggerSegmentation.cxx +++ b/MUON/mapping/AliMpTriggerSegmentation.cxx @@ -27,7 +27,7 @@ #include "AliMpSlat.h" #include "AliMpTrigger.h" -/// +//----------------------------------------------------------------------------- /// \class AliMpTriggerSegmentation /// /// Implementation of AliMpVSegmentation for trigger slats. @@ -35,6 +35,7 @@ /// \todo Implement CreateIterator method, if needed. /// /// \author Laurent Aphecetche +//----------------------------------------------------------------------------- /// \cond CLASSIMP ClassImp(AliMpTriggerSegmentation) @@ -76,7 +77,7 @@ AliMpTriggerSegmentation::AliMpTriggerSegmentation( { for ( Int_t iy = 0; iy <= MaxPadIndexY(); ++iy ) { - if ( HasPad(AliMpIntPair(ix,iy)) ) + if ( HasPadByIndices(ix,iy) ) { ++fNofStrips; } @@ -132,12 +133,19 @@ AliMpTriggerSegmentation::GetNeighbours(const AliMpPad& /*pad*/, } //_____________________________________________________________________________ -TVector2 -AliMpTriggerSegmentation::Dimensions() const +Double_t +AliMpTriggerSegmentation::GetDimensionX() const { -/// Return dimensions +/// Return slat x dimensions + return Slat()->GetDimensionX(); +} - return Slat()->Dimensions(); +//_____________________________________________________________________________ +Double_t +AliMpTriggerSegmentation::GetDimensionY() const +{ +/// Return slat y dimensions + return Slat()->GetDimensionY(); } //_____________________________________________________________________________ @@ -163,18 +171,6 @@ AliMpTriggerSegmentation::GetName() const return name.Data(); } -//_____________________________________________________________________________ -Bool_t -AliMpTriggerSegmentation::HasPad(const AliMpIntPair& indices) const -{ - /// - /// Test if this slat has a pad located at the position referenced - /// by the integer indices. - /// - - return PadByIndices(indices,kFALSE) != AliMpPad::Invalid(); -} - //_____________________________________________________________________________ Int_t AliMpTriggerSegmentation::MaxPadIndexX() const @@ -199,7 +195,7 @@ AliMpTriggerSegmentation::MaxPadIndexY() const //_____________________________________________________________________________ AliMpPad -AliMpTriggerSegmentation::PadByLocation(const AliMpIntPair& location, +AliMpTriggerSegmentation::PadByLocation(Int_t manuId, Int_t manuChannel, Bool_t warning) const { /// @@ -211,37 +207,31 @@ AliMpTriggerSegmentation::PadByLocation(const AliMpIntPair& location, /// AliMpPad::Invalid() is returned if there's no pad at the given location. /// AliMpPad pad; - AliMpIntPair invloc; for ( Int_t i = 0; i < fkSlat->GetSize(); ++i ) { AliMpVSegmentation* seg = fkSlat->GetLayerSegmentation(i); - AliMpPad pi = seg->PadByLocation(location,kFALSE); + AliMpPad pi = seg->PadByLocation(manuId,manuChannel,kFALSE); if ( pi.IsValid() ) { if ( !pad.IsValid() ) { - pad = AliMpPad(invloc,pi.GetIndices(),pi.Position(),pi.Dimensions()); - pad.AddLocation(pi.GetLocation()); + // uses PadByIndices to get the complete list of locations + return PadByIndices(pi.GetIx(), pi.GetIy(), warning); } - else - { - pad.AddLocation(pi.GetLocation()); - } } } if ( warning && !pad.IsValid() ) { - AliWarning(Form("No pad found at location (%d,%d)",location.GetFirst(), - location.GetSecond())); + AliWarning(Form("No pad found at location (%d,%d)", manuId, manuChannel)); } return pad; } //_____________________________________________________________________________ AliMpPad -AliMpTriggerSegmentation::PadByIndices(const AliMpIntPair& indices, - Bool_t warning) const +AliMpTriggerSegmentation::PadByIndices(Int_t ix, Int_t iy, + Bool_t warning) const { /// /// Returns the pad specified by its integer indices. @@ -253,29 +243,30 @@ AliMpTriggerSegmentation::PadByIndices(const AliMpIntPair& indices, /// AliMpPad pad; - AliMpIntPair invloc; - + for ( Int_t i = 0; i < fkSlat->GetSize(); ++i ) { AliMpVSegmentation* seg = fkSlat->GetLayerSegmentation(i); - AliMpPad pi = seg->PadByIndices(indices,kFALSE); + AliMpPad pi = seg->PadByIndices(ix,iy,kFALSE); if ( pi.IsValid() ) { if ( !pad.IsValid() ) { - pad = AliMpPad(invloc,pi.GetIndices(),pi.Position(),pi.Dimensions()); - pad.AddLocation(pi.GetLocation()); + pad = AliMpPad(0, 0, + pi.GetIndices(), + pi.GetPositionX(),pi.GetPositionY(), + pi.GetDimensionX(), pi.GetDimensionY()); + pad.AddLocation(pi.GetManuId(), pi.GetManuChannel()); } else { - pad.AddLocation(pi.GetLocation()); + pad.AddLocation(pi.GetManuId(), pi.GetManuChannel()); } } } if ( warning && !pad.IsValid() ) { - AliWarning(Form("No pad found at indices (%d,%d)",indices.GetFirst(), - indices.GetSecond())); + AliWarning(Form("No pad found at indices (%d,%d)",ix, iy)); } return pad; @@ -283,7 +274,7 @@ AliMpTriggerSegmentation::PadByIndices(const AliMpIntPair& indices, //_____________________________________________________________________________ AliMpPad -AliMpTriggerSegmentation::PadByPosition(const TVector2& position, +AliMpTriggerSegmentation::PadByPosition(Double_t x, Double_t y, Bool_t warning) const { /// @@ -294,29 +285,30 @@ AliMpTriggerSegmentation::PadByPosition(const TVector2& position, /// AliMpPad::Invalid() is returned if there's no pad at the given location. /// AliMpPad pad; - AliMpIntPair invloc; for ( Int_t i = 0; i < fkSlat->GetSize(); ++i ) { AliMpVSegmentation* seg = fkSlat->GetLayerSegmentation(i); - AliMpPad pi = seg->PadByPosition(position,kFALSE); + AliMpPad pi = seg->PadByPosition(x,y,kFALSE); if ( pi.IsValid() ) { if ( !pad.IsValid() ) { - pad = AliMpPad(invloc,pi.GetIndices(),pi.Position(),pi.Dimensions()); - pad.AddLocation(pi.GetLocation()); + pad = AliMpPad(0, 0, + pi.GetIndices(), + pi.GetPositionX(),pi.GetPositionY(), + pi.GetDimensionX(), pi.GetDimensionY()); + pad.AddLocation(pi.GetManuId(), pi.GetManuChannel()); } else { - pad.AddLocation(pi.GetLocation()); + pad.AddLocation(pi.GetManuId(), pi.GetManuChannel()); } } } if ( warning && !pad.IsValid() ) { - AliWarning(Form("No pad found at position (%e,%e)",position.X(), - position.Y())); + AliWarning(Form("No pad found at position (%e,%e)",x,y)); } return pad; @@ -341,3 +333,47 @@ AliMpTriggerSegmentation::Slat() const return fkSlat; } + +//_____________________________________________________________________________ +Int_t +AliMpTriggerSegmentation::GetNofElectronicCards() const +{ + /// Get the number of local board numbers + + TArrayI ecn; + fkSlat->GetAllLocalBoardNumbers(ecn); + return ecn.GetSize(); +} + +//_____________________________________________________________________________ +Double_t +AliMpTriggerSegmentation::GetPositionX() const +{ + /// Return x position of origin + return Slat()->GetPositionX(); +} + +//_____________________________________________________________________________ +Double_t +AliMpTriggerSegmentation::GetPositionY() const +{ + /// Return y position of origin + return Slat()->GetPositionY(); +} + +//_____________________________________________________________________________ +AliMpMotifPosition* +AliMpTriggerSegmentation::MotifPosition(Int_t /* manuId */) const +{ + /// No implemented (yet ?) + AliError("Not implemented"); + return 0x0; +} + +//_____________________________________________________________________________ +Bool_t +AliMpTriggerSegmentation::HasMotifPosition(Int_t manuId) const +{ + /// Uses default implementation + return AliMpVSegmentation::HasMotifPosition(manuId); +}