X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONManuPadPainter.cxx;h=63bf85491114e3d1f2257569d0d288d2e9d19b01;hb=8bec71285df8614da58260f69f125721f633f6cb;hp=a8e4774a97bfbe9a2d07c2589f53c491fcca939c;hpb=1ffbeb9dda307d5ecbe07a8d2a0361d2dad54215;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONManuPadPainter.cxx b/MUON/AliMUONManuPadPainter.cxx index a8e4774a97b..63bf8549111 100644 --- a/MUON/AliMUONManuPadPainter.cxx +++ b/MUON/AliMUONManuPadPainter.cxx @@ -20,7 +20,6 @@ #include "AliLog.h" #include "AliMUONPainterGroup.h" #include "AliMUONPainterHelper.h" -#include "AliMUONPainterPadStore.h" #include "AliMUONTrackerDataHistogrammer.h" #include "AliMUONVCalibParam.h" #include "AliMUONVDigit.h" @@ -28,7 +27,6 @@ #include "AliMpConnection.h" #include "AliMpConstants.h" #include "AliMpDDLStore.h" -#include "AliMpDetElement.h" #include "AliMpPad.h" #include "AliMpSegmentation.h" #include "AliMpVSegmentation.h" @@ -118,7 +116,7 @@ AliMUONManuPadPainter::ComputeDataRange(const AliMUONVTrackerData& data, Double_t& dataMin, Double_t& dataMax) const { /// Compute data range spanned by this manu pads - AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(fDetElemId); + const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(fDetElemId,fManuId); dataMin = FLT_MAX; dataMax = -FLT_MAX; @@ -126,7 +124,7 @@ AliMUONManuPadPainter::ComputeDataRange(const AliMUONVTrackerData& data, for ( Int_t manuChannel = 0; manuChannel < AliMpConstants::ManuNofChannels(); ++manuChannel ) { - if ( de->IsConnectedChannel(fManuId,manuChannel) ) + if ( seg->HasPadByLocation(fManuId,manuChannel) ) { Double_t value = data.Channel(fDetElemId, fManuId, manuChannel, dataIndex); dataMin = TMath::Min(value,dataMin); @@ -155,7 +153,7 @@ AliMUONManuPadPainter::NameAtPosition(Double_t x, Double_t y) const if ( pad.IsValid() ) { - name = Form("%s%d",PathName().Data(),pad.GetLocation().GetSecond()); + name = Form("%s%d",PathName().Data(),pad.GetManuChannel()); } return name; @@ -182,7 +180,7 @@ AliMUONManuPadPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex if ( pad.IsValid() ) { - Double_t value = data.Channel(fDetElemId,fManuId,pad.GetLocation().GetSecond(),dataIndex); + Double_t value = data.Channel(fDetElemId,fManuId,pad.GetManuChannel(),dataIndex); return AliMUONPainterHelper::Instance()->FormatValue(data.DimensionName(dataIndex).Data(),value); } @@ -210,8 +208,8 @@ AliMUONManuPadPainter::DrawHistogramClone(Double_t* values) const AliMUONTrackerDataHistogrammer tdh(*data,0,-1); - fHistogram = tdh.CreateChannelHisto(fDetElemId, fManuId, - pad.GetLocation().GetSecond()); + fHistogram = tdh.CreateChannelHisto(fDetElemId, fManuId,pad.GetManuChannel()); + if (fHistogram) { new TCanvas(); @@ -235,22 +233,17 @@ AliMUONManuPadPainter::PaintArea(const AliMUONVTrackerData& data, AliMUONPainterHelper* h = AliMUONPainterHelper::Instance(); BackupStyle(); - - Int_t cathode = h->GetCathodeType(fDetElemId,fManuId); - + gVirtualX->SetLineColor(-1); - gVirtualX->SetFillStyle(1); + gVirtualX->SetFillStyle(1001); + + const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(fDetElemId,fManuId); for ( Int_t i = 0; i < AliMpConstants::ManuNofChannels(); ++i ) { - Int_t id = AliMUONVDigit::BuildUniqueID(fDetElemId,fManuId,i,cathode); - - TVector2 position; - TVector2 dimensions; - - h->PadStore().GetPadGeometry(id,position,dimensions); + AliMpPad pad = seg->PadByLocation(fManuId,i,kFALSE); - if ( dimensions.X() > 0 ) + if ( pad.IsValid() ) { Double_t value = data.Channel(fDetElemId,fManuId,i,dataIndex); @@ -264,13 +257,11 @@ AliMUONManuPadPainter::PaintArea(const AliMUONVTrackerData& data, fDetElemId,fManuId,i,value,min,max, color)); } - + gVirtualX->SetFillColor(color); - TVector2 bl(position-dimensions); - TVector2 ur(position+dimensions); + PaintPad(pad); - gPad->PaintBox(bl.X(),bl.Y(),ur.X(),ur.Y()); } } @@ -279,22 +270,20 @@ AliMUONManuPadPainter::PaintArea(const AliMUONVTrackerData& data, //_____________________________________________________________________________ void -AliMUONManuPadPainter::PaintPad(Int_t padId) const +AliMUONManuPadPainter::PaintPad(const AliMpPad& pad) const { - /// Paint a single pad + Double_t blx = pad.GetPositionX()-pad.GetDimensionX(); + Double_t bly = pad.GetPositionY()-pad.GetDimensionY(); - TVector2 position; - TVector2 dimensions; - - AliMUONPainterHelper::Instance()->PadStore().GetPadGeometry(padId,position,dimensions); + Double_t urx = pad.GetPositionX()+pad.GetDimensionX(); + Double_t ury = pad.GetPositionY()+pad.GetDimensionY(); + + Double_t xe1,ye1,xe2,ye2,z; - if ( dimensions.X() > 0 ) - { - TVector2 bl(position-dimensions); - TVector2 ur(position+dimensions); + AliMUONPainterHelper::Instance()->Local2Global(fDetElemId,blx,bly,0,xe1,ye1,z); + AliMUONPainterHelper::Instance()->Local2Global(fDetElemId,urx,ury,0,xe2,ye2,z); - gPad->PaintBox(bl.X(),bl.Y(),ur.X(),ur.Y()); - } + gPad->PaintBox(xe1,ye1,xe2,ye2); } //_____________________________________________________________________________ @@ -307,16 +296,10 @@ AliMUONManuPadPainter::PaintOutline(Int_t color, Int_t, Double_t x, Double_t y) Int_t lineColor = color >= 0 ? color : GetLineColor(); - AliMUONPainterHelper* h = AliMUONPainterHelper::Instance(); - - AliDebug(1,Form("color=%d lineColor=%d x=%7.3f y=%7.3f",color,lineColor,x,y)); - if ( lineColor > 0 ) { BackupStyle(); - Int_t cathode = h->GetCathodeType(fDetElemId,fManuId); - gVirtualX->SetLineColor(lineColor); gVirtualX->SetFillStyle(0); @@ -325,17 +308,19 @@ AliMUONManuPadPainter::PaintOutline(Int_t color, Int_t, Double_t x, Double_t y) // find pad to be drawn AliMpPad pad = PadByPosition(x,y); - Int_t id = AliMUONVDigit::BuildUniqueID(fDetElemId,fManuId,pad.GetLocation().GetSecond(),cathode); - - PaintPad(id); + PaintPad(pad); } else { + const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(fDetElemId,fManuId); + for ( Int_t i = 0; i < AliMpConstants::ManuNofChannels(); ++i ) { - Int_t id = AliMUONVDigit::BuildUniqueID(fDetElemId,fManuId,i,cathode); + AliMpPad pad = seg->PadByLocation(fManuId,i,kFALSE); + + if (pad.IsValid()) PaintPad(pad); - PaintPad(id); + PaintPad(pad); } } RestoreStyle(); @@ -358,7 +343,7 @@ AliMUONManuPadPainter::PadByPosition(Double_t x, Double_t y) const AliMUONPainterHelper::Instance()->Global2Local(fDetElemId,x,y,zg,xl,yl,zl); - return seg->PadByPosition(TVector2(xl,yl)); + return seg->PadByPosition(xl,yl); } //_____________________________________________________________________________