#include "AliMpSegmentation.h"
#include "AliMpPad.h"
#include "AliMpDDLStore.h"
+#include "AliMpManuStore.h"
#include "AliMpVPadIterator.h"
#include "AliMpCDB.h"
+#include "AliMpDataStreams.h"
#include "AliLog.h"
#include <TMath.h>
#include <TString.h>
-#include <TVector2.h>
#include <TCanvas.h>
#include <TGButton.h>
#include <TRootEmbeddedCanvas.h>
#include <TGTextView.h>
#include <TGTextEntry.h>
+#include <cstdio>
+
// Category: graphics
//-----------------------------------------------------------------------------
fCurrentPlane(AliMp::kBendingPlane),
fCurrentDetElem(100),
fCurrentDEName(),
- fSegmentation(),
+ fkSegmentation(),
+ fDDLStore(0x0),
+ fManuStore(0x0),
fZoomMode(false)
{
/// Standard constructor
// Load mapping
- if ( ! AliMpCDB::LoadMpSegmentation() )
- {
+ if ( ! AliMpCDB::LoadDDLStore() ) {
AliFatal("Could not access mapping from OCDB !");
}
-
- // Load DDL store
- if ( ! AliMpCDB::LoadDDLStore() )
- {
- AliFatal("Could not access DDL Store from OCDB !");
+
+ if ( ! AliMpCDB::LoadManuStore() ) {
+ AliFatal("Could not access run-dependent mapping from OCDB !");
}
fDDLStore = AliMpDDLStore::Instance();
-
+ fManuStore = AliMpManuStore::Instance();
fTrashList.SetOwner(kFALSE);
fDEComboIdx.Set(26);
for(i = 0; i < 10; i++)
{
- sprintf(text,"%d",i+1);
+ snprintf(text,20,"%d",i+1);
fChamberCombo->AddEntry(text,i);
}
fChamberCombo->Resize(40,20);
fMain->MapWindow();
// instance segmentation
- fSegmentation = AliMpSegmentation::Instance()->GetMpSegmentation(fCurrentDetElem, detElem->GetCathodType(fCurrentPlane));
+ fkSegmentation = AliMpSegmentation::Instance()->GetMpSegmentation(fCurrentDetElem, detElem->GetCathodType(fCurrentPlane));
fLogMessage->AddLine("Segmentation loaded");
fLogMessage->ShowBottom();
}
EventToReal(eventX,eventY,x,y);
// get manu
- AliMpPad pad = fSegmentation->PadByPosition(TVector2(x,y), false);
+ AliMpPad pad = fkSegmentation->PadByPosition(x,y, false);
if (!pad.IsValid()) {
return;
}
- Int_t manu = pad.GetLocation().GetFirst();
+ Int_t manu = pad.GetManuId();
fNumberEntry->SetNumber(manu);
if (AliMpDEManager::GetStationType(fCurrentDetElem) == AliMp::kStation345 ) {
- sprintf(command, "%s%d", "PMCI:", (Int_t)fNumberEntry->GetIntNumber());
+ snprintf(command, 255, "%s%d", "PMCI:", (Int_t)fNumberEntry->GetIntNumber());
DrawSlat(command, popup);
} else {
- sprintf(command, "%s%d", "RSMCI:", (Int_t)fNumberEntry->GetIntNumber());
+ snprintf(command, 255, "%s%d", "RSMCI:", (Int_t)fNumberEntry->GetIntNumber());
DrawQuadrant(command, popup);
AliMpDetElement* detElem = AliMpDEManager::GetDetElement(fCurrentDetElem);
TString nameType = detElem->GetSegType();
-
+
+ AliMpDataStreams dataStreams;
+
AliMpSlatMotifMap mm;
- AliMpSt345Reader reader(mm);
- AliMpSlat* slatCurrent = reader.ReadSlat(nameType.Data(), fCurrentPlane);
- AliMpSlat* slatOther = reader.ReadSlat(nameType.Data(), AliMp::OtherPlaneType(fCurrentPlane));
+
+ AliMpSt345Reader reader(&mm);
+ AliMpSlat* slatCurrent = reader.ReadSlat(dataStreams,nameType.Data(), fCurrentPlane);
+ AliMpSlat* slatOther = reader.ReadSlat(dataStreams,nameType.Data(), AliMp::OtherPlaneType(fCurrentPlane));
AliMpVPainter* painter = AliMpVPainter::CreatePainter(slatCurrent);
painter->Draw(option);
canvas->Clear();
AliMpDetElement* detElem = AliMpDEManager::GetDetElement(fCurrentDetElem);
- AliMp::StationType station = detElem->GetStationType();
+ AliMq::Station12Type station = detElem->GetStation12Type();
+ AliMpDataStreams dataStreams;
+
AliMpSectorReader readerCurrent(station, fCurrentPlane);
- AliMpSector* sectorCurrent = readerCurrent.BuildSector();
+ AliMpSector* sectorCurrent = readerCurrent.BuildSector(dataStreams);
AliMpSectorReader readerOther(station, AliMp::OtherPlaneType(fCurrentPlane));
- AliMpSector* sectorOther = readerOther.BuildSector();
+ AliMpSector* sectorOther = readerOther.BuildSector(dataStreams);
AliMpVPainter *painter = AliMpVPainter::CreatePainter(sectorCurrent);
painter->Draw(option);
//______________________________________________________________________________
void
-AliMpDEVisu::EventToReal(Int_t eventX, Int_t eventY, Double_t& x, Double_t& y) const
+AliMpDEVisu::EventToReal(Int_t eventX, Int_t eventY,
+ Double_t& x, Double_t& y) const
{
/// estimate graphic pad sizes
- static TVector2 ul(gPad->XtoPixel(0.01), gPad->YtoPixel(0.99));
- static TVector2 br(gPad->XtoPixel(0.99), gPad->YtoPixel(0.01));
+ static Double_t ulx(gPad->XtoPixel(0.01));
+ static Double_t uly(gPad->YtoPixel(0.99));
+ static Double_t brx(gPad->XtoPixel(0.99));
+ static Double_t bry(gPad->YtoPixel(0.01));
- static TVector2 padDim = br - ul;
+ static Double_t padDimX = brx - ulx;
+ static Double_t padDimY = bry - uly;
// get DE dimension (half size)
- TVector2 deDim(fSegmentation->Dimensions()*2.0);
-
- TVector2 padReal;
+ Double_t deDimX(fkSegmentation->GetDimensionX()*2.0);
+ Double_t deDimY(fkSegmentation->GetDimensionY()*2.0);
- if (AliMpDEManager::GetStationType(fCurrentDetElem) == AliMp::kStation345 )
+ if ( AliMpDEManager::GetStationType(fCurrentDetElem) == AliMp::kStation345 )
{
// origin at center
- x = (eventX - ul.X() - padDim.X()/2.)/(padDim.X())*deDim.X();
- y = (br.Y() - eventY - padDim.Y()/2.)/(padDim.Y())*deDim.Y();
+ x = (eventX - ulx - padDimX/2.)/(padDimX)*deDimX;
+ y = (bry - eventY - padDimY/2.)/(padDimY)*deDimY;
}
else
{
// origin at bottom left
- x = (eventX - ul.X())/(padDim.X())*deDim.X();
- y = (br.Y() - eventY)/(padDim.Y())*deDim.Y();
+ x = (eventX - ulx)/(padDimX)*deDimX;
+ y = (bry - eventY)/(padDimY)*deDimY;
}
}
Int_t firstBus = TMath::MinElement(detElem->GetNofBusPatches(), vec);
Int_t lastBus = TMath::MaxElement(detElem->GetNofBusPatches(), vec);
- detElem = AliMpDEManager::GetDetElement(fCurrentDetElem);
- Int_t numberOfSerialManu = detElem->GetNofManus(); // number of manu with an identified serial number
+ Int_t numberOfSerialManu = fManuStore->NofManus(detElem->GetId()); // number of manu with an identified serial number
fLogMessage->AddLine(Form("DrawDE: detection element: %d, name: %s",
fCurrentDetElem, fCurrentDEName.Data()));
fNumberEntry->SetNumber(fNumberEntry->GetIntNumber() - 1024);
}
DrawDE();
- fSegmentation = AliMpSegmentation::Instance()
+ fkSegmentation = AliMpSegmentation::Instance()
->GetMpSegmentation(fCurrentDetElem, detElem->GetCathodType(fCurrentPlane));
break;
fCurrentDetElem = fDEComboIdx[fDECombo->GetSelected()];
- fSegmentation = AliMpSegmentation::Instance()
+ fkSegmentation = AliMpSegmentation::Instance()
->GetMpSegmentation(fCurrentDetElem, detElem->GetCathodType(fCurrentPlane));
}
}
fNameDECombo->Select(fDEOccurrence[fCurrentDetElem]);
- fSegmentation = AliMpSegmentation::Instance()
+ fkSegmentation = AliMpSegmentation::Instance()
->GetMpSegmentation(fCurrentDetElem, detElem->GetCathodType(fCurrentPlane));
}
AliMpMotifPosition* motifPos = 0x0;
Int_t manuId = 0;
- for ( AliMpSlat::Size_t i = 0; i < slat->GetSize(); ++i ) {
+ for ( Int_t i = 0; i < slat->GetSize(); ++i ) {
AliMpPCB* pcb = slat->GetPCB(i);
- for ( AliMpPCB::Size_t j = 0; j < slat->GetPCB(i)->GetSize(); ++j ) {
+ for ( Int_t j = 0; j < slat->GetPCB(i)->GetSize(); ++j ) {
motifPos = pcb->GetMotifPosition(j);
{
InfoManuMotif(motifPosFound);
- TVector2 dimension(motifPosFound->Dimensions());
+ Double_t dimensionX(motifPosFound->GetDimensionX());
+ Double_t dimensionY(motifPosFound->GetDimensionY());
Int_t h = 500;
- Int_t w = Int_t(h*dimension.X()/dimension.Y());
+ Int_t w = Int_t(h*dimensionX/dimensionY);
AliMpVPainter* painter = AliMpVPainter::CreatePainter(motifPosFound);
- CreatePopupWindow(w,h,Form("Manu %d",fNumberEntry->GetIntNumber()),
+ CreatePopupWindow(w,h,Form("Manu %ld",fNumberEntry->GetIntNumber()),
painter,"ZT");
}
}
for (Int_t iRowSeg = 0; iRowSeg < sector->GetRow(iRow)->GetNofRowSegments(); ++iRowSeg){
- for (Int_t iRowSeg = 0; iRowSeg < row->GetNofRowSegments(); ++iRowSeg) {
- AliMpVRowSegment *rowSegment = row->GetRowSegment(iRowSeg);
+ for (Int_t iRowSeg2 = 0; iRowSeg2 < row->GetNofRowSegments(); ++iRowSeg2) {
+ AliMpVRowSegment *rowSegment = row->GetRowSegment(iRowSeg2);
for (Int_t iMotif = 0; iMotif < rowSegment->GetNofMotifs(); ++iMotif){
InfoManuMotif(motifPosFound);
- TVector2 dimension(motifPosFound->Dimensions());
+ Double_t dimensionX(motifPosFound->GetDimensionX());
+ Double_t dimensionY(motifPosFound->GetDimensionY());
// Create transient frame
Int_t h = 400;
- Int_t w = Int_t(h*dimension.X()/dimension.Y());
+ Int_t w = Int_t(h*dimensionX/dimensionY);
AliMpVPainter* painter = AliMpVPainter::CreatePainter(motifPosFound);
- CreatePopupWindow(w,h,Form("Manu %d",fNumberEntry->GetIntNumber()),
+ CreatePopupWindow(w,h,Form("Manu %ld",fNumberEntry->GetIntNumber()),
painter,"ZT");
}
// log message
Int_t manuId = fNumberEntry->GetIntNumber();
- TVector2 dimension(motifPos->Dimensions());
+
fLogMessage->AddLine(Form("PopupManuMotif: motif dimension: %5.2f, %5.2f",
- dimension.X()*2., dimension.Y()*2.));
+ motifPos->GetDimensionX()*2.,
+ motifPos->GetDimensionY()*2.));
fLogMessage->AddLine( Form("PopupManuMotif: pad dimension: %4.2f, %4.2f",
- motifPos->GetMotif()->GetPadDimensions(0).X()*2.,
- motifPos->GetMotif()->GetPadDimensions(0).Y()*2. ));
+ motifPos->GetMotif()->GetPadDimensionX(0)*2.,
+ motifPos->GetMotif()->GetPadDimensionY(0)*2. ));
fLogMessage->AddLine( Form("PopupManuMotif: manu: %d, serial number: %d, buspatch: %d",
- manuId,
- fDDLStore->GetDetElement(fCurrentDetElem)->GetManuSerialFromId(manuId),
- fDDLStore->GetBusPatchId(fCurrentDetElem, manuId)) );
+ manuId,
+ fManuStore->GetManuSerial(fCurrentDetElem, manuId),
+ fDDLStore->GetBusPatchId(fCurrentDetElem, manuId)) );
fLogMessage->ShowBottom();
Int_t h = 500;//TMath::Abs(x1-x0);
Int_t w = 500;//TMath::Abs(y1-y0);
- AliMpArea area(TVector2((x0+x1)/2.0,(y0+y1)/2.0),
- TVector2(TMath::Abs(x1-x0)/2.0,TMath::Abs(y1-y0)/2.0));
+ AliMpArea area((x0+x1)/2.0,(y0+y1)/2.0,
+ TMath::Abs(x1-x0)/2.0,TMath::Abs(y1-y0)/2.0);
// area.Print();
if ( area.IsValid() )
{
- AliMpVPadIterator* iterator = fSegmentation->CreateIterator(area);
+ AliMpVPadIterator* iterator = fkSegmentation->CreateIterator(area);
if (iterator)
{
AliMpVPainter* painter = AliMpVPainter::CreatePainter(iterator);