}
//______________________________________________________________________
TGeoMedium* AliITSv11GeometrySPD::GetMedium(const char* mediumName,
- TGeoManager *mgr) const
+ const TGeoManager *mgr) const
{
//
// This function is used to recovery any medium
//
Char_t itsMediumName[30];
- sprintf(itsMediumName, "ITS_%s", mediumName);
+ snprintf(itsMediumName, 30, "ITS_%s", mediumName);
TGeoMedium* medium = mgr->GetMedium(itsMediumName);
if (!medium) AliError(Form("Medium <%s> not found", mediumName));
const Int_t ksecDipIndex[ksecNCoolingTubeDips] = {2, 5, 8, 11, 14, 17};
Double_t secAngleStart[ksecNRadii];
Double_t secAngleEnd[ksecNRadii];
+ for(Int_t i = 0; i < ksecNRadii; i++)secAngleEnd[i] = 0.;
Double_t secAngleStart2[ksecNRadii];
Double_t secAngleEnd2[ksecNRadii];
Double_t secAngleTurbo[ksecNCoolingTubeDips] = {0., 0., 0., 0., 0., 0.0};
} // end if itype==1
switch (itype) {
case 0:
- sprintf(type,"Kap");
+ snprintf(type,10,"Kap");
break;
case 1:
- sprintf(type,"Alu");
+ snprintf(type,10, "Alu");
break;
case 2:
- sprintf(type,"Glue1");
+ snprintf(type,10,"Glue1");
break;
case 3:
- sprintf(type,"Glue2");
+ snprintf(type,10,"Glue2");
break;
}
// we divide the shape in several slices along the horizontal
shGroundFull = new TGeoBBox(Form("ITSSPDSHgFoil%sFull", type),
0.5*length,0.5*width, 0.5*thickness);
+ if(GetDebug(5)) shGroundFull->Print(); // Avoid Coverity warning
+
// create the polygonal shape to be subtracted to give the correct
// shape to the borders its vertices are defined in sugh a way that
// this polygonal will be placed in the correct place considered
Double_t holeY = 0.5*(width - holeWidth) - widthMin;
// create a shape for the holes (common)
- TGeoBBox *shHole = 0;
- shHole = new TGeoBBox(Form("ITSSPD%sGfoilHole", type),0.5*holeLength,
- 0.5*holeWidth, thickness);
+ new TGeoBBox(Form("ITSSPD%sGfoilHole", type),0.5*holeLength,
+ 0.5*holeWidth, thickness);
// insert the holes in the XTRU shape:
// starting from the first value of X, they are simply
holeX += holeSepX2;
} // end if else if's
//cout << i << " --> X = " << holeX << endl;
- sprintf(name,"ITSSPDTRgFoil%sHole%d", type, i);
+ snprintf(name,200,"ITSSPDTRgFoil%sHole%d", type, i);
transHole[i] = new TGeoTranslation(name, holeX, holeY, 0.0);
transHole[i]->RegisterYourself();
strComposite.Append(Form("ITSSPD%sGfoilHole:%s", type, name));
// create a suffix to be used in the names of all shapes
//
char suf[5];
- if (isRight) strcpy(suf, "R"); else strcpy(suf, "L");
+ if (isRight) strncpy(suf, "R", 5); else strncpy(suf, "L", 5);
// this volume will be created in order to ease its placement in
// the half-stave; then, it is added here the small distance of
// the "central" edge of each volume from the Z=0 plane in the stave
// to distinguish the "left" and "right" objects, a suffix is created
char suf[5];
- if (isRight) strcpy(suf, "R"); else strcpy(suf, "L");
+ if (isRight) strncpy(suf, "R", 5); else strncpy(suf, "L", 5);
// ** MEDIA **
TGeoMedium *medBase = GetMedium("SPD KAPTON(POLYCH2)$",mgr);// ??? MCM BASE
0.5*capWidth, 0.5*capLength);
char extname[12];
- sprintf(extname,"Extender1l%d",ilayer);
+ snprintf(extname,12,"Extender1l%d",ilayer);
TGeoVolume *ext1 = mgr->MakeBox(extname, medExt, 0.5*extThickness, 0.5*extWidth, 0.5*ext1Length);
- sprintf(extname,"Extender2l%d",ilayer);
+ snprintf(extname,12,"Extender2l%d",ilayer);
TGeoVolume *ext2 = mgr->MakeBox(extname, medExt, 0.5*extHeight - 2.*extThickness, 0.5*extWidth, 0.5*extThickness);
TGeoVolume *ext3=0;
- sprintf(extname,"Extender3l%d",ilayer);
+ snprintf(extname,12,"Extender3l%d",ilayer);
if (ilayer==1) {
Double_t halflen=(0.5*ext2Length + extThickness);
Double_t xprof[6],yprof[6];
const Double_t kCollThickness = 10.0 *fgkmm;
const Double_t kCollTubeThick = 1.0 *fgkmm;
const Double_t kCollTubeRadius = 7.0 *fgkmm;
- const Double_t kCollTubeLength = 190.0 *fgkmm;
+ const Double_t kCollTubeLength = 205.0 *fgkmm;
const Double_t kOptFibDiamet = 4.5 *fgkmm;
Int_t kPurple = 6; // Purple (Root does not define it)
TGeoVolumeAssembly* container[5];
- container[0] = new TGeoVolumeAssembly("ITSSPDConeModule");
+ if (sideC)
+ container[0] = new TGeoVolumeAssembly("ITSSPDConeModuleC");
+ else
+ container[0] = new TGeoVolumeAssembly("ITSSPDConeModuleA");
container[1] = new TGeoVolumeAssembly("ITSSPDCoolingModuleSideA");
container[2] = new TGeoVolumeAssembly("ITSSPDCoolingModuleSideC");
container[3] = new TGeoVolumeAssembly("ITSSPDPatchPanelModule");
0.5*cableW2,
0.5*thickness);
Char_t string[255];
- sprintf(string, "%s-%s", shOut->GetName(), shIn->GetName());
+ snprintf(string, 255, "%s-%s", shOut->GetName(), shIn->GetName());
TGeoCompositeShape *shPlate = new TGeoCompositeShape("ITSSPDPlate_shape",
string);
volCollTube->SetLineColor(kAzure);
// The cooling tube on the cone as a Ctub
- Double_t tubeLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave;
+ Double_t tubeLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave -0.85;
TGeoCtub *shTube = new TGeoCtub(0, kConeTubeRmax, 0.5*tubeLength, 0, 360,
0, SinD(angrot/2), -CosD(angrot/2),
0, 0, 1);
volCylGasFr->SetLineColor(kPurple);
// The optical fibers bundle on the cone as a Tube
- Double_t optLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave;
+ Double_t optLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave -0.85;
TGeoTube *shOptFibs = new TGeoTube(0., 0.5*kOptFibDiamet, 0.5*optLength);
TGeoVolume *volOptFibs = new TGeoVolume("ITSSPDOpticalFibersOnCone",
container[0]->AddNode(volCollTube, 1, trCollTube);
}
- Double_t dxPatch = 2.9;
+ Double_t dxPatch = 2.75;
Double_t dzPatch = 2.8;
TGeoCombiTrans *tr2 = new TGeoCombiTrans(1.7*ext2Length - dxPatch, 0.0, dzPatch, rot2);
container[3]->AddNode(volPatch, 0, tr2);
const Int_t kNumberOfModules = 10;
const Double_t kInnerRadius = 80.775*fgkmm;
- const Double_t kZTrans = 452.000*fgkmm;
+ const Double_t kZTrans = 451.800*fgkmm;
const Double_t kAlphaRot = 46.500*fgkDegree;
const Double_t kAlphaSpaceCool = 9.200*fgkDegree;
CreateClip(clipSize, kTRUE, mgr);
// define clip movements (width direction)
sizes[3] = xBus + 0.5*busThickness;
- sizes[4] = 0.5 * (fullWidth - busWidth) - clipSize[6] - fgkmm*0.48;
+ sizes[4] = 0.5 * (fullWidth - busWidth) - clipSize[6] - fgkmm*0.26;
sizes[5] = zBus + busSize[4];
sizes[6] = zBus + busSize[5];
// none.
//
Int_t i,j,k,n;
- Double_t gapLadder,GapHalfStave;
-
- *is>>gapLadder>>GapHalfStave>>n;
+ Double_t gapLadder,gapHalfStave;
+ const Int_t kLimits = 100;
+ *is>>gapLadder>>gapHalfStave>>n;
if(n!=6){
- Warning("ReadAscii","fAddStave Array !=6 n=%d",n);
+ AliError(Form("fAddStave Array !=6 n=%d",n));
return;
} // end if
for(i=0;i<n;i++) *is>>fAddStave[i];
*is>>n;
+ if(n<0 || n> kLimits){
+ AliError("Anomalous value for parameter n");
+ return;
+ }
fSPDsectorX0.Set(n);
fSPDsectorY0.Set(n);
fSPDsectorX1.Set(n);