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()
85 AliDebug(1,Form(
"this=%p",
this));
96 fConnectionsByLocalIndices(),
97 fConnectionsByManuChannel()
100 AliDebug(1,Form(
"this=%p (copy ctor)",
this));
110 TObject::operator=(rhs);
129 TObject::Copy(
object);
145 AliDebug(1,Form(
"this=%p",
this));
171 if ( (padName[0]>=
'A') && (padName[0]<=
'Z') )
174 return atoi(padName.Data());
183 return Form(
"%d",padNum);
194 if (!connection)
return kFALSE;
213 AliError(Form(
"Connection already exists for ix=%d iy=%d",ix,iy));
240 while ( ( connection = static_cast<AliMpConnection*>(next()) ) )
242 if (connection->
GetPadNum()==padNum)
return connection;
263 if ( ix <
fNofPadsX && iy < fNofPadsY && ix >= 0 && iy >= 0 )
299 while ( ( connection = static_cast<AliMpConnection*>(next()) ) )
301 if ( connection && connection->
GetKaptonNum()==kaptonNum)
return connection;
316 while ( ( connection = static_cast<AliMpConnection*>(next()) ) )
318 if ( connection && connection->
GetBergNum()==bergNum)
return connection;
339 if ( ! connection)
return -1;
351 if ( ! connection)
return -1;
363 if ( ! connection)
return -1;
375 if ( ! connection)
return -1;
424 case 'N':cout<<
"Name mapping";
426 case 'K':cout<<
"Kapton mapping";
428 case 'B':cout<<
"Berg mapping";
430 case 'G':cout<<
"Gassiplex number mapping";
432 default:cout<<
"Pad mapping";
434 cout<<
" in the motif "<<
fID<<endl;
435 cout<<
"-----------------------------------"<<endl;
442 AliDebug(1,Form(
"i,j=%2d,%2d connexion=%p",i,j,connexion));
449 case 'B':str=Form(
"%d",connexion->
GetBergNum());
453 default:str= Form(
"%d",connexion->
GetPadNum());
456 }
else cout<<setw(2)<<
"--";
483 Bool_t test = gSystem->AccessPathName(padPosFileName.Data());
486 AliError(
"Cannot overwrite existing padPos file");
489 test = gSystem->AccessPathName(motifTypeFileName.Data());
492 AliError(
"Cannot overwrite existing motifType file");
496 ofstream padPosFile(padPosFileName.Data());
497 ofstream motifFile(motifTypeFileName.Data());
499 motifFile <<
"# Motif " << motifName << endl
501 <<
"#connecteur_berg kapton padname not_used" << endl
502 <<
"#for slats there's no kapton connector, so it's always 1"
503 <<
" (zero make the reader" << endl
504 <<
"#exit, so it's not a valid value here)." << endl
515 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
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*
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)