+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * 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 *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
// $Id$
+// $MpId: AliMpMotifType.cxx,v 1.6 2005/08/26 15:43:36 ivana Exp $
// Category: motif
//
// Class AliMpMotifType
fVerboseLevel(0),
fConnections()
{
- // Constructor
+ /// Standard constructor
}
//______________________________________________________________________________
fVerboseLevel(0),
fConnections()
{
- // Default constructor (dummy)
+ /// Default constructor
}
//______________________________________________________________________________
-AliMpMotifType::~AliMpMotifType() {
-// Destructor
+AliMpMotifType::~AliMpMotifType()
+{
+/// Destructor
#ifdef WITH_STL
for(ConnectionMapCIterator i = fConnections.begin();
}
#ifdef WITH_ROOT
+
//______________________________________________________________________________
Int_t AliMpMotifType::GetIndex(const AliMpIntPair& pair) const
{
-// Converts the pair of integers to integer.
-// ---
+/// Convert the pair of integers to integer.
if (pair.GetFirst() >= fgkSeparator || pair.GetSecond() >= fgkSeparator)
Fatal("GetIndex", "Index out of limit.");
//______________________________________________________________________________
AliMpIntPair AliMpMotifType::GetPair(Int_t index) const
{
-// Converts the integer index to the pair of integers.
-// ---
+/// Convert the integer index to the pair of integers.
return AliMpIntPair((index-1)/fgkSeparator,(index-1)%fgkSeparator);
}
//______________________________________________________________________________
AliMpVPadIterator* AliMpMotifType::CreateIterator() const
{
+/// Create new motif type iterator
+
return new AliMpMotifTypePadIterator(this);
}
//______________________________________________________________________________
void AliMpMotifType::SetNofPads(Int_t nofPadsX, Int_t nofPadsY)
{
- // Change the number of pads in this motif
+ /// Change the number of pads in this motif
fNofPadsX = nofPadsX;
fNofPadsY = nofPadsY;
//______________________________________________________________________________
Int_t AliMpMotifType::PadNum(const TString &padName) const
{
- // Transform a pad name into the equivalent pad number
+ /// Transform a pad name into the equivalent pad number
+
if ( (padName[0]>='A') && (padName[0]<='Z') )
return fgkPadNumForA+padName[0]-'A';
else
//______________________________________________________________________________
TString AliMpMotifType::PadName(Int_t padNum) const
{
- // Transform a pad number into its equivalent pad name
+ /// Transform a pad number into its equivalent pad name
+
if (padNum<fgkPadNumForA)
return Form("%d",padNum);
else
void AliMpMotifType::AddConnection(const AliMpIntPair &localIndices,
AliMpConnection* connection)
{
- // Add the connection to the map
+ /// Add the connection to the map
#ifdef WITH_STL
fConnections[localIndices]=connection;
//______________________________________________________________________________
AliMpConnection *AliMpMotifType::FindConnectionByPadNum(Int_t padNum) const
{
- // Retrieve the AliMpConnection pointer from its pad num
+ /// Retrieve the AliMpConnection pointer from its pad num
+
#ifdef WITH_STL
for(ConnectionMapCIterator i = fConnections.begin();
i!=fConnections.end();++i)
AliMpConnection *AliMpMotifType::FindConnectionByLocalIndices(
const AliMpIntPair& localIndices) const
{
- // Retrieve the AliMpConnection pointer from its position (in pad unit)
+ /// Retrieve the AliMpConnection pointer from its position (in pad unit)
+
if (!localIndices.IsValid()) return 0;
#ifdef WITH_STL
//______________________________________________________________________________
AliMpConnection *AliMpMotifType::FindConnectionByGassiNum(Int_t gassiNum) const
{
- // Return the connection for the given gassiplex number
+ /// Return the connection for the given gassiplex number
+
#ifdef WITH_STL
for(ConnectionMapCIterator i = fConnections.begin();
i!=fConnections.end();++i)
//______________________________________________________________________________
AliMpConnection *AliMpMotifType::FindConnectionByKaptonNum(Int_t kaptonNum) const
{
- // Gives the connection related to the given kapton number
+ /// Give the connection related to the given kapton number
+
#ifdef WITH_STL
for(ConnectionMapCIterator i = fConnections.begin();
i!=fConnections.end();++i)
//______________________________________________________________________________
AliMpConnection *AliMpMotifType::FindConnectionByBergNum(Int_t bergNum) const
{
- // Retrieve the connection from a Berg connector number
+ /// Retrieve the connection from a Berg connector number
+
#ifdef WITH_STL
for(ConnectionMapCIterator i = fConnections.begin();
i!=fConnections.end();++i)
AliMpIntPair AliMpMotifType::FindLocalIndicesByConnection(
const AliMpConnection* connection) const
{
- // Retrieve the pad position from the connection pointer.
- // Not to be used widely, since it use a search in the
- // connection list...
+ /// Retrieve the pad position from the connection pointer.
+ /// Not to be used widely, since it use a search in the
+ /// connection list...
#ifdef WITH_STL
for(ConnectionMapCIterator i = fConnections.begin();
//______________________________________________________________________________
AliMpIntPair AliMpMotifType::FindLocalIndicesByPadNum(Int_t padNum) const
{
- // Retrieve the AliMpConnection pointer from its pad num
+ /// Retrieve the AliMpConnection pointer from its pad num
+
#ifdef WITH_STL
for(ConnectionMapCIterator i = fConnections.begin();
i!=fConnections.end();++i)
//______________________________________________________________________________
AliMpIntPair AliMpMotifType::FindLocalIndicesByGassiNum(Int_t gassiNum) const
{
- // return the connection for the given gassiplex number
+ /// Return the connection for the given gassiplex number
+
#ifdef WITH_STL
for(ConnectionMapCIterator i = fConnections.begin();
i!=fConnections.end();++i)
//______________________________________________________________________________
AliMpIntPair AliMpMotifType::FindLocalIndicesByKaptonNum(Int_t kaptonNum) const
{
- // Gives the connection related to the given kapton number
+ /// Give the connection related to the given kapton number
+
#ifdef WITH_STL
for(ConnectionMapCIterator i = fConnections.begin();
i!=fConnections.end();++i)
//______________________________________________________________________________
AliMpIntPair AliMpMotifType::FindLocalIndicesByBergNum(Int_t bergNum) const
{
- // Retrieve the connection from a Berg connector number
+ /// Retrieve the connection from a Berg connector number
+
#ifdef WITH_STL
for(ConnectionMapCIterator i = fConnections.begin();
i!=fConnections.end();++i)
//______________________________________________________________________________
Int_t AliMpMotifType::GetNofPads() const
{
-// Returns the number of pads
+/// Return the number of pads
#ifdef WITH_STL
return fConnections.size();
//______________________________________________________________________________
Bool_t AliMpMotifType::HasPad(const AliMpIntPair& localIndices) const
{
- // Return true if the pad indexed by <localIndices> has a connection
+ /// Return true if the pad indexed by <localIndices> has a connection
+
if (!localIndices.IsValid()) return false;
#ifdef WITH_STL
//______________________________________________________________________________
void AliMpMotifType::Print(Option_t *option) const
{
- // Print the map of the motif. In each cel, the value
- // printed depends of option, as the following:
- // option="N" the "name" of the pad is written
- // option="K" the Kapton connect. number attached to the pad is written
- // option="B" the Berg connect. number attached to the pad is written
- // option="G" the Gassiplex channel number attached to the pad is written
- // otherwise the number of the pad is written
-
- // NOTE : this method is really not optimized, in case 'N' or '',
- // but the Print() this should not be very important in a Print() method
+ /// Print the map of the motif. In each cell, the value
+ /// printed depends of option, as the following:
+ /// - option="N" the "name" of the pad is written
+ /// - option="K" the Kapton connect. number attached to the pad is written
+ /// - option="B" the Berg connect. number attached to the pad is written
+ /// - option="G" the Gassiplex channel number attached to the pad is written
+ /// otherwise the number of the pad is written
+ ///
+ /// NOTE : this method is really not optimized, in case 'N' or '',
+ /// but the Print() this should not be very important in a Print() method
switch (option[0]){
case 'N':cout<<"Name mapping";