TGeoVolumeAssembly* asYoke = new TGeoVolumeAssembly("DYoke");
// Base
- char name[32];
+ char name[16];
Float_t lx0 = gapWidthFront + 2. * blockHeight;
Float_t lx = lx0;
TGeoVolumeAssembly* asYokeBase = new TGeoVolumeAssembly("DYokeBase");
for (Int_t i = 0; i < 7; i++) {
- sprintf(name, "DYokeBaseBlock%1d", i);
- TGeoVolume* voBaseBlock = new TGeoVolume(name,
+ snprintf(name, 16, "DYokeBaseBlock%1d", i);
+ TGeoVolume* voBaseBlock = new TGeoVolume(name,
new TGeoBBox(lx/2., blockHeight/2., blockLength/2.),
kMedSteel);
asYokeBase->AddNode(voBaseBlock, 1, new TGeoTranslation(0., 0., Float_t(i - 3) * blockLength));
for (Int_t i = 0; i < 9; i++)
{
char nameR[16];
- sprintf(nameR, "rotdcs%1d", i);
+ snprintf(nameR, 16, "rotdcs%1d", i);
Float_t phi = Float_t(i) * 3.75;
TGeoRotation* rot = new TGeoRotation(nameR, 90., phi, 90., 90. + phi, 0., 0.);
asDCoilSupport->AddNode(voDCS021, i, new TGeoCombiTrans(0., 0.004, -(sW - coilH)/2., rot));
char name[16];
Int_t mod = i + 13;
if (mod > 17) mod -= 18;
- sprintf(name, "BSEGMO%d", mod);
+ snprintf(name, 16, "BSEGMO%d", mod);
gMC->Gsvolu(name, "TRD1", kAir, ptrd1, 4);
gGeoManager->GetVolume(name)->SetVisibility(kFALSE);
dx = TMath::Sin(phi1*kdeg2rad)*r;
dy = -TMath::Cos(phi1*kdeg2rad)*r;
- char nameR[64];
- sprintf(nameR, "B43_Rot_%d", i);
+ char nameR[16];
+ snprintf(nameR, 16, "B43_Rot_%d", i);
TGeoRotation* rot = new TGeoRotation(nameR, 90.0, phi1, 0., 0., 90., phi2);
AliMatrix(idrotm[2034+i], 90.0, phi1, 0., 0., 90., phi2);
TGeoVolume* vol77 = gGeoManager->GetVolume("B077");
for (i = 0; i < 18; i++) {
char nameMo[16];
- sprintf(nameMo, "BSEGMO%d",i);
+ snprintf(nameMo, 16, "BSEGMO%d",i);
// M
gMC->Gspos("BTSH_M" , i+1 , nameMo, 0., 0., dz, 0, "ONLY");
// AM, CM
for (i = 0; i < 18; i++) {
char nameCh[16];
- sprintf(nameCh, "BTRD%d",i);
+ snprintf(nameCh, 16, "BTRD%d",i);
char nameMo[16];
- sprintf(nameMo, "BSEGMO%d",i);
+ snprintf(nameMo, 16, "BSEGMO%d",i);
gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
gMC->Gspos(nameCh, 1, nameMo, 0., 0., -12.62, 0, "ONLY"); // CBL 28/6/2006
ptrd1[2] = 372.6;
ptrd1[3] = 14.525/2;
char nameChA[16];
- sprintf(nameChA, "BTOFA");
+ snprintf(nameChA, 16, "BTOFA");
TGeoTrd1 *trd1=new TGeoTrd1(nameChA,ptrd1[0],ptrd1[1],ptrd1[2],ptrd1[3]);
trd1->SetName("BTOFA"); // just to avoid a warning
char nameChB[16];
- sprintf(nameChB, "BTOFB");
+ snprintf(nameChB, 16, "BTOFB");
TGeoBBox *box1 = new TGeoBBox(nameChB,64.25 ,372.6, 14.525/2);
box1->SetName("BTOFB"); // just to avoid a warning
TGeoTranslation *tr1 = new TGeoTranslation("trnsl1",0, 0, -14.525/2 );
for (i = 0; i < 18; i++) {
char nameCh[16];
- sprintf(nameCh, "BTOF%d",i);
+ snprintf(nameCh, 16, "BTOF%d",i);
char nameMo[16];
- sprintf(nameMo, "BSEGMO%d",i);
+ snprintf(nameMo, 16, "BSEGMO%d",i);
TGeoVolume* btf = new TGeoVolume(nameCh, Btofcs, gGeoManager->GetMedium("FRAME_Air"));
btf->SetName(nameCh);
gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
const Int_t kAlu = idtmed[2008];
Float_t dx, dy;
- char mname [128];
- char cname [128];
- char t1name[128];
- char t2name[128];
- char t3name[128];
- char t4name[128];
- char t5name[128];
+ char mname[16];
+ char cname [16];
+ char t1name[16];
+ char t2name[16];
+ char t3name[16];
+ char t4name[16];
+ char t5name[16];
//
Float_t dxP = 2. * (287. * TMath::Sin(10.* TMath::Pi()/180.) - 2.);
thshM[0] = dxP / 2.;
thshM[1] = dyP / 2.;
thshM[2] = dzP / 2.;
- sprintf(mname, "BTSH_%s", name);
+ snprintf(mname, 16, "BTSH_%s", name);
gMC->Gsvolu(mname, "BOX ", kAir, thshM, 3);
//
// Aluminum sheet
thshM[2] = 0.025;
- sprintf(cname, "BTSHA_%s", name);
+ snprintf(cname, 16, "BTSHA_%s", name);
gMC->Gsvolu(cname, "BOX ", kAlu, thshM, 3);
gMC->Gspos(cname, 1, mname, 0., 0., -0.5, 0);
//
thshT[1] = 0.5;
thshT[2] = (dyP / 2. - 8.);
//
- sprintf(t1name, "BTSHT1_%s", name);
+ snprintf(t1name, 16, "BTSHT1_%s", name);
gMC->Gsvolu(t1name, "TUBE", kAlu, thshT, 3);
dx = - dxP / 2. + 8. - 0.5;
gMC->Gspos(t1name, 1, mname, dx, 0., 0.025, rot1);
//
- sprintf(t2name, "BTSHT2_%s", name);
- sprintf(t3name, "BTSHT3_%s", name);
- sprintf(t4name, "BTSHT4_%s", name);
- sprintf(t5name, "BTSHT5_%s", name);
+ snprintf(t2name, 16, "BTSHT2_%s", name);
+ snprintf(t3name, 16, "BTSHT3_%s", name);
+ snprintf(t4name, 16, "BTSHT4_%s", name);
+ snprintf(t5name, 16, "BTSHT5_%s", name);
thshT[2] = (thshM[1] - 12.);
gMC->Gsvolu(t2name, "TUBE", kAlu, thshT, 3);
thshT[2] = 7.9/2.;
const Int_t kSteel = idtmed[2064];
Float_t ptrap[11];
- char nameA[64];
- sprintf(nameA, "%sA", name );
+ char nameA[16];
+ snprintf(nameA, 16, "%sA", name );
theta0 *= kdeg2rad;
phi0 *= kdeg2rad;
Float_t theta = TMath::ATan(TMath::Tan(theta0)/TMath::Sin(phi0));
const TGeoMedium* kMedSteel = gGeoManager->GetMedium("PIPE_INOX");
char name[64], nameA[64], nameB[64], bools[64];
- sprintf(name, "%sBellowUS", ext);
+ snprintf(name, 64, "%sBellowUS", ext);
TGeoVolume* voBellow = new TGeoVolume(name, new TGeoTube(rMin, rMax, dU/2.), kMedVac);
//
// Upper part of the undulation
//
TGeoTorus* shPlieTorusU = new TGeoTorus(rMax - rPlie, rPlie - dPlie, rPlie);
- sprintf(nameA, "%sTorusU", ext);
+ snprintf(nameA, 64, "%sTorusU", ext);
shPlieTorusU->SetName(nameA);
TGeoTube* shPlieTubeU = new TGeoTube (rMax - rPlie, rMax, rPlie);
- sprintf(nameB, "%sTubeU", ext);
+ snprintf(nameB, 64, "%sTubeU", ext);
shPlieTubeU->SetName(nameB);
- sprintf(name, "%sUpperPlie", ext);
- sprintf(bools, "%s*%s", nameA, nameB);
+ snprintf(name, 64, "%sUpperPlie", ext);
+ snprintf(bools, 64, "%s*%s", nameA, nameB);
TGeoCompositeShape* shUpperPlie = new TGeoCompositeShape(name, bools);
TGeoVolume* voWiggleU = new TGeoVolume(name, shUpperPlie, kMedSteel);
//
// Lower part of the undulation
TGeoTorus* shPlieTorusL = new TGeoTorus(rMin + rPlie, rPlie - dPlie, rPlie);
- sprintf(nameA, "%sTorusL", ext);
+ snprintf(nameA, 64, "%sTorusL", ext);
shPlieTorusL->SetName(nameA);
TGeoTube* shPlieTubeL = new TGeoTube (rMin, rMin + rPlie, rPlie);
- sprintf(nameB, "%sTubeL", ext);
+ snprintf(nameB, 64, "%sTubeL", ext);
shPlieTubeL->SetName(nameB);
- sprintf(name, "%sLowerPlie", ext);
- sprintf(bools, "%s*%s", nameA, nameB);
+ snprintf(name, 64, "%sLowerPlie", ext);
+ snprintf(bools, 64, "%s*%s", nameA, nameB);
TGeoCompositeShape* shLowerPlie = new TGeoCompositeShape(name, bools);
TGeoVolume* voWiggleL = new TGeoVolume(name, shLowerPlie, kMedSteel);
//
// Connection between upper and lower part of undulation
- sprintf(name, "%sPlieConn1", ext);
+ snprintf(name, 64, "%sPlieConn1", ext);
TGeoVolume* voWiggleC1 = new TGeoVolume(name, new TGeoTube(rMin + rPlie, rMax - rPlie, dPlie/2.), kMedSteel);
//
// One wiggle
Float_t dz = rPlie - dPlie / 2.;
Float_t z0 = - dPlie / 2.;
- sprintf(name, "%sWiggle", ext);
+ snprintf(name, 64, "%sWiggle", ext);
TGeoVolumeAssembly* asWiggle = new TGeoVolumeAssembly(name);
asWiggle->AddNode(voWiggleC1, 1 , new TGeoTranslation(0., 0., z0));
z0 += dz;