/*
$Log$
+Revision 1.6 2000/11/12 17:17:03 pcrochet
+BuildGeometry of AliMUON for trigger chambers delegated to AliMUONSegmentationTriggerX (same strategy as for tracking chambers)
+
+Revision 1.5 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.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:00:14 pcrochet
+global variables removed, problem with HP compiler solved (PH)
+
+Revision 1.2 2000/06/15 07:58:48 morsch
+Code from MUON-dev joined
+
Revision 1.1.2.1 2000/06/09 21:47:24 morsch
Code from AliMUONSegResTrigger.cxx
*/
#include "AliMUONSegmentationTrigger.h"
+#include "AliMUONTriggerConstants.h"
+#include "AliRun.h"
+#include "AliMUON.h"
#include <TMath.h>
#include <TRandom.h>
#include <TArc.h>
#include "AliMUONChamber.h"
#include <iostream.h>
-
+
ClassImp(AliMUONSegmentationTrigger)
-void AliMUONSegmentationTrigger::Init(AliMUONChamber* Chamber)
+//------------------------------------------------------------------
+void AliMUONSegmentationTrigger::Init(Int_t chamber)
{
// initialize Module geometry
- cout << "Initialize Trigger Chamber Module Geometry " << "\n";
+ AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON");
+ AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
- Float_t zPos=Chamber->Z();
+ if(pMUON->GetDebug()) cout << ClassName() << ": Initialize Trigger Chamber Module Geometry " << "\n";
+
+ Float_t zPos=iChamber->Z();
Float_t z1Pos=1603.5;
fZscale = zPos/z1Pos;
- static Int_t nModule=126;
- fgNmodule = nModule;
-// conv : line-column (line : from top to bottom, column : from left to right)
- static Int_t num[126]=
- {11,12,13,14,15,16,17, // right side of the chamber
- 21,22,23,24,25,26,27,
- 31,32,33,34,35,36,37,
- 41,42,43,44,45,46,47,
- 51,52,53,54,55,56,57,
- 61,62,63,64,65,66,67,
- 71,72,73,74,75,76,77,
- 81,82,83,84,85,86,87,
- 91,92,93,94,95,96,97,
- -11,-12,-13,-14,-15,-16,-17, // left side of the chamber
- -21,-22,-23,-24,-25,-26,-27,
- -31,-32,-33,-34,-35,-36,-37,
- -41,-42,-43,-44,-45,-46,-47,
- -51,-52,-53,-54,-55,-56,-57,
- -61,-62,-63,-64,-65,-66,-67,
- -71,-72,-73,-74,-75,-76,-77,
- -81,-82,-83,-84,-85,-86,-87,
- -91,-92,-93,-94,-95,-96,-97};
- fgNum = num;
-
- static Int_t nStripX[126]=
- {16,16,16,16,16,16,16, // right side of the chamber
- 32,32,32,32,32,32,16,
- 32,32,32,32,32,32,16,
- 48,64,64,32,32,32,16,
- 0,64,64,32,32,32,16,
- 48,64,64,32,32,32,16,
- 32,32,32,32,32,32,16,
- 32,32,32,32,32,32,16,
- 16,16,16,16,16,16,16, // left side of the chamber
- 16,16,16,16,16,16,16,
- 32,32,32,32,32,32,16,
- 32,32,32,32,32,32,16,
- 48,64,64,32,32,32,16,
- 0,64,64,32,32,32,16,
- 48,64,64,32,32,32,16,
- 32,32,32,32,32,32,16,
- 32,32,32,32,32,32,16,
- 16,16,16,16,16,16,16};
- fgNstripx = nStripX;
-
- static Int_t nStripY[126]=
- { 8, 8, 8, 8, 8, 8,16, // right side of the chamber
- 8, 8, 8, 8, 8, 8,16,
- 16,16,16,16,16, 8,16,
- 16,16,16,16,16, 8,16,
- 0, 8,16,16,16, 8,16,
- 16,16,16,16,16, 8,16,
- 16,16,16,16,16, 8,16,
- 8, 8, 8, 8, 8, 8,16,
- 8, 8, 8, 8, 8, 8,16, // left side of the chamber
- 8, 8, 8, 8, 8, 8,16, // right side of the chamber
- 8, 8, 8, 8, 8, 8,16,
- 16,16,16,16,16, 8,16,
- 16,16,16,16,16, 8,16,
- 0, 8,16,16,16, 8,16,
- 16,16,16,16,16, 8,16,
- 16,16,16,16,16, 8,16,
- 8, 8, 8, 8, 8, 8,16,
- 8, 8, 8, 8, 8, 8,16};
- fgNstripy = nStripY;
-
- static Float_t xCmin[126]=
- {0.,34.,68.,102.,136.,170.,204., // right
- 0.,34.,68.,102.,136.,170.,204.,
- 0.,34.,68.,102.,136.,170.,204.,
- 0.,34.,68.,102.,136.,170.,204.,
- 0.,51.,68.,102.,136.,170.,204.,
- 0.,34.,68.,102.,136.,170.,204.,
- 0.,34.,68.,102.,136.,170.,204.,
- 0.,34.,68.,102.,136.,170.,204.,
- 0.,34.,68.,102.,136.,170.,204.,
- -34.,-68.,-102.,-136.,-170.,-204.,-272., //left
- -34.,-68.,-102.,-136.,-170.,-204.,-272.,
- -34.,-68.,-102.,-136.,-170.,-204.,-272.,
- -34.,-68.,-102.,-136.,-170.,-204.,-272.,
- 0.,-68.,-102.,-136.,-170.,-204.,-272.,
- -34.,-68.,-102.,-136.,-170.,-204.,-272.,
- -34.,-68.,-102.,-136.,-170.,-204.,-272.,
- -34.,-68.,-102.,-136.,-170.,-204.,-272.,
- -34.,-68.,-102.,-136.,-170.,-204.,-272.};
- fgXcmin = xCmin;
-
- static Float_t xCmax[126]=
- {34.,68.,102.,136.,170.,204.,272., //right
- 34.,68.,102.,136.,170.,204.,272.,
- 34.,68.,102.,136.,170.,204.,272.,
- 34.,68.,102.,136.,170.,204.,272.,
- 0.,68.,102.,136.,170.,204.,272.,
- 34.,68.,102.,136.,170.,204.,272.,
- 34.,68.,102.,136.,170.,204.,272.,
- 34.,68.,102.,136.,170.,204.,272.,
- 34.,68.,102.,136.,170.,204.,272.,
- 0.,-34.,-68.,-102.,-136.,-170.,-204., // left
- 0.,-34.,-68.,-102.,-136.,-170.,-204.,
- 0.,-34.,-68.,-102.,-136.,-170.,-204.,
- 0.,-34.,-68.,-102.,-136.,-170.,-204.,
- 0.,-51.,-68.,-102.,-136.,-170.,-204.,
- 0.,-34.,-68.,-102.,-136.,-170.,-204.,
- 0.,-34.,-68.,-102.,-136.,-170.,-204.,
- 0.,-34.,-68.,-102.,-136.,-170.,-204.,
- 0.,-34.,-68.,-102.,-136.,-170.,-204.};
- fgXcmax = xCmax;
-
- static Float_t yCmin[126];
- static Float_t yCmax[126];
Float_t y1Cmin[126];
Float_t y1Cmax[126];
Float_t z1pm=z1PosPlus/z1PosMinus;
Float_t z1mp=z1PosMinus/z1PosPlus;
- cout << " fZscale = " << fZscale << "\n";
-
-// calculate yCmin and yCmax
- for (Int_t i=62; i>=0; i--) {
- Int_t j=ModuleNumber(-num[i]); // i == right, j == left
- if (Int_t(num[i]/10)==5) { // start with middle chamber
- if (num[i]==51) { // special case (empty module)
- yCmin[i]=yCmax[i]=yCmin[j]=yCmax[j]=0.;
+ if(pMUON->GetDebug()) cout << ClassName() << ": fZscale = " << fZscale << "\n";
+
+// 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;
- yCmin[i]=yCmin[j]=-34.;
- yCmax[i]=yCmax[j]=34.;
+ fYcmin[i]=fYcmin[j]=-34.;
+
+ fYcmax[i]=fYcmax[j]=34.;
}
- } else if (Int_t(num[i]/10)==4) { // up
- if (num[i]!=41) {
+ } 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.;
- yCmin[i]=y1Cmin[i];
- yCmax[i]=yCmin[i]+68.;
+ fYcmin[i]=y1Cmin[i];
+ fYcmax[i]=fYcmin[i]+68.;
y1Cmin[j]=y1Cmax[j+7]*z1mp;
y1Cmax[j]=y1Cmin[j]+68.;
- yCmin[j]=y1Cmin[j];
- yCmax[j]=yCmin[j]+68.;
+ fYcmin[j]=y1Cmin[j];
+ fYcmax[j]=fYcmin[j]+68.;
} else {
y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
y1Cmax[i]=y1Cmin[i]+51.;
- yCmin[i]=y1Cmin[i];
- yCmax[i]=yCmin[i]+51.;
+ fYcmin[i]=y1Cmin[i];
+ fYcmax[i]=fYcmin[i]+51.;
y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
y1Cmax[j]=y1Cmin[j]+51.;
- yCmin[j]=y1Cmin[j];
- yCmax[j]=yCmin[j]+51.;
+ fYcmin[j]=y1Cmin[j];
+ fYcmax[j]=fYcmin[j]+51.;
}
- } else if (Int_t(num[i]/10)==3) {
+ } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) {
y1Cmin[i]=y1Cmax[i+7]*z1mp;
y1Cmax[i]=y1Cmin[i]+68.;
- yCmin[i]=y1Cmin[i];
- yCmax[i]=yCmin[i]+68.;
+ fYcmin[i]=y1Cmin[i];
+ fYcmax[i]=fYcmin[i]+68.;
y1Cmin[j]=y1Cmax[j+7]*z1pm;
y1Cmax[j]=y1Cmin[j]+68.;
- yCmin[j]=y1Cmin[j];
- yCmax[j]=yCmin[j]+68.;
- } else if (Int_t(num[i]/10)==2) {
+ 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.;
- yCmin[i]=y1Cmin[i];
- yCmax[i]=yCmin[i]+68.;
+ fYcmin[i]=y1Cmin[i];
+ fYcmax[i]=fYcmin[i]+68.;
y1Cmin[j]=y1Cmax[j+7]*z1mp;
y1Cmax[j]=y1Cmin[j]+68.;
- yCmin[j]=y1Cmin[j];
- yCmax[j]=yCmin[j]+68.;
- } else if (Int_t(num[i]/10)==1) {
+ 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.;
- yCmin[i]=y1Cmin[i];
- yCmax[i]=yCmin[i]+68.;
+ fYcmin[i]=y1Cmin[i];
+ fYcmax[i]=fYcmin[i]+68.;
y1Cmin[j]=y1Cmax[j+7]*z1pm;
y1Cmax[j]=y1Cmin[j]+68.;
- yCmin[j]=y1Cmin[j];
- yCmax[j]=yCmin[j]+68.;
+ fYcmin[j]=y1Cmin[j];
+ fYcmax[j]=fYcmin[j]+68.;
}
}
- for (Int_t i=0; i<63; i++) { // second loop (fill lower part)
- Int_t j=ModuleNumber(-num[i]); // i == right, j == left
- if (TMath::Abs(Int_t(num[i]/10))==6) {
- yCmin[i]=-yCmax[i-14];
- yCmax[i]=-yCmin[i-14];
- yCmin[j]=-yCmax[j-14];
- yCmax[j]=-yCmin[j-14];
- } else if (TMath::Abs(Int_t(num[i]/10))==7) {
- yCmin[i]=-yCmax[i-28];
- yCmax[i]=-yCmin[i-28];
- yCmin[j]=-yCmax[j-28];
- yCmax[j]=-yCmin[j-28];
- } else if (TMath::Abs(Int_t(num[i]/10))==8) {
- yCmin[i]=-yCmax[i-42];
- yCmax[i]=-yCmin[i-42];
- yCmin[j]=-yCmax[j-42];
- yCmax[j]=-yCmin[j-42];
- } else if (TMath::Abs(Int_t(num[i]/10))==9) {
- yCmin[i]=-yCmax[i-56];
- yCmax[i]=-yCmin[i-56];
- yCmin[j]=-yCmax[j-56];
- yCmax[j]=-yCmin[j-56];
+ 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];
}
}
- fgYcmin = yCmin;
- fgYcmax = yCmax;
-
fNpx=124;
fNpy=64;
- cout << "---------------------------------------------------- \n";
+// Set parent chamber number
+ fChamber=&(pMUON->Chamber(chamber));
+ fId=chamber;
+
+ if(pMUON->GetDebug()) cout << ClassName() << ": ---------------------------------------------------- \n";
}
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; i<fgNmodule; i++) {
- if (fgNum[i]==imodule) {
+ for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
+ if (AliMUONTriggerConstants::ModuleId(i)==imodule) {
imod=i;
break;
}
Int_t absimodule=TMath::Abs(imodule);
Int_t moduleNum=ModuleNumber(imodule);
- if (fgNum[absimodule]==51) {
+ if (absimodule==51) {
return 0;
} else {
- return TMath::Abs((fgYcmax[moduleNum]-fgYcmin[moduleNum])/
- fgNstripx[moduleNum]);
- }
+ return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
+ AliMUONTriggerConstants::NstripX(moduleNum));
+ }
}
//------------------------------------------------------------------
Int_t absimodule=TMath::Abs(imodule);
Int_t moduleNum=ModuleNumber(imodule);
- if (fgNum[absimodule]==51) {
+ if (absimodule==51) {
return 0;
} else {
- return TMath::Abs((fgXcmax[moduleNum]-fgXcmin[moduleNum])/
- fgNstripy[moduleNum]);
+ return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) -
+ AliMUONTriggerConstants::XcMin(moduleNum)) /
+ AliMUONTriggerConstants::NstripY(moduleNum));
}
}
// Sets virtual hit position, needed for evaluating pad response
// outside the tracking program
- fxhit=xhit;
- fyhit=yhit;
+ fXhit=xhit;
+ fYhit=yhit;
}
+
+
+
+
+
+
+
+
+