/************************************************************************** * 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 "TMath.h" #include "TRandom.h" #include "TArc.h" #include "AliMUONChamber.h" #include "AliRun.h" // gAlice #include ClassImp(AliMUONSegmentationTriggerX) //------------------------------------------------------------------ void AliMUONSegmentationTriggerX::Init(Int_t chamber) { // intialize X segmentation 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(); 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 17.0*fZscale; } else if (isec==2) { return 34.0*fZscale; } else if (isec==3) { return 34.0*fZscale; } else if (isec==4) { return 34.0*fZscale; } else if (isec==5) { return 34.0*fZscale; } else if (isec==6) { return 68.0*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 1.0625*fZscale; } else if (isec==2) { return 1.0625*fZscale; } else if (isec==3) { return 1.0625*fZscale; } else if (isec==4) { return 2.125*fZscale; } else if (isec==5) { return 4.25*fZscale; } else if (isec==6) { return 4.25*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) 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(); } } } }