X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCRawStream.cxx;h=57701c8f6847a18f1dbfbfb22cbd38b691124853;hb=7f96259a1dd5fa578309b6298a08758c036c7df2;hp=bf53594f81faafceffe07c6a51e71bbc1c7775cb;hpb=041f6df47d6dee5065ccbae9f3a03973cbbef0d8;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCRawStream.cxx b/TPC/AliTPCRawStream.cxx index bf53594f81f..57701c8f684 100644 --- a/TPC/AliTPCRawStream.cxx +++ b/TPC/AliTPCRawStream.cxx @@ -36,50 +36,70 @@ 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(0); - - 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()); + SelectRawData("TPC"); + + 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; } @@ -88,7 +108,8 @@ AliTPCRawStream::~AliTPCRawStream() { // 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]; } //_____________________________________________________________________________ @@ -138,4 +159,6 @@ void AliTPCRawStream::ApplyAltroMapping() fRow = fMapping[patchIndex]->GetPadRow(hwAddress); fPad = fMapping[patchIndex]->GetPad(hwAddress); + if ((fRow < 0) || (fPad < 0)) + AddMappingErrorLog(Form("hw=%d",hwAddress)); }