42 #include <Riostream.h>
43 #include <Rstrstream.h>
45 #if !defined(__HP_aCC) && !defined(__alpha)
58 fStationType(station),
59 fStation12Type(station12),
78 const TString& motifTypeId)
91 istream& bergToGCStream
95 istream& motifTypeStream
106 padPosStream.getline(line,255);
107 if (!padPosStream)
break;
109 #if defined (__HP_aCC) || (__alpha)
113 istringstream strline(line);
118 if ((key==
"#") || (key==
"") )
continue;
127 }
while (!padPosStream.eof());
129 const Int_t knbergpins =
133 Int_t gassiChannel[100];
134 for (Int_t i=0; i<100; ++i) gassiChannel[i] = 0;
138 bergToGCStream>>bergNum>>gcStr;
139 if (!bergToGCStream.good())
break;
140 if (gcStr==
"GND")
continue;
141 if (bergNum>knbergpins) {
142 Fatal(
"BuildMotifType",
"Berg number > 80 ...");
145 if ( bergNum <= 0 || bergNum >= 101 ) {
146 AliErrorStream() <<
"Wrong bergNum: " << bergNum << endl;
149 gassiChannel[bergNum-1]= atoi(gcStr);
157 Int_t ix,iy,numBerg,numKapton,padNum,gassiNum;
159 TString lineStr,token;
160 lineStr.ReadLine(motifTypeStream);
161 if (!motifTypeStream.good())
break;
162 #if defined (__HP_aCC) || (__alpha)
164 tokenList << lineStr.Data();
166 istringstream tokenList(lineStr.Data());
169 token.ReadToken(tokenList);
170 if (!tokenList.good())
continue;
171 if ( (token.Length()>0) && (token[0]==
'#') )
continue;
173 numBerg = atoi(token.Data());
175 AliWarning(Form(
"Berg number %s invalid",token.Data()));
179 token.ReadToken(tokenList);
180 if (!tokenList.good())
continue;
181 numKapton = atoi(token.Data());
182 if (numKapton==0)
continue;
185 token.ReadToken(tokenList);
186 if (!tokenList.good())
continue;
187 if (token==
"GND")
continue;
188 string padName = token.Data();
189 padNum = motifType->
PadNum(token);
191 token.ReadToken(tokenList);
192 if (token.IsNull() )
continue;
199 if ( (numBerg<1) || (numBerg>knbergpins) ) {
200 AliWarning(Form(
"Berg number %d outside range (1..%d)",numBerg,knbergpins));
204 gassiNum = gassiChannel[numBerg-1];
209 <<
"Problem: Pad number " << padNum
210 <<
" for motif type " << motifTypeId.Data()
211 <<
" found in the motifType stream, but not in the padPos stream" << endl;
222 AliFatal(
"Could not add connection");
228 if (ix>=nofPadsX) nofPadsX=ix+1;
229 if (iy>=nofPadsY) nofPadsY=iy+1;
231 }
while (!motifTypeStream.eof());
236 delete &padPosStream;
237 delete &bergToGCStream;
238 delete &motifTypeStream;
246 const TString& motifID,
287 id = Form(
"%s-%e",motifID.Data(),
scale);
Int_t PadNum(const TString &padName) const
void CalculateDimensions()
void SetPadDimensions(MpPair_t localIndices, Double_t dx, Double_t dy)
A special motif with varying pad dimensions.
AliMpMotifSpecial * BuildMotifSpecial(const AliMpDataStreams &dataStreams, const TString &motifID, AliMpMotifType *motifType, Double_t scale=1.0)
TString MotifSpecialName(const TString &motifID, Double_t scale)
static TString PadPosFilePath(AliMp::StationType station, AliMq::Station12Type station12Type, AliMp::PlaneType plane, const TString &motifTypeID)
AliMp::PlaneType fPlaneType
plane type
MpPair_t Pair(Int_t first, Int_t second)
Encode the pair of integers to another integer.
AliMq::Station12Type fStation12Type
station12 type
static TString MotifFilePath(AliMp::StationType station, AliMq::Station12Type station12Type, AliMp::PlaneType plane, const TString &motifTypeID)
AliMpMotifType * BuildMotifType(const AliMpDataStreams &dataStreams, const TString &motifTypeId)
void SetNofPads(Int_t nofPadsX, Int_t nofPadY)
static TString MotifSpecialFilePath(AliMp::StationType station, AliMq::Station12Type station12Type, AliMp::PlaneType plane, const TString &motifID)
Int_t PairFirst(MpPair_t pair)
Decode the first integer from encoded pair.
Class that takes care of reading the motifs data.
Bool_t AddConnection(AliMpConnection *connection)
static TString BergToGCFilePath(AliMp::StationType station, AliMq::Station12Type station12Type)
static Long_t GetIndex(const TString &s)
Int_t PairSecond(MpPair_t pair)
Decode the second integer from encoded pair.
Class that defines the motif properties.
AliMp::StationType fStationType
station type
virtual ~AliMpMotifReader()
Mapping data streams provider.