39 #include <Riostream.h> 61 fConnectionsByLocalIndices(fMaxNofPads*fMaxNofPads),
62 fConnectionsByManuChannel(fMaxNofPads)
68 fConnectionsByLocalIndices.SetOwner(kTRUE);
69 fConnectionsByManuChannel.SetOwner(kFALSE);
70 AliDebug(1,Form(
"this=%p id=%s",
this,
id.Data()));
81 fConnectionsByLocalIndices(),
82 fConnectionsByManuChannel()
100 AliDebug(1,Form(
"this=%p (copy ctor)",
this));
110 TObject::operator=(rhs);
122 if ( strlen(newname) ) {
134 TObject::Copy(
object);
176 if ( (padName[0]>=
'A') && (padName[0]<=
'Z') )
179 return atoi(padName.Data());
188 return Form(
"%d",padNum);
199 if (!connection)
return kFALSE;
218 AliError(Form(
"Connection already exists for ix=%d iy=%d",ix,iy));
245 while ( ( connection = static_cast<AliMpConnection*>(next()) ) )
247 if (connection->
GetPadNum()==padNum)
return connection;
268 if ( ix <
fNofPadsX && iy < fNofPadsY && ix >= 0 && iy >= 0 )
304 while ( ( connection = static_cast<AliMpConnection*>(next()) ) )
306 if ( connection && connection->
GetKaptonNum()==kaptonNum)
return connection;
321 while ( ( connection = static_cast<AliMpConnection*>(next()) ) )
323 if ( connection && connection->
GetBergNum()==bergNum)
return connection;
344 if ( ! connection)
return -1;
356 if ( ! connection)
return -1;
368 if ( ! connection)
return -1;
380 if ( ! connection)
return -1;
429 case 'N':cout<<
"Name mapping";
431 case 'K':cout<<
"Kapton mapping";
433 case 'B':cout<<
"Berg mapping";
435 case 'G':cout<<
"Gassiplex number mapping";
437 default:cout<<
"Pad mapping";
439 cout<<
" in the motif "<<
fID<<endl;
440 cout<<
"-----------------------------------"<<endl;
447 AliDebug(1,Form(
"i,j=%2d,%2d connexion=%p",i,j,connexion));
454 case 'B':str=Form(
"%d",connexion->
GetBergNum());
458 default:str= Form(
"%d",connexion->
GetPadNum());
461 }
else cout<<setw(2)<<
"--";
488 Bool_t
test = gSystem->AccessPathName(padPosFileName.Data());
491 AliError(
"Cannot overwrite existing padPos file");
494 test = gSystem->AccessPathName(motifTypeFileName.Data());
497 AliError(
"Cannot overwrite existing motifType file");
501 ofstream padPosFile(padPosFileName.Data());
502 ofstream motifFile(motifTypeFileName.Data());
504 motifFile <<
"# Motif " << motifName << endl
506 <<
"#connecteur_berg kapton padname not_used" << endl
507 <<
"#for slats there's no kapton connector, so it's always 1" 508 <<
" (zero make the reader" << endl
509 <<
"#exit, so it's not a valid value here)." << endl
520 padPosFile << con->
GetPadNum() <<
"\t" << ix <<
"\t" << iy << endl;
Int_t fNofPads
total number of pads (= the number of non-void entries in the arrays below)
Int_t PadNum(const TString &padName) const
virtual AliMpVPadIterator * CreateIterator() const
AliMpConnection * FindConnectionByGassiNum(Int_t gassiNum) const
An iterator over the pads of a given motif type.
AliMpConnection * FindConnectionByKaptonNum(Int_t kaptonNum) const
MpPair_t FindLocalIndicesByPadNum(Int_t padNum) const
Int_t fNofPadsX
number of pads in x direction
virtual ~AliMpMotifType()
AliMpConnection * FindConnectionByLocalIndices(MpPair_t localIndices) const
void Copy(TObject &o) const
Int_t GetBergNum() const
Return Berg connector number.
MpPair_t GetLocalIndices() const
Return encoded local indices.
TString PadName(Int_t padNum) const
MpPair_t FindLocalIndicesByGassiNum(Int_t gassiNum) const
AliMpMotifType & operator=(const AliMpMotifType &rhs)
TObject * Clone(const char *newname="") const
TObjArray fConnectionsByManuChannel
array [manuChannel] -> AliMpConnection*
void SetNofPads(Int_t nofPadsX, Int_t nofPadY)
static const Int_t fgkPadNumForA
the pad number for the pad "A"
static Int_t ManuNofChannels()
Max number of channels per manu.
AliMpMotifType()
Not implemented.
AliMpConnection * FindConnectionByBergNum(Int_t bergNum) const
Int_t GetKaptonNum() const
Return kapton connector number.
Int_t GetNofPadsX() const
Return number of pads in x direction.
Int_t fNofPadsY
number of pads in y direction
void SetOwner(AliMpMotifType *owner)
Set the motif type which contains this connection.
Int_t GetNofPadsY() const
Return number of pads in y direction.
Bool_t HasPadByLocalIndices(MpPair_t localIndices) const
Bool_t HasPadByManuChannel(Int_t manuChannel) const
An interface for an iterator over pads.
MpPair_t FindLocalIndicesByConnection(const AliMpConnection *connection) const
Int_t fMaxNofPads
max number of pads we can hold
Int_t GetPadNum() const
Return pad number.
MpPair_t FindLocalIndicesByBergNum(Int_t bergNum) const
#define AliDebug(logLevel, message)
virtual void Print(Option_t *option="") const
Int_t GetManuChannel() const
Return manu channel number.
Int_t PairFirst(MpPair_t pair)
Decode the first integer from encoded pair.
Bool_t AddConnection(AliMpConnection *connection)
MpPair_t FindLocalIndicesByKaptonNum(Int_t kaptonNum) const
TObjArray fConnectionsByLocalIndices
array [ix + 64*iy ] -> AliMpConnection*
#define AliError(message)
Globally used constants definition.
Int_t PairSecond(MpPair_t pair)
Decode the second integer from encoded pair.
TString fID
unique motif ID
AliMpConnection * FindConnectionByPadNum(Int_t padNum) const
Class that defines the motif properties.
static TString MotifFileName(const TString &motifTypeID)
static TString PadPosFileName(const TString &motifTypeID)