X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONTriggerGUIboard.cxx;h=5d6dd3aebfeda1bcc0e87d5db7472d2b1d77617d;hb=4f678629dd7b2d8a1782a88a30e8ee7c26a94429;hp=abd356eec617bde8c8e5f9a094b3c685c7abd100;hpb=905654c293d3df9eeeb7a27e7236535797c303f7;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONTriggerGUIboard.cxx b/MUON/AliMUONTriggerGUIboard.cxx index abd356eec61..5d6dd3aebfe 100644 --- a/MUON/AliMUONTriggerGUIboard.cxx +++ b/MUON/AliMUONTriggerGUIboard.cxx @@ -13,14 +13,21 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -////////////////////////////////////////////////////////////////////////// -// // -// Graphical User Interface utility class for the MUON trigger // -// - single board object // -// // -////////////////////////////////////////////////////////////////////////// +// $Id$ +//----------------------------------------------------------------------------- +/// \class AliMUONTriggerGUIboard +/// +/// Single trigger board object with geometry information, strips and digits +/// +/// \author Bogdan Vulpescu, LPC Clermont-Ferrand +//----------------------------------------------------------------------------- + +#include #include +#include + +#include "AliMUONGeometryTransformer.h" #include "AliMUONTriggerGUIboard.h" @@ -29,9 +36,10 @@ ClassImp(AliMUONTriggerGUIboard) /// \endcond //__________________________________________________________________________ -AliMUONTriggerGUIboard::AliMUONTriggerGUIboard(Int_t id, Char_t *name) +AliMUONTriggerGUIboard::AliMUONTriggerGUIboard() : TObject(), fName(0), + fCrateName(0), fID(-1), fStatus(0), fPosition(0), @@ -44,12 +52,16 @@ AliMUONTriggerGUIboard::AliMUONTriggerGUIboard(Int_t id, Char_t *name) fYSiy(0), fDetElemId(0), fIdCircuit(-1), - fIsOpen(0) + fIsOpen(0), + fNPadsX(), + fNPadsY(), + fPadsX(), + fPadsY() { /// board main constructor - fName = new TString(name); - fID = id; + fName = new TString(""); + fCrateName = new TString(""); for (Int_t i = 0; i < kNMT; i++) { fXCenter[i] = 0.; @@ -87,6 +99,11 @@ AliMUONTriggerGUIboard::AliMUONTriggerGUIboard(Int_t id, Char_t *name) fYOver = 0; fPosition = 0; + for (Int_t i = 0; i < kNMT; i++) { + fPadsX[i] = new TClonesArray("AliMpPad",16); fNPadsX[i] = 0; + fPadsY[i] = new TClonesArray("AliMpPad",16); fNPadsY[i] = 0; + } + } //__________________________________________________________________________ @@ -105,41 +122,6 @@ AliMUONTriggerGUIboard::~AliMUONTriggerGUIboard() } -//__________________________________________________________________________ -AliMUONTriggerGUIboard::AliMUONTriggerGUIboard(const AliMUONTriggerGUIboard& board) - : TObject(board), - fName(0), - fID(-1), - fStatus(0), - fPosition(0), - fYOver(0), - fXSix(0), - fXSiy1(0), - fXSiy2(0), - fYSix1(0), - fYSix2(0), - fYSiy(0), - fDetElemId(0), - fIdCircuit(-1), - fIsOpen(0) -{ - /// copy constructor - - Fatal("AliMUONTriggerGUIboard","copy constructor not implemented"); - -} - -//__________________________________________________________________________ -AliMUONTriggerGUIboard & AliMUONTriggerGUIboard::operator=(const AliMUONTriggerGUIboard& board) -{ - /// asignment operator - - Fatal("AliMUONTriggerGUIboard","assignment operator not implemented"); - - return *this; - -} - //__________________________________________________________________________ void AliMUONTriggerGUIboard::SetXDigBox(Int_t imt, Int_t is, Double_t x1, Double_t y1, Double_t x2, Double_t y2) { @@ -189,3 +171,162 @@ void AliMUONTriggerGUIboard::ClearYDigits() } } + +//__________________________________________________________________________ +void AliMUONTriggerGUIboard::MakeGeometry() +{ + /// create the display geometry from the mapping pads + + AliMpPad *pad; + + // circuit number and manu channel (from x-strips) + for (Int_t ich = 0; ich < kNMT; ich++) { + if (fNPadsX[ich]) { + pad = (AliMpPad*)fPadsX[ich]->At(0); + fIdCircuit = pad->GetLocalBoardId(0); + break; + } + } + + // position index + if (fName->Length()) { + if (fName->Contains("12")) fPosition = 1; + if (fName->Contains("34")) fPosition = 2; + if (fName->Contains("56")) fPosition = 3; + if (fName->Contains("78")) fPosition = 4; + } + + // position index for common y-strip boards + for (Int_t ich = 0; ich < kNMT; ich++) { + if (fNPadsY[ich]) { + pad = (AliMpPad*)fPadsY[ich]->At(0); + fYOver = pad->GetNofLocations(); + break; + } + } + + // pad indices + Int_t padxIx = -1, padxIy1 = +999, padxIy2 = -999; + Int_t padyIy = -1, padyIx1 = +999, padyIx2 = -999; + for (Int_t ip = 0; ip < fNPadsX[0]; ip++) { + pad = (AliMpPad*)fPadsX[0]->At(ip); + padxIx = pad->GetIx(); + padxIy1 = TMath::Min(padxIy1,pad->GetIy()); + padxIy2 = TMath::Max(padxIy2,pad->GetIy()); + } + for (Int_t ip = 0; ip < fNPadsY[0]; ip++) { + pad = (AliMpPad*)fPadsY[0]->At(ip); + padyIy = pad->GetIy(); + padyIx1 = TMath::Min(padyIx1,pad->GetIx()); + padyIx2 = TMath::Max(padyIx2,pad->GetIx()); + } + fXSix = padxIx; + fXSiy1 = padxIy1; + fXSiy2 = padxIy2; + fYSiy = padyIy; + fYSix1 = padyIx1; + fYSix2 = padyIx2; + + // position and dimension + + AliMUONGeometryTransformer transformer; + transformer.LoadGeometryData("transform.dat"); + + Float_t minX, maxX, minY, maxY; + Float_t dx, dy; + Float_t xloc, yloc, xglo, yglo, zglo; + for (Int_t ich = 0; ich < kNMT; ich++) { + minX = +9999; maxX = -9999; + minY = +9999; maxY = -9999; + for (Int_t ix = 0; ix < fNPadsX[ich]; ix++) { + pad = (AliMpPad*)fPadsX[ich]->At(ix); + xloc = pad->GetPositionX(); + yloc = pad->GetPositionY(); + dx = pad->GetDimensionX(); + dy = pad->GetDimensionY(); + transformer.Local2Global((11+ich)*100+GetDetElemId(), xloc, yloc, 0, xglo, yglo, zglo); + minX = TMath::Min(minX,(xglo-dx)); + maxX = TMath::Max(maxX,(xglo+dx)); + minY = TMath::Min(minY,(yglo-dy)); + maxY = TMath::Max(maxY,(yglo+dy)); + } + fXCenter[ich] = 0.5*(minX+maxX); + fYCenter[ich] = 0.5*(minY+maxY); + fZCenter[ich] = zglo; + fXWidth[ich] = maxX-minX; + fYWidth[ich] = maxY-minY; + // truncate to same precision as in the old guimap files + fXCenter[ich] = 0.01*TMath::Nint(fXCenter[ich]*100.0); + fYCenter[ich] = 0.01*TMath::Nint(fYCenter[ich]*100.0); + fXWidth[ich] = 0.01*TMath::Nint(fXWidth[ich]*100.0); + fYWidth[ich] = 0.01*TMath::Nint(fYWidth[ich]*100.0); + + } + + // delete the pads arrays + for (Int_t ich = 0; ich < kNMT; ich++) { + delete fPadsX[ich]; fNPadsX[ich] = 0; + delete fPadsY[ich]; fNPadsY[ich] = 0; + } + +} + +//__________________________________________________________________________ +Int_t AliMUONTriggerGUIboard::GetLine() const +{ + /// get detector side + if (fName->Length() >= 5) { + const Char_t *name = fName->Data(); + TString sline = TString(name[4]); + return sline.Atoi(); + } + + return -1; + +} + +//__________________________________________________________________________ +Int_t AliMUONTriggerGUIboard::GetCol() const +{ + /// get detector side + if (fName->Length() >= 5) { + const Char_t *name = fName->Data(); + TString scol = TString(name[2]); + return scol.Atoi(); + } + + return -1; + +} + +//__________________________________________________________________________ +Int_t AliMUONTriggerGUIboard::GetSide() const +{ + /// get detector side + if (fName->Length() >= 5) { + const Char_t *name = fName->Data(); + if (!strncmp(name,"L",1)) return 0; + if (!strncmp(name,"R",1)) return 1; + } + + return -1; + +} + +//__________________________________________________________________________ +void AliMUONTriggerGUIboard::PrintBoard() const +{ + /// print information on this board + + printf("Name: %s Id %3d Circ %3d DetElemId %2d Pos %1d YOver %1d\n",GetBoardName(),GetNumber(),GetIdCircuit(),GetDetElemId(),GetPosition(),GetYOver()); + printf("NStrips: X %2d Y %2d \n",GetNStripX(),GetNStripY()); + printf("Pad indices: X: ix %3d iy1 %3d iy2 %3d \n",GetXSix(),GetXSiy1(),GetXSiy2()); + printf("Pad indices: Y: iy %3d ix1 %3d ix2 %3d \n",GetYSiy(),GetYSix1(),GetYSix2()); + printf("Position and dimension:\n"); + for (Int_t imt = 0; imt < 4; imt++) { + printf("MT=%1d: X %9.4f Y %9.4f Z %10.4f \n",imt,GetXCenter(imt),GetYCenter(imt),GetZCenter(imt)); + printf(" DX %7.4f DY %7.4f \n",GetXWidth(imt),GetYWidth(imt)); + } + +} +