#include "AliMUONBusPatchPainter.h"
#include "AliMUONManuPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
#include "AliMUONPainterHelper.h"
#include "AliMUONVCalibParam.h"
#include "AliMUONVTrackerData.h"
Int_t mask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
- AliMUONPainterContour* bpContour = h->GetContour(ContourName());
+ AliMUONContour* bpContour = h->GetContour(ContourName());
AliDebug(1,Form("BusPatchId %04d bending %d DE %4d bpContour(%s)=%p nofManus=%d",
fBusPatchId,att.IsBendingPlane(),detElemId,ContourName().Data(),bpContour,busPatch->GetNofManus()));
Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
- Contour()->PaintArea(color);
+ PaintArea(color);
}
//_____________________________________________________________________________
virtual void Copy(TObject& object) const;
+ using AliMUONVPainter::PaintArea;
+
void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
Double_t min, Double_t max);
#include "AliMUONChamberPainter.h"
#include "AliMUONDEPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
#include "AliMUONPainterHelper.h"
#include "AliMUONVCalibParam.h"
#include "AliMUONVTrackerData.h"
deIt.First(fChamberId);
- AliMUONPainterContour* contour = h->GetContour(ContourName());
+ AliMUONContour* contour = h->GetContour(ContourName());
TObjArray contourArray;
while (!deIt.IsDone())
Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
- Contour()->PaintArea(color);
+ PaintArea(color);
}
//_____________________________________________________________________________
virtual void Copy(TObject& object) const;
+ using AliMUONVPainter::PaintArea;
+
void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
Double_t min, Double_t max);
#include "AliMUONBusPatchPainter.h"
#include "AliMUONGeometryTransformer.h"
#include "AliMUONPCBPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
#include "AliMUONPainterHelper.h"
#include "AliMUONVCalibParam.h"
#include "AliMUONVTrackerData.h"
AliFatal("Not implemented for trigger !!!");
}
- AliMUONPainterContour* contour = h->GetContour(ContourName());
+ AliMUONContour* contour = h->GetContour(ContourName());
TObjArray contourArray;
Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
- Contour()->PaintArea(color);
+ PaintArea(color);
}
//_____________________________________________________________________________
/// Return the ID of this detection element
Int_t DetElemId() const { return fDetElemId; }
+ using AliMUONVPainter::PaintArea;
+
void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
Double_t min, Double_t max);
#include "AliLog.h"
#include "AliMUONPainterGroup.h"
#include "AliMUONPainterHelper.h"
-#include "AliMUONPainterPadStore.h"
#include "AliMUONTrackerDataHistogrammer.h"
#include "AliMUONVCalibParam.h"
#include "AliMUONVDigit.h"
#include "AliMpConnection.h"
#include "AliMpConstants.h"
#include "AliMpDDLStore.h"
-#include "AliMpDetElement.h"
#include "AliMpPad.h"
#include "AliMpSegmentation.h"
#include "AliMpVSegmentation.h"
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;
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);
AliMUONTrackerDataHistogrammer tdh(*data,0,-1);
- fHistogram = tdh.CreateChannelHisto(fDetElemId, fManuId, pad.GetManuChannel());
+ fHistogram = tdh.CreateChannelHisto(fDetElemId, fManuId,pad.GetManuChannel());
+
if (fHistogram)
{
new TCanvas();
AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
BackupStyle();
-
- Int_t cathode = h->GetCathodeType(fDetElemId,fManuId);
-
+
gVirtualX->SetLineColor(-1);
gVirtualX->SetFillStyle(1);
+ 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);
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());
}
}
//_____________________________________________________________________________
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);
}
//_____________________________________________________________________________
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);
// find pad to be drawn
AliMpPad pad = PadByPosition(x,y);
- Int_t id = AliMUONVDigit::BuildUniqueID(fDetElemId,fManuId,pad.GetManuChannel(),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();
virtual TString Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
Double_t x=FLT_MAX, Double_t y=FLT_MAX);
- void PaintArea(const AliMUONVTrackerData& data,
+ using AliMUONVPainter::PaintArea;
+
+ void PaintArea(const AliMUONVTrackerData& data,
Int_t dataIndex,
Double_t min,
Double_t max);
void BackupStyle();
void RestoreStyle();
- void PaintPad(Int_t padId) const;
AliMpPad PadByPosition(Double_t x, Double_t y) const;
+ void PaintPad(const AliMpPad& pad) const;
private:
Int_t fDetElemId; ///< our detection element id
+
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
#include "AliMUONManuPainter.h"
#include "AliMUONManuPadPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
#include "AliMUONPainterHelper.h"
#include "AliMUONVCalibParam.h"
#include "AliMUONVDigit.h"
{
/// ctor
- SetAttributes(att);
-
- AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
-
- SetID(detElemId,manuId);
- SetName(h->ManuName(manuId));
- SetPathName(h->ManuPathName(detElemId,manuId));
-
- AliMpMotifPosition* mp = h->GetMotifPosition(detElemId,manuId);
-
- if (!mp)
- {
- AliFatal(Form("Could not get manuId %04d from DE %04d",manuId,detElemId));
- }
-
- Double_t x,y,z;
-
- AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
-
- if ( stationType == AliMp::kStation345 )
- {
- const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(detElemId,manuId);
-
- h->Local2Global(fDetElemId,
- mp->GetPositionX() -slat->GetPositionX(),
- mp->GetPositionY() -slat->GetPositionY(),
- 0,
- x,y,z);
- }
- else if ( stationType != AliMp::kStationTrigger )
- {
- h->Local2Global(fDetElemId,
- mp->GetPositionX(),
- mp->GetPositionY(),
- 0,
- x,y,z);
- }
- else
- {
- AliError("Hu ho. Not supposed to be used for trigger !");
- Invalidate();
- return;
- }
+ SetAttributes(att);
- AliMUONPainterContour* contour = h->GetContour(ContourName());
+ AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
- if (!contour)
- {
- contour = h->GenerateManuContour(fDetElemId,
- fManuId,
- Attributes(),
- ContourName());
- }
- SetContour(contour);
+ SetID(detElemId,manuId);
+ SetName(h->ManuName(manuId));
+ SetPathName(h->ManuPathName(detElemId,manuId));
+
+
+ AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
+
+ if ( stationType == AliMp::kStationTrigger )
+ {
+ AliError("Hu ho. Not supposed to be used for trigger !");
+ Invalidate();
+ return;
+ }
- Add(new AliMUONManuPadPainter(*this,fDetElemId,fManuId));
+ AliMUONContour* contour = h->GetContour(ContourName());
+
+ if (!contour)
+ {
+ contour = h->GenerateManuContour(fDetElemId,
+ fManuId,
+ Attributes(),
+ ContourName());
+ }
+
+ if (!contour)
+ {
+ AliFatal(Form("Could not get manuId %04d from DE %04d",manuId,detElemId));
+ }
+
+ SetContour(contour);
+
+ Add(new AliMUONManuPadPainter(*this,fDetElemId,fManuId));
}
//_____________________________________________________________________________
Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
- Contour()->PaintArea(color);
+ PaintArea(color);
}
//_____________________________________________________________________________
virtual void Copy(TObject& object) const;
- virtual TString Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
- Double_t x=FLT_MAX, Double_t y=FLT_MAX);
-
- void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
- Double_t min, Double_t max);
+ virtual TString Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
+ Double_t x=FLT_MAX, Double_t y=FLT_MAX);
- virtual AliMUONAttPainter Validate(const AliMUONAttPainter& attributes) const;
-
- virtual void FillManuList(TObjArray& manuList) const;
-
- virtual Bool_t IsIncluded() const;
+ using AliMUONVPainter::PaintArea;
+
+ void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
+ Double_t min, Double_t max);
+
+ virtual AliMUONAttPainter Validate(const AliMUONAttPainter& attributes) const;
+
+ virtual void FillManuList(TObjArray& manuList) const;
+
+ virtual Bool_t IsIncluded() const;
private:
Int_t fDetElemId; ///< our detection element id
#include "AliCDBManager.h"
#include "AliCodeTimer.h"
#include "AliLog.h"
+#include "AliMUONPainterDataRegistry.h"
#include "AliMUONPainterDataSourceFrame.h"
#include "AliMUONPainterEnv.h"
#include "AliMUONPainterHelper.h"
AliMUONVTrackerDataMaker* maker = dynamic_cast<AliMUONVTrackerDataMaker*>(object);
if ( maker )
{
- AliMUONPainterRegistry::Instance()->Register(maker);
+ AliMUONPainterDataRegistry::Instance()->Register(maker);
}
}
if ( data )
{
AliMUONVTrackerDataMaker* maker = new AliMUONTrackerDataWrapper(data);
- AliMUONPainterRegistry::Instance()->Register(maker);
+ AliMUONPainterDataRegistry::Instance()->Register(maker);
}
}
}
TGTextView* rn = new TGTextView(t);
+ rn->AddLine("0.96a");
+ rn->AddLine("");
+ rn->AddLine("Internal reorganization of the contour computations, that lead to improved performance. ");
+ rn->AddLine("Improved enough to be able to remove completely the usage of the padstore.root file with precomputed contours.");
+ rn->AddLine("");
+
rn->AddLine("0.96");
rn->AddLine("");
rn->AddLine("New features");
{
/// Save VTrackerDataMaker objects into file of given name
- AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+ AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
TFile f(filename,"RECREATE");
#include "AliMUONPCBPainter.h"
#include "AliMUONManuPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
#include "AliMUONPainterHelper.h"
#include "AliMUONVCalibParam.h"
#include "AliMUONVTrackerData.h"
fDetElemId(detElemId),
fPCBIndex(pcbNumber)
{
- /// Ctor
-
- SetAttributes(att);
-
- AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
-
- AliMp::PlaneType planeType = ( att.IsBendingPlane() ? AliMp::kBendingPlane : AliMp::kNonBendingPlane );
-
- const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(fDetElemId,planeType);
-
- SetID(detElemId,pcbNumber);
- SetName(h->PCBName(pcbNumber));
- SetPathName(h->PCBPathName(detElemId,pcbNumber));
-
- AliMpPCB* pcb = slat->GetPCB(fPCBIndex);
-
- AliMUONPainterContour* contour = h->GetContour(ContourName());
- TObjArray contourArray;
-
- for ( Int_t imp = 0 ; imp < pcb->GetSize(); ++imp )
- {
- AliMpMotifPosition* mp = pcb->GetMotifPosition(imp);
- AliDebug(1,Form("Adding manu %d to PCB %d of DE %d",
- mp->GetID(),fPCBIndex,fDetElemId));
- AliMUONVPainter* painter = new AliMUONManuPainter(Attributes(),fDetElemId,mp->GetID());
- Add(painter);
- if (!contour)
- {
- contourArray.Add(painter->Contour());
- }
- }
-
- Double_t x,y,z;
- h->Local2Global(fDetElemId,
- pcb->X()-slat->GetPositionX(),
- pcb->Y()-slat->GetPositionY(),
- 0.0,
- x,y,z);
-
+ /// Ctor
+
+ SetAttributes(att);
+
+ AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
+
+ AliMp::PlaneType planeType = ( att.IsBendingPlane() ? AliMp::kBendingPlane : AliMp::kNonBendingPlane );
+
+ const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(fDetElemId,planeType);
+
+ SetID(detElemId,pcbNumber);
+ SetName(h->PCBName(pcbNumber));
+ SetPathName(h->PCBPathName(detElemId,pcbNumber));
+
+ AliMpPCB* pcb = slat->GetPCB(fPCBIndex);
+
+ AliMUONContour* contour = h->GetContour(ContourName());
+ TObjArray contourArray;
+
+ for ( Int_t imp = 0 ; imp < pcb->GetSize(); ++imp )
+ {
+ AliMpMotifPosition* mp = pcb->GetMotifPosition(imp);
+ AliDebug(1,Form("Adding manu %d to PCB %d of DE %d",
+ mp->GetID(),fPCBIndex,fDetElemId));
+ AliMUONVPainter* painter = new AliMUONManuPainter(Attributes(),fDetElemId,mp->GetID());
+ Add(painter);
if (!contour)
{
- contour = h->MergeContours(contourArray,ContourName());
+ contourArray.Add(painter->Contour());
}
-
- SetContour(contour);
+ }
+
+ Double_t x,y,z;
+
+ h->Local2Global(fDetElemId,
+ pcb->X()-slat->GetPositionX(),
+ pcb->Y()-slat->GetPositionY(),
+ 0.0,
+ x,y,z);
+
+ if (!contour)
+ {
+ contour = h->MergeContours(contourArray,ContourName());
+ }
+
+ SetContour(contour);
}
//_____________________________________________________________________________
Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
- Contour()->PaintArea(color);
+ PaintArea(color);
}
TString Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
Double_t, Double_t);
+ using AliMUONVPainter::PaintArea;
+
void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
Double_t min, Double_t max);
#include "AliMUONPainterDataSourceItem.h"
#include "AliMUONPainterEnv.h"
#include "AliMUONPainterHelper.h"
-#include "AliMUONPainterRegistry.h"
+#include "AliMUONPainterDataRegistry.h"
#include "AliMUONRecoParam.h"
#include "AliMUONTrackerACFDataMaker.h"
#include "AliMUONTrackerDataMaker.h"
{
/// Ctor
- AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+ AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
reg->Connect("DataMakerWasRegistered(AliMUONVTrackerDataMaker*)",
"AliMUONPainterDataSourceFrame",
if ( reader->IsValid() )
{
- AliMUONPainterRegistry::Instance()->Register(reader);
+ AliMUONPainterDataRegistry::Instance()->Register(reader);
AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
if ( reader->IsValid() )
{
- AliMUONPainterRegistry::Instance()->Register(reader);
+ AliMUONPainterDataRegistry::Instance()->Register(reader);
AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
reader->SetSource(filename.Data());
- AliMUONPainterRegistry::Instance()->Register(reader);
+ AliMUONPainterDataRegistry::Instance()->Register(reader);
AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
#include "AliMUONPainterEnv.h"
#include "AliMUONPainterHelper.h"
-#include "AliMUONPainterRegistry.h"
+#include "AliMUONPainterDataRegistry.h"
#include "AliMUONVTrackerDataMaker.h"
#include "AliMUONVTrackerData.h"
#include "AliLog.h"
ok = reader->NextEvent();
if ( reader->IsZombie() )
{
- AliMUONPainterRegistry::Instance()->DeleteZombies();
+ AliMUONPainterDataRegistry::Instance()->DeleteZombies();
return 0x0;
}
if ( !reader->IsRunning() ) gSystem->Sleep(1000);
/// Remove
MakeZombie();
- AliMUONPainterRegistry::Instance()->Unregister(fDataMaker);
+ AliMUONPainterDataRegistry::Instance()->Unregister(fDataMaker);
}
//_____________________________________________________________________________
#include <cstdlib>
#include "AliMUONPainterHelper.h"
+#include "AliCodeTimer.h"
+#include "AliLog.h"
+#include "AliMUONContour.h"
+#include "AliMUONContourMaker.h"
#include "AliMUONGeometryDetElement.h"
#include "AliMUONGeometryTransformer.h"
-#include "AliMUONPainterContour.h"
-#include "AliMUONPainterContourMaker.h"
+#include "AliMUONManuContourMaker.h"
#include "AliMUONPainterEnv.h"
#include "AliMUONPainterMatrix.h"
-#include "AliMUONPainterPadStore.h"
#include "AliMUONPainterRegistry.h"
#include "AliMUONVCalibParam.h"
#include "AliMUONVDigit.h"
#include "AliMpSlat.h"
#include "AliMpStationType.h"
#include "AliMpVPadIterator.h"
-#include "AliCodeTimer.h"
-#include "AliLog.h"
#include <Riostream.h>
#include <TArrayI.h>
#include <TCanvas.h>
#include <TCollection.h>
#include <TFile.h>
#include <TGLabel.h>
-#include <TGeoMatrix.h>
#include <TGMsgBox.h>
+#include <TGeoMatrix.h>
#include <TLine.h>
#include <TList.h>
#include <TMap.h>
#include <TVirtualPad.h>
#include <TVirtualX.h>
+#include "AliMUONChamberPainter.h"
+
///\class AliMUONPainterHelper
///
/// Helper class for painters
//_____________________________________________________________________________
AliMUONPainterHelper::AliMUONPainterHelper() :
- TObject(),
- fPadStore(0x0),
- fExplodedGlobalTransformations(0x0),
- fRealGlobalTransformations(0x0),
- fIsModified(kFALSE),
- fContourMaker(0x0),
- fPainterMatrices(0x0),
- fEnv(0x0)
+TObject(),
+fExplodedGlobalTransformations(0x0),
+fRealGlobalTransformations(0x0),
+fPainterMatrices(0x0),
+fEnv(0x0),
+fAllContours(20000,1)
{
/// ctor
+
+ fAllContours.SetOwnerKeyValue(kTRUE,kTRUE);
+
fExplodeFactor[0] = 1.00;
fExplodeFactor[1] = 1.50;
AliMUONPainterHelper::~AliMUONPainterHelper()
{
/// dtor
- if ( fIsModified ) Save();
delete fExplodedGlobalTransformations;
delete fRealGlobalTransformations;
- delete fPadStore;
- delete fContourMaker;
delete fPainterMatrices;
+ fEnv->Save();
fgInstance = 0;
}
//_____________________________________________________________________________
-AliMUONPainterContour*
+AliMUONContour*
AliMUONPainterHelper::GetContour(const char* contourName) const
{
- /// Get a contour by name
-
- AliCodeTimerAuto("")
-
- if ( fContourMaker )
- {
- return fContourMaker->GetContour(contourName);
- }
- return 0x0;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONPainterHelper::FindPadID(const TArrayI& pads, Double_t x, Double_t y) const
-{
- /// Find a pad by position
-
- return fPadStore->FindPadID(pads,x,y);
+ /// Get a contour by name
+ return static_cast<AliMUONContour*>(fAllContours.GetValue(contourName));
}
//_____________________________________________________________________________
{
/// Kind of bootstrap method to trigger the generation of all contours
+ AliCodeTimerAuto("");
+
fPainterMatrices = new TObjArray;
fPainterMatrices->SetOwner(kFALSE);
att.SetViewPoint(kTRUE,kFALSE);
att.SetPlane(kFALSE,kFALSE);
att.SetCathode(kTRUE,kFALSE);
-
- AliWarningClass("Should generate back views as well here");
-
- attributes.Add(new AliMUONAttPainter(att));
- att.SetCathode(kFALSE,kTRUE);
- attributes.Add(new AliMUONAttPainter(att));
+
att.SetCathode(kFALSE,kFALSE);
att.SetPlane(kTRUE,kFALSE);
attributes.Add(new AliMUONAttPainter(att));
- att.SetPlane(kFALSE,kTRUE);
- attributes.Add(new AliMUONAttPainter(att));
+
+// commented the lines below, as it's now fast enough to be created on the fly,
+// only when requested by the user
+//
+// attributes.Add(new AliMUONAttPainter(att));
+// att.SetCathode(kFALSE,kTRUE);
+// attributes.Add(new AliMUONAttPainter(att));
+// att.SetPlane(kFALSE,kTRUE);
+// attributes.Add(new AliMUONAttPainter(att));
TIter next(&attributes);
AliMUONAttPainter* a;
for ( Int_t i = 0; i < 10; ++i )
{
- AliMUONVPainter* painter = AliMUONVPainter::CreatePainter("AliMUONChamberPainter",*a,i,-1);
+ AliMUONVPainter* painter = new AliMUONChamberPainter(*a,i);
painter->SetResponder("Chamber");
/// having overlapping detection elements as in the reality, which
/// would be inconvenient for a display ;-)
- AliDebug(1,Form(" with explodeFactor=%e,%e",fExplodeFactor[0],fExplodeFactor[1]));
+ AliCodeTimerAuto("");
AliMUONGeometryTransformer transformer;
transformer.LoadGeometryData("transform.dat");
-// transformer.LoadGeometryData("geometry.root"); //FIXME: add a protection if geometry.root file does not exist
fExplodedGlobalTransformations = new AliMpExMap;
fRealGlobalTransformations = new AliMpExMap;
AliMpDEIterator deIt;
}
//_____________________________________________________________________________
-AliMUONPainterContour*
+AliMUONContour*
AliMUONPainterHelper::GenerateManuContour(Int_t detElemId,
Int_t manuId,
AliMUONAttPainter viewType,
{
/// Generate the contour of the list of pads
- if (!fContourMaker) fContourMaker = new AliMUONPainterContourMaker(fExplodedGlobalTransformations);
-
- AliMUONPainterContour* contour =
- fContourMaker->GenerateManuContour(contourName,detElemId,manuId,viewType);
+ static AliMUONManuContourMaker maker(fExplodedGlobalTransformations);
- if (contour)
+ if ( viewType.IsBackView() )
{
- RegisterContour(contour);
+ AliError("Backview not implemented yet (and will probably never be, after all...)");
+ return 0x0;
}
- return contour;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterHelper::GeneratePadStore()
-{
- /// Generate the pad store
+ AliMUONContour* contour = maker.CreateManuContour(detElemId,manuId,contourName);
- AliCodeTimerAuto("")
- AliDebugClass(1,"Generating pad store");
- fPadStore = new AliMUONPainterPadStore();
+ if ( !contour ) return 0x0;
- AliMpDEIterator deIt;
+ AliMUONContour* pContour = new AliMUONContour(*contour);
- deIt.First();
- while ( !deIt.IsDone() )
+ if (pContour)
{
- Int_t detElemId = deIt.CurrentDEId();
- if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
- {
- GeneratePadStore(detElemId);
- }
- deIt.Next();
- }
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterHelper::GeneratePadStore(Int_t detElemId)
-{
- /// Generate part of the padstore for one detection element
-
- AliMp::CathodType cathode[] = { AliMp::kCath0, AliMp::kCath1 };
-
- for ( Int_t i = 0; i < 2; ++i )
- {
- const AliMpVSegmentation* seg =
- AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathode[i]);
- AliMpVPadIterator* it = seg->CreateIterator();
- it->First();
-
- while ( !it->IsDone() )
- {
- AliMpPad pad = it->CurrentItem();
-
- Double_t x,y,z;
- Local2Global(detElemId,pad.GetPositionX(),pad.GetPositionY(),0,
- x,y,z);
- Int_t manuId = pad.GetManuId();
- Int_t manuChannel = pad.GetManuChannel();
- AliMUONVCalibParam* param = fPadStore->Get(detElemId,manuId);
- param->SetValueAsDouble(manuChannel,0,x);
- param->SetValueAsDouble(manuChannel,1,y);
- param->SetValueAsDouble(manuChannel,2,pad.GetDimensionX());
- param->SetValueAsDouble(manuChannel,3,pad.GetDimensionY());
- it->Next();
- }
- delete it;
+ RegisterContour(pContour);
}
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterHelper::GetBoundaries(const TArrayI& pads, Double_t& xmin, Double_t& ymin,
- Double_t& xmax, Double_t& ymax) const
-{
- /// Get the area covered by an array of pads
- return fPadStore->GetBoundaries(pads,xmin,ymin,xmax,ymax);
+ return pContour;
}
//_____________________________________________________________________________
return AliMpDEManager::GetCathod(detElemId,planeType);
}
-//_____________________________________________________________________________
-AliMUONPainterContour*
-AliMUONPainterHelper::GetLocalManuContour(Int_t detElemId, Int_t manuId) const
-{
- /// Retrieve a manu contour (in local coordinates)
- return fContourMaker->FindLocalManuContour(detElemId,manuId);
-}
//_____________________________________________________________________________
AliMpMotifPosition*
/// Return the global and unique instance of this class
if (fgInstance) return fgInstance;
-
- AliMUONPainterEnv env;
-
- TString fileName(gSystem->ExpandPathName(env.String("PadStoreFileName","$HOME/padstore.root")));
- if ( gSystem->AccessPathName(fileName.Data(),kFileExists) ) // mind the strange return value of that method...
- {
- // file does NOT exist yet. Create it
- AliDebugClass(1,"Generating instance");
-
- Int_t ret;
-
- new TGMsgBox(gClient->GetRoot(),gClient->GetRoot(),"",
- Form("File %s not found.\nI will generate it, and this will take a while.\n"
- "Click OK (and grab a cup of coffee ;-) ) to proceed,\n or Cancel to quit.",fileName.Data()),
- kMBIconQuestion,
- kMBOk | kMBCancel,
- &ret);
- if ( ret == kMBCancel ) exit(1);
-
- fgInstance = new AliMUONPainterHelper;
- fgInstance->GenerateGeometry();
- fgInstance->GeneratePadStore();
- fgInstance->GenerateDefaultMatrices();
- fgInstance->Modified(kTRUE);
- fgInstance->fEnv = new AliMUONPainterEnv;
- fgInstance->fEnv->Set("PadStoreFileName",fileName.Data());
- fgInstance->Save();
-
- }
- else
- {
- AliDebugClass(1,"Reading instance");
- TFile f(fileName.Data());
- fgInstance = static_cast<AliMUONPainterHelper*>(f.Get("AliMUONPainterHelper"));
-
- TIter next(fgInstance->fPainterMatrices);
- AliMUONPainterMatrix* matrix;
- while ( ( matrix = static_cast<AliMUONPainterMatrix*>(next()) ) )
- {
- AliMUONPainterRegistry::Instance()->Register(matrix);
- }
- fgInstance->fPainterMatrices->SetOwner(kFALSE);
- fgInstance->fEnv = new AliMUONPainterEnv;
- }
+ AliCodeTimerAutoClass("");
+
+ fgInstance = new AliMUONPainterHelper;
+ fgInstance->GenerateGeometry();
+ fgInstance->GenerateDefaultMatrices();
+ fgInstance->fEnv = new AliMUONPainterEnv;
return fgInstance;
}
}
//_____________________________________________________________________________
-AliMUONPainterContour*
+AliMUONContour*
AliMUONPainterHelper::MergeContours(const TObjArray& contours,
const char* contourName)
{
/// Merge a set of contours (delegating to the contour maker)
- if (!fContourMaker)
- {
- fContourMaker = new AliMUONPainterContourMaker(fExplodedGlobalTransformations);
- }
- AliMUONPainterContour* contour = fContourMaker->MergeContours(contours,
- contourName);
+ AliMUONContourMaker maker;
+
+ AliMUONContour* contour = maker.MergeContour(contours,contourName);
if (contour)
{
if ( sopt.Length() == 0 )
{
cout << Form("ExplodeFactor=%e,%e",fExplodeFactor[0],fExplodeFactor[1]) << endl;
- cout << Form("PadStore=%x",fPadStore);
- if ( fPadStore ) cout << Form(" with %d pads",fPadStore->GetSize());
cout << endl;
cout << Form("GlobalTransformations=%x",fExplodedGlobalTransformations);
if ( fExplodedGlobalTransformations ) cout << Form(" with %d transformations",fExplodedGlobalTransformations->GetSize());
cout << endl;
- if ( fContourMaker )
- {
- cout << Form(" with %d contours",fContourMaker->Size());
- }
- else
- {
- cout << "No contour";
- }
+ cout << Form("Contour map : collisions = %5.3f size = %d capacity = %d",
+ fAllContours.AverageCollisions(),
+ fAllContours.GetSize(),
+ fAllContours.Capacity()) << endl;
cout << endl;
- cout << "Modified=";
- if ( IsModified() )
- {
- cout << "YES";
- }
- else
- {
- cout << "NO";
- }
- cout << endl;
- }
-
- if ( sopt.Contains("CONTOUR") || sopt.Contains("FULL") )
- {
- fContourMaker->Print(opt);
}
if ( sopt.Contains("MATRI") || sopt.Contains("FULL") )
//_____________________________________________________________________________
void
-AliMUONPainterHelper::RegisterContour(AliMUONPainterContour* contour)
+AliMUONPainterHelper::RegisterContour(AliMUONContour* contour)
{
/// contour is adopted by contourMaker
AliCodeTimerAuto("")
AliDebug(1,contour->GetName());
- if ( fContourMaker->HasContour(contour->GetName()) )
+ if ( fAllContours.GetValue(contour->GetName()) )
{
AliError(Form("Contour with name %s is already there",contour->GetName()));
// Print("CONTOUR");
return;
}
- fContourMaker->Add(contour);
- Modified(kTRUE);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterHelper::Save()
-{
- /// Save to disk
-
- if (!IsModified()) return;
-
- Modified(kFALSE);
-
- AliInfo("");
-
- fgInstance->Print();
-
- fgInstance->Env()->Save();
-
- TString fileName(gSystem->ExpandPathName(fgInstance->Env()->String("PadStoreFileName")));
-
- AliInfo(Form("Saving to %s",fileName.Data()));
-
- TFile f(fileName,"RECREATE");
-
- fgInstance->Write("");
-
- f.Close();
+ fAllContours.Add(new TObjString(contour->GetName()),contour);
}
//_____________________________________________________________________________
return Form("%s = %e",name,value);
}
+
# include "AliMpPad.h"
#endif
+#ifndef ROOT_TMap
+# include "TMap.h"
+#endif
+
class AliMUONAttPainter;
-class AliMUONPainterContour;
-class AliMUONPainterContourMaker;
+class AliMUONContour;
class AliMUONPainterEnv;
-class AliMUONPainterPadStore;
class AliMUONVCalibParam;
class AliMUONVTrackerData;
class AliMpExMap;
Int_t ColorFromValue(Double_t value, Double_t min, Double_t max) const;
- Int_t FindPadID(const TArrayI& pads, Double_t x, Double_t y) const;
-
AliMp::CathodType GetCathodeType(Int_t detElemId, Int_t manuId) const;
- AliMUONPainterContour* GenerateManuContour(Int_t detElemId, Int_t manuId,
+ AliMUONContour* GenerateManuContour(Int_t detElemId, Int_t manuId,
AliMUONAttPainter viewType,
const char* contourName);
- void GetBoundaries(const TArrayI& pads, Double_t& xmin, Double_t& ymin,
- Double_t& xmax, Double_t& ymax) const;
-
- AliMUONPainterContour* GetContour(const char* contourName) const;
+ AliMUONContour* GetContour(const char* contourName) const;
/// Return a contour by name
- AliMUONPainterContour* GetContour(const TString& contourName) const { return GetContour(contourName.Data()); }
-
- AliMUONPainterContour* GetLocalManuContour(Int_t detElemId, Int_t manuId) const;
+ AliMUONContour* GetContour(const TString& contourName) const { return GetContour(contourName.Data()); }
AliMpMotifPosition* GetMotifPosition(Int_t detElemId, Int_t manuId) const;
void Global2LocalReal(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
Double_t& xl, Double_t& yl, Double_t& zl) const;
- AliMUONPainterContour* MergeContours(const TObjArray& contours,
+ AliMUONContour* MergeContours(const TObjArray& contours,
const char* contourName);
virtual void Print(Option_t* opt="") const;
- void RegisterContour(AliMUONPainterContour* contour);
-
- /// Whether we were modified since our creation
- Bool_t IsModified() const { return fIsModified; }
-
- /// Set the modified flag
- void Modified(Bool_t value=kTRUE) { fIsModified = value; }
-
- void Save();
-
- /// Return the pad store
- const AliMUONPainterPadStore& PadStore() const { return *fPadStore; }
+ void RegisterContour(AliMUONContour* contour);
TString FormatValue(const char* name, Double_t value) const;
void GenerateDefaultMatrices();
void GenerateGeometry();
- void GeneratePadStore();
- void GeneratePadStore(Int_t detElemId);
private:
static AliMUONPainterHelper* fgInstance; ///< global instance
- AliMUONPainterPadStore* fPadStore; ///< the pad store
Double_t fExplodeFactor[2]; ///< explosing factors for representation
AliMpExMap* fExplodedGlobalTransformations; ///< global geometric transformations (exploded)
AliMpExMap* fRealGlobalTransformations; ///< global geometric transformations (real)
- Bool_t fIsModified; ///< whether we've been modified since creation
- mutable AliMUONPainterContourMaker* fContourMaker; ///< the contour builder
TObjArray* fPainterMatrices; ///< default matrices
AliMUONPainterEnv* fEnv; ///< resources
+ TMap fAllContours; ///< all contours
- ClassDef(AliMUONPainterHelper,1) // Helper class for painters
+ ClassDef(AliMUONPainterHelper,2) // Helper class for painters
};
#endif
#include "AliMUONPainterHighlighter.h"
#include "AliMUONVPainter.h"
-#include "AliMUONPainterContour.h"
#include "AliLog.h"
/// \class AliMUONPainterHighlighter
#include "AliMUONPainterGroup.h"
#include "AliMUONPainterInterfaceHelper.h"
#include "AliMUONPainterMatrix.h"
-#include "AliMUONPainterRegistry.h"
+#include "AliMUONPainterDataRegistry.h"
#include "AliMUONVPainter.h"
#include "AliMUONVTrackerData.h"
#include "AliLog.h"
fDataSourceNames = new TGButtonGroup(this,"Sources");
- AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+ AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
reg->Connect("DataSourceWasRegistered(AliMUONVTrackerData*)",
"AliMUONPainterPlotSelector",
AliDebug(1,Form("Creating dimension buttons for dataSource %s",dataSourceName));
- AliMUONVTrackerData* data = AliMUONPainterRegistry::Instance()->DataSource(dataSourceName);
+ AliMUONVTrackerData* data = AliMUONPainterDataRegistry::Instance()->DataSource(dataSourceName);
TGButtonGroup* bg = new TGButtonGroup(this,0,3,5,0,dataSourceName);
#include "AliMUON2DMap.h"
#include "AliMUONCalibParamND.h"
#include "AliMUONPainterMatrix.h"
-#include "AliMUONTrackerData.h"
-#include "AliMUONVTrackerDataMaker.h"
#include "AliLog.h"
#include <TGMenu.h>
#include <TGWindow.h>
//_____________________________________________________________________________
AliMUONPainterRegistry::AliMUONPainterRegistry() : TObject(), TQObject(),
fPainterMatrices(new TObjArray),
-fDataMakers(new TObjArray),
fHistoryMenu(0x0),
fMenuBar(0x0),
-fHistoryCounter(0),
-fZombies(new TObjArray),
-fInteractiveReadOutConfig(0x0)
+fHistoryCounter(0)
{
/// ctor
fPainterMatrices->SetOwner(kTRUE);
- fDataMakers->SetOwner(kTRUE);
- fZombies->SetOwner(kTRUE);
}
//_____________________________________________________________________________
{
/// dtor
delete fPainterMatrices;
- delete fDataMakers;
- delete fInteractiveReadOutConfig;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::CreateInteractiveReadOutConfig() const
-{
- /// Create configuration of readout
- fInteractiveReadOutConfig = new AliMUONTrackerData("IROC","IROC",1);
- fInteractiveReadOutConfig->SetDimensionName(0,"Switch");
- /// FIXME: should use a version of TrackerData w/ no storage for channels
- /// (i.e. starting at the manu level, or even bus patch level ?)
- AliMpManuIterator it;
- Int_t detElemId;
- Int_t manuId;
- AliMUON2DMap store(true);
-
- while ( it.Next(detElemId,manuId) )
- {
- AliMUONVCalibParam* param = new AliMUONCalibParamND(1,64,detElemId,manuId,1);
- store.Add(param);
- }
- fInteractiveReadOutConfig->Add(store);
-}
-
-//_____________________________________________________________________________
-AliMUONVTrackerDataMaker*
-AliMUONPainterRegistry::DataMaker(Int_t i) const
-{
- /// Get one data source
- if ( i >= 0 && i <= fDataMakers->GetLast() )
- {
- return static_cast<AliMUONVTrackerDataMaker*>(fDataMakers->At(i));
- }
- else
- {
- AliError(Form("Index out of bounds : %d / %d",i,fDataMakers->GetLast()+1));
- return 0x0;
- }
-}
-
-//_____________________________________________________________________________
-AliMUONVTrackerData*
-AliMUONPainterRegistry::DataSource(Int_t i) const
-{
- /// Get one data source
-
- AliMUONVTrackerDataMaker* maker = DataMaker(i);
- if ( maker ) return maker->Data();
- return 0x0;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::DataMakerWasRegistered(const AliMUONVTrackerDataMaker* data)
-{
- /// A new reader source was registered
- Long_t param[] = { (Long_t)data };
-
- Emit("DataMakerWasRegistered(AliMUONVTrackerDataMaker*)",param);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::DataMakerWasUnregistered(const AliMUONVTrackerDataMaker* data)
-{
- /// A data reader was unregistered
- Long_t param[] = { (Long_t)data };
-
- Emit("DataMakerWasUnregistered(AliMUONVTrackerDataMaker*)",param);
-
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::DataSourceWasRegistered(const AliMUONVTrackerData* data)
-{
- /// A new data source was registered
- Long_t param[] = { (Long_t)data };
-
- Emit("DataSourceWasRegistered(AliMUONVTrackerData*)",param);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::DataSourceWasUnregistered(const AliMUONVTrackerData* data)
-{
- /// A data source was unregistered
- Long_t param[] = { (Long_t)data };
-
- Emit("DataSourceWasUnregistered(AliMUONVTrackerData*)",param);
-
-}
-
-//_____________________________________________________________________________
-AliMUONVTrackerData*
-AliMUONPainterRegistry::DataSource(const char* name) const
-{
- /// Find a data source by name
- for ( Int_t i = 0; i < NumberOfDataMakers(); ++i )
- {
- AliMUONVTrackerData* data = DataMaker(i)->Data();
- if ( data )
- {
- TString dname(data->GetName());
- if ( dname == name ) return data;
- }
- }
- return 0x0;
}
//_____________________________________________________________________________
return fgInstance;
}
-//_____________________________________________________________________________
-AliMUONVTrackerData*
-AliMUONPainterRegistry::InteractiveReadOutConfig() const
-{
- /// Return an object that contains the parts of the detector selected
- /// (using the mouse) to be part of the readout.
-
- if (!fInteractiveReadOutConfig) CreateInteractiveReadOutConfig();
- return fInteractiveReadOutConfig;
-}
-
//_____________________________________________________________________________
AliMUONPainterMatrix*
AliMUONPainterRegistry::PainterMatrix(Int_t i) const
//_____________________________________________________________________________
void
-AliMUONPainterRegistry::PainterMatrixWantToShow(const AliMUONPainterMatrix* group)
+AliMUONPainterRegistry::PainterMatrixWantToShow(AliMUONPainterMatrix* group)
{
/// A given paintermatrix want to appear on screen
Long_t param[] = { (Long_t)group };
//_____________________________________________________________________________
void
-AliMUONPainterRegistry::PainterMatrixWasRegistered(const AliMUONPainterMatrix* group)
+AliMUONPainterRegistry::PainterMatrixWasRegistered(AliMUONPainterMatrix* group)
{
/// A new painter matrix was registered
Long_t param[] = { (Long_t)group };
//_____________________________________________________________________________
void
-AliMUONPainterRegistry::PainterMatrixWasUnregistered(const AliMUONPainterMatrix* group)
+AliMUONPainterRegistry::PainterMatrixWasUnregistered(AliMUONPainterMatrix* group)
{
/// A painter matrix was unregistered
Long_t param[] = { (Long_t)group };
TString sopt(opt);
sopt.ToUpper();
- cout << "Number of data readers = " << NumberOfDataMakers() << endl;
cout << "Number of painter matrices = " << NumberOfPainterMatrices() << endl;
- if ( sopt.Contains("FULL") || sopt.Contains("READER") )
- {
- TIter next(fDataMakers);
- AliMUONVTrackerDataMaker* reader;
-
- while ( ( reader = static_cast<AliMUONVTrackerDataMaker*>(next()) ) )
- {
- reader->Print();
- }
- }
-
- if ( sopt.Contains("FULL") || sopt.Contains("DATA") )
- {
- TIter next(fDataMakers);
- AliMUONVTrackerDataMaker* reader;
-
- while ( ( reader = static_cast<AliMUONVTrackerDataMaker*>(next()) ) )
- {
- AliMUONVTrackerData* data = reader->Data();
- if ( data ) data->Print();
- }
- }
-
if ( sopt.Contains("FULL") || sopt.Contains("MATRIX") )
{
TIter next(fPainterMatrices);
return fPainterMatrices->IndexOf(group);
}
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::Register(AliMUONVTrackerDataMaker* reader)
-{
- /// reader is adopted, i.e. the registry becomes the owner of it.
- fDataMakers->AddLast(reader);
- DataMakerWasRegistered(reader);
- if ( reader->Data() ) DataSourceWasRegistered(reader->Data());
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONPainterRegistry::NumberOfDataMakers() const
-{
- /// The number of data readers we handle
- return fDataMakers->GetLast()+1;
-}
-
//_____________________________________________________________________________
Int_t
AliMUONPainterRegistry::NumberOfPainterMatrices() const
return fPainterMatrices->GetLast()+1;
}
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::DeleteZombies()
-{
- /// Delete zombies
- fZombies->Delete();
-}
-
-//_____________________________________________________________________________
-Bool_t
-AliMUONPainterRegistry::Unregister(AliMUONVTrackerDataMaker* reader)
-{
- /// Unregister some reader
-
- if (!reader) return kFALSE;
-
- if ( reader->Data() )
- {
- DataSourceWasUnregistered(reader->Data());
- reader->Data()->Destroyed(); // we pretend it's deleted now, even
- // if it will be only later on when zombie are killed, so that
- // for instance painters depending on it will no longer try to access it
- }
-
- DataMakerWasUnregistered(reader);
-
- TObject* o = fDataMakers->Remove(reader);
-
- fZombies->Add(o); // for later deletion
-
-// if ( o )
-// {
-// delete o;
-// }
-// else
-// {
-// AliError(Form("Could not unregister data named %s title %s",reader->GetName(),
-// reader->GetTitle()));
-// }
- return ( o != 0x0 );
-}
-
//_____________________________________________________________________________
Bool_t
AliMUONPainterRegistry::Unregister(AliMUONPainterMatrix* group)
class TGPopupMenu;
class TObjArray;
-class AliMUONVTrackerData;
-class AliMUONVTrackerDataMaker;
class AliMUONPainterMatrix;
class TGMenuBar;
public:
virtual ~AliMUONPainterRegistry();
- AliMUONVTrackerDataMaker* DataMaker(Int_t i) const;
-
- AliMUONVTrackerData* DataSource(Int_t i) const;
-
- AliMUONVTrackerData* DataSource(const char* name) const;
-
- AliMUONVTrackerData* InteractiveReadOutConfig() const;
-
- void DataSourceWasRegistered(const AliMUONVTrackerData* data); // *SIGNAL*
-
- void DataSourceWasUnregistered(const AliMUONVTrackerData* data); // *SIGNAL*
-
- void DataMakerWasRegistered(const AliMUONVTrackerDataMaker* reader); // *SIGNAL*
-
- void DataMakerWasUnregistered(const AliMUONVTrackerDataMaker* reader); // *SIGNAL*
-
Int_t FindIndexOf(AliMUONPainterMatrix* group) const;
void HistoryMenuActivated(Int_t i);
static AliMUONPainterRegistry* Instance();
- Int_t NumberOfDataMakers() const;
-
- /// Number of data sources = data makers
- Int_t NumberOfDataSources() const { return NumberOfDataMakers(); }
-
Int_t NumberOfPainterMatrices() const;
AliMUONPainterMatrix* PainterMatrix(Int_t i) const;
void AddToHistory(AliMUONPainterMatrix* group);
- void PainterMatrixWasRegistered(const AliMUONPainterMatrix* group); // *SIGNAL*
+ void PainterMatrixWasRegistered(AliMUONPainterMatrix* group); // *SIGNAL*
- void PainterMatrixWasUnregistered(const AliMUONPainterMatrix* group); // *SIGNAL*
+ void PainterMatrixWasUnregistered(AliMUONPainterMatrix* group); // *SIGNAL*
- void PainterMatrixWantToShow(const AliMUONPainterMatrix* group); // *SIGNAL*
+ void PainterMatrixWantToShow(AliMUONPainterMatrix* group); // *SIGNAL*
void Print(Option_t* opt) const;
Int_t Register(AliMUONPainterMatrix* group);
- void Register(AliMUONVTrackerDataMaker* reader);
-
/// Set the menu bar where to put the history menu
void SetMenuBar(TGMenuBar* bar) { fMenuBar = bar; }
Bool_t Unregister(AliMUONPainterMatrix* group);
- Bool_t Unregister(AliMUONVTrackerDataMaker* reader);
-
- void DeleteZombies();
-
private:
/// Not implemented
AliMUONPainterRegistry();
/// Not implemented
AliMUONPainterRegistry& operator=(const AliMUONPainterRegistry&);
- void CreateInteractiveReadOutConfig() const;
-
private:
static AliMUONPainterRegistry* fgInstance; ///< unique instance
TObjArray* fPainterMatrices; ///< painter matrices
- TObjArray* fDataMakers; ///< data makers
TGPopupMenu* fHistoryMenu; ///< history menu
TGMenuBar* fMenuBar; ///< Menu bar where to put the history menu
Int_t fHistoryCounter; ///< index to get back history menu items
- TObjArray* fZombies; ///< data readers to be deleted
- mutable AliMUONVTrackerData* fInteractiveReadOutConfig; ///< clickable readout configuration
- ClassDef(AliMUONPainterRegistry,4) // Registry for AliMUONVPainter related stuff
+ ClassDef(AliMUONPainterRegistry,5) // Registry for AliMUONVPainter related stuff
};
#endif
class AliRawReader;
-
class AliMUONRawStream: public TObject {
public :
AliMUONRawStream();
{
fkCurrentData = fkCurrentBusPatch->GetData();
fkEndOfData = fkCurrentData + fkCurrentBusPatch->GetDataCount();
+ if ( skipParityErrors )
+ {
+ Bool_t ok(kTRUE);
+ for ( Int_t i = 0; i < fkCurrentBusPatch->GetLength() && ok; ++ i )
+ {
+ ok = fkCurrentBusPatch->IsParityOk(i);
+ }
+ if (!ok) fkCurrentData = fkEndOfData;
+ }
goto retry;
}
}
///
#include "AliLog.h"
-#include "AliMpConstants.h"
#include "AliMUON2DMap.h"
#include "AliMUONCalibParamND.h"
-#include "AliMUONPainterRegistry.h"
+#include "AliMUONPainterDataRegistry.h"
#include "AliMUONTrackerData.h"
#include "AliMUONTrackerDataWrapper.h"
#include "AliMUONVTrackerData.h"
+#include "AliMpConstants.h"
#include "AliMpDDLStore.h"
#include "AliMpDetElement.h"
#include "AliMpManuIterator.h"
SetCleanup(kDeepCleanup);
- AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+ AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
for ( Int_t i = 0; i < reg->NumberOfDataSources(); ++i )
{
{
/// Compare two data sources
- AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+ AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
AliMUONVTrackerData* d1 = reg->DataSource(d1name);
if (!d1)
AliMUONVTrackerDataMaker* dw = new AliMUONTrackerDataWrapper(d);
- AliMUONPainterRegistry::Instance()->Register(dw);
+ AliMUONPainterDataRegistry::Instance()->Register(dw);
}
//______________________________________________________________________________
#include "AliMUONVPainter.h"
-#include "AliCodeTimer.h"
#include "AliLog.h"
#include "AliMUON2DMap.h"
#include "AliMUONCalibParamND.h"
-#include "AliMUONPainterRegistry.h"
-#include "AliMpManuUID.h"
+#include "AliMUONContour.h"
+#include "AliMUONContourPainter.h"
#include "AliMUONObjectPair.h"
-#include "AliMUONPainterContour.h"
#include "AliMUONPainterGroup.h"
#include "AliMUONPainterHelper.h"
+#include "AliMUONPainterDataRegistry.h"
#include "AliMUONTrackerDataHistogrammer.h"
#include "AliMUONVTrackerData.h"
+#include "AliMpManuUID.h"
#include <Riostream.h>
#include <TCanvas.h>
#include <TClass.h>
Double_t& x2, Double_t& y2) const
{
/// Get the bounding box = our area
-
- AliMpArea area(Area().GetPositionX(),
+ AliMpArea area(Area().GetPositionX(),
Area().GetPositionY(),
- Area().GetDimensionX()*fBorderFactor,
+ Area().GetDimensionX()*fBorderFactor,
Area().GetDimensionY()*fBorderFactor);
x1 = area.LeftBorder();
if ( IsExcluded() )
{
- fContour->PaintArea(2);
- fContour->PaintOutline(1,1);
+ AliMUONContourPainter::Paint(*fContour,1,1,2); // red fill with black thin outline
}
}
Int_t c = color >= 0 ? color : GetLineColor();
Int_t w = width >= 0 ? width : GetLineWidth();
- fContour->PaintOutline(c,w);
+ AliMUONContourPainter::Paint(*fContour,c,w);
}
//_____________________________________________________________________________
//_____________________________________________________________________________
void
-AliMUONVPainter::SetContour(AliMUONPainterContour* contour)
+AliMUONVPainter::SetContour(AliMUONContour* contour)
{
/// Set out contour
if (!contour)
AliMUONVPainter::InteractiveReadOutConfig() const
{
/// get the interactive readout config object
- return AliMUONPainterRegistry::Instance()->InteractiveReadOutConfig();
+ return AliMUONPainterDataRegistry::Instance()->InteractiveReadOutConfig();
}
//_____________________________________________________________________________
return rv;
}
+//_____________________________________________________________________________
+void
+AliMUONVPainter::PaintArea(Int_t fillColor)
+{
+ AliMUONContourPainter::Paint(*(Contour()),-1,-1,fillColor);
+}
#endif
#include <float.h>
-class AliMUONPainterContour;
+class AliMUONContour;
class AliMUONPainterGroup;
class AliMUONVTrackerData;
class AliMpArea;
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
/// Return the contour representing the outline of this object
- AliMUONPainterContour* Contour() const { return fContour; }
+ AliMUONContour* Contour() const { return fContour; }
/// Get our name
virtual const char* GetName() const { return Name().Data(); }
AliMUONPainterGroup* ResponderGroup() const { return fResponderGroup; }
/// Set out contour
- void SetContour(AliMUONPainterContour* contour);
+ void SetContour(AliMUONContour* contour);
void SetData(const char* pattern, AliMUONVTrackerData* data, Int_t dataIndex);
virtual void PaintOutline(Int_t color=-1, Int_t width=-1, Double_t x=FLT_MAX, Double_t y=FLT_MAX);
+ virtual void PaintArea(Int_t fillColor);
+
virtual void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
Double_t min, Double_t max);
TString fType; ///< our type (DE, Chamber, MANU, etc...)
AliMUONVPainter* fMother; ///< our mother
AliMUONPainterGroup* fGroup; ///< our group
- AliMUONPainterContour* fContour; ///< our contour
+ AliMUONContour* fContour; ///< our contour
TMap* fPainterGroups; ///< map of groups
TObjArray* fChildren; ///< our children
AliMUONPainterGroup* fResponderGroup; ///< the responder group
#pragma link C++ class AliMUONTriggerGUIboard+;
#pragma link C++ class AliMUONClusterInfo+;
#pragma link C++ class AliMUONPadInfo+;
+#pragma link C++ class AliMUONContourMakerTest+;
#endif
#pragma link C++ class AliMUONChamberPainter+;
#pragma link C++ class AliMUONManuPainter+;
#pragma link C++ class AliMUONPCBPainter+;
-#pragma link C++ class AliMUONPainterContour+;
-#pragma link C++ class AliMUONPainterContourMaker+;
-#pragma link C++ class AliMUONPainterContourMaker::AliMUONNeighbour+;
#pragma link C++ class AliMUONPainterHelper+;
#pragma link C++ class AliMUONPainterPadStore+;
#pragma link C++ class AliMUONDEPainter+;
#pragma link C++ class AliMUONPainterMatrix+;
#pragma link C++ class AliMUONAttPainter+;
#pragma link C++ class AliMUONPainterRegistry+;
+#pragma link C++ class AliMUONPainterDataRegistry+;
#pragma link C++ class AliMUONPainterHighlighter+;
#pragma link C++ class AliMUONPainterPlotSelector+;
#pragma link C++ class AliMUONPainterInterfaceHelper+;
#pragma link C++ class AliMUONTrackerDataWrapper+;
#pragma link C++ class AliMUONTrackerDataCompareDialog+;
#pragma link C++ class AliMUONTrackerACFDataMaker+;
+#pragma link C++ class AliMUONContourPainter+;
+#pragma link C++ class AliMUONPolygon+;
+#pragma link C++ class AliMUONContour+;
+#pragma link C++ class AliMUONContourMaker+;
+#pragma link C++ class AliMUONManuContourMaker+;
+#pragma link C++ class AliMUONSegment+;
+#pragma link C++ class AliMUONSegmentTree+;
+#pragma link C++ class AliMUONNode+;
+#pragma link C++ class AliMUONPointWithRef+;
+
#endif
#pragma link C++ class AliMpFrtCrocusConstants+;
#pragma link C++ class AliMpManuStore+;
#pragma link C++ class AliMpFastSegmentation+;
+#pragma link C++ class AliMpUID+;
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
AliMUONTriggerGUIdimap.cxx \
AliMUONTriggerGUIboard.cxx \
AliMUONClusterInfo.cxx \
- AliMUONPadInfo.cxx
+ AliMUONPadInfo.cxx \
+ AliMUONContourMakerTest.cxx
HDRS:= $(SRCS:.cxx=.h)
AliMUONChamberPainter.cxx \
AliMUONManuPainter.cxx \
AliMUONPainterPadStore.cxx \
- AliMUONPainterContourMaker.cxx \
- AliMUONPainterContour.cxx \
AliMUONPainterMasterFrame.cxx \
AliMUONPainterMatrixFrame.cxx \
AliMUONManuPadPainter.cxx \
AliMUONPainterMatrix.cxx \
AliMUONAttPainter.cxx \
AliMUONPainterRegistry.cxx \
+ AliMUONPainterDataRegistry.cxx \
AliMUONPainterHighlighter.cxx \
AliMUONPainterPlotSelector.cxx \
AliMUONPainterInterfaceHelper.cxx \
AliMUONTrackerDataHistogrammer.cxx \
AliMUONTrackerDataWrapper.cxx \
AliMUONTrackerDataCompareDialog.cxx \
- AliMUONTrackerACFDataMaker.cxx
-
+ AliMUONTrackerACFDataMaker.cxx \
+ AliMUONContourPainter.cxx \
+ AliMUONPolygon.cxx \
+ AliMUONContour.cxx \
+ AliMUONContourMaker.cxx \
+ AliMUONManuContourMaker.cxx \
+ AliMUONSegment.cxx \
+ AliMUONSegmentTree.cxx \
+ AliMUONNode.cxx \
+ AliMUONPointWithRef.cxx
+
HDRS:= $(SRCS:.cxx=.h)
DHDR:= MUONgraphicsLinkDef.h
mapping/AliMpCDB.cxx \
mapping/AliMpFrtCrocusConstants.cxx \
mapping/AliMpManuStore.cxx \
- mapping/AliMpFastSegmentation.cxx
+ mapping/AliMpFastSegmentation.cxx \
+ mapping/AliMpUID.cxx
# Category graphics
#
// --- Start the event loop ---
theApp->Run(kTRUE);
- AliMUONPainterHelper::Instance()->Save();
+ delete AliMUONPainterHelper::Instance(); // important to trigger the saving of the env. file
}