28 #include "Riostream.h"
30 #include "TObjString.h"
83 fMotifPositions.SetOwner(kTRUE);
84 AliDebug(1,Form(
"this=%p",
this));
89 Double_t enveloppeSizeX, Double_t enveloppeSizeY)
94 fEnveloppeSizeX(enveloppeSizeX),
95 fEnveloppeSizeY(enveloppeSizeY),
112 AliDebug(1,Form(
"this=%p id=%s",
this,
id));
139 AliDebug(1,Form(
"this=%p (copy ctor) : begin",
this));
141 AliDebug(1,Form(
"this=%p (copy ctor) : end",
this));
150 fEnveloppeSizeX(ms->DimensionX()*2.0),
151 fEnveloppeSizeY(ms->DimensionY()*2.0),
154 fActiveXmax(fEnveloppeSizeX),
156 fIxmax(ms->GetMotifType()->GetNofPadsX()-1),
158 fIymax(ms->GetMotifType()->GetNofPadsY()-1),
160 fNofPads(ms->GetMotifType()->GetNofPads()),
172 AliDebug(1,Form(
"this=%p (ctor special motif)",
this));
190 AliDebug(1,Form(
"this=%p (assignment op) : begin",
this));
192 AliDebug(1,Form(
"this=%p (assignment op) : end",
this));
202 AliDebug(1,Form(
"this=%p",
this));
250 AliDebug(1,Form(
"Adding motif %s to motifMap",
id.Data()));
255 AliDebug(1,Form(
"Got motif %s from motifMap",
id.Data()));
263 if ( ix >= 0 && iy >= 0 )
271 if ( ix >= 0 && iy < 0 )
279 if ( ix < 0 && iy < 0 )
287 if ( ix < 0 && iy >=0 )
334 TObject*
object =
new AliMpPCB(*
this);
357 if ( Int_t(pcb->
GetSize()) != manuids.GetSize() )
359 AliError(Form(
"Cannot Clone PCB %s because I do not get the correct number of "
360 "manu ids (got %d, wanted %d)",pcb->
GetID(),
361 manuids.GetSize(),pcb->
GetSize()));
369 for ( Int_t i = 0; i < pcb->
GetSize(); ++i )
372 mp->
SetID(manuids[i]);
419 AliDebug(1,
"Deleting pcb.fMotifPositions");
421 AliDebug(1,
"Deleting pcb.fMotifPositions : done");
531 if ( localIndices >= 0 &&
605 while ( ( pos = static_cast<AliMpMotifPosition*>(next()) ) )
607 if ( pos->
GetID() == manuId )
return kTRUE;
691 <<
" EnvXmin,max=(" <<
Xmin() <<
"," <<
Xmax()
695 if ( option && option[0] ==
'M' )
711 TString fileName(
fId);
714 lines.SetOwner(kTRUE);
723 TString id(motif->
GetID());
726 Ssiz_t index =
id.Index(
"-");
729 AliError(Form(
"id=%s does not meet expectations",
id.Data()));
732 TString motifName(
id(0,index));
733 lines.Add(
new TObjString(Form(
"MOTIF %s %d %d",
739 ofstream out(fileName.Data());
747 while ( ( s = (TObjString*)next() ) )
749 out << s->String().Data() << endl;
Double_t GetPositionY() const
Return y position.
void SetLowIndicesLimit(MpPair_t limit, Bool_t valid=true)
virtual Double_t DimensionY() const
Return y dimensions.
void Print(Option_t *option="") const
Bool_t HasMotifPositionID(Int_t manuId) const
Double_t GetDimensionY() const
Return y dimension.
void Copy(TObject &o) const
Double_t ActiveDY() const
A special motif with varying pad dimensions.
AliMpSlatMotifMap * fMotifMap
to keep track of things to avoid duplications of motif and motiftypes, and get proper deletion ...
Int_t fNofPads
number of pads in this PCB
virtual Double_t DimensionY() const =0
Return y dimensions.
Int_t GetNofPadsX() const
AliMpPCB & operator=(const AliMpPCB &o)
A PCB for station 3,4 or 5.
AliMpMotifPosition * FindMotifPosition(Int_t ix, Int_t iy) const
Returns the motifPosition which contains the pad at (ix,iy).
Double_t GetDimensionX() const
Return x dimension.
MpPair_t Pair(Int_t first, Int_t second)
Encode the pair of integers to another integer.
Int_t GetSize() const
The number of motifs, aka manus.
A rectangle area positioned in plane..
Bool_t HasPadByIndices(MpPair_t indices) const
Double_t PadSizeX() const
AliMpMotifType * GetMotifType() const
Return the motif type.
void SetPosition(Double_t x, Double_t y)
Int_t GetNofPadsY() const
A container to keep track of allocated motifs and motifTypes for slats (both St345 and trigger ones)...
Double_t ActiveDX() const
virtual Double_t DimensionX() const
Return x dimensions.
Int_t fIxmax
max pad index in x
MpPair_t GetHighIndicesLimit() const
void SetHighIndicesLimit(MpPair_t limit, Bool_t valid=true)
Double_t fEnveloppeSizeY
max y-size of this PCB (cm)
Int_t fIxmin
min pad index in x
Int_t GetID() const
Return motif position ID = manu id.
TString GetID() const
Return the motif identifier.
Double_t fPadSizeY
y-size of this PCB's pads (cm)
Int_t GetNofPadsX() const
Return number of pads in x direction.
void Add(AliMpMotifType *motifType, Int_t ix, Int_t iy)
Int_t GetNofPadsY() const
Return number of pads in y direction.
Bool_t HasPadByLocalIndices(MpPair_t localIndices) const
const char * GetID() const
Double_t ActiveXmin() const
MpPair_t GetLowIndicesLimit() const
Double_t ActiveXmax() const
AliMpVMotif * GetMotif() const
Return motif.
Double_t fPadSizeX
x-size of this PCB's pads (cm)
virtual Double_t DimensionX() const =0
Return x dimensions.
Int_t fIymax
max pad index in y
AliMpMotifPosition * GetMotifPosition(Int_t i) const
virtual MpPair_t PadIndicesLocal(Double_t localPosX, Double_t localPosY) const =0
Return local indices of the pad specified by local position.
TObjArray fMotifPositions
array of motifs
Int_t GetNofPads() const
Return the total number of pads.
Int_t fIymin
min pad index in y
AliMpVMotif * FindMotif(const TString &id) const
Abstract base class for a motif with its unique ID and the motif type.
Double_t fXoffset
x-offset = x of first pad of this PCB (cm)
TString GetID() const
Return unique motif ID.
Int_t PairFirst(MpPair_t pair)
Decode the first integer from encoded pair.
TObject * Clone(const char *newname="") const
Double_t GetPositionX() const
Return x position.
A motif with its unique ID and the motif type.
Double_t fActiveXmax
max x of an actual pad in this PCB (cm)
Bool_t AddMotif(AliMpVMotif *motif, Bool_t warn=kTRUE)
Double_t fActiveXmin
min x of an actual pad in this PCB (cm)
Double_t PadSizeY() const
Double_t fEnveloppeSizeX
max x-size of this PCB (cm)
Class that defines the motif properties.