From 5f12af862d80185a512f2c4a85ac365078135506 Mon Sep 17 00:00:00 2001 From: martinez Date: Tue, 14 Jun 2005 03:36:09 +0000 Subject: [PATCH] Removing old segmentation classes --- MUON/AliMUONSegmentationSlat.cxx | 663 ----------------------- MUON/AliMUONSegmentationSlatModule.cxx | 442 --------------- MUON/AliMUONSegmentationSlatModuleN.cxx | 272 ---------- MUON/AliMUONSegmentationSlatN.cxx | 142 ----- MUON/AliMUONSegmentationTrigger.cxx | 242 --------- MUON/AliMUONSegmentationTriggerX.cxx | 361 ------------- MUON/AliMUONSegmentationTriggerY.cxx | 319 ----------- MUON/AliMUONSegmentationV0.cxx | 347 ------------ MUON/AliMUONSegmentationV01.cxx | 686 ------------------------ MUON/AliMUONSegmentationV02.cxx | 170 ------ MUON/AliMUONSt1Segmentation.cxx | 605 --------------------- 11 files changed, 4249 deletions(-) delete mode 100644 MUON/AliMUONSegmentationSlat.cxx delete mode 100644 MUON/AliMUONSegmentationSlatModule.cxx delete mode 100644 MUON/AliMUONSegmentationSlatModuleN.cxx delete mode 100644 MUON/AliMUONSegmentationSlatN.cxx delete mode 100644 MUON/AliMUONSegmentationTrigger.cxx delete mode 100644 MUON/AliMUONSegmentationTriggerX.cxx delete mode 100644 MUON/AliMUONSegmentationTriggerY.cxx delete mode 100644 MUON/AliMUONSegmentationV0.cxx delete mode 100644 MUON/AliMUONSegmentationV01.cxx delete mode 100644 MUON/AliMUONSegmentationV02.cxx delete mode 100644 MUON/AliMUONSt1Segmentation.cxx diff --git a/MUON/AliMUONSegmentationSlat.cxx b/MUON/AliMUONSegmentationSlat.cxx deleted file mode 100644 index c847cb73be0..00000000000 --- a/MUON/AliMUONSegmentationSlat.cxx +++ /dev/null @@ -1,663 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -#include -#include -#include -#include -#include -#include - -#include "AliMUONSegmentationSlat.h" -#include "AliMUONSegmentationSlatModule.h" -#include "AliMUON.h" -#include "AliMUONChamber.h" -#include "AliRun.h" -#include "AliMUONConstants.h" -#include "AliLog.h" -//___________________________________________ -ClassImp(AliMUONSegmentationSlat) - -AliMUONSegmentationSlat::AliMUONSegmentationSlat() - : AliSegmentation() -{ -// Default constructor - fChamber = 0; - fNDiv = 0; - fSlats = 0; - fCurrentSlat = 0; -} - -AliMUONSegmentationSlat::AliMUONSegmentationSlat(Int_t /*nsec*/) - : AliSegmentation() -{ -// Non default constructor - fSlats=0; - fNDiv = new TArrayI(4); - fChamber = 0; - fCurrentSlat = 0; -} - -AliMUONSegmentationSlat::AliMUONSegmentationSlat(const AliMUONSegmentationSlat& rhs) - : AliSegmentation(rhs) -{ -// Protected copy constructor - - AliFatal("Not implemented."); -} - -AliMUONSegmentationSlat::~AliMUONSegmentationSlat(){ - //PH Delete TObjArrays - if (fSlats) { - fSlats->Delete(); - delete fSlats; - } - - if (fNDiv) { - delete fNDiv; - } - -} - -//---------------------------------------------------------------------- -AliMUONSegmentationSlat& -AliMUONSegmentationSlat::operator=(const AliMUONSegmentationSlat& rhs) -{ -// Protected assignement operator - - if (this == &rhs) return *this; - - AliFatal("Not implemented."); - - return *this; -} - -//----------------------------------------------------------- -void AliMUONSegmentationSlat::SetPadSize(Float_t p1, Float_t p2) -{ -// Sets the pad (strip) size -// - fDpx=p1; - fDpy=p2; -} - -//----------------------------------------------------------- -Float_t AliMUONSegmentationSlat::GetAnod(Float_t xhit) const -{ -// Returns for a hit position xhit the position of the nearest anode wire - Float_t wire= (xhit>0)? Int_t(xhit/fWireD)+0.5:Int_t(xhit/fWireD)-0.5; - return fWireD*wire; -} - -//----------------------------------------------------------- -void AliMUONSegmentationSlat::GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/, Int_t *Nparallel, Int_t *Offset) -{ - *Nparallel = 1; - *Offset = 0; -} -//----------------------------------------------------------- -void AliMUONSegmentationSlat::GiveTestPoints(Int_t & /*n*/, Float_t */*x*/, Float_t */*y*/) const -{;} - -//----------------------------------------------------------- -Float_t AliMUONSegmentationSlat::Distance2AndOffset(Int_t /*iX*/, Int_t /*iY*/, Float_t /*X*/, Float_t /*Y*/, Int_t * /*dummy*/) -{ - return 0.; -} - -//----------------------------------------------------------- -Float_t AliMUONSegmentationSlat::Dpx(Int_t isec) const -{ -// -// Returns x-pad size for given sector isec -// isec = 100*islat+iregion -// - Int_t islat, iregion; - islat = isec/100; - iregion = isec%100; - return Slat(islat)->Dpx(iregion); -} - -Float_t AliMUONSegmentationSlat::Dpy(Int_t /*isec*/) const -{ -// -// Returns y-pad (strip) size for given sector isec - return fDpy; -} - -void AliMUONSegmentationSlat::SetPadDivision(Int_t ndiv[4]) -{ -// -// Defines the pad size perp. to the anode wire (y) for different sectors. -// Pad sizes are defined as integral fractions ndiv of a basis pad size -// fDpx -// - for (Int_t i = 0; i < 4; i++) { - (*fNDiv)[i] = ndiv[i]; - } -} - -void AliMUONSegmentationSlat::GlobalToLocal( - Float_t x, Float_t y, Float_t z, Int_t &islat, Float_t &xlocal, Float_t &ylocal) -{ -// -// Perform local to global transformation for space coordinates -// - Float_t zlocal; - Int_t i; - Int_t index = -1; - Float_t eps = 1.e-4; - -// Transform According to slat plane z-position: negative side is shifted down -// positive side is shifted up -// by half the overlap - zlocal = z-fChamber->Z(); - -// zlocal = (x>0) ? zlocal-2.*fDz : zlocal+2.*fDz; -// zlocal = (x>0) ? zlocal+2.*fDz : zlocal-2.*fDz; //Change? - - - - -// Set the signs for the symmetry transformation and transform to first quadrant - SetSymmetry(x); - Float_t xabs = TMath::Abs(x); - - -// Find slat number - for (i = 0; i < fNSlats; i++) { //Loop on all slats (longuer but more secure) - index = i; - if ((y >= fYPosition[i]-eps) && (y <= fYPosition[i]+fSlatY+eps)) break; - } - -// -// Transform to local coordinate system - - - if (index >= fNSlats || index < 0 ) { - islat = -1; - xlocal = -1; - ylocal = -1; - } else { - islat = index; - xlocal = xabs - fXPosition[index]; - ylocal = y - fYPosition[index]; - } -} -//_________________________________________________ -void AliMUONSegmentationSlat::GlobalToLocal( - Int_t ix, Int_t iy, Int_t &islat, Int_t &ixlocal, Int_t &iylocal) const -{ -// -// Perform global to local transformation for pad coordinates -// - Int_t iytemp = iy; - Int_t index = 0; - - iylocal = iytemp; - -// -// Find slat number (index) and iylocal - for (Int_t i=0; iNpy(); - - if (iytemp <= 0) break; - iylocal = iytemp; - index=i+1; - } - ixlocal=TMath::Abs(ix); - islat=index; -} - -//_________________________________________________ -void AliMUONSegmentationSlat:: -LocalToGlobal(Int_t islat, Float_t xlocal, Float_t ylocal, Float_t &x, Float_t &y, Float_t &z) const -{ -// Transform from local to global space coordinates -// -// upper plane (y>0) even slat number is shifted down -// upper plane (y>0) odd slat number is shifted up -// lower plane (y<0) even slat number is shifted up -// lower plane (y<0) odd slat number is shifted down -// - - x = (xlocal + fXPosition[islat])*fSym; - y = (ylocal + fYPosition[islat]); - -// z = (TMath::Even(islat)) ? fDz : -fDz ; //Change for new referential -// z = (x>0) ? z+2.*fDz : z-2.*fDz ; -// z+=fChamber->Z(); - -// z-position - z = (TMath::Even(islat)) ? -fDzSlat : fDzSlat ; //Change for new referential - z = (x>0) ? -z + fDzCh : z - fDzCh; - z += fChamber->Z(); - -} - -//_________________________________________________ -void AliMUONSegmentationSlat::LocalToGlobal ( - Int_t islat, Int_t ixlocal, Int_t iylocal, Int_t &ix, Int_t &iy) const -{ -// Transform from local to global pad coordinates -// - Int_t i; - iy=iylocal; - -// -// Find slat number (index) and iylocal - for (i=0; iNpy(); - - ix=ixlocal*fSym; - iy=iy; -} - -//_________________________________________________ -void AliMUONSegmentationSlat::SetSymmetry(Int_t ix) -{ -// Set set signs for symmetry transformation - fSym = TMath::Sign(1,ix); -} - -//_________________________________________________ -void AliMUONSegmentationSlat::SetSymmetry(Float_t x) -{ -// Set set signs for symmetry transformation - fSym = Int_t (TMath::Sign((Float_t)1.,x)); -} - -//_________________________________________________ -void AliMUONSegmentationSlat:: -GetPadI(Float_t x, Float_t y, Float_t z, Int_t &ix, Int_t &iy) -{ -// Returns pad coordinates for given set of space coordinates - - Int_t islat, i; - Float_t xlocal, ylocal; - - GlobalToLocal(x,y,z,islat,xlocal,ylocal); - if (islat == -1) { - ix = 0; iy = 0; - return; - } - - Slat(islat)->GetPadI(xlocal, ylocal, ix, iy); - for (i = 0; i < islat; i++) iy += Slat(islat)->Npy(); - - ix = ix*Int_t(TMath::Sign((Float_t)1.,x)); -} - -//_________________________________________________ -void AliMUONSegmentationSlat:: -GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z) -{ -// Returns real coordinates (x,y) for given pad coordinates (ix,iy) -// - Int_t islat, ixlocal, iylocal; -// -// Delegation of transforamtion to slat - GlobalToLocal(ix,iy,islat,ixlocal,iylocal); - Slat(islat)->GetPadC(ixlocal, iylocal, x, y); -// Slat offset - x += fXPosition[islat]; - y += fYPosition[islat]; - -// Symmetry transformation of half planes - x = x * TMath::Sign(1,ix); - -// z-position - z = (TMath::Even(islat)) ? -fDzSlat : fDzSlat ; //Change for new referential - z = (x>0) ? -z + fDzCh : z - fDzCh; - z += fChamber->Z(); -} - -//_________________________________________________ -Int_t AliMUONSegmentationSlat::ISector() -{ -// Returns current sector during tracking - Int_t iregion; - - iregion = fCurrentSlat->ISector(); - return 100*fSlatIndex+iregion; -} - -//_________________________________________________ -Int_t AliMUONSegmentationSlat::Sector(Int_t ix, Int_t iy) -{ -// Returns sector for pad coordiantes (ix,iy) - Int_t ixlocal, iylocal, iregion, islat; - - GlobalToLocal(ix,iy,islat,ixlocal,iylocal); - - iregion = Slat(islat)->Sector(ixlocal, iylocal); - return 100*islat+iregion; -} - -//_________________________________________________ -void AliMUONSegmentationSlat::SetPad(Int_t ix, Int_t iy) -{ - // - // Sets virtual pad coordinates, needed for evaluating pad response - // outside the tracking program - Int_t islat, ixlocal, iylocal; - - SetSymmetry(ix); - - GlobalToLocal(ix,iy,islat,ixlocal,iylocal); - fSlatIndex=islat; - fCurrentSlat=Slat(islat); - fCurrentSlat->SetPad(ixlocal, iylocal); -} - -//_________________________________________________ -void AliMUONSegmentationSlat::SetHit(Float_t xhit, Float_t yhit, Float_t zhit) -{ // - // Sets current hit coordinates - - Float_t xlocal, ylocal; - Int_t islat; - - - - GlobalToLocal(xhit,yhit,zhit,islat,xlocal,ylocal); - fSlatIndex=islat; - if (islat < 0) printf("\n SetHit: %d", islat); - - fCurrentSlat=Slat(islat); - fCurrentSlat->SetHit(xlocal, ylocal); -} - -//_________________________________________________ -void AliMUONSegmentationSlat:: -FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, Float_t dx, Float_t dy) -{ -// Initialises iteration over pads for charge distribution algorithm -// - - - Int_t islat; - Float_t xlocal, ylocal; - GlobalToLocal(xhit, yhit, zhit, islat, xlocal, ylocal); - fSlatIndex=islat; - if (islat>-1) { - fCurrentSlat=Slat(islat); - fCurrentSlat->FirstPad(xlocal, ylocal, dx, dy); - } - -} - -//_________________________________________________ -void AliMUONSegmentationSlat::NextPad() -{ -// Stepper for the iteration over pads -// - fCurrentSlat->NextPad(); -} - -//_________________________________________________ -Int_t AliMUONSegmentationSlat::MorePads() -// Stopping condition for the iterator over pads -// -// Are there more pads in the integration region -{ - return fCurrentSlat->MorePads(); -} - -//_________________________________________________ -void AliMUONSegmentationSlat:: -IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2) -{ -// Returns integration limits for current pad -// - - fCurrentSlat->IntegrationLimits(x1, x2, y1, y2); - -} - -//_________________________________________________ -void AliMUONSegmentationSlat:: -Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) -{ -// Returns list of neighbours of pad with coordinates iX, iY - - Int_t i, xListLocal[10], yListLocal[10], iXlocal, iYlocal, islat; - - SetSymmetry(iX); - - GlobalToLocal(iX, iY, islat, iXlocal, iYlocal); - - Slat(islat)->Neighbours(iXlocal, iYlocal, Nlist, xListLocal, yListLocal); - - for (i=0; i<*Nlist; i++) LocalToGlobal(islat, xListLocal[i], yListLocal[i], Xlist[i], Ylist[i]); - -} - -//_________________________________________________ -Int_t AliMUONSegmentationSlat::Ix() -{ -// Return current pad coordinate ix during stepping - Int_t ixl,iyl,ix,iy; - ixl=fCurrentSlat->Ix(); - iyl=fCurrentSlat->Iy(); - LocalToGlobal(fSlatIndex, ixl, iyl, ix, iy); - - Int_t ixc, iyc, isc; - Float_t xc, yc; - GlobalToLocal(ix, iy, isc, ixc, iyc); - - Slat(isc)->GetPadC(ixc,iyc,xc,yc); - return ix; -} - -//_________________________________________________ -Int_t AliMUONSegmentationSlat::Iy() -{ -// Return current pad coordinate iy during stepping - Int_t ixl,iyl,ix,iy; - ixl=fCurrentSlat->Ix(); - iyl=fCurrentSlat->Iy(); - LocalToGlobal(fSlatIndex, ixl, iyl, ix, iy); - return iy; -} - -//_________________________________________________ -Int_t AliMUONSegmentationSlat::SigGenCond(Float_t x, Float_t y, Float_t z) -{ - // Signal Generation Condition during Stepping -// -// True if signal generation condition fullfilled - Float_t xlocal, ylocal; - Int_t islat; - GlobalToLocal(x, y, z, islat, xlocal, ylocal); - return Slat(islat)->SigGenCond(xlocal, ylocal, z); -} - -//_________________________________________________ -void AliMUONSegmentationSlat::SigGenInit(Float_t x, Float_t y, Float_t z) -{ - -// Initialize the signal generation condition -// - Float_t xlocal, ylocal; - Int_t islat; - - GlobalToLocal(x, y, z, islat, xlocal, ylocal); - Slat(islat)->SigGenInit(xlocal, ylocal, z); -} - -//_________________________________________________ -void AliMUONSegmentationSlat::Init(Int_t chamber) -{ -// -// Initialize slat modules of quadrant +/+ -// The other three quadrants are handled through symmetry transformations -// - //printf("\n Initialise Segmentation Slat \n"); -// - -// Initialize Slat modules - Int_t islat, i; - Int_t ndiv[4]; -// Pad division - for (i=0; i<4; i++) ndiv[i]=(*fNDiv)[i]; - -// Slat height - fSlatY=40.; - for (i=0; i<15; i++) fSlatX[i]=0.; - -// shifts in z direction - fDzSlat = AliMUONConstants::DzSlat(); - fDzCh = AliMUONConstants::DzCh(); - -// Initialize array of slats - fSlats = new TObjArray(fNSlats); -// Maximum number of strips (pads) in x and y - fNpy=0; - fNpx=0; -// for each slat in the quadrant (+,+) - for (islat=0; islatAddAt(CreateSlatModule(),islat); - - AliMUONSegmentationSlatModule *slat = Slat(islat); - // Configure Slat - slat->SetId(islat); - -// Foward pad size - slat->SetPadSize(fDpx, fDpy); -// Forward wire pitch - slat->SetDAnod(fWireD); -// Foward segmentation - slat->SetPadDivision(ndiv); - slat->SetPcbBoards(fPcb[islat]); -// Initialize slat module - slat->Init(chamber); -// y-position of slat module relative to the first (closest to the beam) -// fYPosition[islat]= fYPosOrigin+islat*(fSlatY-2.*fShift); -// - fNpy+=slat->Npy(); - if (slat->Npx() > fNpx) fNpx=slat->Npx(); - Int_t isec; - for (isec=0; isec< 4; isec++) - { - fSlatX[islat]+=40.*fPcb[islat][isec]; - } - - } -// Set parent chamber number - AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); - fChamber=&(pMUON->Chamber(chamber)); - fId=chamber; -} - -//_________________________________________________ -void AliMUONSegmentationSlat::SetNPCBperSector(Int_t *npcb) -{ - // PCB distribution for station 4 (6 rows with 1+3 segmentation regions) - for (Int_t islat=0; islatAt(index)); -} - -//_________________________________________________ -AliMUONSegmentationSlatModule* AliMUONSegmentationSlat:: -CreateSlatModule() const -{ - // Factory method for slat module - return new AliMUONSegmentationSlatModule(4); -} - -//_________________________________________________ -void AliMUONSegmentationSlat::Draw(const char* opt) -{ - // Draw method for event display - // - if (!strcmp(opt,"eventdisplay")) { - const int kColorMUON1 = kYellow; - const int kColorMUON2 = kBlue; - // - // Drawing Routines for example for Event Display - Int_t i,j; - Int_t npcb[15]; - char nameChamber[9], nameSlat[9], nameNode[9]; - - // - // Number of modules per slat - for (i = 0; i < fNSlats; i++) { - npcb[i] = 0; - for (j = 0; j < 4; j++) npcb[i] += fPcb[i][j]; - } - // - TNode* top=gAlice->GetGeometry()->GetNode("alice"); - sprintf(nameChamber,"C_MUON%d",fId+1); - new TBRIK(nameChamber,"Mother","void",340,340,5.); - top->cd(); - sprintf(nameNode,"MUON%d",100+fId+1); - TNode* node = new TNode(nameNode,"Chambernode",nameChamber,0,0,fChamber->Z(),""); - - node->SetLineColor(kBlack); - AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); - (pMUON->Nodes())->Add(node); - TNode* nodeSlat; - Int_t color; - - for (j = 0; j < fNSlats; j++) { - sprintf(nameSlat,"SLAT%d",100*fId+1+j); - Float_t dx = 20.*npcb[j]; - Float_t dy = 20; - new TBRIK(nameSlat,"Slat Module","void",dx,20.,0.25); - node->cd(); - color = TMath::Even(j) ? kColorMUON1 : kColorMUON2; - - sprintf(nameNode,"SLAT%d",100*fId+1+j); - nodeSlat = - new TNode(nameNode,"Slat Module",nameSlat, dx+fXPosition[j],fYPosition[j]+dy,0,""); - nodeSlat->SetLineColor(color); - node->cd(); - sprintf(nameNode,"SLAT%d",100*fId+1+j+fNSlats); - nodeSlat = - new TNode(nameNode,"Slat Module",nameSlat,-dx-fXPosition[j],fYPosition[j]+dy,0,""); - nodeSlat->SetLineColor(color); - } - } -} - - - diff --git a/MUON/AliMUONSegmentationSlatModule.cxx b/MUON/AliMUONSegmentationSlatModule.cxx deleted file mode 100644 index 8b599d82c7e..00000000000 --- a/MUON/AliMUONSegmentationSlatModule.cxx +++ /dev/null @@ -1,442 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -///////////////////////////////////////////////////// -// Segmentation classes for slat modules // -// to be used with AluMUONSegmentationSlat // -///////////////////////////////////////////////////// - -#include -#include - -#include "AliMUONSegmentationSlatModule.h" -#include "AliLog.h" - -//___________________________________________ -ClassImp(AliMUONSegmentationSlatModule) - -AliMUONSegmentationSlatModule::AliMUONSegmentationSlatModule() - : AliMUONSegmentationV0() -{ -// Default constructor - fNDiv = 0; - fDpxD = 0; -} - -AliMUONSegmentationSlatModule::AliMUONSegmentationSlatModule(Int_t nsec) - : AliMUONSegmentationV0() -{ -// Non default constructor - fNsec = nsec; - fNDiv = new TArrayI(fNsec); - fDpxD = new TArrayF(fNsec); - (*fNDiv)[0]=(*fNDiv)[1]=(*fNDiv)[2]=(*fNDiv)[3]=0; - (*fDpxD)[0]=(*fDpxD)[1]=(*fDpxD)[2]=(*fDpxD)[3]=0; -} - -//---------------------------------------------------------------------- -AliMUONSegmentationSlatModule::AliMUONSegmentationSlatModule( - const AliMUONSegmentationSlatModule& rhs) - : AliMUONSegmentationV0(rhs) -{ -// Protected copy constructor - - AliFatal("Not implemented."); -} - - -AliMUONSegmentationSlatModule::~AliMUONSegmentationSlatModule() -{ -// Destructor - if (fNDiv) delete fNDiv; - if (fDpxD) delete fDpxD; -} - -//---------------------------------------------------------------------- -AliMUONSegmentationSlatModule& -AliMUONSegmentationSlatModule::operator=( - const AliMUONSegmentationSlatModule& rhs) -{ -// Protected assignement operator - - if (this == &rhs) return *this; - - AliFatal("Not implemented."); - - return *this; -} - -void AliMUONSegmentationSlatModule::SetPcbBoards(Int_t n[4]) -{ -// -// Set Pcb Board segmentation zones - for (Int_t i=0; i<4; i++) fPcbBoards[i]=n[i]; -} - - -void AliMUONSegmentationSlatModule::SetPadDivision(Int_t ndiv[4]) -{ -// -// Defines the pad size perp. to the anode wire (y) for different sectors. -// Pad sizes are defined as integral fractions ndiv of a basis pad size -// fDpx -// - for (Int_t i=0; i<4; i++) { - (*fNDiv)[i]=ndiv[i]; - } - ndiv[0]=ndiv[1]; -} - -Float_t AliMUONSegmentationSlatModule::Dpx(Int_t isec) const -{ -// Return x-strip width - return (*fDpxD)[isec]; -} - - -Float_t AliMUONSegmentationSlatModule::Dpy(Int_t /*isec*/) const -{ -// Return y-strip width - - return fDpy; -} - - -void AliMUONSegmentationSlatModule:: -GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy) -{ -// Returns pad coordinates (ix,iy) for given real coordinates (x,y) -// - iy = Int_t(y/fDpy)+1; - if (iy > fNpy) iy= fNpy; -// -// Find sector isec - - Int_t isec=-1; - for (Int_t i=fNsec-1; i > 0; i--) { - if (x >= fCx[i-1]) { - isec=i; - if (fCx[isec] == fCx[isec-1] && isec > 1) isec--; - break; - } - } - - if (isec>0) { - ix= Int_t((x-fCx[isec-1])/(*fDpxD)[isec]) - +fNpxS[isec-1]+1; - } else if (isec == 0) { - ix= Int_t(x/(*fDpxD)[isec])+1; - } else { - ix=0; - iy=0; - } -} - -void AliMUONSegmentationSlatModule:: -GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) -{ -// Returns real coordinates (x,y) for given pad coordinates (ix,iy) -// - y = Float_t(iy*fDpy)-fDpy/2.; -// -// Find sector isec - Int_t isec=AliMUONSegmentationSlatModule::Sector(ix,iy); - if (isec == -1) printf("\n PadC %d %d %d %d \n ", isec, fId, ix, iy); -// - if (isec>0) { - x = fCx[isec-1]+(ix-fNpxS[isec-1])*(*fDpxD)[isec]; - x = x-(*fDpxD)[isec]/2; - } else { - x=y=0; - } -} -//------------------------------------------------------------------------- -void AliMUONSegmentationSlatModule::GetPadI(Float_t x, Float_t y , Float_t /*z*/, Int_t &ix, Int_t &iy) -{ - GetPadI(x, y, ix, iy); -} -//------------------------------------------------------------------------- -void AliMUONSegmentationSlatModule:: -SetPad(Int_t ix, Int_t iy) -{ - // - // Sets virtual pad coordinates, needed for evaluating pad response - // outside the tracking program - GetPadC(ix,iy,fX,fY); - fSector=Sector(ix,iy); -} - -void AliMUONSegmentationSlatModule:: -SetHit(Float_t x, Float_t y) -{ -// Set current hit -// - fXhit = x; - fYhit = y; - - if (x < 0) fXhit = 0; - if (y < 0) fYhit = 0; - - if (x >= fCx[fNsec-1]) fXhit = fCx[fNsec-1]; - if (y >= fDyPCB) fYhit = fDyPCB; - - -} -//---------------------------------------------------------- -void AliMUONSegmentationSlatModule::SetHit(Float_t xhit, Float_t yhit, Float_t /*zhit*/) -{ - SetHit(xhit, yhit); -} -//---------------------------------------------------------- -void AliMUONSegmentationSlatModule:: -FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy) -{ -// Initialises iteration over pads for charge distribution algorithm -// - // - // Find the wire position (center of charge distribution) - Float_t x0a=GetAnod(xhit); - fXhit=x0a; - fYhit=yhit; - // - // and take fNsigma*sigma around this center - Float_t x01=x0a - dx; - Float_t x02=x0a + dx; - Float_t y01=yhit - dy; - Float_t y02=yhit + dy; - if (x01 < 0) x01 = 0; - if (y01 < 0) y01 = 0; - - if (x02 >= fCx[fNsec-1]) x02 = fCx[fNsec-1]; - - - - Int_t isec=-1; - for (Int_t i=fNsec-1; i > 0; i--) { - if (x02 >= fCx[i-1]) { - isec=i; - if (fCx[isec] == fCx[isec-1] && isec > 1) isec--; - break; - } - } - y02 += Dpy(isec); - if (y02 >= fDyPCB) y02 = fDyPCB; - - // - // find the pads over which the charge distributes - GetPadI(x01,y01,fIxmin,fIymin); - GetPadI(x02,y02,fIxmax,fIymax); - - if (fIxmax > fNpx) fIxmax=fNpx; - if (fIymax > fNpyS[isec]) fIymax = fNpyS[isec]; - - fXmin=x01; - fXmax=x02; - fYmin=y01; - fYmax=y02; - - // - // Set current pad to lower left corner - if (fIxmax < fIxmin) fIxmax=fIxmin; - if (fIymax < fIymin) fIymax=fIymin; - fIx=fIxmin; - fIy=fIymin; - - GetPadC(fIx,fIy,fX,fY); - fSector=Sector(fIx,fIy); -/* - printf("\n \n First Pad: %d %d %f %f %d %d %d %f" , - fIxmin, fIxmax, fXmin, fXmax, fNpx, fId, isec, Dpy(isec)); - printf("\n \n First Pad: %d %d %f %f %d %d %d %f", - fIymin, fIymax, fYmin, fYmax, fNpyS[isec], fId, isec, Dpy(isec)); -*/ -} -//---------------------------------------------------------------------- -void AliMUONSegmentationSlatModule::FirstPad(Float_t xhit, Float_t yhit, Float_t /*zhit*/, Float_t dx, Float_t dy) -{ - FirstPad(xhit, yhit, dx, dy); -} -//---------------------------------------------------------------------- -void AliMUONSegmentationSlatModule::NextPad() -{ -// Stepper for the iteration over pads -// -// Step to next pad in the integration region -// step from left to right - if (fIx != fIxmax) { - fIx++; - GetPadC(fIx,fIy,fX,fY); - fSector=Sector(fIx,fIy); -// step up - } else if (fIy != fIymax) { - fIx=fIxmin; - fIy++; - GetPadC(fIx,fIy,fX,fY); - fSector=Sector(fIx,fIy); - - } else { - fIx=-1; - fIy=-1; - } -// printf("\n Next Pad %d %d %f %f %d %d %d %d %d ", -} - - -Int_t AliMUONSegmentationSlatModule::MorePads() -{ -// Stopping condition for the iterator over pads -// -// Are there more pads in the integration region - - return (fIx != -1 || fIy != -1); -} - - -Int_t AliMUONSegmentationSlatModule::Sector(Int_t ix, Int_t iy) -{ -// -// Determine segmentation zone from pad coordinates -// - Int_t isec=-1; - for (Int_t i=0; i < fNsec; i++) { - if (ix <= fNpxS[i]) { - isec=i; - break; - } - } - if (isec == -1) printf("\n Sector: Attention isec ! %d %d %d %d \n", - fId, ix, iy,fNpxS[3]); - - return isec; - -} - -void AliMUONSegmentationSlatModule:: -IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2) -{ -// Returns integration limits for current pad -// - - x1=fXhit-fX-Dpx(fSector)/2.; - x2=x1+Dpx(fSector); - y1=fYhit-fY-Dpy(fSector)/2.; - y2=y1+Dpy(fSector); -// printf("\n Integration Limits %f %f %f %f %d %f", x1, x2, y1, y2, fSector, Dpx(fSector)); - -} - -void AliMUONSegmentationSlatModule:: -Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) -{ -// Returns list of next neighbours for given Pad (iX, iY) -// -// - Int_t i=0; -// -// step right - if (iX+1 <= fNpx) { - Xlist[i]=iX+1; - Ylist[i++]=iY; - } -// -// step left - if (iX-1 > 0) { - Xlist[i]=iX-1; - Ylist[i++]=iY; - } - -// -// step up - if (iY+1 <= fNpy) { - Xlist[i]=iX; - Ylist[i++]=iY+1; - } -// -// step down - if (iY-1 > 0) { - Xlist[i]=iX; - Ylist[i++]=iY-1; - } - - *Nlist=i; -} - - -void AliMUONSegmentationSlatModule::Init(Int_t chamber) -{ -// -// Fill the arrays fCx (x-contour) and fNpxS (ix-contour) for each sector -// These arrays help in converting from real to pad co-ordinates and -// vice versa -// -// Segmentation is defined by rectangular modules approximating -// concentric circles as shown below -// -// PCB module size in cm - // printf("\n Initialise Segmentation SlatModule \n"); - - fDxPCB=40; - fDyPCB=40; -// -// number of pad rows per PCB -// - Int_t nPyPCB=Int_t(fDyPCB/fDpy); -// -// maximum number of pad rows - fNpy=nPyPCB; -// -// Calculate padsize along x - (*fDpxD)[fNsec-1]=fDpx; - if (fNsec > 1) { - for (Int_t i=fNsec-2; i>=0; i--){ - (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i]; - } - } -// -// fill the arrays defining the pad segmentation boundaries -// -// -// Loop over sectors (isec=0 is the dead space surounding the beam pipe) - for (Int_t isec=0; isec<4; isec++) { - if (isec==0) { - fNpxS[0] = 0; - fNpyS[0] = 0; - fCx[0] = 0; - } else { - fNpxS[isec]=fNpxS[isec-1] + fPcbBoards[isec]*Int_t(fDxPCB/(*fDpxD)[isec]); - fNpyS[isec]=fNpy; - fCx[isec]=fCx[isec-1] + fPcbBoards[isec]*fDxPCB; - } - } // sectors -// maximum number of pad rows - fNpy=nPyPCB; - fNpx=fNpxS[3]; -// - fId = chamber; -} - - - - - - - - - - - - diff --git a/MUON/AliMUONSegmentationSlatModuleN.cxx b/MUON/AliMUONSegmentationSlatModuleN.cxx deleted file mode 100644 index 5165795c4eb..00000000000 --- a/MUON/AliMUONSegmentationSlatModuleN.cxx +++ /dev/null @@ -1,272 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -///////////////////////////////////////////////////// -// Segmentation classes for slat modules // -// to be used with AluMUONSegmentationSlat // -///////////////////////////////////////////////////// - - -#include -#include - -#include "AliMUONSegmentationSlatModuleN.h" - -//___________________________________________ -ClassImp(AliMUONSegmentationSlatModuleN) - -AliMUONSegmentationSlatModuleN::AliMUONSegmentationSlatModuleN() - : AliMUONSegmentationSlatModule() -{ -// Default constructor -} - -AliMUONSegmentationSlatModuleN::AliMUONSegmentationSlatModuleN(Int_t nsec) - : AliMUONSegmentationSlatModule(nsec) -{ -// Non default constructor -} - - -Float_t AliMUONSegmentationSlatModuleN::Dpx(Int_t /*isec*/) const -{ -// -// Returns x-pad size for given sector isec - return fDpx; -} - -Float_t AliMUONSegmentationSlatModuleN::Dpy(Int_t isec) const -{ -// -// Returns y-pad size for given sector isec - return (*fDpxD)[isec]; -} - - -void AliMUONSegmentationSlatModuleN:: -GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy) -{ -// Returns pad coordinates (ix,iy) for given real coordinates (x,y) -// - ix = Int_t(x/fDpx)+1; - if (ix > fNpx) ix= fNpx; -// -// Find sector isec - Int_t isec=-1; - for (Int_t i = fNsec-1; i > 0; i--) { - if (x >= fCx[i-1]) { - isec=i; - if (fCx[isec] == fCx[isec-1] && isec > 1) isec--; - break; - } - } -// -// - - if (isec == -1) { - ix = 0; - iy = 0; - } else { - iy = Int_t(y/(*fDpxD)[isec])+1; - } -} - -void AliMUONSegmentationSlatModuleN:: -GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) -{ -// Returns real coordinates (x,y) for given pad coordinates (ix,iy) -// - x = Float_t(ix*fDpx)-fDpx/2.; -// -// Find sector isec - Int_t isec=Sector(ix,iy); - if (isec == -1) printf("\n gtpadc2 Warning isec !\n"); - y = iy*(*fDpxD)[isec]-(*fDpxD)[isec]/2.; -} - - -void AliMUONSegmentationSlatModuleN::NextPad() -{ -// Stepper for the iteration over pads -// - Float_t xc,yc; - Int_t ixc; - // step up - if ((fY + Dpy(fSector)) < fYmax) { - fIy++; - GetPadC(fIx,fIy,fX,fY); -// step right - } else if (fIx != fIxmax) { - fIx++; -// get y-position of next row (yc), xc not used here - GetPadC(fIx,fIy,xc,yc); -// get x-pad coordiante for 1 pad in row (fIx) - GetPadI(xc,fYmin,ixc,fIy); - GetPadC(fIx,fIy,fX,fY); - fSector=Sector(fIx,fIy); - } else { - fIx=fIy=-1; - } - - if (fIy > fNpyS[fSector]) printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy); - GetPadC(fIx, fIy, xc, yc); -// printf("\n Next Pad (n)%d %d %f %f %d %f %d ", fIx,fIy,fX,fY,fSector, fYmax, fIxmax); -} - -Int_t AliMUONSegmentationSlatModuleN::MorePads() -{ -// Stopping condition for the iterator over pads -// -// -// Are there more pads in the integration region - - if (fIy == -1) { - return 0; - } else { - return 1; - } -} - -void AliMUONSegmentationSlatModuleN:: -Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) -{ -// Returns list of next neighbours for given Pad (iX, iY) -// -// - Int_t i=0; - Float_t x,y; - Int_t ix,iy,isec1,isec2; - Float_t kEpsil= 0.001; - -// -// step up - Int_t isec=Sector(iX, iY); - - if (iY+1 <= fNpyS[isec]) { - Xlist[i]=iX; - Ylist[i++]=iY+1; - } -// -// step down - if (iY-1 > 0) { - Xlist[i]=iX; - Ylist[i++]=iY-1; - } -// -// -// step right - - if (iX+1 <= fNpx) { - - - GetPadC(iX, iY, x, y); - GetPadI(x+fDpx, y, ix, iy); - Xlist[i]=iX+1; - Ylist[i++]=iy; - } -// -// step left - if (iX-1 > 0) { - isec1=Sector(iX, iY); - isec2=Sector(iX-1, iY); - if (isec1==isec2) { - Xlist[i]=iX-1; - Ylist[i++]=iY; - } else { - GetPadC(iX, iY, x, y); - GetPadI(x-fDpx, y+kEpsil, ix, iy); - if (ix != -1) { - Xlist[i]=iX-1; - Ylist[i++]=iy; - } - GetPadI(x-fDpx, y-kEpsil, ix, iy); - if (ix != -1) { - Xlist[i]=iX-1; - Ylist[i++]=iy; - } - } - } - *Nlist=i; -} - - -void AliMUONSegmentationSlatModuleN::Init(Int_t chamber) -{ -// -// Fill the arrays fCx (x-contour) for each sector -// These arrays help in converting from real to pad co-ordinates and -// vice versa -// -// Segmentation is defined by rectangular modules approximating -// concentric circles as shown below -// -// PCB module size in cm - - // printf("\n Initialise Segmentation SlatModuleN \n"); - - - fDxPCB=40; - fDyPCB=40; -// -// number of pad rows per PCB -// - fNpxPCB = Int_t(fDxPCB/fDpx) ; -// -// Calculate padsize along y - (*fDpxD)[fNsec-1]=fDpy; - if (fNsec > 1) { - for (Int_t i=fNsec-2; i>=0; i--){ - (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i]; - } - } -// -// fill the arrays defining the pad segmentation boundaries -// -// -// Loop over sectors (isec=0 is the dead space surounding the beam pipe) - - for (Int_t isec=0; isec<4; isec++) { - if (isec==0) { - fCx[0] = 0; - fNpxS[0] = 0; - fNpyS[0] = 0; - } else { - fNpxS[isec] = fNpxS[isec-1] + fPcbBoards[isec]*fNpxPCB; - fNpyS[isec] = Int_t(fDyPCB/fDpy)*(*fNDiv)[isec]; - fCx[isec] = fCx[isec-1] + fPcbBoards[isec]*fDxPCB; - fNpx += fPcbBoards[isec] * fNpxPCB; - } - } // sectors - - fNpx=fNpxS[3]; - fNpy=Int_t(fDyPCB/fDpy)*(*fNDiv)[1]; -// - fId = chamber; - -} - - - - - - - - - - - - diff --git a/MUON/AliMUONSegmentationSlatN.cxx b/MUON/AliMUONSegmentationSlatN.cxx deleted file mode 100644 index d5d075b148e..00000000000 --- a/MUON/AliMUONSegmentationSlatN.cxx +++ /dev/null @@ -1,142 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -#include -#include - -#include "AliMUONSegmentationSlatN.h" -#include "AliMUONSegmentationSlatModuleN.h" - -//___________________________________________ -ClassImp(AliMUONSegmentationSlatN) - -AliMUONSegmentationSlatN::AliMUONSegmentationSlatN() - : AliMUONSegmentationSlat() -{ -// Default constructor -} - - -AliMUONSegmentationSlatN::AliMUONSegmentationSlatN(Int_t nsec) - : AliMUONSegmentationSlat(nsec) -{ -// Non default constructor -} - - -Float_t AliMUONSegmentationSlatN::Dpx(Int_t /*isec*/) const -{ -// -// Returns y-pad size for given sector isec - return fDpx; -} - -Float_t AliMUONSegmentationSlatN::Dpy(Int_t isec) const -{ -// -// Returns x-pad size for given sector isec -// isec = 100*islat+iregion -// - Int_t islat, iregion; - islat = isec/100; - iregion = isec%100; - return Slat(islat)->Dpy(iregion); -} - - - -void AliMUONSegmentationSlatN::GlobalToLocal( - Int_t ix, Int_t iy, Int_t &islat, Int_t &ixlocal, Int_t &iylocal) const -{ -// -// Perform local to global transformation for pad coordinates -// - Int_t iytemp = iy; - Int_t index = 0; - - iylocal = iytemp; - ix=TMath::Abs(ix); - -// -// Find slat number (index) and iylocal - for (Int_t i=0; iNpx()) { - Int_t isec=Slat(i)->Sector(ix,1); - iytemp-=Slat(i)->Npy()*(*fNDiv)[isec]/(*fNDiv)[1]; - } - if (iytemp <= 0) break; - iylocal = iytemp; - index=i+1; - } - ixlocal=ix; - islat=index; -} - -void AliMUONSegmentationSlatN::LocalToGlobal( - Int_t islat, Int_t ixlocal, Int_t iylocal, Int_t &ix, Int_t &iy) const -{ -// Local to global transformation for pad coordinates - - Int_t i; - iy=iylocal; - -// -// Find iy global by adding iy offset from slats below - for (i=0; iNpx()) { - Int_t isec=Slat(i)->Sector(ixlocal,1); - iy+=Slat(i)->Npy()*(*fNDiv)[isec]/(*fNDiv)[1]; - } - } -// -// Perform symmetry transformation - ix=ixlocal*fSym; -} - - -void AliMUONSegmentationSlatN:: -GetPadI(Float_t x, Float_t y, Float_t z, Int_t &ix, Int_t &iy) -{ -// Returns pad coordinates for given set of space coordinates - - Int_t islat, i; - Float_t xlocal, ylocal; -// Transform to local coordinates - AliMUONSegmentationSlat::GlobalToLocal(x,y,z,islat,xlocal,ylocal); - Slat(islat)->GetPadI(xlocal, ylocal, ix, iy); -// add to local iy offfset from slats below - for (i=0; iNpx()) { - Int_t isec=Slat(i)->Sector(ix,1); - iy+=Slat(i)->Npy()*(*fNDiv)[isec]/(*fNDiv)[1]; - } - } -// Determine sign depending on quadrant - ix=ix*Int_t(TMath::Sign((Float_t)1.,x)); -} - -AliMUONSegmentationSlatModule* AliMUONSegmentationSlatN:: -CreateSlatModule() const -{ - // Factory method for slat module - return new AliMUONSegmentationSlatModuleN(4); -} - - - - - diff --git a/MUON/AliMUONSegmentationTrigger.cxx b/MUON/AliMUONSegmentationTrigger.cxx deleted file mode 100644 index d3b26e01053..00000000000 --- a/MUON/AliMUONSegmentationTrigger.cxx +++ /dev/null @@ -1,242 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -#include -//#include -//#include -//#include - -#include "AliMUONSegmentationTrigger.h" -#include "AliMUONTriggerConstants.h" -#include "AliMUONConstants.h" -#include "AliRun.h" -#include "AliMUON.h" -#include "AliMUONChamber.h" -#include "AliLog.h" - -ClassImp(AliMUONSegmentationTrigger) - -//------------------------------------------------------------------ -AliMUONSegmentationTrigger::AliMUONSegmentationTrigger() - : AliMUONSegmentationV0() -{ -// Constructor - - fChamber=0; -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTrigger::Init(Int_t chamber) -{ - // initialize Module geometry - AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); - AliMUONChamber* iChamber=&(pMUON->Chamber(chamber)); - - AliDebug(2,"Initialize Trigger Chamber Module Geometry"); - - Float_t zPos=iChamber->Z(); - Float_t z1Pos=AliMUONConstants::DefaultChamberZ(10); //cp changed - fZscale = zPos/z1Pos; - - Float_t y1Cmin[126]; - Float_t y1Cmax[126]; - - Float_t dz=7.2; - Float_t z1PosPlus=z1Pos-dz/2.; - Float_t z1PosMinus=z1Pos+dz/2.; - - Float_t z1pm=z1PosPlus/z1PosMinus; - Float_t z1mp=z1PosMinus/z1PosPlus; - - AliDebug(2,Form("fZscale = %f ",fZscale)); -// calculate yCmin and fYcmax - Int_t i; - for (i=62; i>=0; i--) { - Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left - if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) { // start with middle chamber - if (AliMUONTriggerConstants::ModuleId(i)==51) { // special case (empty module) - fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.; - } else { - y1Cmin[i]=y1Cmin[j]=-34; - y1Cmax[i]=y1Cmax[j]=34; - fYcmin[i]=fYcmin[j]=-34.; - - fYcmax[i]=fYcmax[j]=34.; - } - } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up - if (AliMUONTriggerConstants::ModuleId(i)!=41) { - y1Cmin[i]=y1Cmax[i+7]*z1pm; - y1Cmax[i]=y1Cmin[i]+68.; - fYcmin[i]=y1Cmin[i]; - fYcmax[i]=fYcmin[i]+68.; - - y1Cmin[j]=y1Cmax[j+7]*z1mp; - y1Cmax[j]=y1Cmin[j]+68.; - fYcmin[j]=y1Cmin[j]; - fYcmax[j]=fYcmin[j]+68.; - } else { - y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17; - y1Cmax[i]=y1Cmin[i]+51.; - fYcmin[i]=y1Cmin[i]; - fYcmax[i]=fYcmin[i]+51.; - - y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17; - y1Cmax[j]=y1Cmin[j]+51.; - fYcmin[j]=y1Cmin[j]; - fYcmax[j]=fYcmin[j]+51.; - } - } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) { - y1Cmin[i]=y1Cmax[i+7]*z1mp; - y1Cmax[i]=y1Cmin[i]+68.; - fYcmin[i]=y1Cmin[i]; - fYcmax[i]=fYcmin[i]+68.; - - y1Cmin[j]=y1Cmax[j+7]*z1pm; - y1Cmax[j]=y1Cmin[j]+68.; - fYcmin[j]=y1Cmin[j]; - fYcmax[j]=fYcmin[j]+68.; - } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) { - y1Cmin[i]=y1Cmax[i+7]*z1pm; - y1Cmax[i]=y1Cmin[i]+68.; - fYcmin[i]=y1Cmin[i]; - fYcmax[i]=fYcmin[i]+68.; - - y1Cmin[j]=y1Cmax[j+7]*z1mp; - y1Cmax[j]=y1Cmin[j]+68.; - fYcmin[j]=y1Cmin[j]; - fYcmax[j]=fYcmin[j]+68.; - } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) { - y1Cmin[i]=y1Cmax[i+7]*z1mp; - y1Cmax[i]=y1Cmin[i]+68.; - fYcmin[i]=y1Cmin[i]; - fYcmax[i]=fYcmin[i]+68.; - - y1Cmin[j]=y1Cmax[j+7]*z1pm; - y1Cmax[j]=y1Cmin[j]+68.; - fYcmin[j]=y1Cmin[j]; - fYcmax[j]=fYcmin[j]+68.; - } - } - - for (i=0; i<63; i++) { // second loop (fill lower part) - Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left - if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) { - fYcmin[i]=-fYcmax[i-14]; - fYcmax[i]=-fYcmin[i-14]; - fYcmin[j]=-fYcmax[j-14]; - fYcmax[j]=-fYcmin[j-14]; - } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) { - fYcmin[i]=-fYcmax[i-28]; - fYcmax[i]=-fYcmin[i-28]; - fYcmin[j]=-fYcmax[j-28]; - fYcmax[j]=-fYcmin[j-28]; - } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) { - fYcmin[i]=-fYcmax[i-42]; - fYcmax[i]=-fYcmin[i-42]; - fYcmin[j]=-fYcmax[j-42]; - fYcmax[j]=-fYcmin[j-42]; - } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) { - fYcmin[i]=-fYcmax[i-56]; - fYcmax[i]=-fYcmin[i-56]; - fYcmin[j]=-fYcmax[j-56]; - fYcmax[j]=-fYcmin[j-56]; - } - } - - fNpx=124; - fNpy=64; - -// Set parent chamber number - fChamber=&(pMUON->Chamber(chamber)); - fId=chamber; -} -//------------------------------------------------------------------ -void AliMUONSegmentationTrigger::Draw(const char * /*opt*/) {} -//------------------------------------------------------------------ -Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){ -// returns module number (from 0 to 126) corresponding to module imodule - Int_t imod=0; - for (Int_t i=0; i7) { - return AliMUONTriggerConstants::StripWidth(1); - } - else { - return 0.; - } - } else { - return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) - - AliMUONTriggerConstants::XcMin(moduleNum)) / - AliMUONTriggerConstants::NstripY(moduleNum)); - } -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit) -{ - // Sets virtual hit position, needed for evaluating pad response - // outside the tracking program - - fXhit=xhit; - fYhit=yhit; -} - - - - - - - - - diff --git a/MUON/AliMUONSegmentationTriggerX.cxx b/MUON/AliMUONSegmentationTriggerX.cxx deleted file mode 100644 index 5dc6bd78b51..00000000000 --- a/MUON/AliMUONSegmentationTriggerX.cxx +++ /dev/null @@ -1,361 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -#include -#include -#include -#include - -#include "AliMUON.h" -#include "AliMUONSegmentationTriggerX.h" -#include "AliMUONTriggerConstants.h" -#include "AliMUONChamber.h" -#include "AliRun.h" // gAlice -#include "AliLog.h" - -ClassImp(AliMUONSegmentationTriggerX) - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerX::Init(Int_t chamber) -{ -// intialize X segmentation - AliDebug(2,"Initialize Trigger Chamber Geometry X"); - AliMUONSegmentationTrigger::Init(chamber); - -// calculate x & y position of X strips - Int_t nModule=AliMUONTriggerConstants::Nmodule(); - for (Int_t imodule=0; imodulefXofxsmin[imodule][istrip]&&xfYofxsmin[imodule][istrip]&&y= 0) { - Xlist[j] = iX; - Ylist[j] = iCandidateDo; - } - } - - } // iY < nStrip -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerX::SetPad(Int_t ix, Int_t iy) -{ - // Sets virtual pad coordinates, needed for evaluating pad response - // outside the tracking program - GetPadC(ix,iy,fX,fY); - GetPadI(fX,fY,fIx,fIy); - fSector=Sector(ix,iy); -} - -//------------------------------------------------------------------ -Int_t AliMUONSegmentationTriggerX::ISector() -{ return fSector;} - -//------------------------------------------------------------------ -Int_t AliMUONSegmentationTriggerX::Ix() -{ return fIx;} - -//------------------------------------------------------------------ - -Int_t AliMUONSegmentationTriggerX::Iy() -{ return fIy;} - -//------------------------------------------------------------------ -Float_t AliMUONSegmentationTriggerX::Dpx(Int_t isec) const -{ -// returns x size of x strips for sector isec - - if (isec==1) { - return AliMUONTriggerConstants::StripLength(0)*fZscale; - } else if (isec==2) { - return AliMUONTriggerConstants::StripLength(1)*fZscale; - } else if (isec==3) { - return AliMUONTriggerConstants::StripLength(1)*fZscale; - } else if (isec==4) { - return AliMUONTriggerConstants::StripLength(1)*fZscale; - } else if (isec==5) { - return AliMUONTriggerConstants::StripLength(1)*fZscale; - } else if (isec==6) { - return AliMUONTriggerConstants::StripLength(2)*fZscale; - } else { - return 0.; - } -} - -//------------------------------------------------------------------ -Float_t AliMUONSegmentationTriggerX::Dpy(Int_t isec) const -{ -// returns y size of x strips for sector isec - - if (isec==1) { - return AliMUONTriggerConstants::StripWidth(0)*fZscale; - } else if (isec==2) { - return AliMUONTriggerConstants::StripWidth(0)*fZscale; - } else if (isec==3) { - return AliMUONTriggerConstants::StripWidth(0)*fZscale; - } else if (isec==4) { - return AliMUONTriggerConstants::StripWidth(1)*fZscale; - } else if (isec==5) { - return AliMUONTriggerConstants::StripWidth(2)*fZscale; - } else if (isec==6) { - return AliMUONTriggerConstants::StripWidth(2)*fZscale; - } else { - return 0.; - } -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerX::GetPadI(Float_t x, Float_t y, Float_t /*z*/, Int_t &ix, Int_t &iy) -{ - GetPadI(x, y, ix, iy); -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerX::SetHit(Float_t xhit, Float_t yhit) -{ -// set hit during disIntegration -AliMUONSegmentationTrigger::SetHit(xhit,yhit); -} -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerX::SetHit(Float_t xhit, Float_t yhit, Float_t /*zhit*/) -{ - SetHit(xhit, yhit); -} - -//------------------------------------------------------------------ -Int_t AliMUONSegmentationTriggerX::Sector(Int_t ix, Int_t /*iy*/) -{ -// Returns sector number for given module -// - - Int_t absix=TMath::Abs(ix); - Int_t iwidth=Int_t(StripSizeX(absix)); - - if (absix==52) { - return 1; - } else if (absix==41||absix==61) { - return 2; - } else if (iwidth==1) { - return 3; - } else if (iwidth==2) { - return 4; - } else if ((absix>=11&&absix<17)||(absix>=91&&absix<97)) { - return 5; - } else if (iwidth==4) { - return 6; - } else { - return 0; - } -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerX:: -IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& x4) -{ -// returns quantities needed to evaluate neighbour strip response - - Int_t ix,iy; - Float_t xstrip,ystrip; - GetPadI(fXhit,fYhit,ix,iy); - GetPadC(ix,iy,xstrip,ystrip); - x1=fYhit; // hit y position - x2=ystrip; // y coordinate of the main strip - x3=fY; // current strip real y coordinate - // width=StripSizeX(ix); // width of the main strip - - // find the position of the 2 borders of the current strip - Float_t ymin = fYofxsmin[ModuleNumber(fIx)][fIy]; - Float_t ymax = fYofxsmax[ModuleNumber(fIx)][fIy]; - - // dist. between the hit and the closest border of the current strip - x4 = (TMath::Abs(ymax-x1) > TMath::Abs(ymin-x1)) ? - TMath::Abs(ymin-x1):TMath::Abs(ymax-x1); - -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerX::Draw(const char* opt) -{ -// Draw method for event display - if (!strcmp(opt,"eventdisplay")) { - - TNode *node, *nodeS; - char nameChamber[10], nameNode[12]; - char nameSense1[10], nameSense2[10], nameSense3[10], nameSense4[10]; - - TNode* top=gAlice->GetGeometry()->GetNode("alice"); - sprintf(nameChamber,"C_MUON%d",fId+1); - new TBRIK(nameChamber,"Mother","void",340.,340.,0.25); - top->cd(); - sprintf(nameNode,"MUON%d",100+fId+1); - node = new TNode(nameNode,"Chambernode",nameChamber,0,0,fChamber->Z(),""); - node->SetLineColor(kBlack); - AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); - (pMUON->Nodes())->Add(node); - - sprintf(nameSense1,"S1_MUON%d",fId+1); - sprintf(nameSense2,"S2_MUON%d",fId+1); - sprintf(nameSense3,"S3_MUON%d",fId+1); - sprintf(nameSense4,"S4_MUON%d",fId+1); - - for (Int_t imodule=0; imodulecd(); - sprintf(nameNode,"S_MUON%d",1000*fId+1+imodule); - - if (TMath::Abs(idModule)==41||TMath::Abs(idModule)==61) { - nodeS = new TNode(nameNode,"Module",nameSense3,xpos,ypos,0,""); - } else if (TMath::Abs(idModule)==52) { - nodeS = new TNode(nameNode,"Module",nameSense4,xpos,ypos,0,""); - } else if (TMath::Abs((idModule-Int_t(idModule/10)*10.))!=7) { - nodeS = new TNode(nameNode,"Module",nameSense1,xpos,ypos,0,""); - } else { - // } else if (TMath::Abs((idModule-Int_t(idModule/10)*10.))==7) { - nodeS = new TNode(nameNode,"Module",nameSense2,xpos,ypos,0,""); - } - nodeS->SetLineColor(kBlue); - node->cd(); - } - } - } -} - - - - diff --git a/MUON/AliMUONSegmentationTriggerY.cxx b/MUON/AliMUONSegmentationTriggerY.cxx deleted file mode 100644 index 4060d55d525..00000000000 --- a/MUON/AliMUONSegmentationTriggerY.cxx +++ /dev/null @@ -1,319 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -#include - -#include "AliMUONSegmentationTriggerY.h" -#include "AliMUONTriggerConstants.h" -#include "AliMUON.h" -#include "AliRun.h" -#include "AliLog.h" - -ClassImp(AliMUONSegmentationTriggerY) - -//------------------------------------------------------------------ -AliMUONSegmentationTriggerY::AliMUONSegmentationTriggerY() - : AliMUONSegmentationTrigger() -{ -// Constructor -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerY::Init(Int_t chamber) -{ -// intialize Y segmentation - AliDebug(2,"Initialize Trigger Chamber Geometry Y"); - AliMUONSegmentationTrigger::Init(chamber); - -// calculate x & y position of Y strips - Int_t nModule=AliMUONTriggerConstants::Nmodule(); - for (Int_t imodule=0; imodule7) { - fXofysmin[imodule][istrip]= - ( AliMUONTriggerConstants::XcMin(imodule)+ - (width*2.)*8 + width*(istrip-8) )*fZscale; - fXofysmax[imodule][istrip]= - ( AliMUONTriggerConstants::XcMin(imodule)+ - (width*2.)*8 + width*(istrip-7) )*fZscale; - } else { - fXofysmin[imodule][istrip]= - (AliMUONTriggerConstants::XcMin(imodule) - +width*(istrip))*fZscale; - fXofysmax[imodule][istrip]= - (AliMUONTriggerConstants::XcMin(imodule) - +width*(istrip+1))*fZscale; - - } - - } else { - fXofysmin[imodule][istrip]=-1.*fXofysmax[imodule-63][istrip]; - fXofysmax[imodule][istrip]=-1.*fXofysmin[imodule-63][istrip]; - } - fYofysmin[imodule][istrip] = fYcmin[imodule]*fZscale; - fYofysmax[imodule][istrip] = fYcmax[imodule]*fZscale; - } - } -/* - if (TMath::Abs(AliMUONTriggerConstants::ModuleId(imodule))==11) { - printf("module Id istrip fXofxsmin fXofxsmax fYofxsmin fYofxsmax %d %d %f %f %f %f \n", - AliMUONTriggerConstants::ModuleId(imodule), - istrip, - fXofysmin[imodule][istrip], - fXofysmax[imodule][istrip], - fYofysmin[imodule][istrip], - fYofysmax[imodule][istrip]); - } -*/ - -} - - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerY::GetPadI(Float_t x,Float_t y,Int_t &ix,Int_t &iy) -{ -// Returns pad coordinates (ix,iy) for given real coordinates (x,y) -// x,y = real coordinates; ix = module number , iy = strip number - - ix = 0; - iy = 0; - Int_t nModule=AliMUONTriggerConstants::Nmodule(); - for (Int_t imodule=0; imodulefXofysmin[imodule][istrip]&&xfYofysmin[imodule][istrip]&&y=0 ) { // strip in same module - Xlist[j] = absiX; - Ylist[j] = iCandidateLeft; - } else if ( iNewCandidateLeft !=0) { - Xlist[j] = absiX-1; - Ylist[j] = iNewCandidateLeft; - iNewCandidateLeft--; - } - } - - if (iX<0) { // left side of chamber - for (Int_t i=0; i<10; i++) { - if (Xlist[i]!=0) Xlist[i]=-Xlist[i]; - } - } - - } // iY < nStrip -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerY::SetPad(Int_t ix, Int_t iy) -{ - // Sets virtual pad coordinates, needed for evaluating pad response - // outside the tracking program - GetPadC(ix,iy,fX,fY); - GetPadI(fX,fY,fIx,fIy); - fSector=Sector(ix,iy); -} - -//------------------------------------------------------------------ -Int_t AliMUONSegmentationTriggerY::ISector() -{ return fSector;} - -//------------------------------------------------------------------ - -Int_t AliMUONSegmentationTriggerY::Ix() -{ return fIx;} - -//------------------------------------------------------------------ - -Int_t AliMUONSegmentationTriggerY::Iy() -{ return fIy;} - -//------------------------------------------------------------------ -Float_t AliMUONSegmentationTriggerY::Dpx(Int_t isec) const -{ -// returns x size of y strips for sector isec - if (isec==1) { - return AliMUONTriggerConstants::StripWidth(1)*fZscale; - } else if (isec==2) { - return AliMUONTriggerConstants::StripWidth(1)*fZscale; - } else if (isec==3) { - return AliMUONTriggerConstants::StripWidth(1)*fZscale; - } else if (isec==4) { - return AliMUONTriggerConstants::StripWidth(2)*fZscale; - } else { - return 0.; - } -} - -//------------------------------------------------------------------ -Float_t AliMUONSegmentationTriggerY::Dpy(Int_t isec) const -{ -// returns y size of y strips for sector isec - if (isec==1) { - return AliMUONTriggerConstants::StripLength(3)*fZscale; - } else if (isec==2) { - return AliMUONTriggerConstants::StripLength(2)*fZscale; - } else if (isec==3) { - return AliMUONTriggerConstants::StripLength(3)*fZscale; - } else if (isec==4) { - return AliMUONTriggerConstants::StripLength(3)*fZscale; - } else if (isec==5) { - return AliMUONTriggerConstants::StripLength(3)*fZscale; - } else { - return 0.; - } -} -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerY::GetPadI(Float_t x, Float_t y, Float_t /*z*/, Int_t &ix, Int_t &iy) -{ - GetPadI(x, y, ix, iy); -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerY::SetHit(Float_t xhit, Float_t yhit) -{ -// set hits during diintegration - AliMUONSegmentationTrigger::SetHit(xhit,yhit); -} -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerY::SetHit(Float_t xhit, Float_t yhit, Float_t /*zhit*/) -{ - SetHit(xhit, yhit); -} -//------------------------------------------------------------------ -Int_t AliMUONSegmentationTriggerY::Sector(Int_t ix, Int_t iy) -{ -// Returns sector number for given module -// - Int_t absix=TMath::Abs(ix); - Int_t iwidth=Int_t(StripSizeY(absix,iy)); - - if (absix==52) { - return 1; - } else if (absix==41||absix==61) { - return 2; - } else if (iwidth==2) { - return 3; - } else if (iwidth==4) { - return 4; - } else { - return 0; - } - -} - -//------------------------------------------------------------------ -void AliMUONSegmentationTriggerY:: -IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& x4) -{ -// returns quantities needed to evaluate neighbour strip response - Int_t ix,iy; - Float_t xstrip,ystrip; - GetPadI(fXhit,fYhit,ix,iy); - GetPadC(ix,iy,xstrip,ystrip); - x1=fXhit; // hit x position - x2=xstrip; // x coordinate of the main strip - x3=fX; // current strip real x coordinate - // width=StripSizeY(ix); // width of the main strip - - // find the position of the 2 borders of the current strip - Float_t xmin = fXofysmin[ModuleNumber(fIx)][fIy]; - Float_t xmax = fXofysmax[ModuleNumber(fIx)][fIy]; - - // dist. between the hit and the closest border of the current strip - x4 = (TMath::Abs(xmax-x1) > TMath::Abs(xmin-x1)) ? - TMath::Abs(xmin-x1):TMath::Abs(xmax-x1); - -} - - - - diff --git a/MUON/AliMUONSegmentationV0.cxx b/MUON/AliMUONSegmentationV0.cxx deleted file mode 100644 index 6f87562db7f..00000000000 --- a/MUON/AliMUONSegmentationV0.cxx +++ /dev/null @@ -1,347 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -#include -#include - -#include "AliMUONSegmentationV0.h" -#include "AliMUONChamber.h" -#include "AliRun.h" -#include "AliMUON.h" -#include "AliLog.h" - -ClassImp(AliMUONSegmentationV0) - -AliMUONSegmentationV0::AliMUONSegmentationV0() - : AliSegmentation() -{ - fCorr=0; - fChamber=0; -} - -AliMUONSegmentationV0::AliMUONSegmentationV0(const AliMUONSegmentationV0& segmentation) - : AliSegmentation(segmentation) -{ -// Protected copy constructor - - AliFatal("Not implemented."); -} - - -/* -// Commented out - not used - -void AliMUONSegmentationV0::Init(Int_t chamber) -{ -// Initialises member data of the segmentation from geometry data -// owned by Chamber -// - - AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); - fChamber=&(pMUON->Chamber(chamber)); - -// Initialise maximum number of pads in x ans y - fNpx=(Int_t) (fChamber->ROuter()/fDpx+1); - fNpy=(Int_t) (fChamber->ROuter()/fDpy+1); -// Initialize inner and outer radius of the sensitive region - fRmin=fChamber->RInner(); - fRmax=fChamber->ROuter(); - fCorr=0; - fZ=fChamber->Z(); - fId=chamber; -} -*/ - -Float_t AliMUONSegmentationV0::GetAnod(Float_t xhit) const -{ -// Returns for a hit position xhit the position of the nearest anode wire - Float_t wire= (xhit>0)? Int_t(xhit/fWireD)+0.5:Int_t(xhit/fWireD)-0.5; - return fWireD*wire; -} -//____________________________________________________________________________ -void AliMUONSegmentationV0::GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/, Int_t *Nparallel, Int_t *Offset) -{ - *Nparallel=1; - *Offset=0; -} - - -//____________________________________________________________________________ -void AliMUONSegmentationV0::GetPadI(Float_t x, Float_t y , Float_t /*z*/, Int_t &ix, Int_t &iy) -{ - GetPadI(x, y, ix, iy); -} -//____________________________________________________________________________ -void AliMUONSegmentationV0::SetCorrFunc(Int_t /*dum*/, TF1* func) -{ - fCorr=func; -} -//____________________________________________________________________________ -Int_t AliMUONSegmentationV0::Sector(Int_t /*ix*/, Int_t /*iy*/) -{ - return 1; -} -//____________________________________________________________________________ -Int_t AliMUONSegmentationV0::Sector(Float_t /*x*/, Float_t /*y*/) -{ - return 1; -} -//____________________________________________________________________________ -void AliMUONSegmentationV0::SetPadSize(Float_t p1, Float_t p2) -{ -// Sets the padsize -// - fDpx=p1; - fDpy=p2; -} - -void AliMUONSegmentationV0:: - GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy) -{ -// Returns pad coordinates (ix,iy) for given real coordinates (x,y) -// - ix = (x>0)? Int_t(x/fDpx)+1 : Int_t(x/fDpx)-1; - iy = (y>0)? Int_t(y/fDpy)+1 : Int_t(y/fDpy)-1; - if (iy > fNpy) iy= fNpy; - if (iy < -fNpy) iy=-fNpy; - if (ix > fNpx) ix= fNpx; - if (ix < -fNpx) ix=-fNpx; -} - -void AliMUONSegmentationV0:: -GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) -{ -// Returns real coordinates (x,y) for given pad coordinates (ix,iy) -// -// Comments and Critics: - -// The Pad(0,0) does not exist, this causes in the present version errors -// during iteration when used with hits close to zero. -// Since we have frame crosses at x=0 or y=0 this does not cause any problems -// Nevertheless, should be corrected in the next version !! -// The name fRmin is misleading although we use this version with -// a circular chamber geometry. - - x = (ix>0) ? Float_t(ix*fDpx)-fDpx/2. : Float_t(ix*fDpx)+fDpx/2.; - y = (iy>0) ? Float_t(iy*fDpy)-fDpy/2. : Float_t(iy*fDpy)+fDpy/2.; -} -//______________________________________________________________________ -void AliMUONSegmentationV0::SetHit(Float_t xhit, Float_t yhit) -{ - // - // Sets virtual hit position, needed for evaluating pad response - // outside the tracking program - fXhit=xhit; - fYhit=yhit; -} -//_______________________________________________________________________ -void AliMUONSegmentationV0::SetHit(Float_t xhit, Float_t yhit, Float_t /*zhit*/) -{ - SetHit(xhit, yhit); -} -//_______________________________________________________________________ - - -void AliMUONSegmentationV0:: -SetPad(Int_t ix, Int_t iy) -{ - // - // Sets virtual pad coordinates, needed for evaluating pad response - // outside the tracking program - GetPadC(ix,iy,fX,fY); -} -//____________________________________________________________________________________ -void AliMUONSegmentationV0::FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy) -{ -// Initialises iteration over pads for charge distribution algorithm -// - // - // Find the wire position (center of charge distribution) - Float_t x0a=GetAnod(xhit); - fXhit=x0a; - fYhit=yhit; - // - // and take fNsigma*sigma around this center - Float_t x01=x0a - dx; - Float_t x02=x0a + dx; - Float_t y01=yhit - dy; - Float_t y02=yhit + dy; - // - // find the pads over which the charge distributes - GetPadI(x01,y01,fIxmin,fIymin); - GetPadI(x02,y02,fIxmax,fIymax); - // - // Set current pad to lower left corner - fIx=fIxmin; - fIy=fIymin; - GetPadC(fIx,fIy,fX,fY); -} -//________________________________________________________________________ -void AliMUONSegmentationV0::FirstPad(Float_t xhit, Float_t yhit, Float_t /*zhit*/, Float_t dx, Float_t dy) - {FirstPad(xhit, yhit, dx, dy);} - - -void AliMUONSegmentationV0::NextPad() -{ - // Stepper for the iteration over pads - // - // Comments and Critics: - // Boundary crossing at x=0 or y=0 not correctly handled ! - // Step to next pad in the integration region - if (fIx != fIxmax) { - if (fIx==-1) fIx++; - fIx++; - } else if (fIy != fIymax) { - fIx=fIxmin; - if (fIy==-1) fIy++; - fIy++; - } else { - printf("\n Error: Stepping outside integration region\n "); - } - GetPadC(fIx,fIy,fX,fY); -} - -Int_t AliMUONSegmentationV0::MorePads() -{ -// Stopping condition for the iterator over pads -// -// Are there more pads in the integration region ? - - if (fIx == fIxmax && fIy == fIymax) { - return 0; - } else { - return 1; - - } -} - -void AliMUONSegmentationV0::SigGenInit(Float_t x,Float_t y,Float_t /*z*/) -{ -// -// Initialises pad and wire position during stepping - fXt =x; - fYt =y; - GetPadI(x,y,fIxt,fIyt); - fIwt= (x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1 ; -} - -Int_t AliMUONSegmentationV0::SigGenCond(Float_t x,Float_t y,Float_t /*z*/) -{ -// Signal generation condition during stepping -// 0: don't generate signal -// 1: generate signal -// Comments and critics: - -// Crossing of pad boundary and mid plane between neighbouring wires is checked. -// To correctly simulate the dependence of the spatial resolution on the angle -// of incidence signal must be generated for constant steps on -// the projection of the trajectory along the anode wire. - -// -// Signal will be generated if particle crosses pad boundary or -// boundary between two wires. - Int_t ixt, iyt; - GetPadI(x,y,ixt,iyt); - Int_t iwt=(x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1; - if ((ixt != fIxt) || (iyt !=fIyt) || (iwt != fIwt)) { - return 1; - } else { - return 0; - } -} -void AliMUONSegmentationV0:: -IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2) -{ -// Returns integration limits for current pad -// - x1=fXhit-fX-fDpx/2.; - x2=x1+fDpx; - y1=fYhit-fY-fDpy/2.; - y2=y1+fDpy; -} - -void AliMUONSegmentationV0:: -Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) -{ -// Returns list of next neighbours for given Pad (iX, iY) -// -// Comments and critics -// "Diagonal" neighbours are not passed -// Is this ok when we search for local maxima ?? -// No test whether neighbours have valid indices id performed - *Nlist=4; - Xlist[0]=Xlist[1]=iX; - Xlist[2]=iX-1; - Xlist[3]=iX+1; - Ylist[0]=iY-1; - Ylist[1]=iY+1; - Ylist[2]=Ylist[3]=iY; -} - -Float_t AliMUONSegmentationV0::Distance2AndOffset(Int_t iX, Int_t iY, Float_t X, Float_t Y - , Int_t * /*dummy*/) -{ -// Returns the square of the distance between 1 pad -// labelled by its Channel numbers and a coordinate - - Float_t x,y; - GetPadC(iX,iY,x,y); - return (x-X)*(x-X) + (y-Y)*(y-Y); -} - - -void AliMUONSegmentationV0::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) const -{ -// Returns test point on the pad plane. -// Used during determination of the segmoid correction of the COG-method - n=1; - x[0]=(fRmax+fRmin)/2/TMath::Sqrt(2.); - y[0]=x[0]; -} - -/* -// Commented out - not used - -void AliMUONSegmentationV0::Draw(const char *) -{ -// Draws the segmentation zones -// - TArc *circle; - Float_t scale=0.95/fRmax/2.; - - - circle = new TArc(0.5,0.5,fRmax*scale,0.,360.); - circle->SetFillColor(2); - circle->Draw(); - - circle = new TArc(0.5,0.5,fRmin*scale,0.,360.); - circle->SetFillColor(1); - circle->Draw(); -} -*/ - -AliMUONSegmentationV0& -AliMUONSegmentationV0::operator =(const AliMUONSegmentationV0 & rhs) -{ -// Protected assignement operator - - if (this == &rhs) return *this; - - AliFatal("Not implemented."); - - return *this; -} diff --git a/MUON/AliMUONSegmentationV01.cxx b/MUON/AliMUONSegmentationV01.cxx deleted file mode 100644 index 9b918623631..00000000000 --- a/MUON/AliMUONSegmentationV01.cxx +++ /dev/null @@ -1,686 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -///////////////////////////////////////////////////// -// Segmentation and Response classes version 01 // -///////////////////////////////////////////////////// - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "AliMUONSegmentationV01.h" -#include "AliMUON.h" -#include "AliMUONChamber.h" -#include "AliRun.h" -#include "AliLog.h" - - - -//___________________________________________ -ClassImp(AliMUONSegmentationV01) - -AliMUONSegmentationV01::AliMUONSegmentationV01(const AliMUONSegmentationV01& segmentation) - : AliMUONSegmentationV0(segmentation) -{ -// Protected copy constructor - - AliFatal("Not implemented."); -} - -AliMUONSegmentationV01::AliMUONSegmentationV01() - : AliMUONSegmentationV0() -{ -// Default constructor - fRSec = 0; - fNDiv = 0; - fDpxD = 0; - fCorrA = 0; - fSector = -1; -} - -AliMUONSegmentationV01::AliMUONSegmentationV01(Int_t nsec) - : AliMUONSegmentationV0() -{ -// Non default constructor - - fNsec = nsec; - fRSec = new TArrayF(fNsec); - fNDiv = new TArrayI(fNsec); - fDpxD = new TArrayF(fNsec); - - - (*fRSec)[0]=(*fRSec)[1]=(*fRSec)[2]=(*fRSec)[3]=0; - (*fNDiv)[0]=(*fNDiv)[1]=(*fNDiv)[2]=(*fNDiv)[3]=0; - (*fDpxD)[0]=(*fDpxD)[1]=(*fDpxD)[2]=(*fDpxD)[3]=0; - fCorrA = new TObjArray(3); - fCorrA->AddAt(0,0); - fCorrA->AddAt(0,1); - fCorrA->AddAt(0,2); - fOffsetY=0; - fSector = -1; -} - -AliMUONSegmentationV01::~AliMUONSegmentationV01() -{ -// Destructor - if (fRSec) delete fRSec; - if (fNDiv) delete fNDiv; - if (fDpxD) delete fDpxD; - if (fCorrA) { - fCorrA->Delete(); - delete fCorrA; - } -} - - -Float_t AliMUONSegmentationV01::Dpx(Int_t isec) const -{ -// -// Returns x-pad size for given sector isec - Float_t dpx = (*fDpxD)[isec]; - return dpx; -} - -Float_t AliMUONSegmentationV01::Dpy(Int_t /*isec*/) const -{ -// -// Returns y-pad size for given sector isec - return fDpy; -} - -void AliMUONSegmentationV01::SetSegRadii(Float_t r[4]) -{ -// -// Set the radii of the segmentation zones - for (Int_t i=0; i<4; i++) { - (*fRSec)[i]=r[i]; - } -} - - -void AliMUONSegmentationV01::SetPadDivision(Int_t ndiv[4]) -{ -// -// Defines the pad size perp. to the anode wire (y) for different sectors. -// Pad sizes are defined as integral fractions ndiv of a basis pad size -// fDpx -// - for (Int_t i=0; i<4; i++) { - (*fNDiv)[i]=ndiv[i]; - } - ndiv[0]=ndiv[1]; -} - - -void AliMUONSegmentationV01::Init(Int_t chamber) -{ -// -// Fill the arrays fCx (x-contour) and fNpxS (ix-contour) for each sector -// These arrays help in converting from real to pad co-ordinates and -// vice versa. -// This version approximates concentric segmentation zones -// - - Int_t isec; - //printf("\n Initialise Segmentation V01\n"); - - - fNpy=Int_t((*fRSec)[fNsec-1]/fDpy)+1; - - (*fDpxD)[fNsec-1]=fDpx; - if (fNsec > 1) { - for (Int_t i=fNsec-2; i>=0; i--){ - (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i]; - } - } -// -// fill the arrays defining the pad segmentation boundaries - Float_t ry; - Int_t dnx; - Int_t add; -// -// loop over sections - for(isec=0; isec (*fRSec)[isec]) { - fNpxS[isec][iy]=0; - fCx[isec][iy]=0; - } else { - ry=TMath::Sqrt((*fRSec)[isec]*(*fRSec)[isec]-x*x); - if (isec > 1) { - dnx= Int_t((ry-fCx[isec-1][iy])/(*fDpxD)[isec]); - if (isec < fNsec-1) { - if (TMath::Odd((Long_t)dnx)) dnx++; - } - fNpxS[isec][iy]=fNpxS[isec-1][iy]+dnx; - fCx[isec][iy]=fCx[isec-1][iy]+dnx*(*fDpxD)[isec]; - } else if (isec == 1) { - dnx= Int_t((ry-fCx[isec-1][iy])/(*fDpxD)[isec]); - fNpxS[isec][iy]=fNpxS[isec-1][iy]+dnx; - add=4 - (fNpxS[isec][iy])%4; - if (add < 4) fNpxS[isec][iy]+=add; - dnx=fNpxS[isec][iy]-fNpxS[isec-1][iy]; - fCx[isec][iy]=fCx[isec-1][iy]+dnx*(*fDpxD)[isec]; - } else { - dnx=Int_t(ry/(*fDpxD)[isec]); - fNpxS[isec][iy]=dnx; - fCx[isec][iy]=dnx*(*fDpxD)[isec]; - } - } - } // y-pad loop - } // sector loop - -// reference to chamber - AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); - fChamber=&(pMUON->Chamber(chamber)); - fRmin=fChamber->RInner(); - fRmax=fChamber->ROuter(); - fCorr=0; - fZ = fChamber->Z(); - fId=chamber; -} - -//______________________________________________________________________ -Int_t AliMUONSegmentationV01::Sector(Int_t ix, Int_t iy) -{ -// Returns sector number for given pad position -// - Int_t absix=TMath::Abs(ix); - Int_t absiy=TMath::Abs(iy); - Int_t isec=0; - for (Int_t i=0; i0)? - Int_t((y-fOffsetY)/fDpy)+1 - : - Int_t((y-fOffsetY)/fDpy)-1; - - if (iy > fNpy) iy= fNpy; - if (iy < -fNpy) iy=-fNpy; -// -// Find sector isec - Int_t isec=-1; - Float_t absx=TMath::Abs(x); - Int_t absiy=TMath::Abs(iy); - for (Int_t i=0; i < fNsec; i++) { - if (absx <= fCx[i][absiy]) { - isec=i; - break; - } - } - if (isec>0) { - ix= Int_t((absx-fCx[isec-1][absiy])/(*fDpxD)[isec]) - +fNpxS[isec-1][absiy]+1; - } else if (isec == 0) { - ix= Int_t(absx/(*fDpxD)[isec])+1; - } else { - ix=fNpxS[fNsec-1][absiy]+1; - } - ix = (x>0) ? ix:-ix; -} -//________________________________________________________________ -void AliMUONSegmentationV01::GetPadI(Float_t x, Float_t y , Float_t /*z*/, Int_t &ix, Int_t &iy) -{ - GetPadI(x, y, ix, iy); -} -//________________________________________________________________ - -void AliMUONSegmentationV01:: -GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) -{ -// Returns real coordinates (x,y) for given pad coordinates (ix,iy) -// - y = (iy>0) ? - Float_t(iy*fDpy)-fDpy/2.+fOffsetY - : - Float_t(iy*fDpy)+fDpy/2.+fOffsetY; - -// -// Find sector isec - Int_t isec=AliMUONSegmentationV01::Sector(ix,iy); -// - Int_t absix=TMath::Abs(ix); - Int_t absiy=TMath::Abs(iy); - if (isec) { - x=fCx[isec-1][absiy]+(absix-fNpxS[isec-1][absiy])*(*fDpxD)[isec]; - x=(ix>0) ? x-(*fDpxD)[isec]/2 : -x+(*fDpxD)[isec]/2; - } else { - x=y=0; - } - -} -//________________________________________________________________ - -void AliMUONSegmentationV01:: -GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z) -{ -// Returns real coordinates (x,y,z) for given pad coordinates (ix,iy) -// - GetPadC(ix,iy,x,y); - - // To be properly interfaced with chamber geometry (AliMUONSt1GeometryBuilderV2) ??? - TVector3 scale[4]; - scale[0] = TVector3( 1, 1, 1); // quadrant I - scale[1] = TVector3(-1, 1, -1); // quadrant II - scale[2] = TVector3(-1, -1, 1); // quadrant III - scale[3] = TVector3( 1, -1, -1); // quadrant IV - - Int_t iQuadrant; - - if (ix > 0) { - if (iy > 0) { - iQuadrant = 0; - } else { - iQuadrant = 3; - } - } else { - if (iy > 0) { - iQuadrant = 1; - } else { - iQuadrant = 2; - } - } - if (TMath::Abs(fZ) < 600) { - z = fZ + scale[iQuadrant].Z()*6.5/2.; // Station 1 - } else { - z = fZ; // Station 2 - } -} - -void AliMUONSegmentationV01:: -SetPad(Int_t ix, Int_t iy) -{ - // - // Sets virtual pad coordinates, needed for evaluating pad response - // outside the tracking program - GetPadC(ix,iy,fX,fY); - fSector=Sector(ix,iy); -} - -//______________________________________________________________________ -void AliMUONSegmentationV01::FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy) -{ -// Initialises iteration over pads for charge distribution algorithm -// - // - // Find the wire position (center of charge distribution) - Float_t x0a=GetAnod(xhit); - fXhit=x0a; - fYhit=yhit; - - // - // and take fNsigma*sigma around this center - Float_t x01=x0a - dx; - Float_t x02=x0a + dx; - Float_t y01=yhit - dy; - Float_t y02=yhit + dy; - // - // find the pads over which the charge distributes - - GetPadI(x01,y01,fIxmin,fIymin); - GetPadI(x02,y02,fIxmax,fIymax); - fXmin=x01; - fXmax=x02; - fYmin=y01; - fYmax=y02; - - // - // Set current pad to lower left corner - if (fIxmax < fIxmin) fIxmax=fIxmin; - if (fIymax < fIymin) fIymax=fIymin; - fIx=fIxmin; - fIy=fIymin; - GetPadC(fIx,fIy,fX,fY); - - // added - if (fSector == -1) { - fSector=Sector(fIx,fIy); - } -} - - -void AliMUONSegmentationV01::NextPad() -{ -// Stepper for the iteration over pads -// -// Step to next pad in the integration region - // - // Step to next pad in integration region - Float_t xc,yc; - Int_t iyc; - -// step from left to right - - if (fX < fXmax && fX != 0) { - if (fIx==-1) fIx++; - fIx++; -// step up - } else if (fIy != fIymax) { - if (fIy==-1) fIy++; - fIy++; -// get y-position of next row (yc), xc not used here - GetPadC(fIx,fIy,xc,yc); -// get x-pad coordiante for first pad in row (fIx) - GetPadI(fXmin,yc,fIx,iyc); - } else { - fIx=-1; - fIy=-1; - } - GetPadC(fIx,fIy,fX,fY); - fSector=Sector(fIx,fIy); - if (MorePads() && - (fSector ==-1 || fSector==0)) - NextPad(); -} - -Int_t AliMUONSegmentationV01::MorePads() - -{ -// Stopping condition for the iterator over pads -// -// Are there more pads in the integration region - return (fIx != -1 || fIy != -1); -/* - if ((fX >= fXmax && fIy >= fIymax) || fY==0) { - return 0; - } else { - return 1; - } -*/ -} -//______________________________________________________________________ -void AliMUONSegmentationV01::FirstPad(Float_t xhit, Float_t yhit, Float_t /*zhit*/, Float_t dx, Float_t dy) -{ - FirstPad(xhit, yhit, dx, dy); -} - - -void AliMUONSegmentationV01:: -IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2) -{ -// Returns integration limits for current pad -// - x1=fXhit-fX-Dpx(fSector)/2.; - x2=x1+Dpx(fSector); - y1=fYhit-fY-Dpy(fSector)/2.; - y2=y1+Dpy(fSector); -} - -void AliMUONSegmentationV01:: -Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) -{ -// Returns list of next neighbours for given Pad (iX, iY) -// - const Float_t kEpsilon=fDpy/1000; - - Float_t x,y; - Int_t ixx, iyy, isec1; -// - Int_t isec0=AliMUONSegmentationV01::Sector(iX,iY); - Int_t i=0; -// -// step right - Xlist[i]=iX+1; - if (Xlist[i]==0) Xlist[i]++; - Ylist[i++]=iY; -// -// step left - Xlist[i]=iX-1; - if (Xlist[i]==0) Xlist[i]--; - Ylist[i++]=iY; -// -// step up - AliMUONSegmentationV01::GetPadC(iX,iY,x,y); - AliMUONSegmentationV01::GetPadI(x+kEpsilon,y+fDpy,ixx,iyy); - Xlist[i]=ixx; - Ylist[i++]=iyy; - isec1=AliMUONSegmentationV01::Sector(ixx,iyy); - if (isec1==isec0) { -// -// no sector boundary crossing -// Xlist[i]=ixx+1; -// Ylist[i++]=iY+1; - -// Xlist[i]=ixx-1; -// Ylist[i++]=iY+1; - } else if (isec1 < isec0) { -// finer segmentation -// Xlist[i]=ixx+1; -// Ylist[i++]=iY+1; - - Xlist[i]=ixx-1; - Ylist[i++]=iyy; - -// Xlist[i]=ixx-2; -// Ylist[i++]=iY+1; - } else { -// coarser segmenation -/* - if (TMath::Odd(iX-fNpxS[isec1-1][iY+1])) { - Xlist[i]=ixx-1; - Ylist[i++]=iY+1; - } else { - Xlist[i]=ixx+1; - Ylist[i++]=iY+1; - } -*/ - } - -// -// step down - AliMUONSegmentationV01::GetPadC(iX,iY,x,y); - AliMUONSegmentationV01::GetPadI(x+kEpsilon,y-fDpy,ixx,iyy); - Xlist[i]=ixx; - Ylist[i++]=iyy; - isec1=AliMUONSegmentationV01::Sector(ixx,iyy); - if (isec1==isec0) { -// -// no sector boundary crossing -/* - Xlist[i]=ixx+1; - Ylist[i++]=iY-1; - - Xlist[i]=ixx-1; - Ylist[i++]=iY-1; -*/ - } else if (isec1 < isec0) { -// finer segmentation -// Xlist[i]=ixx+1; -// Ylist[i++]=iY-1; - - Xlist[i]=ixx-1; - Ylist[i++]=iyy; - -// Xlist[i]=ixx-2; -// Ylist[i++]=iY-1; - } else { -// coarser segmentation -/* - if (TMath::Odd(iX-fNpxS[isec1-1][iY-1])) { - Xlist[i]=ixx-1; - Ylist[i++]=iY-1; - } else { - Xlist[i]=ixx+1; - Ylist[i++]=iY-1; - } -*/ - } - *Nlist=i; -} - -void AliMUONSegmentationV01::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) const -{ -// Returns test point on the pad plane. -// Used during determination of the segmoid correction of the COG-method - - n=3; - x[0]=((*fRSec)[0]+(*fRSec)[1])/2/TMath::Sqrt(2.); - y[0]=x[0]; - x[1]=((*fRSec)[1]+(*fRSec)[2])/2/TMath::Sqrt(2.); - y[1]=x[1]; - x[2]=((*fRSec)[2]+(*fRSec)[3])/2/TMath::Sqrt(2.); - y[2]=x[2]; -} - -void AliMUONSegmentationV01::Draw(const char* opt) -{ - -// Draws the segmentation zones -// - if (!strcmp(opt,"eventdisplay")) { - const int kColorMUON = kBlue; - - TRotMatrix* rot000 = new TRotMatrix("Rot000"," ", 90, 0, 90, 90, 0, 0); - TRotMatrix* rot090 = new TRotMatrix("Rot090"," ", 90, 90, 90,180, 0, 0); - TRotMatrix* rot180 = new TRotMatrix("Rot180"," ", 90,180, 90,270, 0, 0); - TRotMatrix* rot270 = new TRotMatrix("Rot270"," ", 90,270, 90, 0, 0, 0); - - char nameChamber[9], nameSense[9], nameFrame[9], nameNode[9]; - char nameSense1[9], nameSense2[9]; - TNode *node, *nodeF; - - sprintf(nameChamber,"C_MUON%d",fId+1); - sprintf(nameSense,"S_MUON%d",fId+1); - sprintf(nameSense1,"S1_MUON%d",fId+1); - sprintf(nameSense2,"S2_MUON%d",fId+1); - sprintf(nameFrame,"F_MUON%d",fId+1); - - TNode* top=gAlice->GetGeometry()->GetNode("alice"); - - Float_t rmin = (*fRSec)[0]-3; - Float_t rmax = (*fRSec)[3]+3; - new TTUBE(nameChamber,"Mother","void",rmin,rmax,0.25,1.); - rmin = (*fRSec)[0]; - rmax = (*fRSec)[3]; - new TTUBE(nameSense,"Sens. region","void",rmin,rmax,0.25, 1.); - Float_t dx=(rmax-rmin)/2; - Float_t dy=3.; - Float_t dz=0.25; - TBRIK* frMUON = new TBRIK(nameFrame,"Frame","void",dx,dy,dz); - top->cd(); - sprintf(nameNode,"MUON%d",100+fId+1); - node = new TNode(nameNode,"ChamberNode",nameChamber,0,0,fChamber->Z(),""); - node->SetLineColor(kColorMUON); - AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); - (pMUON->Nodes())->Add(node); - node->cd(); - sprintf(nameNode,"MUON%d",200+fId+1); - node = new TNode(nameNode,"Sens. Region Node",nameSense,0,0,0,""); - node->SetLineColor(kColorMUON); - node->cd(); - Float_t dr=dx+rmin; - sprintf(nameNode,"MUON%d",300+fId+1); - nodeF = new TNode(nameNode,"Frame0",frMUON,dr, 0, 0,rot000,""); - nodeF->SetLineColor(kColorMUON); - node->cd(); - sprintf(nameNode,"MUON%d",400+fId+1); - nodeF = new TNode(nameNode,"Frame1",frMUON,0 ,dr,0,rot090,""); - nodeF->SetLineColor(kColorMUON); - node->cd(); - sprintf(nameNode,"MUON%d",500+fId+1); - nodeF = new TNode(nameNode,"Frame2",frMUON,-dr,0,0,rot180,""); - nodeF->SetLineColor(kColorMUON); - node ->cd(); - sprintf(nameNode,"MUON%d",600+fId+1); - nodeF = new TNode(nameNode,"Frame3",frMUON,0,-dr,0,rot270,""); - nodeF->SetLineColor(kColorMUON); - } else { - TBox *box; - - Float_t dx=0.95/fCx[3][1]/2; - Float_t dy=0.95/(Float_t(Npy()))/2; - Float_t x0,y0,x1,y1; - Float_t xc=0.5; - Float_t yc=0.5; - - for (Int_t iy=1; iySetFillColor(isec+1); - box->Draw(); - - box=new TBox(-x1+xc,y0+yc,-x0+xc,y1+yc); - box->SetFillColor(isec+1); - box->Draw(); - - box=new TBox(x0+xc,-y1+yc,x1+xc,-y0+yc); - box->SetFillColor(isec+1); - box->Draw(); - - box=new TBox(-x1+xc,-y1+yc,-x0+xc,-y0+yc); - box->SetFillColor(isec+1); - box->Draw(); - } - } - } -} -void AliMUONSegmentationV01::SetCorrFunc(Int_t isec, TF1* func) -{ -// Set the correction function - fCorrA->AddAt(func,isec); -} - -TF1* AliMUONSegmentationV01::CorrFunc(Int_t isec) const -{ -// Get correction function - //PH return (TF1*) (*fCorrA)[isec]; - return (TF1*) fCorrA->At(isec); -} - -AliMUONSegmentationV01& -AliMUONSegmentationV01::operator =(const AliMUONSegmentationV01 & rhs) -{ -// Protected assignement operator - - if (this == &rhs) return *this; - - AliFatal("Not implemented."); - - return *this; -} - diff --git a/MUON/AliMUONSegmentationV02.cxx b/MUON/AliMUONSegmentationV02.cxx deleted file mode 100644 index de31b6d314d..00000000000 --- a/MUON/AliMUONSegmentationV02.cxx +++ /dev/null @@ -1,170 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -///////////////////////////////////////////////////// -// Segmentation and Response classes version 02 // -///////////////////////////////////////////////////// - -#include - -#include "AliMUONSegmentationV02.h" - -//___________________________________________ -ClassImp(AliMUONSegmentationV02) - - -AliMUONSegmentationV02::AliMUONSegmentationV02() - : AliMUONSegmentationV01() -{ -// Default constructor -} - -AliMUONSegmentationV02::AliMUONSegmentationV02(Int_t nsec) - : AliMUONSegmentationV01(nsec) -{ -// Non default constructor -} - -void AliMUONSegmentationV02::SetPadSize(Float_t p1, Float_t p2) -{ -// Sets the padsize -// - fDpy=p1; - fDpx=p2; -} - -Int_t AliMUONSegmentationV02::Npx() const -// Returns maximum number if pads in x -{return AliMUONSegmentationV01::Npy();} - -Int_t AliMUONSegmentationV02::Npy() const -// Returns maximum number if pads in y -{return AliMUONSegmentationV01::Npx();} - - -Float_t AliMUONSegmentationV02::Dpx(Int_t /*isec*/) const -// Returns pad-size in x -{return fDpy;} - -Float_t AliMUONSegmentationV02::Dpy(Int_t isec) const -// Returns pad-size in y -{return (*fDpxD)[isec];} - -void AliMUONSegmentationV02::Draw(const char * /*opt*/) const -{} - -Int_t AliMUONSegmentationV02::Sector(Int_t ix, Int_t iy) -// Returns sector number for given pad position -// -{return AliMUONSegmentationV01::Sector(iy, ix);} - -void AliMUONSegmentationV02:: -GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy) -// Returns pad coordinates (ix,iy) for given real coordinates (x,y) -// -{ -AliMUONSegmentationV01::GetPadI(y, x, iy, ix); -// printf("\n x,y,ix,iy %f %f %d %d", x,y,ix,iy); -} - -void AliMUONSegmentationV02::GetPad(Float_t x, Float_t y , Float_t /*z*/, Int_t &ix, Int_t &iy) -{ - GetPadI(x, y, ix, iy); -} - -void AliMUONSegmentationV02:: -GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) -{ -// Returns real coordinates (x,y) for given pad coordinates (ix,iy) -// - - AliMUONSegmentationV01::GetPadC(iy, ix, y, x); -} -void AliMUONSegmentationV02::SetPad(Int_t ix,Int_t iy) -{ - // - // Sets virtual pad coordinates, needed for evaluating pad response - // outside the tracking program - GetPadC(ix,iy,fX,fY); - fSector=Sector(ix,iy); -} - - - -void AliMUONSegmentationV02::NextPad() -{ -// Stepper for the iteration over pads -// - // - // Step to next pad in integration region - Float_t xc,yc; - Int_t ixc; - -// step up - if (fY < fYmax && fY != 0) { - if (fIy==-1) fIy++; - fIy++; -// step right - } else if (fIx != fIxmax) { - if (fIx==-1) fIx++; - fIx++; -// get y-position of next row (yc), xc not used here - GetPadC(fIx,fIy,xc,yc); -// get x-pad coordiante for 1 pad in row (fIx) - GetPadI(xc,fYmin,ixc,fIy); - } else { - fIx=fIy=-1; - } - GetPadC(fIx,fIy,fX,fY); - fSector=Sector(fIx,fIy); - if (MorePads() && - (fSector ==-1 || fSector==0 )) - NextPad(); -// printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy); - -} - -Int_t AliMUONSegmentationV02::MorePads() -{ -// Stopping condition for the iterator over pads -// -// -// Are there more pads in the integration region - - return (fIx != -1 || fIy != -1); -/* - if ((fY >= fYmax && fIx >= fIxmax) || fX==0) { - return 0; - } else { - return 1; - } -*/ -} - -void AliMUONSegmentationV02:: -Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) -{ -// Returns list of next neighbours for given Pad (iX, iY) -// - Int_t n; - AliMUONSegmentationV01::Neighbours(iY, iX, &n, Ylist, Xlist); - *Nlist=n; -} - - - - diff --git a/MUON/AliMUONSt1Segmentation.cxx b/MUON/AliMUONSt1Segmentation.cxx deleted file mode 100644 index e3ed8ab7f22..00000000000 --- a/MUON/AliMUONSt1Segmentation.cxx +++ /dev/null @@ -1,605 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/* $Id$ */ - -// Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay -// -// Class AliMUONSt1Segmentation -// ------------------------------ -// Segmentation for MUON station 1 using the external -// mapping package -// Included in AliRoot 2003/01/28 - -#include -#include -#include -#include - -#include "AliMpPad.h" -#include "AliMpPlane.h" -#include "AliMpPlaneAreaPadIterator.h" -#include "AliMpPlaneSegmentation.h" - -#include "AliMUONSt1Segmentation.h" -#include "AliRun.h" -#include "AliMUON.h" -#include "AliMUONChamber.h" -#include "AliLog.h" - -ClassImp(AliMUONSt1Segmentation) - -const Float_t AliMUONSt1Segmentation::fgkWireD = 0.20; -const Float_t AliMUONSt1Segmentation::fgkLengthUnit = 0.1; - -//______________________________________________________________________________ -AliMUONSt1Segmentation::AliMUONSt1Segmentation(const AliMpPlaneType planeType) -: AliSegmentation(), - fPlane(0), - fPlaneSegmentation(0), - fPlaneIterator(0), - fWireD(fgkWireD), - fChamber(0), - fId(0), - fRmin(0.), - fRmax(0.), - fZ(0.), - fIx(0), - fIy(0), - fX(0.), - fY(0.), - fSector(0), - fXhit(0.), - fYhit(0.), - fIxt(0), - fIyt(0), - fIwt(0), - fXt(0.), - fYt(0.), - fCorrA(0) -{ -// Normal constructor - fPlane = AliMpPlane::Create(kStation1, planeType); - fPlaneSegmentation = new AliMpPlaneSegmentation(fPlane); - - fCorrA = new TObjArray(3); - fCorrA->AddAt(0,0); - fCorrA->AddAt(0,1); - fCorrA->AddAt(0,2); -} - -//______________________________________________________________________________ -AliMUONSt1Segmentation::AliMUONSt1Segmentation() -: AliSegmentation(), - fPlane(0), - fPlaneSegmentation(0), - fPlaneIterator(0), - fWireD(fgkWireD), - fChamber(0), - fId(0), - fRmin(0.), - fRmax(0.), - fZ(0.), - fIx(0), - fIy(0), - fX(0.), - fY(0.), - fSector(0), - fXhit(0.), - fYhit(0.), - fIxt(0), - fIyt(0), - fIwt(0), - fXt(0.), - fYt(0.), - fCorrA(0) { -// Default Constructor -} - -//______________________________________________________________________________ -AliMUONSt1Segmentation::AliMUONSt1Segmentation(const AliMUONSt1Segmentation& rhs) - : AliSegmentation(rhs) -{ -// Copy constructor - AliFatal("Copy constructor is not implemented."); -} - -//______________________________________________________________________________ -AliMUONSt1Segmentation::~AliMUONSt1Segmentation() { -// Destructor - - delete fPlane; - delete fPlaneSegmentation; - delete fPlaneIterator; -} - -// -// operators -// - -//______________________________________________________________________________ -AliMUONSt1Segmentation& -AliMUONSt1Segmentation::operator=(const AliMUONSt1Segmentation& rhs) -{ -// Copy operator - - // check assignement to self - if (this == &rhs) return *this; - - AliFatal("Assignment operator is not implemented."); - - return *this; -} - -// -// private methods -// - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::UpdateCurrentPadValues(const AliMpPad& pad) -{ -// Updates current pad values. -// --- - - fIx = pad.GetIndices().GetFirst(); - fIy = pad.GetIndices().GetSecond(); - fX = pad.Position().X() * fgkLengthUnit; - fY = pad.Position().Y() * fgkLengthUnit; - fSector = fPlaneSegmentation->Zone(pad); -} - -// -// public methods -// - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::SetPadSize(Float_t /*p1*/, Float_t /*p2*/) -{ -// Set pad size Dx*Dy -// --- - - AliFatal("Not uniform pad size."); -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::SetDAnod(Float_t d) -{ -// Set anod pitch -// --- - - fWireD = d; -} - -//______________________________________________________________________________ -Float_t AliMUONSt1Segmentation::GetAnod(Float_t xhit) const -{ -// Anod wire coordinate closest to xhit -// Returns for a hit position xhit the position of the nearest anode wire -// From AliMUONSegmentationV01. -// --- - - Float_t wire= (xhit>0) ? Int_t(xhit/fWireD) + 0.5 - : Int_t(xhit/fWireD) - 0.5; - return fWireD*wire; - -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::GetPadI(Float_t x, Float_t y, Float_t /*z*/, - Int_t& ix, Int_t& iy) -{ -// Returns pad coordinates (ix,iy) for given real coordinates (x,y) -// --- - - GetPadI(x, y, ix, iy); -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::GetPadI(Float_t x, Float_t y, - Int_t& ix, Int_t& iy) -{ -// Returns pad coordinates (ix,iy) for given real coordinates (x,y) -// If there is no pad, ix = 0, iy = 0 are returned. -// --- - - AliMpPad pad = fPlaneSegmentation - ->PadByPosition(TVector2(x/fgkLengthUnit, y/fgkLengthUnit), false); - - ix = pad.GetIndices().GetFirst(); - iy = pad.GetIndices().GetSecond(); -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::GetPadC(Int_t ix, Int_t iy, - Float_t& x, Float_t& y, Float_t& z) -{ -// Transform from pad to real coordinates -// --- - - z = fZ; - GetPadC(ix, iy, x , y); -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::GetPadC(Int_t ix, Int_t iy, - Float_t& x, Float_t& y) -{ -// Transform from pad to real coordinates -// If there is no pad, x = 0., y = 0. are returned. -// --- - - AliMpPad pad = fPlaneSegmentation->PadByIndices(AliMpIntPair(ix,iy)); - - x = pad.Position().X() * fgkLengthUnit; - y = pad.Position().Y() * fgkLengthUnit; -} - - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::Init(Int_t chamber) -{ -// Initialize segmentation -// --- - - // find Npx, Npy and save this info - - // reference to chamber - AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); - fChamber = &(pMUON->Chamber(chamber)); - fRmin=fChamber->RInner(); - fRmax=fChamber->ROuter(); - fZ = fChamber->Z(); - fId=chamber; -} - -//______________________________________________________________________________ -Float_t AliMUONSt1Segmentation::Dpx() const -{ -// Get pad size in x -// --- - - AliFatal( "Not uniform pad size."); - return 0.; -} - -//______________________________________________________________________________ -Float_t AliMUONSt1Segmentation::Dpy() const -{ -// Get pad size in y -// --- - - AliFatal("Not uniform pad size."); - return 0.; -} - -//______________________________________________________________________________ -Float_t AliMUONSt1Segmentation::Dpx(Int_t isector) const -{ -// Pad size in x by sector -// --- - - return fPlaneSegmentation->PadDimensions(isector).X()*2.*fgkLengthUnit; -} - -//______________________________________________________________________________ -Float_t AliMUONSt1Segmentation::Dpy(Int_t isector) const -{ -// Pad size in x, y by Sector -// --- - - return fPlaneSegmentation->PadDimensions(isector).Y()*2.*fgkLengthUnit; -} - -//______________________________________________________________________________ -Int_t AliMUONSt1Segmentation::Npx() const -{ -// Maximum number of Pads in x -// --- - - //Fatal("Npx", "Not yet implemented."); - return 142; //hard coded for the time being -} - -//______________________________________________________________________________ -Int_t AliMUONSt1Segmentation::Npy() const -{ -// Maximum number of Pads in y -// --- - - //Fatal("Npy", "Not yet implemented."); - return 213; //hard coded for the time being -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::SetPad(Int_t ix, Int_t iy) -{ -// Set pad position. -// Sets virtual pad coordinates, needed for evaluating pad response -// outside the tracking program. -// From AliMUONSegmentationV01. -// --- - - GetPadC(ix, iy, fX, fY); - fSector = Sector(ix, iy); -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::SetHit(Float_t xhit, Float_t yhit, Float_t /*zhit*/) -{ -// Set hit position -// Sets virtual hit position, needed for evaluating pad response -// outside the tracking program -// From AliMUONSegmentationV01. - - fXhit = xhit; - fYhit = yhit; -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::FirstPad(Float_t xhit, Float_t yhit, Float_t /*zhit*/, - Float_t dx, Float_t dy) -{ -// Iterate over pads - initialiser -// --- - - // Sets the current pad to that located in the hit position - - SetHit(GetAnod(xhit), yhit, 0.); - - // Enable iterating in one dimension - if (dx == 0.) dx = 0.01; - if (dy == 0.) dy = 0.01; - - fPlaneIterator - = fPlaneSegmentation - ->CreateIterator(AliMpArea(TVector2(fXhit/fgkLengthUnit, fYhit/fgkLengthUnit), - TVector2(dx/fgkLengthUnit, dy/fgkLengthUnit))); - - fPlaneIterator->First(); - - if (! fPlaneIterator->IsDone()) - UpdateCurrentPadValues(fPlaneIterator->CurrentItem()); -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::NextPad() -{ -// Iterate over pads - stepper -// --- - - fPlaneIterator->Next(); - - if (! fPlaneIterator->IsDone()) - UpdateCurrentPadValues(fPlaneIterator->CurrentItem()); -} - -//______________________________________________________________________________ -Int_t AliMUONSt1Segmentation::MorePads() -{ -// Iterate over pads - condition -// --- - - if (fPlaneIterator->IsDone()) - return 0; - else - return 1; -} - -//______________________________________________________________________________ -Float_t AliMUONSt1Segmentation::Distance2AndOffset(Int_t iX, Int_t iY, - Float_t x, Float_t y, Int_t* /*dummy*/) -{ -// Returns the square of the distance between 1 pad -// labelled by its channel numbers and a coordinate -// --- - - AliMpPad pad = fPlaneSegmentation->PadByIndices(AliMpIntPair(iX, iY)); - - if (!pad.IsValid()) - AliFatal("Cannot locate pad."); - - return (pad.Position()*fgkLengthUnit - TVector2(x, y)).Mod2(); -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/, - Int_t* /*Nparallel*/, Int_t* /*Offset*/) -{ -// Number of pads read in parallel and offset to add to x -// (specific to LYON, but mandatory for display) -// --- - - AliFatal( "Not yet implemented."); -} - - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::Neighbours(Int_t iX, Int_t iY, - Int_t* Nlist, - Int_t Xlist[10], Int_t Ylist[10]) -{ -// Get next neighbours -// --- - - AliMpPad pad = fPlaneSegmentation->PadByIndices(AliMpIntPair(iX,iY)); - Int_t &i = *Nlist; - i=0; - AliMpVPadIterator* iter - = fPlaneSegmentation - ->CreateIterator(AliMpArea(pad.Position(),2.*pad.Dimensions()*1.1)); - - for( iter->First(); !iter->IsDone() && i<10; iter->Next()) { - Xlist[i] = iter->CurrentItem().GetIndices().GetFirst(); - Ylist[i] = iter->CurrentItem().GetIndices().GetSecond(); - i++; - } - - delete iter; -} - -//______________________________________________________________________________ -Int_t AliMUONSt1Segmentation::Ix() -{ -// Current pad cursor during disintegration -// x, y-coordinate -// --- - - return fPlaneIterator->CurrentItem().GetIndices().GetFirst(); -} - -//______________________________________________________________________________ -Int_t AliMUONSt1Segmentation::Iy() -{ -// Current pad cursor during disintegration -// x, y-coordinate -// --- - - return fPlaneIterator->CurrentItem().GetIndices().GetSecond(); -} - -//______________________________________________________________________________ -Int_t AliMUONSt1Segmentation::ISector() -{ -// Current sector -// --- - - return fSector; -} - -//______________________________________________________________________________ -Int_t AliMUONSt1Segmentation::Sector(Int_t ix, Int_t iy) -{ -// Calculate sector from pad coordinates -// --- - - return fPlaneSegmentation - ->Zone(fPlaneSegmentation->PadByIndices(AliMpIntPair(ix, iy))); -} - -//______________________________________________________________________________ -Int_t AliMUONSt1Segmentation::Sector(Float_t x, Float_t y) -{ -// Calculate sector from pad coordinates -// --- - - return fPlaneSegmentation - ->Zone(fPlaneSegmentation - ->PadByPosition(TVector2(x/fgkLengthUnit, y/fgkLengthUnit))); -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::IntegrationLimits(Float_t& x1, Float_t& x2, - Float_t& y1, Float_t& y2) -{ -// Current integration limits -// --- - - x1 = fXhit - fX - Dpx(fSector)/2.; - x2 = x1 + Dpx(fSector); - - y1 = fYhit - fY - Dpy(fSector)/2.; - y2 = y1 + Dpy(fSector); -} - -//______________________________________________________________________________ -Int_t AliMUONSt1Segmentation::SigGenCond(Float_t x, Float_t y, Float_t /*z*/) -{ -// Signal Generation Condition during Stepping -// 0: don't generate signal -// 1: generate signal -// Comments: -// -// Crossing of pad boundary and mid plane between neighbouring wires is checked. -// To correctly simulate the dependence of the spatial resolution on the angle -// of incidence signal must be generated for constant steps on -// the projection of the trajectory along the anode wire. -// -// Signal will be generated if particle crosses pad boundary or -// boundary between two wires. -// -// From AliMUONSegmentationV01 -// --- - - Int_t ixt, iyt; - GetPadI(x, y, ixt, iyt); - Int_t iwt=(x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1; - - if ((ixt != fIxt) || (iyt !=fIyt) || (iwt != fIwt)) { - return 1; - } - else { - return 0; - } -} - - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::SigGenInit(Float_t x, Float_t y, Float_t /*z*/) -{ -// Initialise signal generation at coord (x,y,z) -// Initialises pad and wire position during stepping. -// From AliMUONSegmentationV01 -// --- - - fXt = x; - fYt = y; - GetPadI(x, y, fIxt, fIyt); - fIwt = (x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1 ; -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::GiveTestPoints(Int_t& n, Float_t* x, Float_t* y) const -{ -// Test points for auto calibration -// Returns test point on the pad plane. -// Used during determination of the segmoid correction of the COG-method -// From AliMUONSegmentationV01 -// --- - - n=1; - x[0] = (fRmax+fRmin)/2/TMath::Sqrt(2.); - y[0] = x[0]; -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::Draw(const char * /*opt*/) -{ -// Draw the segmentation zones. -// (Called from AliMUON::BuildGeometry) -// --- - - AliWarning("Not yet implemented."); -} - -//______________________________________________________________________________ -void AliMUONSt1Segmentation::SetCorrFunc(Int_t isec, TF1* func) -{ -// Set the correction function. -// From AliMUONSegmentationV01 -// --- - - fCorrA->AddAt(func, isec); -} - -//______________________________________________________________________________ -TF1* AliMUONSt1Segmentation::CorrFunc(Int_t isec) const -{ -// Get the correction Function. -// From AliMUONSegmentationV01 -// --- - - return (TF1*) fCorrA->At(isec); -} - -- 2.43.0