34 #include "Riostream.h"
36 #include "TObjString.h"
99 const TString kSizeKeyword(
"SIZES");
100 const TString kMotifKeyword(
"MOTIF");
104 while ( in.getline(line,80) )
106 if ( line[0] ==
'#' )
continue;
110 if ( sline(0,kSizeKeyword.Length()) == kSizeKeyword )
112 std::istringstream sin(sline(kSizeKeyword.Length(),
113 sline.Length()-kSizeKeyword.Length()).Data());
114 double padSizeX = 0.0;
115 double padSizeY = 0.0;
116 double pcbSizeX = 0.0;
117 double pcbSizeY = 0.0;
118 sin >> padSizeX >> padSizeY >> pcbSizeX >> pcbSizeY;
121 AliError(
"pcb not null as expected");
126 if ( sline(0,kMotifKeyword.Length()) == kMotifKeyword )
128 std::istringstream sin(sline(kMotifKeyword.Length(),
129 sline.Length()-kMotifKeyword.Length()).Data());
133 sin >> sMotifType >> ix >> iy;
138 AliDebug(1,Form(
"Reading motifType %s from file",sMotifType.Data()));
139 motifType = reader.
BuildMotifType(dataStreams, sMotifType.Data());
144 AliDebug(1,Form(
"Got motifType %s from motifMap",sMotifType.Data()));
147 if (pcb) pcb->
Add(motifType,ix,iy);
172 const TString kpcbKeyword(
"PCB");
176 while ( in.getline(line,80) )
178 if ( line[0] ==
'#' )
continue;
182 if ( sline(0,kpcbKeyword.Length()) == kpcbKeyword )
184 TString tmp(sline(kpcbKeyword.Length()+1,sline.Length()-kpcbKeyword.Length()));
185 Ssiz_t blankPos = tmp.First(
' ');
188 AliErrorClass(
"Syntax error in PCB file, should get a list of "
189 "manu ids after the pcbname");
194 TString pcbName(tmp(0,blankPos));
195 TString manus(tmp(blankPos+1,tmp.Length()-blankPos));
200 AliErrorClass(Form(
"Cannot read pcbType=%s",pcbName.Data()));
207 if ( manuList.GetSize() != Int_t(pcbType->
GetSize()) )
209 AliErrorClass(Form(
"Wrong number of manu ids for this PCB ("
210 "%s) : %d out of %d",pcbName.Data(),
211 manuList.GetSize(),pcbType->
GetSize()));
217 for ( Int_t i = 0; i < manuList.GetSize(); ++i )
221 slat->
Add(*pcbType,manuList);
Bool_t AddMotifType(AliMpMotifType *motifType, Bool_t warn=kTRUE)
static TString Normalize(const char *line)
A PCB for station 3,4 or 5.
void Add(const AliMpPCB &pcbType, const TArrayI &manuList)
Int_t GetSize() const
The number of motifs, aka manus.
AliMpMotifType * BuildMotifType(const AliMpDataStreams &dataStreams, const TString &motifTypeId)
AliMpSlatMotifMap * fMotifMap
! storage for motifTypes and motifs...
A slat (building block of stations 3, 4 and 5)
A container to keep track of allocated motifs and motifTypes for slats (both St345 and trigger ones)...
static TString SlatPCBFilePath(AliMp::StationType stationType, const char *pcbType)
AliMpSlat * ReadSlat(const AliMpDataStreams &dataStreams, const char *slatType, AliMp::PlaneType planeType)
void Add(AliMpMotifType *motifType, Int_t ix, Int_t iy)
AliMpPCB * ReadPCB(const AliMpDataStreams &dataStreams, const char *pcbType)
Read slat and pcb ASCII files.
value for all non sector stations
virtual ~AliMpSt345Reader()
Class that takes care of reading the motifs data.
AliMpMotifType * FindMotifType(const TString &id) const
static TString SlatFilePath(AliMp::StationType stationType, const char *slatType, AliMp::PlaneType plane)
static Int_t ManuMask(AliMp::PlaneType planeType)
Class that defines the motif properties.
Mapping data streams provider.
static void DecodeName(const char *manus, char sep, TArrayI &theList)