#include "AliMpMotifSpecial.h"
#include "AliMpMotifType.h"
#include "AliMpConnection.h"
-#include "AliMpIntPair.h"
+#include "AliMpEncodePair.h"
#include "AliLog.h"
AliMpMotifType* motifType = new AliMpMotifType(motifTypeId);
- PadMapType positions;
+ TExMap positions;
char line[256];
do {
int i,j;
strline>>i>>j;
-#ifdef WITH_STL
- positions[key].first=i;
- positions[key].second=j;
-#endif
-#ifdef WITH_ROOT
positions.Add( AliMpExMap::GetIndex(key),
- AliMpExMap::GetIndex(AliMpIntPair(i,j)) );
-#endif
+ AliMp::Pair(i,j) + 1 );
+ // we have to add 1 to the AliMp::Pair in order to
+ // its value always != 0, as the TExMap returns 0 value
+ // if given key does not exists
} while (!padPosStream.eof());
const Int_t knbergpins =
// Station1 & 2 Bergstak connectors have 80 pins, while for stations
// 3, 4 and 5 they have 100 pins.
Int_t gassiChannel[100];
+ for (Int_t i=0; i<100; ++i) gassiChannel[i] = 0;
while(1) {
Int_t bergNum;
TString gcStr;
Fatal("BuildMotifType","Berg number > 80 ...");
continue;
}
+ if ( bergNum <= 0 || bergNum >= 101 ) {
+ AliErrorStream() << "Wrong bergNum: " << bergNum << endl;
+ return 0;
+ }
gassiChannel[bergNum-1]= atoi(gcStr);
}
gassiNum = gassiChannel[numBerg-1];
-#ifdef WITH_STL
- PadMapTypeIterator iter = positions.find(padName);
- if (iter==positions.end()) {
- AliWarningStream()
- << "Problem: Pad number " << padNum
- << " for motif type " << motifTypeId.Data()
- << " found in the motifType stream, but not in the padPos stream" << endl;
- continue;
- }
-
- ix= iter->second.first;
- iy= iter->second.second;
-#endif
-
-#ifdef WITH_ROOT
Long_t value = positions.GetValue(AliMpExMap::GetIndex(padName));
if (!value) {
AliWarningStream()
continue;
}
- ix = AliMpExMap::GetPair(value).GetFirst();
- iy = AliMpExMap::GetPair(value).GetSecond();
-
-#endif
-
AliMpConnection* connection
- = new AliMpConnection(padNum,numBerg,numKapton,gassiNum, AliMpIntPair(ix,iy));
+ = new AliMpConnection(padNum,numBerg,numKapton,gassiNum, --value);
+
+ Bool_t ok = motifType->AddConnection(connection);
- motifType->AddConnection(AliMpIntPair(ix,iy),connection);
+ if (!ok)
+ {
+ AliFatal("Could not add connection");
+ }
+ ix = AliMp::PairFirst(value);
+ iy = AliMp::PairSecond(value);
+
if (ix>=nofPadsX) nofPadsX=ix+1;
if (iy>=nofPadsY) nofPadsY=iy+1;
in >> i;
while (!in.eof()){
in >>j >>x >> y;
- res->SetPadDimensions(AliMpIntPair(i,j),TVector2(x*scale/2.,y*scale/2.));
+ res->SetPadDimensions(i,j,x*scale/2.,y*scale/2.);
in >> i;
}
res->CalculateDimensions();