31 #include "AliCodeTimer.h"
42 #include <Riostream.h>
65 fMotifPositions2.SetOwner(
false);
73 fMotifPositions(ioCtor),
74 fMotifPositions2(ioCtor)
98 cout << motif->
GetID().Data() <<
" "
109 cout << motifType->
GetID().Data() <<
" "
120 cout <<
" ID " << motifPosition->
GetID() <<
" "
122 <<
" Pos (X,Y) = (" << motifPosition->
GetPositionX() <<
","
136 << motifPosition->
GetID() <<
" ";
146 cout <<
"Dump of Motif Map - " <<
fMotifs.
GetSize() <<
" entries:" << endl;
152 while ( ( motif = static_cast<AliMpVMotif*>(it->
Next(key)) ) )
154 TString
id =
fMotifs.AliMpExMap::GetString(key);
155 cout <<
"Map element "
156 << setw(3) << counter++ <<
" "
157 <<
id.Data() <<
" " ;
179 while ( ( motifType = static_cast<AliMpMotifType*>(it->
Next(key)) ) )
182 cout <<
"Map element "
183 << setw(3) << counter++ <<
" "
184 <<
id.Data() <<
" " ;
204 while ( ( motifPosition = static_cast<AliMpMotifPosition*>(next()) ) )
206 ecn[i] = motifPosition->GetID();
224 AliCodeTimerAuto(
"",0);
227 AliErrorStream() <<
"Index " << index <<
" outside limits." << endl;
232 while (index-- > 0) next();
245 while ( ( motifPosition = static_cast<AliMpMotifPosition*>(next()) ) )
264 while ( ( motifPosition = static_cast<AliMpMotifPosition*>(next()) ) )
266 cout <<
"Map element "
267 << setw(3) << counter++ <<
" ";
288 while ( ( motifPosition = static_cast<AliMpMotifPosition*>(next()) ) )
290 cout <<
"Map element " << setw(3) << counter++ <<
" ";
310 if (warn && found == motif)
311 AliWarningStream() <<
"The motif is already in map." << endl;
313 if (warn && found != motif) {
315 <<
"Another motif with the same ID is already in map." << endl;
333 if (warn && found == motifType)
334 AliWarningStream() <<
"The motif type is already in map." << endl;
336 if (warn && found != motifType) {
338 <<
"Another motif type with the same ID is already in map." << endl;
356 if (warn && found == motifPosition) {
358 <<
"ID: " << motifPosition->
GetID()
359 <<
" found: " << found
360 <<
" new: " << motifPosition << endl
361 <<
"This motif position is already in map." << endl;
364 if (warn && found != motifPosition) {
366 <<
"ID: " << motifPosition->
GetID()
367 <<
" found: " << found
368 <<
" new: " << motifPosition << endl
369 <<
"Another motif position with the same ID is already in map."
387 AliWarningStream() <<
"Map has been already filled." << endl;
393 while ( ( motifPosition = static_cast<AliMpMotifPosition*>(next()) ) )
396 motifPosition->GetLowLimitIy(),
410 if ( sopt.Contains(
"MOTIFS") || sopt ==
"ALL" )
PrintMotifs();
421 ofstream out(fileName, ios::out);
426 while ( ( motifPosition = static_cast<AliMpMotifPosition*>(next()) ) )
428 out << setw(5) << motifPosition->
GetID() <<
" "
429 << setw(3) << motifPosition->GetLowLimitIx() <<
" "
430 << setw(3) << motifPosition->GetLowLimitIy()
442 ifstream in(fileName, ios::in);
444 Int_t motifPositionId, offx, offy;
447 in >> motifPositionId >> offx >> offy;
459 << motifPosition->
GetID() <<
" " << offx <<
" " << offy << endl;
473 <<
"Motif position " << motifPositionId <<
" not found" << endl;
492 const TString& motifTypeID,
493 Double_t padDimensionX,
494 Double_t padDimensionY )
const
506 AliFatal(
"Motif has been already defined with a different type.");
512 dynamic_cast<AliMpMotif*>(motif) &&
516 AliFatal(
"Motif type has been already defined with different dimensions.");
523 ( padDimensionX == 0. && padDimensionY == 0.) &&
524 ! dynamic_cast<AliMpMotifSpecial*>(motif) ) {
526 AliFatal(
"Motif type has been already defined with different dimensions.");
Double_t GetPositionY() const
Return y position.
void PrintMotifPosition2(const AliMpMotifPosition *motifPosition) const
void SetLowIndicesLimit(MpPair_t limit, Bool_t valid=true)
Bool_t AddMotifPosition(AliMpMotifPosition *motifType, Bool_t warn=true)
AliMpExMap fMotifTypes
motifs types map
void FillMotifPositionMap2()
AliMpExMap fMotifPositions2
motifs positions map
Int_t GetLowLimitIx() const
virtual Double_t GetPadDimensionY(Int_t i) const =0
Return the i-th pad y dimension.
void PrintMotifPositions2() const
void PrintMotif(const AliMpVMotif *motif) const
Int_t CalculateNofPads() const
Calculate total number of pads defined in the map.
virtual Double_t DimensionY() const =0
Return y dimensions.
void UpdateGlobalIndices(const char *fileName)
void PrintMotifType(const AliMpMotifType *motifType) const
UInt_t GetNofMotifPositions() const
AliMpExMap fMotifs
motifs map
Int_t GetLowLimitIy() const
Int_t GetHighLimitIy() const
void PrintMotifPosition(const AliMpMotifPosition *motifPosition) const
AliMpVMotif * FindMotif(const TString &motifID) const
AliMpMotifType * GetMotifType() const
Return the motif type.
virtual void Print(const char *option="ALL") const
void PrintMotifPositions() const
void SetHighIndicesLimit(MpPair_t limit, Bool_t valid=true)
virtual TObject * Next()
The returned object must not be deleted by the user.
Int_t GetID() const
Return motif position ID = manu id.
TString GetID() const
Return the motif identifier.
Int_t GetNofPadsX() const
Return number of pads in x direction.
Int_t GetNofPadsY() const
Return number of pads in y direction.
Bool_t AddMotif(AliMpVMotif *motif, Bool_t warn=true)
TObject * GetValue(Int_t keyFirst, Int_t keySecond) const
AliMpVMotif * GetMotif() const
Return motif.
AliMpMotifType * FindMotifType(const TString &motifTypeID) const
void Add(Int_t keyFirst, Int_t keySecond, TObject *object)
virtual Double_t DimensionX() const =0
Return x dimensions.
AliMpMotifPosition * GetMotifPosition(UInt_t index) const
Int_t GetNofPads() const
Return the total number of pads.
void SetOwner(Bool_t owner)
Abstract base class for a motif with its unique ID and the motif type.
void PrintGlobalIndices(const char *fileName) const
TString GetID() const
Return unique motif ID.
Bool_t AddMotifType(AliMpMotifType *motifType, Bool_t warn=true)
AliMpMotifPosition * FindMotifPosition(Int_t motifPositionID) const
virtual Double_t GetPadDimensionX(Int_t i) const =0
Return the i-th pad x dimension.
void PrintMotifTypes() const
Double_t GetPositionX() const
Return x position.
Int_t GetHighLimitIx() const
static TString GetString(Long_t index)
Implementation of TIterator for AliMpExMap.
AliMpExMap fMotifPositions
motifs positions map
AliMpExMapIterator * CreateIterator() const
Class that defines the motif properties.
void GetAllMotifPositionsIDs(TArrayI &enc) const
Find all motifPositionsIDs (=electronicCardNumbers) handled by this map.