Skip to content

Commit

Permalink
ALIROOT-6110 : force BBox recomputing after assembly is finalized
Browse files Browse the repository at this point in the history
Note: cherry-picked from 9b452a8.
Paths have changed in the meanwhile (ITS -> ITS/ITSsim).
  • Loading branch information
shahor02 authored and dberzano committed Mar 2, 2016
1 parent 34f22b2 commit 9dd7f51
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 94 deletions.
41 changes: 41 additions & 0 deletions ITS/AliITSv11GeometrySDD.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@ void AliITSv11GeometrySDD::CreateBasicObjects() {
fRaccordoL->AddNode(vtube1Rac, 1,trTube1Rac);
fRaccordoL->AddNode(vtube2Rac, 1,trTube2Rac);
fRaccordoL->AddNode(vtube3Rac, 1,trTube3Rac);
fRaccordoL->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox
}


Expand Down Expand Up @@ -1524,6 +1525,9 @@ void AliITSv11GeometrySDD::ForwardLayer3(TGeoVolume *moth) {
virtualForward3Pos->AddNode(lay3EndLadder, iLadd*2, ctEndLaddPos);
virtualForward3Neg->AddNode(lay3EndLadder, iLadd*2, ctEndLaddNeg);
}

virtualForward3Pos->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox
virtualForward3Neg->GetShape()->ComputeBBox();

if(GetDebug(1)) {
virtualForward3Pos->CheckOverlaps(0.01);
Expand Down Expand Up @@ -1784,6 +1788,9 @@ void AliITSv11GeometrySDD::ForwardLayer4(TGeoVolume *moth) {
virtualForward4Neg->AddNode(lay4EndLadder, iLadd*2, ctEndLaddNeg);
}

virtualForward4Pos->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox
virtualForward4Neg->GetShape()->ComputeBBox();

// 180deg Y rotation to compensate the cancellation of ITSD volume
// (idortm[199] in AliITSv11Hybrid : z---> -z; x ---> -x; y ---> y)
TGeoRotation *y180 = new TGeoRotation();
Expand Down Expand Up @@ -1965,6 +1972,8 @@ TGeoVolumeAssembly *AliITSv11GeometrySDD::CreateLadder(Int_t iLay) {
};

//**********************************
virtualLadder->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

if(GetDebug(1)) virtualLadder->CheckOverlaps(0.01);
return virtualLadder;
}
Expand Down Expand Up @@ -3497,6 +3506,8 @@ TGeoVolumeAssembly* AliITSv11GeometrySDD::CreateEndLadder(Int_t iLay) {
virtualEnd->AddNode(fRaccordoL, 1, trRaccordo1);
virtualEnd->AddNode(fRaccordoL, 2, trRaccordo2);

virtualEnd->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

if(GetDebug(1)) virtualEnd->CheckOverlaps(0.01);

return virtualEnd;
Expand Down Expand Up @@ -3607,6 +3618,8 @@ TGeoVolumeAssembly* AliITSv11GeometrySDD::CreateLadderFoot() {
vFootLeft->SetLineColor(fColorStesalite);
virtualFoot->AddNode(vFootLeft, 1, footLeftTr);

virtualFoot->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

if(GetDebug(3)){ // Remove compiler warning.
ladFingerPrint->InspectShape();
ladFootBox1->InspectShape();
Expand Down Expand Up @@ -3905,6 +3918,8 @@ TGeoVolumeAssembly* AliITSv11GeometrySDD::CreateCarlosCard(Int_t iLay) {
qz1.AddCheckPoint( (TGeoVolume *) assemblySupCarlos, 1, p2, vX);
qz1.CreateAndInsertBoxCableSegment(1,90);

assemblySupCarlos->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

return assemblySupCarlos;
}

Expand Down Expand Up @@ -4148,6 +4163,9 @@ Int_t AliITSv11GeometrySDD::CreateLVCard() {
fCardLVR->AddNode(vAlLVcooling2, 2,alLVcooling2TrBR);
fCardLVR->AddNode(vAlLVcooling3, 1,alLVcooling3TrR);

fCardLVL->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox
fCardLVR->GetShape()->ComputeBBox();

return kTRUE;
}

Expand Down Expand Up @@ -4204,6 +4222,9 @@ TGeoVolumeAssembly* AliITSv11GeometrySDD::CreateHVCard(){
capa1->AddNode(vCapa1End, 1, capa1EndTr1);
capa1->AddNode(vCapa1End, 2, capa1EndTr2);

capa1->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox


highVCard->AddNode(capa1, 1, capa1PosTr);

// capa2
Expand Down Expand Up @@ -4231,6 +4252,9 @@ TGeoVolumeAssembly* AliITSv11GeometrySDD::CreateHVCard(){
capa2->AddNode(vCapa2End, 1, capa2EndTr1);
capa2->AddNode(vCapa2End, 2, capa2EndTr2);

capa2->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox


highVCard->AddNode(capa2, 1, capa2PosTr);

// capa3
Expand Down Expand Up @@ -4281,6 +4305,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySDD::CreateHVCard(){
highVCard->AddNode(capa3, 4, capa3PosTr4);
highVCard->AddNode(capa3, 5, capa3PosTr5);

capa3->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox
//====================================
//--- connexions to LV card

Expand Down Expand Up @@ -4334,6 +4359,9 @@ TGeoVolumeAssembly* AliITSv11GeometrySDD::CreateHVCard(){
fgkConnexLVHVy1+3*fgkConnexLVHVdy,
-fgkHVCardCeramZ/2-fgkConnexLVHVlen/2 );

connexion->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox


highVCard->AddNode(connexion, 1, trConnexion1);
highVCard->AddNode(connexion, 2, trConnexion2);
highVCard->AddNode(connexion, 3, trConnexion3);
Expand Down Expand Up @@ -4430,6 +4458,8 @@ TGeoVolumeAssembly* AliITSv11GeometrySDD::CreateHVCard(){
highVCard->AddNode(fCommonVol[0], 1, cbScrewHead1);
highVCard->AddNode(fCommonVol[0], 2, cbScrewHead2);

highVCard->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

return highVCard;
}

Expand Down Expand Up @@ -4627,6 +4657,8 @@ TGeoVolumeAssembly* AliITSv11GeometrySDD::CreateEndLadderCards(Int_t iLay) {
endLadderCards->AddNode(assemblySupCarlos, iCard, carlosPos);
}

endLadderCards->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

return endLadderCards;
}

Expand Down Expand Up @@ -5036,6 +5068,9 @@ TGeoVolumeAssembly* AliITSv11GeometrySDD::CreateSupportRing() {

supportRing->AddNode(vRubyCageSquare, 0, 0);
//supportRing->AddNode(vRubyCageV, 0, 0);

supportRing->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

return supportRing;
}

Expand Down Expand Up @@ -5480,6 +5515,8 @@ TGeoVolumeAssembly *AliITSv11GeometrySDD::CreateDetectorsAssembly(Int_t iLay) {
virtualDet->AddNode(sensorSDD, i, sensorPos);
};
}

virtualDet->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

if(GetDebug(1)) virtualDet->CheckOverlaps(0.01);
return virtualDet;
Expand Down Expand Up @@ -5524,6 +5561,8 @@ TGeoVolumeAssembly *AliITSv11GeometrySDD::CreateDetectorsAssemblyLadd2() {
};
}

virtualDet->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

if(GetDebug(1)) virtualDet->CheckOverlaps(0.01);
return virtualDet;
}
Expand Down Expand Up @@ -6001,6 +6040,8 @@ void AliITSv11GeometrySDD::SDDCables(TGeoVolume *moth)
CreateAndInsetConeCablePart(endConeSDDCable, 353, 1*3,3*4, fgkSDDCableR5,
fgkSDDCableZ5,fgkSDDCableR6,fgkSDDCableZ6);

endConeSDDCable->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

moth->AddNode(endConeSDDCable, 1, 0);

TGeoRotation* reflect = new TGeoRotation("reflectEndConeSDDCable");
Expand Down
25 changes: 25 additions & 0 deletions ITS/AliITSv11GeometrySPD.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
vCarbonFiberSector[is] = new TGeoVolumeAssembly("ITSSPDCarbonFiberSectorV");
vCarbonFiberSector[is]->SetMedium(medSPDcf);
CarbonFiberSector(vCarbonFiberSector[is], is, xAAtubeCenter0, yAAtubeCenter0, mgr);
vCarbonFiberSector[is]->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox
}

// Compute the radial shift out of the sectors
Expand Down Expand Up @@ -363,6 +364,9 @@ void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
angle += kSectorRelativeAngle;
secRot->RotateZ(kSectorRelativeAngle);
} // end for i

