#include "AliMpMotifType.h"
#include "AliMpPCB.h"
#include "AliMpSlat.h"
-#include "AliMpSlatSegmentation.h"
#include "AliMpTrigger.h"
///
//_____________________________________________________________________________
AliMpTriggerSegmentation::AliMpTriggerSegmentation()
: AliMpVSegmentation(),
-fkSlat(0),
-fNofStrips(0)
+ fkSlat(0),
+ fIsOwner(false),
+ fNofStrips(0)
{
- //
- // Default ctor. Not to be used really.
- //
+ ///
+ /// Default ctor. Not to be used really.
+ ///
AliDebug(1,Form("this=%p Empty ctor",this));
}
//_____________________________________________________________________________
-AliMpTriggerSegmentation::AliMpTriggerSegmentation(const AliMpTrigger* slat)
+AliMpTriggerSegmentation::AliMpTriggerSegmentation(
+ const AliMpTrigger* slat, Bool_t own)
: AliMpVSegmentation(),
fkSlat(slat),
+ fIsOwner(own),
fNofStrips(0)
{
- //
- // Normal ctor.
- //
+ ///
+ /// Normal ctor.
+ ///
AliDebug(1,Form("this=%p Normal ctor slat=%p",this,slat));
// Compute the number of strips.
}
}
-//______________________________________________________________________________
-AliMpTriggerSegmentation::AliMpTriggerSegmentation(const AliMpTriggerSegmentation& right)
- : AliMpVSegmentation(right),
- fkSlat(right.fkSlat),
- fNofStrips(right.fNofStrips)
-{
-/// Protected copy constructor (not implemented)
-
- AliFatal("Copy constructor not provided.");
-}
-
//_____________________________________________________________________________
AliMpTriggerSegmentation::~AliMpTriggerSegmentation()
{
- //
- // Dtor (empty).
- //
+ ///
+ /// Dtor (empty).
+ ///
+
+ if ( fIsOwner ) delete fkSlat;
+
AliDebug(1,Form("this=%p",this));
}
-//______________________________________________________________________________
-AliMpTriggerSegmentation&
-AliMpTriggerSegmentation::operator=(const AliMpTriggerSegmentation& right)
+//_____________________________________________________________________________
+AliMpVPadIterator*
+AliMpTriggerSegmentation::CreateIterator(const AliMpArea&) const
{
-/// Protected assignement operator (not implemented)
-
- // check assignement to self
- if (this == &right) return *this;
-
- AliFatal("Assignement operator not provided.");
-
- return *this;
-}
+ ///
+ /// Returns an iterator to loop over the pad contained within given area.
+ /// Not implemented for trigger.
+ AliError("Not implemented for trigger");
+ return 0;
+}
//_____________________________________________________________________________
AliMpVPadIterator*
-AliMpTriggerSegmentation::CreateIterator(const AliMpArea&) const
+AliMpTriggerSegmentation::CreateIterator() const
{
- //
- // Returns an iterator to loop over the pad contained within given area.
- // Not implemented for trigger.
+ ///
+ /// Returns an iterator to loop over all the pads
+ /// Not implemented for trigger.
+ AliError("Not implemented for trigger");
return 0;
}
+//_____________________________________________________________________________
+Int_t
+AliMpTriggerSegmentation::GetNeighbours(const AliMpPad& /*pad*/,
+ TObjArray& /*neighbours*/,
+ Bool_t /*includeSelf*/,
+ Bool_t /*includeVoid*/) const
+{
+ /// not implemented.
+ AliError("Not implemented for trigger");
+ return 0;
+}
+
//_____________________________________________________________________________
TVector2
AliMpTriggerSegmentation::Dimensions() const
{
+/// Return dimensions
+
return Slat()->Dimensions();
}
void
AliMpTriggerSegmentation::GetAllElectronicCardIDs(TArrayI& ecn) const
{
+/// Fill the array ecn with all manuIds
+
Slat()->GetAllLocalBoardNumbers(ecn);
}
const char*
AliMpTriggerSegmentation::GetName() const
{
- // Name of that segmentation = TriggerSegmentation + slatName
+ /// Name of that segmentation = TriggerSegmentation + slatName
TString name("TriggerSegmentation");
if ( fkSlat)
{
Bool_t
AliMpTriggerSegmentation::HasPad(const AliMpIntPair& indices) const
{
- //
- // Test if this slat has a pad located at the position referenced
- // by the integer indices.
- //
+ ///
+ /// 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
{
- //
- // Returns the value of the largest pad index in x-direction.
- //
+ ///
+ /// Returns the value of the largest pad index in x-direction.
+ ///
return fkSlat->GetNofPadsX()-1;
}
Int_t
AliMpTriggerSegmentation::MaxPadIndexY() const
{
- //
- // Returns the value of the largest pad index in y-direction.
- //
+ ///
+ /// Returns the value of the largest pad index in y-direction.
+ ///
return fkSlat->GetMaxNofPadsY()-1;
}
AliMpTriggerSegmentation::PadByLocation(const AliMpIntPair& location,
Bool_t warning) const
{
- //
- // Returns the pad specified by its location, where location is the
- // pair (ManuID,ManuChannel).
- // If warning=kTRUE and the pad does not exist, a warning message is
- // printed.
- //
- // AliMpPad::Invalid() is returned if there's no pad at the given location.
- //
+ ///
+ /// Returns the pad specified by its location, where location is the
+ /// pair (ManuID,ManuChannel).
+ /// If warning=kTRUE and the pad does not exist, a warning message is
+ /// printed.
+ ///
+ /// 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 )
{
- const AliMpSlat* slat = fkSlat->GetLayer(i);
- AliMpSlatSegmentation seg(slat);
- AliMpPad pi = seg.PadByLocation(location,kFALSE);
+ AliMpVSegmentation* seg = fkSlat->GetLayerSegmentation(i);
+ AliMpPad pi = seg->PadByLocation(location,kFALSE);
if ( pi.IsValid() )
{
if ( !pad.IsValid() )
AliMpTriggerSegmentation::PadByIndices(const AliMpIntPair& indices,
Bool_t warning) const
{
- //
- // Returns the pad specified by its integer indices.
- // If warning=kTRUE and the pad does not exist, a warning message is
- // printed.
- //
- // AliMpPad::Invalid() is returned if there's no pad at the given location.
- //
- //
+ ///
+ /// Returns the pad specified by its integer indices.
+ /// If warning=kTRUE and the pad does not exist, a warning message is
+ /// printed.
+ ///
+ /// 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 )
{
- const AliMpSlat* slat = fkSlat->GetLayer(i);
- AliMpSlatSegmentation seg(slat);
- AliMpPad pi = seg.PadByIndices(indices,kFALSE);
+ AliMpVSegmentation* seg = fkSlat->GetLayerSegmentation(i);
+ AliMpPad pi = seg->PadByIndices(indices,kFALSE);
if ( pi.IsValid() )
{
if ( !pad.IsValid() )
AliMpTriggerSegmentation::PadByPosition(const TVector2& position,
Bool_t warning) const
{
- //
- // Returns the pad specified by its (floating point) position.
- // If warning=kTRUE and the pad does not exist, a warning message is
- // printed.
- //
- // AliMpPad::Invalid() is returned if there's no pad at the given location.
- //
+ ///
+ /// Returns the pad specified by its (floating point) position.
+ /// If warning=kTRUE and the pad does not exist, a warning message is
+ /// printed.
+ ///
+ /// 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 )
{
- const AliMpSlat* slat = fkSlat->GetLayer(i);
- AliMpSlatSegmentation seg(slat);
- AliMpPad pi = seg.PadByPosition(position,kFALSE);
+ AliMpVSegmentation* seg = fkSlat->GetLayerSegmentation(i);
+ AliMpPad pi = seg->PadByPosition(position,kFALSE);
if ( pi.IsValid() )
{
if ( !pad.IsValid() )
}
//_____________________________________________________________________________
-AliMpPlaneType
+AliMp::PlaneType
AliMpTriggerSegmentation::PlaneType() const
{
+ /// Return plane type
+
return Slat()->PlaneType();
}
const AliMpTrigger*
AliMpTriggerSegmentation::Slat() const
{
- //
- // Returns the pointer to the referenced slat.
- //
+ ///
+ /// Returns the pointer to the referenced slat.
+ ///
return fkSlat;
}