#include <TVirtualMC.h>
#include <TGeoMatrix.h>
+#include "AliLog.h"
+
#include "AliMUONTriggerGeometryBuilder.h"
#include "AliMUON.h"
-#include "AliMUONChamber.h"
-#include "AliMUONChamberGeometry.h"
+#include "AliMUONConstants.h"
+#include "AliMUONGeometryModule.h"
+#include "AliMUONGeometryEnvelopeStore.h"
ClassImp(AliMUONTriggerGeometryBuilder)
//______________________________________________________________________________
AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(AliMUON* muon)
- : AliMUONVGeometryBuilder(&muon->Chamber(10), &muon->Chamber(11),&muon->Chamber(12),&muon->Chamber(13)),
+ : AliMUONVGeometryBuilder(10, 11, 12, 13),
fMUON(muon)
{
// Standard constructor
{
// Protected copy constructor
- Fatal("Copy constructor",
- "Copy constructor is not implemented.");
+ AliFatal("Copy constructor is not implemented.");
}
//______________________________________________________________________________
// check assignement to self
if (this == &rhs) return *this;
- Fatal("operator=",
- "Assignment operator is not implemented.");
+ AliFatal("Assignment operator is not implemented.");
return *this;
}
Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
Int_t idAir= idtmed[1100]; // medium 1
Int_t idAlu1=idtmed[1103]; // medium 4
+ Int_t detElemId=0; // Detection Element Number
Float_t tpar[3];
Double_t dpar[3];
// main distances for chamber definition in first plane/first station
const Float_t kXMIN=34.;
const Float_t kXMED=51.;
- const Float_t kXMAX=272.;
-// kXMAX will become 255. in real life. segmentation to be updated accordingly
+ const Float_t kXMAX=255.;
+// 090704 kXMAX changed from 272 to 255.
// (see fig.2-4 & 2-5 of Local Trigger Board PRR)
+// segmentation updated accordingly
const Float_t kYMIN=34.;
const Float_t kYMAX=51.;
// inner/outer radius of flange between beam shield. and chambers (1/station)
- const Float_t kRMIN[2]={50.,50.};
- const Float_t kRMAX[2]={64.,68.};
+// const Float_t kRMIN[2]={50.,50.};
+// const Float_t kRMAX[2]={64.,68.};
// z position of the middle of the gas gap in mother vol
const Float_t kZm=-3.6;
- const Float_t kZp=+3.6;
-
- AliMUONChamber *iChamber, *iChamber1;
- iChamber1 = GetChamber(10);
- Float_t zpos1=-iChamber1->Z();
+ const Float_t kZp=+3.6;
+ Float_t zpos1= AliMUONConstants::DefaultChamberZ(10);
+ Double_t dstation = ( ( - AliMUONConstants::DefaultChamberZ(11)) -
+ ( - AliMUONConstants::DefaultChamberZ(10)) ) /2.1;
+ Float_t par[3];
+ par[2] = dstation;
+
// ratio of zpos1m/zpos1p and inverse for first plane
Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
Float_t zpm=1./zmp;
for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
Int_t iVolNum=1; // counter Volume Number
- icount = Int_t(iplane*TMath::Power(2,0))+
- Int_t(istation*TMath::Power(2,1));
+ icount = Int_t(iplane<<0)+Int_t(istation<<1);
- iChamber = GetChamber(10+icount);
- Float_t zpos = - iChamber->Z();
+ par[0] = AliMUONConstants::Rmin(5+istation);
+ par[1] = AliMUONConstants::Rmax(5+istation);
+ Char_t volName[6];
+ sprintf(volName,"%s%d", "SC",11+icount);
+ gMC->Gsvolu(volName,"TUBE", idAir, par, 3);
+ GetGeometry(10+icount)->SetVolume(volName);
+ Float_t zpos = AliMUONConstants::DefaultChamberZ(10+icount);
+/* removed 03/18/05
// Flange between beam shielding and RPC
tpar[0]= kRMIN[istation];
tpar[1]= kRMAX[istation];
gMC->Gsvolu(volFlange,"TUBE",idAlu1,tpar,3); // Al
// changed by ivana
//gMC->Gspos(volFlange,1,"ALIC",0.,0.,zpos,0,"MANY");
- iChamber->GetGeometry()->AddEnvelope(volFlange, false, "MANY");
+ iChamber->GetGeometry()->GetEnvelopeStore()
+ ->AddEnvelope(volFlange, 0, false, "MANY");
+*/
// scaling factor
Float_t zRatio = zpos / zpos1;
tpar[0] = (kXMAX/2.) * zRatio;
if (iline==5) tpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
if (icolumn==0)
- sprintf(volEnv[i],"S%dL%d",icount,iline);
- else
sprintf(volEnv[i],"S%dR%d",icount,iline);
+ else
+ sprintf(volEnv[i],"S%dL%d",icount,iline);
gMC->Gsvolu(volEnv[i],"BOX",idAir,tpar,0);
i++;
}
// chamber prototype
tpar[0]= 0.;
tpar[1]= 0.;
- tpar[2]= 0.;
- char volAlu[5]; // Alu
+ tpar[2]= 0.; char volAlu[5]; // Alu
char volBak[5]; // Bakelite
char volGaz[5]; // Gas streamer
sprintf(volAlu,"SC%dA",icount+1);
sprintf(volBak,"SB%dA",icount+1);
- sprintf(volGaz,"SG%dA",icount+1);
+ sprintf(volGaz,"S%dG",icount+11);
gMC->Gsvolu(volAlu,"BOX",idAlu1,tpar,0); // Al
gMC->Gsvolu(volBak,"BOX",idtmed[1107],tpar,0); // Bakelite
gMC->Gsvolu(volGaz,"BOX",idtmed[1106],tpar,0); // Gas streamer
dpar[0] = ((kXMAX-kXMED)/2.)*zRatio;
dpar[1] = kYMIN * zRatio;
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[4], true, TGeoTranslation(xEnv,yEnvM,kZm));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[13], true, TGeoTranslation(-xEnv,yEnvP,kZp));
+ detElemId = (10+icount+1)*100;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[4], detElemId, true, TGeoTranslation(xEnv,yEnvP,kZp));
+ detElemId = (10+icount+1)*100+9;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[13], detElemId, true, TGeoTranslation(-xEnv,yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[4],iVolNum++,3, dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[13],iVolNum++,3, dpar);
// chamber type B (plus envelope chambers B & C)
xEnv = (kDXZERO+kXMAX/2.)*zRatio;
xpos = kXMIN/2. * zRatio;
ypos = (kYMIN - kYMIN/4.) * zRatio;
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[3], true, TGeoTranslation( xEnv,-yEnvP,kZp));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[5], true, TGeoTranslation( xEnv, yEnvP,kZp));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[12], true, TGeoTranslation(-xEnv,-yEnvM,kZm));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[14], true, TGeoTranslation(-xEnv, yEnvM,kZm));
+ detElemId = (10+icount+1)*100+17;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[3], detElemId, true, TGeoTranslation( xEnv,-yEnvM,kZm));
+ detElemId = (10+icount+1)*100+1;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[5], detElemId, true, TGeoTranslation( xEnv, yEnvM,kZm));
+ detElemId = (10+icount+1)*100+10;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[12], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
+ detElemId = (10+icount+1)*100+8;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[14], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(-xpos, ypos,0.),3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(-xpos,-ypos,0.),3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
// chamber type C (note: same Z than type B)
dpar[0] = (kXMAX/2)*zRatio;
xpos = 0.;
ypos = ((kYMAX - kYMIN)/2.) * zRatio;
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(-xpos,-ypos,0.),3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(-xpos, ypos,0.),3,dpar);
-
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[3],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[5],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[12],iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[14],iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
+
// chamber type D, E and F (same size)
// D
yEnvPsave = yEnvP;
dpar[0] = (kXMAX/2.)*zRatio;
dpar[1] = kYMIN*zRatio;
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[2], true, TGeoTranslation(xEnv, yEnvM,kZm));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[6], true, TGeoTranslation(-xEnv, yEnvP,kZp));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[11], true, TGeoTranslation(xEnv,-yEnvM,kZm));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[15], true, TGeoTranslation(-xEnv,-yEnvP,kZp));
+ detElemId = (10+icount+1)*100+16;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[2], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
+ detElemId = (10+icount+1)*100+2;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[6], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
+ detElemId = (10+icount+1)*100+11;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[11], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
+ detElemId = (10+icount+1)*100+7;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[15], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[2],iVolNum++,3, dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[6],iVolNum++,3, dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[11],iVolNum++,3, dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[15],iVolNum++,3, dpar);
// E
yEnvPsave = yEnvP;
yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[1], true, TGeoTranslation(xEnv, yEnvP,kZp));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[7], true, TGeoTranslation(-xEnv, yEnvM,kZm));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[10], true, TGeoTranslation(xEnv,-yEnvP,kZp));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[16], true, TGeoTranslation(-xEnv,-yEnvM,kZm));
+ detElemId = (10+icount+1)*100+15;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[1], detElemId, true, TGeoTranslation(xEnv,-yEnvM,kZm));
+ detElemId = (10+icount+1)*100+3;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[7], detElemId, true, TGeoTranslation(xEnv, yEnvM,kZm));
+ detElemId = (10+icount+1)*100+12;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[10], detElemId, true, TGeoTranslation(-xEnv,-yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
+ detElemId = (10+icount+1)*100+6;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[16], detElemId, true, TGeoTranslation(-xEnv, yEnvP,kZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[1],iVolNum++,3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[7],iVolNum++,3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[10],iVolNum++,3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[16],iVolNum++,3,dpar);
// F
yEnvP = (yEnvMsave + kYMIN * zRatio ) * zpm + kYMIN * zRatio;
yEnvM = (yEnvPsave + kYMIN * zRatio ) * zmp + kYMIN * zRatio;
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[0], true, TGeoTranslation(xEnv, yEnvM,kZm));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[8], true, TGeoTranslation(-xEnv, yEnvP,kZp));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[9], true, TGeoTranslation(xEnv,-yEnvM,kZm));
- GetChamber(10+icount)->GetGeometry()->AddEnvelope(volEnv[17], true, TGeoTranslation(-xEnv,-yEnvP,kZp));
-
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
- GetChamber(10+icount)->GetGeometry()->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
+ detElemId = (10+icount+1)*100+14;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[0], detElemId, true, TGeoTranslation(xEnv,-yEnvP,kZp));
+ detElemId = (10+icount+1)*100+4;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[8], detElemId, true, TGeoTranslation(xEnv, yEnvP,kZp));
+ detElemId = (10+icount+1)*100+13;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[9], detElemId, true, TGeoTranslation(-xEnv,-yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
+ detElemId = (10+icount+1)*100+5;
+ GetEnvelopes(10+icount)->AddEnvelope(volEnv[17], detElemId, true, TGeoTranslation(-xEnv, yEnvM,kZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
+
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[0],iVolNum++,3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[8],iVolNum++,3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[9],iVolNum++,3,dpar);
+ GetEnvelopes(10+icount)->AddEnvelopeConstituentParam(volAlu,volEnv[17],iVolNum++,3,dpar);
} // end loop on detection planes
} // end loop on stations
{
// Defines the transformations for the trigger chambers.
// ---
- Double_t zpos1, zpos2;
- AliMUONChamber *iChamber1, *iChamber2;
- iChamber1 = GetChamber(10);
- zpos1= - iChamber1->Z();
- iChamber1->GetGeometry()
- ->SetTranslation(TGeoTranslation(0., 0., zpos1));
-
- iChamber2 = GetChamber(11);
- zpos2 = - iChamber2->Z();
- iChamber2->GetGeometry()
- ->SetTranslation(TGeoTranslation(0., 0., zpos2));
-
- iChamber1 = GetChamber(12);
- zpos1 = - iChamber1->Z();
- iChamber1->GetGeometry()
- ->SetTranslation(TGeoTranslation(0., 0., zpos1));
+ Double_t zpos1= AliMUONConstants::DefaultChamberZ(10);
+ SetTranslation(10, TGeoTranslation(0., 0., zpos1));
- iChamber2 = GetChamber(13);
- zpos2 = - iChamber2->Z();
- iChamber2->GetGeometry()
- ->SetTranslation(TGeoTranslation(0., 0., zpos2));
+ zpos1= AliMUONConstants::DefaultChamberZ(11);
+ SetTranslation(11, TGeoTranslation(0., 0., zpos1));
+
+ zpos1= AliMUONConstants::DefaultChamberZ(12);
+ SetTranslation(12, TGeoTranslation(0., 0., zpos1));
+
+ zpos1= AliMUONConstants::DefaultChamberZ(13);
+ SetTranslation(13, TGeoTranslation(0., 0., zpos1));
+
}
//______________________________________________________________________________
// Defines the sensitive volumes for trigger station chambers.
// ---
- GetChamber(10)->GetGeometry()->SetSensitiveVolume("SG1A");
- GetChamber(11)->GetGeometry()->SetSensitiveVolume("SG2A");
- GetChamber(12)->GetGeometry()->SetSensitiveVolume("SG3A");
- GetChamber(13)->GetGeometry()->SetSensitiveVolume("SG4A");
+ GetGeometry(10)->SetSensitiveVolume("S11G");
+ GetGeometry(11)->SetSensitiveVolume("S12G");
+ GetGeometry(12)->SetSensitiveVolume("S13G");
+ GetGeometry(13)->SetSensitiveVolume("S14G");
}