ClassImp(AliTPCRawStream)
//_____________________________________________________________________________
-AliTPCRawStream::AliTPCRawStream(AliRawReader* rawReader) :
+AliTPCRawStream::AliTPCRawStream(AliRawReader* rawReader, AliAltroMapping **mapping) :
AliAltroRawStream(rawReader),
fSector(-1),
fPrevSector(-1),
fRow(-1),
fPrevRow(-1),
fPad(-1),
- fPrevPad(-1)
+ fPrevPad(-1),
+ fIsMapOwner(kFALSE)
{
// create an object to read TPC raw digits
SelectRawData("TPC");
- TString path = gSystem->Getenv("ALICE_ROOT");
- path += "/TPC/mapping/Patch";
- TString path2;
- for(Int_t i = 0; i < 6; i++) {
- path2 = path;
- path2 += i;
- path2 += ".data";
- fMapping[i] = new AliTPCAltroMapping(path2.Data());
+ if (mapping == NULL) {
+ TString path = gSystem->Getenv("ALICE_ROOT");
+ path += "/TPC/mapping/Patch";
+ TString path2;
+ for(Int_t i = 0; i < 6; i++) {
+ path2 = path;
+ path2 += i;
+ path2 += ".data";
+ fMapping[i] = new AliTPCAltroMapping(path2.Data());
+ }
+ fIsMapOwner = kTRUE;
}
-
- fNoAltroMapping = kFALSE;
+ else {
+ for(Int_t i = 0; i < 6; i++)
+ fMapping[i] = mapping[i];
+ }
+
}
//_____________________________________________________________________________
AliTPCRawStream::AliTPCRawStream(const AliTPCRawStream& stream) :
AliAltroRawStream(stream),
- fSector(-1),
- fPrevSector(-1),
- fRow(-1),
- fPrevRow(-1),
- fPad(-1),
- fPrevPad(-1)
+ fSector(stream.fSector),
+ fPrevSector(stream.fPrevSector),
+ fRow(stream.fRow),
+ fPrevRow(stream.fPrevRow),
+ fPad(stream.fPad),
+ fPrevPad(stream.fPrevPad),
+ fIsMapOwner(kFALSE)
{
- Fatal("AliTPCRawStream", "copy constructor not implemented");
+ for(Int_t i = 0; i < 6; i++) fMapping[i] = stream.fMapping[i];
}
//_____________________________________________________________________________
-AliTPCRawStream& AliTPCRawStream::operator = (const AliTPCRawStream&
- /* stream */)
+AliTPCRawStream& AliTPCRawStream::operator = (const AliTPCRawStream& stream)
{
- Fatal("operator =", "assignment operator not implemented");
+ if(&stream == this) return *this;
+
+ ((AliAltroRawStream *)this)->operator=(stream);
+
+ fSector = stream.fSector;
+ fPrevSector = stream.fPrevSector;
+ fRow = stream.fRow;
+ fPrevRow = stream.fPrevRow;
+ fPad = stream.fPad;
+ fPrevPad = stream.fPrevPad;
+ fIsMapOwner = kFALSE;
+
+ for(Int_t i = 0; i < 6; i++) fMapping[i] = stream.fMapping[i];
+
return *this;
}
{
// destructor
- for(Int_t i = 0; i < 6; i++) delete fMapping[i];
+ if (fIsMapOwner)
+ for(Int_t i = 0; i < 6; i++) delete fMapping[i];
}
//_____________________________________________________________________________
fRow = fMapping[patchIndex]->GetPadRow(hwAddress);
fPad = fMapping[patchIndex]->GetPad(hwAddress);
+ if ((fRow < 0) || (fPad < 0))
+ AddMappingErrorLog(Form("hw=%d",hwAddress));
}