X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONSegmentationTriggerX.cxx;h=027cddc49cc9cb0efd60d498b5c84719118a10ed;hb=b2a1dc96314a3d94ea9f2fd80bae428a0618e0fd;hp=7daba873354bf56e9a36854e581e1995099943b0;hpb=3f2cdba82a6ad73c74358ac870851181addb0d92;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONSegmentationTriggerX.cxx b/MUON/AliMUONSegmentationTriggerX.cxx index 7daba873354..027cddc49cc 100644 --- a/MUON/AliMUONSegmentationTriggerX.cxx +++ b/MUON/AliMUONSegmentationTriggerX.cxx @@ -15,6 +15,52 @@ /* $Log$ +Revision 1.14 2002/10/23 07:24:56 alibrary +Introducing Riostream.h + +Revision 1.13 2002/10/14 14:57:29 hristov +Merging the VirtualMC branch to the main development branch (HEAD) + +Revision 1.11.10.1 2002/10/11 06:56:48 hristov +Updating VirtualMC to v3-09-02 + +Revision 1.12 2002/09/23 13:29:15 hristov +nameNode enlarged (HP) + +Revision 1.11 2001/05/16 14:57:17 alibrary +New files for folders and Stack + +Revision 1.10 2000/12/21 22:12:41 morsch +Clean-up of coding rule violations, + +Revision 1.9 2000/11/20 21:44:17 pcrochet +some modifications to account for the new class AliMUONResponseTriggerV1 + +Revision 1.8 2000/11/12 17:17:03 pcrochet +BuildGeometry of AliMUON for trigger chambers delegated to AliMUONSegmentationTriggerX (same strategy as for tracking chambers) + +Revision 1.7 2000/10/03 21:48:07 morsch +Adopt to const declaration of some of the methods in AliSegmentation. + +Revision 1.6 2000/10/02 16:58:29 egangler +Cleaning of the code : +-> coding conventions +-> void Streamers +-> some useless includes removed or replaced by "class" statement + +Revision 1.5 2000/07/03 11:54:57 morsch +AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER +The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC. + +Revision 1.4 2000/06/29 12:34:09 morsch +AliMUONSegmentation class has been made independent of AliMUONChamber. This makes +it usable with any other geometry class. The link to the object to which it belongs is +established via an index. This assumes that there exists a global geometry manager +from which the pointer to the parent object can be obtained (in our case gAlice). + +Revision 1.3 2000/06/26 10:01:26 pcrochet +global variables removed + Revision 1.2 2000/06/15 07:58:48 morsch Code from MUON-dev joined @@ -41,21 +87,29 @@ Draft version from P. Crochet */ +#include +#include +#include +#include + +#include "AliMUON.h" #include "AliMUONSegmentationTriggerX.h" #include "AliMUONTriggerConstants.h" #include "TMath.h" #include "TRandom.h" #include "TArc.h" #include "AliMUONChamber.h" -#include +#include "AliRun.h" // gAlice +#include ClassImp(AliMUONSegmentationTriggerX) //------------------------------------------------------------------ -void AliMUONSegmentationTriggerX::Init(AliMUONChamber* Chamber) +void AliMUONSegmentationTriggerX::Init(Int_t chamber) { // intialize X segmentation - cout << "Initialize Trigger Chamber Geometry X " << "\n"; - AliMUONSegmentationTrigger::Init(Chamber); + AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); + if(pMUON->GetDebug()>1) printf("%s: Initialize Trigger Chamber Geometry X\n",ClassName()); + AliMUONSegmentationTrigger::Init(chamber); // calculate x & y position of X strips Int_t nModule=AliMUONTriggerConstants::Nmodule(); @@ -73,7 +127,8 @@ void AliMUONSegmentationTriggerX::Init(AliMUONChamber* Chamber) } //------------------------------------------------------------------ -void AliMUONSegmentationTriggerX::GetPadIxy(Float_t x,Float_t y,Int_t &ix,Int_t &iy){ +void AliMUONSegmentationTriggerX::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; @@ -92,7 +147,8 @@ void AliMUONSegmentationTriggerX::GetPadIxy(Float_t x,Float_t y,Int_t &ix,Int_t } //------------------------------------------------------------------ -void AliMUONSegmentationTriggerX::GetPadCxy(Int_t ix, Int_t iy, Float_t &x, Float_t &y){ +void AliMUONSegmentationTriggerX::GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) +{ // Returns real coordinates (x,y) for given pad coordinates (ix,iy) // ix = module number , iy = strip number; x,y = center of strip x = 0.; @@ -118,31 +174,46 @@ void AliMUONSegmentationTriggerX::SetPadSize(Float_t p1, Float_t p2) //------------------------------------------------------------------ void AliMUONSegmentationTriggerX:: -Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2]){ -// Returns list of next neighbours for given Pad (ix, iy) - - Int_t absiX=TMath::Abs(iX); - *Nlist = 0; - - if (absiX!=0) { - Int_t numModule=ModuleNumber(absiX); - - if (iY0) { // strip down in same module - *Nlist=*Nlist+1; - Xlist[*Nlist-1]=absiX; - Ylist[*Nlist-1]=iY-1; - } - - if (iX<0) { // left side of chamber - for (Int_t i=0; i<*Nlist; i++) {Xlist[i]=-Xlist[i];} +Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]){ +// Returns list of 10 next neighbours for given X strip (ix, iy) +// neighbour number 4 in the list - +// neighbour number 3 in the list | +// neighbour number 2 in the list |_ Upper part +// neighbour number 1 in the list | +// neighbour number 0 in the list - +// X strip (ix, iy) +// neighbour number 5 in the list - +// neighbour number 6 in the list | _ Lower part +// neighbour number 7 in the list | +// neighbour number 8 in the list | +// neighbour number 9 in the list - + + Int_t absiX = TMath::Abs(iX); + Int_t numModule = ModuleNumber(absiX); // module number Id. + Int_t nStrip = AliMUONTriggerConstants::NstripX(numModule); //numb of strips + Int_t iCandidateUp, iCandidateDo; + Int_t j; + + *Nlist = 10; + for (Int_t i=0; i<10; i++) Xlist[i]=Ylist[i]=0; + + if (iY < nStrip) { + + for (Int_t i=0; i<5; i++) { + j = i + 5; + iCandidateUp = iY + (i + 1); + iCandidateDo = iY - (i + 1); + if (iCandidateUp < nStrip) { + Xlist[i] = iX; + Ylist[i] = iCandidateUp; + } + if (iCandidateDo >= 0) { + Xlist[j] = iX; + Ylist[j] = iCandidateDo; + } } - } + + } // iY < nStrip } //------------------------------------------------------------------ @@ -150,25 +221,26 @@ void AliMUONSegmentationTriggerX::SetPad(Int_t ix, Int_t iy) { // Sets virtual pad coordinates, needed for evaluating pad response // outside the tracking program - GetPadCxy(ix,iy,fx,fy); - GetPadIxy(fx,fy,fix,fiy); + GetPadC(ix,iy,fX,fY); + GetPadI(fX,fY,fIx,fIy); fSector=Sector(ix,iy); } //------------------------------------------------------------------ -Int_t AliMUONSegmentationTriggerX::ISector() +Int_t AliMUONSegmentationTriggerX::ISector() { return fSector;} //------------------------------------------------------------------ Int_t AliMUONSegmentationTriggerX::Ix() -{ return fix;} +{ return fIx;} //------------------------------------------------------------------ + Int_t AliMUONSegmentationTriggerX::Iy() -{ return fiy;} +{ return fIy;} //------------------------------------------------------------------ -Float_t AliMUONSegmentationTriggerX::Dpx(Int_t isec) +Float_t AliMUONSegmentationTriggerX::Dpx(Int_t isec) const { // returns x size of x strips for sector isec @@ -190,7 +262,7 @@ Float_t AliMUONSegmentationTriggerX::Dpx(Int_t isec) } //------------------------------------------------------------------ -Float_t AliMUONSegmentationTriggerX::Dpy(Int_t isec) +Float_t AliMUONSegmentationTriggerX::Dpy(Int_t isec) const { // returns y size of x strips for sector isec @@ -219,7 +291,7 @@ AliMUONSegmentationTrigger::SetHit(xhit,yhit); } //------------------------------------------------------------------ -Int_t AliMUONSegmentationTriggerX::Sector(Int_t ix, Int_t iy) +Int_t AliMUONSegmentationTriggerX::Sector(Int_t ix, Int_t iy) { // Returns sector number for given module // @@ -246,23 +318,95 @@ Int_t AliMUONSegmentationTriggerX::Sector(Int_t ix, Int_t iy) //------------------------------------------------------------------ void AliMUONSegmentationTriggerX:: -IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& width) +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; - GetPadIxy(fxhit,fyhit,ix,iy); - GetPadCxy(ix,iy,xstrip,ystrip); - x1=fyhit; // hit y position + 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 -} - + 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) const +{ +// Draw method for event display + if (!strcmp(opt,"eventdisplay")) { + TNode *node, *nodeS; + char nameChamber[10], nameNode[11]; + 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(); + } + } + } +}