X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONSimpleClusterServer.cxx;h=b6bfe99e28901698edfb0fe7d6284c4e85e24930;hb=09cd3cd002cc0594e742971fab6f95c6a69dac0e;hp=553352dbe0148a47a1596cadc289d47b3e6c2954;hpb=4750f29d4be9cd5025a4bc544b2bf44e1de6093c;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONSimpleClusterServer.cxx b/MUON/AliMUONSimpleClusterServer.cxx index 553352dbe01..b6bfe99e289 100644 --- a/MUON/AliMUONSimpleClusterServer.cxx +++ b/MUON/AliMUONSimpleClusterServer.cxx @@ -38,7 +38,7 @@ #include "AliMpSegmentation.h" #include "AliMpVSegmentation.h" #include -#include +#include #include #include @@ -49,6 +49,8 @@ /// /// \author Laurent Aphecetche, Subatech +using std::endl; +using std::cout; /// \cond CLASSIMP ClassImp(AliMUONSimpleClusterServer) /// \endcond @@ -137,10 +139,10 @@ AliMUONSimpleClusterServer::Clusterize(Int_t chamberId, { Int_t detElemId = it.CurrentDEId(); - TClonesArray* pads[2] = + TObjArray* pads[2] = { - static_cast(fPads[0]->GetValue(detElemId)), - static_cast(fPads[1]->GetValue(detElemId)) + static_cast(fPads[0]->GetValue(detElemId)), + static_cast(fPads[1]->GetValue(detElemId)) }; if ( ( pads[0] && pads[0]->GetLast()>=0 ) || @@ -244,7 +246,12 @@ AliMUONSimpleClusterServer::Global2Local(Int_t detElemId, const AliMpArea& globa Double_t xl,yl,zl; - Double_t zg = AliMUONConstants::DefaultChamberZ(AliMpDEManager::GetChamberId(detElemId)); + Int_t chamberId = AliMpDEManager::GetChamberId(detElemId); + if ( chamberId < 0 ) { + AliErrorStream() << "Cannot get chamberId from detElemId=" << detElemId << endl; + return; + } + Double_t zg = AliMUONConstants::DefaultChamberZ(chamberId); fkTransformer.Global2Local(detElemId, globalArea.GetPositionX(),globalArea.GetPositionY(),zg, @@ -294,12 +301,12 @@ AliMUONSimpleClusterServer::Overlap(Int_t detElemId, } //_____________________________________________________________________________ -TClonesArray* +TObjArray* AliMUONSimpleClusterServer::PadArray(Int_t detElemId, Int_t cathode) const { /// Return array for given cathode of given DE - return static_cast(fPads[cathode]->GetValue(detElemId)); + return static_cast(fPads[cathode]->GetValue(detElemId)); } //_____________________________________________________________________________ @@ -344,20 +351,21 @@ AliMUONSimpleClusterServer::UseDigits(TIter& next, AliMUONVDigitStore* digitStor GetMpSegmentation(detElemId,AliMp::GetCathodType(cathode)); AliMpPad pad = seg->PadByIndices(ix,iy); - TClonesArray* padArray = PadArray(detElemId,cathode); + TObjArray* padArray = PadArray(detElemId,cathode); if (!padArray) { - padArray = new TClonesArray("AliMUONPad",100); + padArray = new TObjArray(100); + padArray->SetOwner(kTRUE); fPads[cathode]->Add(detElemId,padArray); } - AliMUONPad mpad(detElemId,cathode, + AliMUONPad* mpad = new AliMUONPad(detElemId,cathode, ix,iy,pad.GetPositionX(),pad.GetPositionY(), pad.GetDimensionX(),pad.GetDimensionY(), d->Charge()); - if ( d->IsSaturated() ) mpad.SetSaturated(kTRUE); - mpad.SetUniqueID(d->GetUniqueID()); - new ((*padArray)[padArray->GetLast()+1]) AliMUONPad(mpad); + if ( d->IsSaturated() ) mpad->SetSaturated(kTRUE); + mpad->SetUniqueID(d->GetUniqueID()); + padArray->Add(mpad); } } @@ -456,7 +464,7 @@ AliMUONSimpleClusterServer::Print(Option_t*) const { cout << Form(" -- Cathode %1d",cathode) << endl; - TClonesArray* padArray = PadArray(detElemId,cathode); + TObjArray* padArray = PadArray(detElemId,cathode); if (!padArray) {