Float_t xxmax = (kBframeLength - kNulocLength)/2.;
Int_t index=0;
Int_t* fStations = new Int_t[5];
- for (Int_t i=0; i<5; i++) fStations[i] = 1;
+ for (Int_t iSt=0; iSt<5; iSt++) fStations[iSt] = 1;
fStations[2] = 1;
if (fStations[2])
Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
- Float_t *dum=0;
Float_t pcbDLength3 = (kPcbLength - tlength);
// For rounded pcb of central slat
char idSlatCh6[5];
Float_t xSlat3;
Float_t ySlat3 = 0;
- Float_t angle = 0.;
+ angle = 0.;
+
Float_t spar2[3];
for (i = 0; i < kNslats3; i++){
spar2[1] = spar[1];
spar2[2] = spar[2];
Float_t dzCh3 = dzCh;
- Float_t zSlat3 = (i%2 ==0)? -zSlat : zSlat; // seems not that zSlat3 = zSlat4 & 5 refering to plan PQ7EN345-6 ?
+ Float_t dzSlat3 = -0.25; // see drawing PQ7EN345-6 (Delta_slat=80mm instead 85mm)
+ Float_t zSlat3 = (i%2 ==0)? -(zSlat+dzSlat3) : (zSlat+dzSlat3); // seems not that zSlat3 = zSlat4 & 5 refering to plan PQ7EN345-6 ? -> Indeed, fixed J.C.
sprintf(idSlatCh5,"LA%d",i+kNslats3-1);
detElemId = 509 - (i + kNslats3-1-4);
// Get shape
Int_t nSlatType = 2;
Int_t nVol = 8;
- char slatType[3] = "CD"; // C: central slat; D: rounded slat
- char volLetter[9] = "CNXIPHBG";
- char volName[5] = "SC5C";
- char compName[11] = "SC5C";
- char csName[14] = "centerSlatC5C";
+ const char* slatType = "CD"; // C: central slat; D: rounded slat
+ const char* volLetter = "CNXIPHBG";
+ TString volName;
+ TString compName;
+ TString csName;
TGeoVolume *mVol = 0x0;
TObjArray centerSlat(nSlatType*((nVol+1)*2));
TObjArray composite(nSlatType*((nVol+1)*2));
-
// Beam shield recess
new TGeoTube("tubeCut", 0., AliMUONConstants::Rmin(2), kSlatWidth/2.+0.001);
// Displacement
trCTube->RegisterYourself();
TGeoTranslation* trDTube = new TGeoTranslation("trDTube", -(kPcbLength+kVframeLength)/2., -kYpos3[1], 0.);
trDTube->RegisterYourself();
+ TGeoTranslation* trCBTube = new TGeoTranslation("trCBTube", 0., ( kPcbHeight - kBframeHeight ) / 2., 0.);
+ trCBTube->Add(trCTube);
+ trCBTube->RegisterYourself();
+ TGeoTranslation* trDBTube = new TGeoTranslation("trDBTube", 0., ( kPcbHeight - kBframeHeight ) / 2., 0.);
+ trDBTube->Add(trDTube);
+ trDBTube->RegisterYourself();
Float_t cPhi2 = (TMath::Pi()/2.-TMath::ACos((kSensHeight/2.)/(AliMUONConstants::Rmin(2)-kRframeLength)));
TGeoBBox *boxCCut = new TGeoBBox("boxCCut",(cFramepar3[1]-cFramepar3[0]*TMath::Cos(cPhi2))/2., hFramepar3[1], cFramepar3[2]+0.001);
for (int iSlatType = 0; iSlatType<nSlatType; iSlatType++) {
for (int iVol = 0; iVol<nVol; iVol++){
Int_t lIndex = (iCh-5)*(nSlatType*(nVol+1))+iSlatType*(nVol+1)+iVol;
- sprintf(volName,"S%c%d%c",slatType[iSlatType],iCh,volLetter[iVol]);
+ volName=Form("S%c%d%c",slatType[iSlatType],iCh,volLetter[iVol]);
mVol = gGeoManager->FindVolumeFast(volName);
if ( !mVol ) {
AliErrorStream()
}
else {
centerSlat[lIndex] = mVol->GetShape();
- sprintf(csName,"centerSlat%c%d%c",slatType[iSlatType],iCh,volLetter[iVol]);
+ csName=Form("centerSlat%c%d%c",slatType[iSlatType],iCh,volLetter[iVol]);
((TGeoShape*)centerSlat[lIndex])->SetName(csName);
// Composite shape
TString compOperation(csName);
compOperation+="-tubeCut:tr";
compOperation+=slatType[iSlatType];
- compOperation+="Tube";
if (strstr(volName,"B")){
- // Displacement
- TGeoTranslation* trB = new TGeoTranslation("trB", 0., -( kPcbHeight - kBframeHeight ) / 2., 0.);
- trB->RegisterYourself();
- compOperation.ReplaceAll("-tubeCut",":trB-tubeCut");
+ compOperation+="B";
}
- sprintf(compName,"composite%d%c",iCh,volLetter[iVol]);
+ compOperation+="Tube";
+ compName=Form("composite%d%c",iCh,volLetter[iVol]);
composite[lIndex] = new TGeoCompositeShape(compName, compOperation.Data());
// Reset shape to volume
// For rounded spacer
Int_t lIndex = (iCh-5)*(nSlatType*(nVol+1))+iSlatType*(nVol+1)+nVol;
- sprintf(volName,"S%c%dD",slatType[iSlatType],iCh);
+ volName=Form("S%c%dD",slatType[iSlatType],iCh);
mVol = gGeoManager->FindVolumeFast(volName);
if ( !mVol ) {
AliErrorStream()
}
else {
centerSlat[lIndex] = mVol->GetShape();
- sprintf(csName,"centerSlat%c%dD",slatType[iSlatType],iCh);
+ csName=Form("centerSlat%c%dD",slatType[iSlatType],iCh);
((TGeoShape*)centerSlat[lIndex])->SetName(csName);
// Composite shape
compOperation.Prepend("(");
compOperation+="+boxVframe:trVBox)*boxDCut:trDBox";
}
- sprintf(compName,"composite%c%dD",slatType[iSlatType],iCh);
+ compName=Form("composite%c%dD",slatType[iSlatType],iCh);
composite[lIndex] = new TGeoCompositeShape(compName, compOperation.Data());
// Reset shape to volume
mVol->SetShape((TGeoShape*)composite[lIndex]);
// position the panels and the insulating material
for (j = 0; j < kNPCB3[i]; j++){
index++;
- Float_t xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5);
+ xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5);
Float_t xx2 = xx - pcbDLength3/2.;
Float_t xx3 = xx + (kSensLength-csvPcbLength)/2.;
gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
- gMC->Gspos("SC5B",1,"SC5P",0., 0.,0.,0,"ONLY");
- gMC->Gspos("SC5B",2,"SC5P",0., 0.,0.,rotB,"ONLY");
- gMC->Gspos("SD5B",1,"SD5P",0., 0.,0.,0,"ONLY");
+ gMC->Gspos("SC5B",1,"SC5P",0., yborder,0.,rotB,"ONLY");
+ gMC->Gspos("SC5B",2,"SC5P",0.,-yborder,0.,0,"ONLY");
gMC->Gspos("S05B",1,"SD5P",0., yborder,0.,0,"ONLY");
+ gMC->Gspos("SD5B",1,"SD5P",0.,-yborder,0.,0,"ONLY");
gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
- gMC->Gspos("SC6B",1,"SC6P",0., 0.,0.,0,"ONLY");
- gMC->Gspos("SC6B",2,"SC6P",0., 0.,0.,rotB,"ONLY");
- gMC->Gspos("SD6B",1,"SD6P",0., 0.,0.,0,"ONLY");
+ gMC->Gspos("SC6B",1,"SC6P",0., yborder,0.,rotB,"ONLY");
+ gMC->Gspos("SC6B",2,"SC6P",0.,-yborder,0.,0,"ONLY");
gMC->Gspos("S06B",1,"SD6P",0., yborder,0.,0,"ONLY");
+ gMC->Gspos("SD6B",1,"SD6P",0.,-yborder,0.,0,"ONLY");
// create the NULOC volume and position it in the horizontal frame
gMC->Gsvolu("S05E","BOX",kNulocMaterial,nulocpar,3);
gMC->Gspos("S05E",2*index ,"SB5B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
}
if (xx > -xxmax3 && xx< xxmax3) {
- gMC->Gspos("S05E",2*index-1,"SC5B", xx, -yborder,-kBframeWidth/2.+ kNulocWidth/2., 0, "ONLY");
- gMC->Gspos("S05E",2*index ,"SC5B", xx, -yborder, kBframeWidth/2.- kNulocWidth/2., 0, "ONLY");
- gMC->Gspos("S06E",2*index-1,"SC6B", xx, -yborder,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
- gMC->Gspos("S06E",2*index ,"SC6B", xx, -yborder, kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S05E",2*index-1,"SC5B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2., 0, "ONLY");
+ gMC->Gspos("S05E",2*index ,"SC5B", xx, 0., kBframeWidth/2.- kNulocWidth/2., 0, "ONLY");
+ gMC->Gspos("S06E",2*index-1,"SC6B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S06E",2*index ,"SC6B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
}
if (xx > xxmax4 && xx< xxmax) {
- gMC->Gspos("S05E",2*index-1,"SD5B", xx, -yborder,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
- gMC->Gspos("S05E",2*index ,"SD5B", xx, -yborder, kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
- gMC->Gspos("S06E",2*index-1,"SD6B", xx, -yborder,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
- gMC->Gspos("S06E",2*index ,"SD6B", xx, -yborder, kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S05E",2*index-1,"SD5B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S05E",2*index ,"SD5B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S06E",2*index-1,"SD6B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S06E",2*index ,"SD6B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
}
}
cablepar6[0] = supporthlengthCh6/2.;
lCableX6 = 0.;
lCableDY = (kYpos3[i+1]+kYpos3[i+2])/2.-cablepar[1]; // half way between 2 slats on same side
- lCableZ = TMath::Power(-1,i)*(nomexthickness+carbonthickness+(iCable++)*kCableWidth)/2.;
+ lCableZ = TMath::Power(-1,i)*(nomexthickness/2.+carbonthickness+(-1+iCable++)*kCableWidth+kCableWidth/2.);
if(i==0){ // central slat is shorter (rounded)
cablepar[0] -= (kPcbLength-csvPcbLength)/2.;
lCableX = (kPcbLength-csvPcbLength)/2.;
cablepar6[0] = (supporthlengthCh6-kPcbLength-kVframeLength)/2.;
lCableX6 = (kPcbLength+kVframeLength)/2.;
lCableDY = (kYpos3[i+1]+kYpos3[i+2])/2.-cablepar[1]; // half way between 2 slats on same side
- lCableZ = TMath::Power(-1,i)*(nomexthickness+carbonthickness+(iCable++)*kCableWidth)/2.;
+ lCableZ = TMath::Power(-1,i)*(nomexthickness/2.+carbonthickness+(-1+iCable++)*kCableWidth+kCableWidth/2.);
gMC->Gsposp("S05L",100*i+cIndex++,"S05S",lCableX,lCableY+lCableDY,lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S05L",100*i+cIndex++,"S05S",lCableX,-(lCableY+lCableDY),lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S06L",100*i+cIndex6++,"S06S",lCableX6,lCableY+lCableDY,lCableZ,0,"ONLY",cablepar6,3);
else {
lCableDY = (kYpos3[i+1]+kYpos3[i+2])/2.-cablepar[1];
}
- lCableZ = TMath::Power(-1,i)*(nomexthickness+carbonthickness+(iCable++)*kCableWidth)/2.;
+ lCableZ = TMath::Power(-1,i)*(nomexthickness/2.+carbonthickness+(-1+iCable++)*kCableWidth+kCableWidth/2.);
+
if (i<=2){ // shortened pcb
cablepar[0] += pcbDLength3/2.;
lCableX -= pcbDLength3/2.;
// Get shape
Int_t nSlatType = 1;
Int_t nVol = 8;
- char slatType[2] = "D"; // D: Rounded slat
- char volLetter[9] = "CNXIPHBG";
- char volName[5] = "SD7C";
- char compName[14] = "SD7C";
- char csName[16] = "rounded4SlatD7C";
+ const char* slatType = "D"; // D: Rounded slat
+ const char* volLetter = "CNXIPHBG";
+ TString volName;
+ TString compName;
+ TString csName;
TGeoVolume *mVol = 0x0;
// Beam shield recess
new TGeoTube("tube4Cut", 0., AliMUONConstants::Rmin(3), kSlatWidth/2.+0.001);
// Displacement
TGeoTranslation* trDTube4 = new TGeoTranslation("trDTube4", -(kPcbLength+kVframeLength)/2., -kYpos41[1], 0.);
trDTube4->RegisterYourself();
+ TGeoTranslation* trDBTube4 = new TGeoTranslation("trDBTube4", 0., ( kPcbHeight - kBframeHeight ) / 2., 0.);
+ trDBTube4->Add(trDTube4);
+ trDBTube4->RegisterYourself();
+
TObjArray composite4(nSlatType*((nVol+1)*2));
new TGeoBBox("box4DCut",(kPcbLength+kVframeLength)/2., hFramepar[1], vFramepar[2]+0.001);
// Displacement
for (int iSlatType = 0; iSlatType<nSlatType; iSlatType++) {
for (int iVol = 0; iVol<nVol; iVol++){
Int_t lIndex = (iCh-7)*(nSlatType*(nVol+1))+iSlatType*(nVol+1)+iVol;
- sprintf(volName,"S%c%d%c",slatType[iSlatType],iCh,volLetter[iVol]);
+ volName=Form("S%c%d%c",slatType[iSlatType],iCh,volLetter[iVol]);
mVol = gGeoManager->FindVolumeFast(volName);
if ( !mVol ) {
AliErrorStream()
}
else {
rounded4Slat[lIndex] = mVol->GetShape();
- sprintf(csName,"rounded4Slat%c%d%c",slatType[iSlatType],iCh,volLetter[iVol]);
+ csName=Form("rounded4Slat%c%d%c",slatType[iSlatType],iCh,volLetter[iVol]);
((TGeoShape*)rounded4Slat[lIndex])->SetName(csName);
// Composite shape
TString compOperation(csName);
compOperation+="-tube4Cut:tr";
compOperation+=slatType[iSlatType];
- compOperation+="Tube4";
if (strstr(volName,"B")){
- // Displacement
- Float_t posXb = 0.;
- Float_t posYb = -( kPcbHeight - kBframeHeight ) / 2.;
- Float_t posZb = 0.;
- TGeoTranslation* trB = new TGeoTranslation("trB", posXb, posYb, posZb);
- trB->RegisterYourself();
- compOperation.ReplaceAll("-tube4Cut",":trB-tube4Cut");
- }
- sprintf(compName,"composite4%d%c",iCh,volLetter[iVol]);
+ compOperation+="B";
+ }
+ compOperation+="Tube4";
+ compName=Form("composite4%d%c",iCh,volLetter[iVol]);
composite4[lIndex] = new TGeoCompositeShape(compName, compOperation.Data());
// Reset shape to volume
// For rounded spacer
Int_t lIndex = (iCh-7)*(nSlatType*(nVol+1))+iSlatType*(nVol+1)+nVol;
- sprintf(volName,"S%c%dD",slatType[iSlatType],iCh);
+ volName=Form("S%c%dD",slatType[iSlatType],iCh);
mVol = gGeoManager->FindVolumeFast(volName);
if ( !mVol ) {
AliErrorStream()
}
else {
rounded4Slat[lIndex] = mVol->GetShape();
- sprintf(csName,"rounded4Slat%c%dD",slatType[iSlatType],iCh);
+ csName=Form("rounded4Slat%c%dD",slatType[iSlatType],iCh);
((TGeoShape*)rounded4Slat[lIndex])->SetName(csName);
// Composite shape
compOperation.Prepend("(");
compOperation+="+box4Vframe:trVBox4)*box4DCut:trDBox4";
}
- sprintf(compName,"composite4%c%dD",slatType[iSlatType],iCh);
+ compName=Form("composite4%c%dD",slatType[iSlatType],iCh);
composite4[lIndex] = new TGeoCompositeShape(compName, compOperation.Data());
// Reset shape to volume
mVol->SetShape((TGeoShape*)composite4[lIndex]);
// position the panels and the insulating material
for (j = 0; j < kNPCB4[i]; j++){
index++;
- Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5);
+ xx = kSensLength * (-kNPCB4[i]/2.+j+.5);
Float_t zPanel = spar[2] - nomexbpar[2];
if (i==1 && j==0){ // Rounded pcb of rounded slat
GetEnvelopes(moduleSlatCh7)->AddEnvelopeConstituent("SD7X", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
- gMC->Gspos("SD7B",1,"SD7P",0., 0.,0.,0,"ONLY");
- gMC->Gspos("S07B",1,"SD7P",0., yborder,0.,0,"ONLY");
+ gMC->Gspos("S07B",1,"SD7P",0., yborder,0.,0,"ONLY");
+ gMC->Gspos("SD7B",1,"SD7P",0.,-yborder,0.,0,"ONLY");
gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
- gMC->Gspos("SD8B",1,"SD8P",0., 0.,0.,0,"ONLY");
gMC->Gspos("S08B",1,"SD8P",0., yborder,0.,0,"ONLY");
+ gMC->Gspos("SD8B",1,"SD8P",0.,-yborder,0.,0,"ONLY");
// create the NULOC volume and position it in the horizontal frame
gMC->Gspos("S08E",2*index ,"S08B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
}
if (xx > xxmax4 && xx< xxmax) {
- gMC->Gspos("S07E",2*index-1,"SD7B", xx, -yborder,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
- gMC->Gspos("S07E",2*index ,"SD7B", xx, -yborder, kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
- gMC->Gspos("S08E",2*index-1,"SD8B", xx, -yborder,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
- gMC->Gspos("S08E",2*index ,"SD8B", xx, -yborder, kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S07E",2*index-1,"SD7B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S07E",2*index ,"SD7B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S08E",2*index-1,"SD8B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S08E",2*index ,"SD8B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
}
//
lCableX = kXpos4[i]/2.;
lCableDY = (kYpos41[i+1]+kYpos41[i+2])/2.-cablepar[1];
lCableDY8 = (kYpos42[i+1]+kYpos42[i+2])/2.-cablepar[1];
- lCableZ = TMath::Power(-1,i)*(nomexthickness+carbonthickness+(iCable++)*kCableWidth)/2.;
+ lCableZ = TMath::Power(-1,i)*(nomexthickness/2.+carbonthickness+(-1+iCable++)*kCableWidth+kCableWidth/2.);
gMC->Gsposp("S07L",10*i+cIndex++,"S07S",lCableX,lCableY+lCableDY,lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S07L",10*i+cIndex++,"S07S",lCableX,-(lCableY+lCableDY),lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S08L",10*i+cIndex8++,"S08S",lCableX,lCableY8+lCableDY8,lCableZ,0,"ONLY",cablepar,3);
lCableX = (kPcbLength+kVframeLength)/2.;
lCableDY = (kYpos41[i+1]+kYpos41[i+2])/2.-cablepar[1]; // half way between 2 slats on same side
lCableDY8 = (kYpos42[i+1]+kYpos42[i+2])/2.-cablepar[1]; // half way between 2 slats on same side
- lCableZ = TMath::Power(-1,i)*(nomexthickness+carbonthickness+(iCable++)*kCableWidth)/2.;
+ lCableZ = TMath::Power(-1,i)*(nomexthickness/2.+carbonthickness+(-1+iCable++)*kCableWidth+kCableWidth/2.);
gMC->Gsposp("S07L",10*i+cIndex++,"S07S",lCableX,lCableY+lCableDY,lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S07L",10*i+cIndex++,"S07S",lCableX,-(lCableY+lCableDY),lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S08L",10*i+cIndex8++,"S08S",lCableX,lCableY8+lCableDY8,lCableZ,0,"ONLY",cablepar,3);
lCableDY = (kYpos41[i+1]+kYpos41[i+2])/2.-cablepar[1];
lCableDY8 = (kYpos42[i+1]+kYpos42[i+2])/2.-cablepar[1];
}
- lCableZ = TMath::Power(-1,i)*(nomexthickness+carbonthickness+(iCable++)*kCableWidth)/2.;
+ lCableZ = TMath::Power(-1,i)*(nomexthickness/2.+carbonthickness+(-1+iCable++)*kCableWidth+kCableWidth/2.);
gMC->Gsposp("S07L",10*i+cIndex++,"S07S",lCableX,lCableY+lCableDY,lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S07L",10*i+cIndex++,"S07S",lCableX,-(lCableY+lCableDY),lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S08L",10*i+cIndex8++,"S08S",lCableX,lCableY8+lCableDY8,lCableZ,0,"ONLY",cablepar,3);
// Get shape
Int_t nSlatType = 1;
Int_t nVol = 8;
- char slatType[2] = "D"; // D: Rounde slat
- char volLetter[9] = "CNXIPHBG";
- char volName[5] = "SD9D";
- char compName[14] = "SD9D";
- char csName[16] = "rounded5SlatD9D";
+ const char* slatType = "D"; // D: Rounde slat
+ const char* volLetter = "CNXIPHBG";
+ TString volName;
+ TString compName;
+ TString csName;
TGeoVolume *mVol = 0x0;
// Beam shield recess
new TGeoTube("tube5Cut", 0., AliMUONConstants::Rmin(4), kSlatWidth/2.+0.001);
// Displacement
TGeoTranslation* trDTube5 = new TGeoTranslation("trDTube5", -(kPcbLength+kVframeLength)/2., -kYpos5[1], 0.);
trDTube5->RegisterYourself();
+ TGeoTranslation* trDBTube5 = new TGeoTranslation("trDBTube5", 0., ( kPcbHeight - kBframeHeight ) / 2., 0.);
+ trDBTube5->Add(trDTube5);
+ trDBTube5->RegisterYourself();
+
TObjArray composite5(nSlatType*((nVol+1)*2));
new TGeoBBox("box5DCut",(kPcbLength+kVframeLength)/2., hFramepar[1], vFramepar[2]+0.001);
// Displacement
for (int iSlatType = 0; iSlatType<nSlatType; iSlatType++) {
for (int iVol = 0; iVol<nVol; iVol++){
Int_t lIndex = (iCh-9)*(nSlatType*(nVol+1))+iSlatType*(nVol+1)+iVol;
- sprintf(volName,"S%c%d%c",slatType[iSlatType],iCh%10,volLetter[iVol]);
+ volName=Form("S%c%d%c",slatType[iSlatType],iCh%10,volLetter[iVol]);
mVol = gGeoManager->FindVolumeFast(volName);
if ( !mVol ) {
AliErrorStream()
}
else {
rounded5Slat[lIndex] = mVol->GetShape();
- sprintf(csName,"rounded5Slat%c%d%c",slatType[iSlatType],iCh%10,volLetter[iVol]);
+ csName=Form("rounded5Slat%c%d%c",slatType[iSlatType],iCh%10,volLetter[iVol]);
((TGeoShape*)rounded5Slat[lIndex])->SetName(csName);
// Composite shape
TString compOperation(csName);
compOperation+="-tube5Cut:tr";
compOperation+=slatType[iSlatType];
- compOperation+="Tube5";
if (strstr(volName,"B")){
- // Displacement
- TGeoTranslation* trB = new TGeoTranslation("trB", 0., -(kPcbHeight - kBframeHeight)/2., 0.);
- trB->RegisterYourself();
- compOperation.ReplaceAll("-tube5Cut",":trB-tube5Cut");
+ compOperation+="B";
}
- sprintf(compName,"composite5%d%c",iCh,volLetter[iVol]);
+ compOperation+="Tube5";
+ compName=Form("composite5%d%c",iCh,volLetter[iVol]);
composite5[lIndex] = new TGeoCompositeShape(compName, compOperation.Data());
// Reset shape to volume
// For rounded spacer
Int_t lIndex = (iCh-9)*(nSlatType*(nVol+1))+iSlatType*(nVol+1)+nVol;
- sprintf(volName,"S%c%dD",slatType[iSlatType],iCh%10);
+ volName=Form("S%c%dD",slatType[iSlatType],iCh%10);
mVol = gGeoManager->FindVolumeFast(volName);
if ( !mVol ) {
AliErrorStream()
}
else {
rounded5Slat[lIndex] = mVol->GetShape();
- sprintf(csName,"rounded5Slat%c%dD",slatType[iSlatType],iCh%10);
+ csName=Form("rounded5Slat%c%dD",slatType[iSlatType],iCh%10);
((TGeoShape*)rounded5Slat[lIndex])->SetName(csName);
// Composite shape
compOperation.Prepend("(");
compOperation+="+box5Vframe:trVBox5)*box5DCut:trDBox5";
}
- sprintf(compName,"composite5%c%dD",slatType[iSlatType],iCh%10);
+ compName=Form("composite5%c%dD",slatType[iSlatType],iCh%10);
composite5[lIndex] = new TGeoCompositeShape(compName, compOperation.Data());
// Reset shape to volume
mVol->SetShape((TGeoShape*)composite5[lIndex]);
// position the panels and the insulating material
for (j = 0; j < kNPCB5[i]; j++){
index++;
- Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5);
+ xx = kSensLength * (-kNPCB5[i]/2.+j+.5);
Float_t zPanel = spar[2] - nomexbpar[2];
if (i==1 && j==0){ // Rounded pcb of rounded slat
Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
- gMC->Gspos("SD9B",1,"SD9P",0., 0.,0.,0,"ONLY");
gMC->Gspos("S09B",1,"SD9P",0., yborder,0.,0,"ONLY");
+ gMC->Gspos("SD9B",1,"SD9P",0.,-yborder,0.,0,"ONLY");
gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
- gMC->Gspos("SD0B",1,"SD0P",0., 0.,0.,0,"ONLY");
gMC->Gspos("S10B",1,"SD0P",0., yborder,0.,0,"ONLY");
+ gMC->Gspos("SD0B",1,"SD0P",0.,-yborder,0.,0,"ONLY");
// // create the NULOC volume and position it in the horizontal frame
gMC->Gspos("S10E",2*index ,"S10B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
}
if (xx > xxmax4 && xx< xxmax) {
- gMC->Gspos("S09E",2*index-1,"SD9B", xx, -yborder,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
- gMC->Gspos("S09E",2*index ,"SD9B", xx, -yborder, kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
- gMC->Gspos("S10E",2*index-1,"SD0B", xx, -yborder,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
- gMC->Gspos("S10E",2*index ,"SD0B", xx, -yborder, kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S09E",2*index-1,"SD9B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S09E",2*index ,"SD9B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S10E",2*index-1,"SD0B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S10E",2*index ,"SD0B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
}
//
else {
lCableDY = (kYpos5[i+1]+kYpos5[i+2])/2.-cablepar[1];
}
- lCableZ = TMath::Power(-1,i)*(nomexthickness+carbonthickness+(iCable++)*kCableWidth)/2.;
+ lCableZ = TMath::Power(-1,i)*(nomexthickness/2.+carbonthickness+(-1+iCable++)*kCableWidth+kCableWidth/2.);
gMC->Gsposp("S09L",10*i+cIndex++,"S09S",lCableX,lCableY+lCableDY,lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S09L",10*i+cIndex++,"S09S",lCableX,-(lCableY+lCableDY),lCableZ,0,"ONLY",cablepar,3);
// Then bottom cables
cablepar[0] = (supporthlength-kPcbLength-kVframeLength)/2.;
lCableX = (kPcbLength+kVframeLength)/2.;
lCableDY = (kYpos5[i+1]+kYpos5[i+2])/2.-cablepar[1]; // half way between 2 slats on same side
- lCableZ = TMath::Power(-1,i)*(nomexthickness+carbonthickness+(iCable++)*kCableWidth)/2.;
+ lCableZ = TMath::Power(-1,i)*(nomexthickness/2.+carbonthickness+(-1+iCable++)*kCableWidth+kCableWidth/2.);
gMC->Gsposp("S09L",10*i+cIndex++,"S09S",lCableX,lCableY+lCableDY,lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S09L",10*i+cIndex++,"S09S",lCableX,-(lCableY+lCableDY),lCableZ,0,"ONLY",cablepar,3);
}
else {
lCableDY = (kYpos5[i+1]+kYpos5[i+2])/2.-cablepar[1];
}
- lCableZ = TMath::Power(-1,i)*(nomexthickness+carbonthickness+(iCable++)*kCableWidth)/2.;
+ lCableZ = TMath::Power(-1,i)*(nomexthickness/2.+carbonthickness+(-1+iCable++)*kCableWidth+kCableWidth/2.);
gMC->Gsposp("S09L",10*i+cIndex++,"S09S",lCableX,lCableY+lCableDY,lCableZ,0,"ONLY",cablepar,3);
gMC->Gsposp("S09L",10*i+cIndex++,"S09S",lCableX,-(lCableY+lCableDY),lCableZ,0,"ONLY",cablepar,3);
if(i>0){
}
-
//______________________________________________________________________________
-void AliMUONSlatGeometryBuilder::SetTransformations()
+void AliMUONSlatGeometryBuilder::SetVolumes()
{
-/// Defines the transformations for the station345 chambers.
+/// Defines the volumes for the station345 chambers.
if (gAlice->GetModule("DIPO")) {
// if DIPO is preset, the whole station will be placed in DDIP volume
SetVolume(13, "SC09O", true);
SetVolume(14, "SC10I", true);
SetVolume(15, "SC10O", true);
+}
+
+
+//______________________________________________________________________________
+void AliMUONSlatGeometryBuilder::SetTransformations()
+{
+/// Defines the transformations for the station345 chambers.
// Stations 345 are not perpendicular to the beam axis
// See AliMUONConstants class