#include "AliMpSlat.h"
#include "AliMpTrigger.h"
-///
+//-----------------------------------------------------------------------------
/// \class AliMpTriggerSegmentation
///
/// Implementation of AliMpVSegmentation for trigger slats.
/// \todo Implement CreateIterator method, if needed.
///
/// \author Laurent Aphecetche
+//-----------------------------------------------------------------------------
/// \cond CLASSIMP
ClassImp(AliMpTriggerSegmentation)
{
for ( Int_t iy = 0; iy <= MaxPadIndexY(); ++iy )
{
- if ( HasPad(AliMpIntPair(ix,iy)) )
+ if ( HasPadByIndices(ix,iy) )
{
++fNofStrips;
}
}
//_____________________________________________________________________________
-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();
}
//_____________________________________________________________________________
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
//_____________________________________________________________________________
AliMpPad
-AliMpTriggerSegmentation::PadByLocation(const AliMpIntPair& location,
+AliMpTriggerSegmentation::PadByLocation(Int_t manuId, Int_t manuChannel,
Bool_t warning) const
{
///
/// 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() )
{
// uses PadByIndices to get the complete list of locations
- return PadByIndices(pi.GetIndices(),warning);
+ return PadByIndices(pi.GetIx(), pi.GetIy(), warning);
}
}
}
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.
///
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;
//_____________________________________________________________________________
AliMpPad
-AliMpTriggerSegmentation::PadByPosition(const TVector2& position,
+AliMpTriggerSegmentation::PadByPosition(Double_t x, Double_t y,
Bool_t warning) const
{
///
/// 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;
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);
+}