vcenteral->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

if(GetDebug(3)) moth->PrintNodes();
delete secRot;

Expand Down Expand Up @@ -1173,6 +1177,8 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth, Int_t sect,
mas[2],
new TGeoRotation("",90+t,90,90)));

vM0->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

if(GetDebug(3)){
vM0->PrintNodes();
vA0->PrintNodes();
Expand Down Expand Up @@ -2066,6 +2072,9 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
if (isRight) z += shift;
else z -= shift;
} // end for i

container->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

return container;
}
//___________________________________________________________________
Expand Down Expand Up @@ -2353,6 +2362,8 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
// add cap top
mcmAssembly->AddNode(volCapTop, 1, gGeoIdentity);

mcmAssembly->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

return mcmAssembly;
}

Expand Down Expand Up @@ -2639,6 +2650,8 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
sizes[4] = zRef + pt1000Z[2];
sizes[5] = zRef + pt1000Z[7];

container->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

return container;
}

Expand Down Expand Up @@ -3006,6 +3019,12 @@ TList* AliITSv11GeometrySPD::CreateConeModule(Bool_t sideC, const Double_t angro
container[4]->AddNode(volFitt, 1,
new TGeoTranslation(0, -yloc, zloc));

container[0]->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox
container[1]->GetShape()->ComputeBBox();
container[2]->GetShape()->ComputeBBox();
container[3]->GetShape()->ComputeBBox();
container[4]->GetShape()->ComputeBBox();

// Finally create the list of assemblies and return it to the caller
TList* conemodulelist = new TList();
conemodulelist->Add(container[0]);
Expand Down Expand Up @@ -3642,6 +3661,9 @@ void AliITSv11GeometrySPD::CreateServices(TGeoVolume *moth) const
zpos += kCoolManifCollDZ;
}

coolmanifA->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox
coolmanifC->GetShape()->ComputeBBox();

// Now add the cooling tubes to the assembly
CreateCoolingTubes(coolmanifA, kFALSE);
CreateCoolingTubes(coolmanifC, kTRUE);
Expand Down Expand Up @@ -4200,6 +4222,8 @@ Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
sizes[5] = zBus + busSize[4];
sizes[6] = zBus + busSize[5];

container->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox

return container;
}
//______________________________________________________________________
Expand Down Expand Up @@ -4278,6 +4302,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateStave(Int_t layer,
container->AddNode(hstaveL, 1);
container->AddNode(hstaveR, 1);

container->GetShape()->ComputeBBox(); //RS: enforce recompting of BBox
return container;
}
//______________________________________________________________________
Expand Down
Loading

0 comments on commit 9dd7f51

Please sign in to comment.